content
stringlengths
7
2.61M
Begin Reading Table of Contents Newsletters Copyright Page In accordance with the U.S. Copyright Act of 1976, the scanning, uploading, and electronic sharing of any part of this book without the permission of the publisher constitute unlawful piracy and theft of the author's intellectual property. If you would like to use material from the book (other than for review purposes), prior written permission must be obtained by contacting the publisher at permissions@hbgusa.com. Thank you for your support of the author's rights. This book is dedicated to all the Tapping family: Dave, Zoe, Rachael, Matthew and last, but not least, Harry. With affection. Chapter One I wish I loved the Human Race; I wish I loved its silly face; I wish I liked the way it walks; I wish I liked the way it talks: And when I'm introduced to one I wish I thought _What Jolly Fun!_ —Sir Walter A. Raleigh Police Sergeant Hamish Macbeth was in a sour mood, despite the sunny, windy weather. His new sidekick, policeman Charlie Carter, was giving him claustrophobia. Admittedly, Charlie was kind and amiable and worked hard. But he was big, very big. Hamish was tall but Charlie was taller and broader, and he was clumsy. He fell over the furniture, he broke china and glass, and when Hamish shouted at him, he looked so miserable that Hamish immediately felt guilty. Hamish's odd-looking dog called Lugs walked at his heels as did his wild cat, Sonsie. Wild cats are an endangered species and Hamish was always afraid that Sonsie would be taken away. As if sensing his master's bad mood, Lugs looked up at Hamish with his strange blue eyes. The breeze sent sunny ripples dancing across the sea loch. The village of Lochdubh in Sutherland looked like a picture postcard with its row of small eighteenth-century whitewashed cottages facing the sea loch. Hamish was leaning on the seawall, thinking dark thoughts about getting Charlie transferred back to Strathbane, that ghastly town full of drugs and crime. He turned away from the wall, and that was when he saw a vision. A nurse came tripping along with a shopping basket over her arm. From her jaunty cap to her candy-striped dress and her black stockings, she looked like a fantasy nurse. She went into Patel's grocery store and Hamish followed. He waited outside until she emerged with a basket full of groceries over her arm. He swept off his cap. "May I carry your messages for you?" She smiled up at him from a perfect oval of a face. Her large eyes were grey and fringed with heavy lashes. Her hair, under the cap, was fair and glossy. "Thank you," she said. "But my car is right there." "I'll put them in the boot for you," said Hamish. "Do you work near here?" "Yes, I am a private nurse. I take care of old Mr. Harrison." "He lives in that old hunting lodge out on the Braikie road," said Hamish. "But he had a nurse, a Miss Macduff." She laughed. "He fired her and employed me. So you're the local copper." "Hamish Macbeth. And you are?" "Gloria Dainty." He put her basket in the boot. She bent over the boot to arrange something and the frisky wind lifted the skirt of her dress, revealing that those stockings were held up with lacy suspenders. "I'll follow you," said Hamish. "I haven't said hullo to Mr. Harrison." He had actually visited the old man, ignoring the fact that Mr. Harrison had said sourly that he did not want visitors. But he was determined to further his acquaintance with Gloria. Charlie Carter knew in his bones that Hamish wanted rid of him. He could not bear the idea of leaving Lochdubh. He was trying to make a cup of tea without breaking or spilling anything when there was a knock at the door. When he opened it, he found Priscilla Halburton-Smythe smiling at him. "I'm afraid Hamish is out," said Charlie. "I'm about to make tea. Like some?" "Yes, please." Priscilla sat down at the kitchen table. Various pieces of china, recently mended, stood on a piece of newspaper. "Have you been breaking much?" she asked sympathetically. "Hamish gets so mad at me," said Charlie. "And that makes me worse. Fact is, it is a wee station and we're two big men." He poured tea carefully and then sat down gingerly opposite her. Even sitting down, his head was near the low ceiling. The kitchen chair creaked alarmingly under his weight. His normally pleasant face looked so miserable that Priscilla was touched. Because of her beauty, until Charlie came along, Priscilla had never been able to have a male friend. "I've just remembered something," she said. "In the basement at the castle, there's a little apartment which used to be the butler's place before we turned it into a hotel. It has high ceilings." Charlie brightened and then his face fell. "I'm supposed to live in police accommodation." "Nobody would know, apart from me and Hamish. Oh, maybe the villagers, but they won't talk. Let's go now and have a look." Hamish, as he followed Gloria into the dark hall of the hunting lodge, remembered again that Mr. Harrison was a nasty old man who had sneered at him when Hamish had visited. He carried the shopping basket into a cavernous kitchen. "Just put the basket on the table," said Gloria, "and come through to the drawing room and say hullo." "Isn't there a housekeeper to do the shopping?" asked Hamish. "Yes, but this stuff is for me. Mr. Harrison has a Latvian couple to look after him, Juris and Inga Janson. I prefer to cook my own food. Must look after my figure." Oh, let _me_ look after it for you, thought Hamish dreamily. "Come along," she said briskly. As he followed her through a dark stone-flagged passage and across the shadowy hall where only weak light filtered through the mullioned windows, Hamish reflected that the hunting box had probably been built at the end of the nineteenth century when there was a craze for Gothic architecture. Stuffed animals' heads looked down from the thick stone walls. A stone staircase with a stone banister led upwards. Gloria pushed open a heavy oak door, stood aside, and called, "Here is our local bobby to see you, Mr. Harrison." An old man with his knees covered in a tartan rug was seated in a wheelchair by a French window overlooking a terrace where a few dead leaves skittered along in the breeze. He swung his chair round. "He's already said hullo. Where the hell are the Jansons? I want a drink." "I'll get it," said Gloria. "Your usual whisky and soda? What about you, Hamish?" "Too early for me," said Hamish. "Sanctimonious prick," commented Mr. Harrison. He had a thick head of hair and bushy eyebrows. His eyes were small and black. "You see this copper here, Gloria?" he demanded. "This is just the sort of chap you want to avoid. If he had any guts or ambition, he would have risen in the ranks instead of being stuck in the back of nowhere." "Like you," said Hamish. "Here's your drink, my dear," said Gloria soothingly. "Aren't we a bit cross this morning?" Mr. Harrison took the glass from her and his face softened. "What would I do without you? Push off, copper." Hamish smiled. "If you ever need my help, forget it." "I'll see you out," said Gloria. Hamish hesitated at the front door. "Any chance of taking you out for dinner one evening? There's a very good restaurant in Lochdubh." "I'm allowed a day off a week. Every Sunday. Maybe that would be nice." "What about next Sunday? I'll drive so you can have a drink." "If Mr. Harrison saw you, I don't think he would approve. I'll get Juris to run me there. What time?" "Say eight o'clock?" "Fine." "You're not going to bring those creepy animals with you, are you?" "No, not at all," said Hamish, her attractions dimming a little like a faulty lightbulb. "See you there." He climbed into the police Land Rover. Sonsie was in the passenger seat and Lugs in the back. "You're not creepy, are you?" he said. Sonsie gave a rumbling purr. At the police station, he was met by local fisherman Archie Maclean, carrying two mackerel. "Make you a nice wee dinner," he said, handing them over. "I saw you chasing after that flirty nurse." "Why do you call her flirty?" "Herself gets the Sundays off and aye gangs up tae the bar at the hotel and sits there till some fellow invites her for dinner." "Surely not!" "Aye. As sure as I'm standing here. If you're looking for Charlie, he's gone off with Priscilla." "Why?" demanded Hamish. "I dinnae ken. Take the fish." "Thanks, Archie." Hamish went slowly into the police station, where he put the fish in the fridge. He was envious of Charlie's easy-going friendship with Priscilla. He wondered sourly whether Charlie was gay. He had shown no sexual interest in any female so far. But then one of his own best friends was Angela Brodie, the doctor's wife, and he could not ever remember lusting after her. Curiosity overcame him. He told his animals to stay and went back out to his vehicle and sped off to the hotel. The manager, Mr. Johnson, said they were down in the basement but he didn't know what they were doing. Hamish made his way down. "This'll just be grand," he heard Charlie saying. "But maybe Hamish won't like it." The voices were coming from the far end of the basement where a door stood open. "Hamish won't like what?" he called. There was a short silence and then Priscilla called, "In here." Hamish walked in. He found himself in what seemed to have been a small apartment. "What d'ye think?" cried Charlie. "Priscilla says I could move in here and you'd have more room at the station." "What is this place?" asked Hamish. "It used to be a wee apartment for the butler," said Charlie. The Tommel Castle Hotel had once been the Halburton-Smythes' private residence. When Colonel Halburton-Smythe had fallen on hard times, Hamish had persuaded him to turn the place into a hotel. Hamish looked round. There was a small living room, furnished simply with a dusty gate-leg table and two hard chairs. By the side of the living room was a small kitchen with a tiny Belling cooker on a counter and some cups and plates covered with dust on the draining board beside a sink. "The bedroom's through here," said Charlie eagerly. "Priscilla says that the butler, old Mr. Sweeney, was a great tall man." The bedroom held a long single bed covered in an old mattress stuffed with ticking, flanked by two small chests of drawers. "How do I square it wi' Strathbane?" asked Hamish. "They don't need to know," said Priscilla. Hamish suddenly realised that this could mean he would get his station back, all to himself. Perhaps he could even persuade one pretty nurse to join him there. He went off into a rosy dream. Priscilla looked with some irritation at the tall sergeant with the flaming-red hair. "Hamish! Wake up!" "Oh, aye, grand," said Hamish quickly. "But make sure your phone works down here, Charlie. And God forbid we should have any more major crime, but if we do, you'll need to move back to the station." "A home of my own!" cried Charlie, sitting down on one of the hard chairs, which promptly splintered under his weight. He turned scarlet as he scrambled to his feet. "I'll repair that, Priscilla. I promise." "Charlie, it was riddled with woodworm. There's plenty of furniture in the basement for you to choose from. I'll get a couple of the maids to help you." "No," said Charlie firmly. "I'll do it all myself. I just need some cleaning stuff." There were some cupboards under the sink. Priscilla bent down and looked into them. "Well! Look at this. Our old butler seems to have nicked some of the best wines. And here's a bottle of vintage champagne. We'll have a glass each to celebrate." "You mean the butler was a thief?" asked Charlie. "It's called butler's privilege. He's dead anyway. I've found some glasses. I'll just rinse them out." Hamish collected three sturdy chairs from an area of the basement outside, crowded with discarded furniture. Priscilla had just opened the bottle and was pouring out three glasses of champagne when Detective Jimmy Anderson walked into the apartment. "What's this?" he demanded. "I was on my road to see you, Hamish, when I saw your Land Rover in the hotel car park. You know what I feel about drinking on duty. Got any whisky, Priscilla?" Priscilla went to the cupboard and brought out a bottle of twelve-year-old malt. "This do?" Jimmy's blue eyes gleamed in his foxy face. "Pour it out, lassie." "What brings you?" asked Hamish. "Strathbane prison, that's what. I'm rounding up manpower. The search starts this afternoon. The number of weapons, drugs, and mobile phones has doubled in Scottish prisons." "You could have phoned me," said Hamish. "Och, I wanted a trip out. Blair is in charge and he's shouting and bullying already. We've got mobile phone detection equipment and drug dogs, so the main search will be for weapons." Detective Chief Inspector Blair was the bane of Hamish Macbeth's life, always trying to get him transferred to Strathbane. "You should be looking for bent screws," said Charlie. "If it's weapons, then the prison officers must be getting paid to sneak them in." "Hard going," said Jimmy. "They all cover for each other." His phone rang. He looked gloomily at the dial. "Blair," he said. "We'd best get going. Man, this whisky is heaven." He slipped the bottle in his pocket. "You can stay," whispered Hamish to Charlie. "I'll get Jimmy to say you couldnae leave the station unmanned. But collect Sonsie and Lugs. I don't want them left alone too long." As they approached Strathbane, the skies darkened and a smear of drizzle clouded Hamish's windscreen before he switched the wipers on and looked down the long road to where what he thought of as a boil on the Highlands appeared in the distance. It had once been a thriving fishing port, but the fishing stock had declined and with it any heavy industry, leaving the town a sink of crime and drugs. The prison was a Victorian one, built to the same design as Wormwood Scrubs. As they drove up to the entrance, the rain had become a torrent and the wind was rising, moaning in the turrets of the old prison. After they had been through security, a wooden-faced prison officer told them to report to the governor's office. The governor, Bella Ogilvie, was a small, plump woman. Beside her was a tall woman in police inspector's uniform. She had high Slavic cheekbones, cold grey eyes, and a thin mouth. "Where have you been, Anderson?" she snapped. "Collecting reinforcements, ma'am," said Jimmy. "You are...?" "Fiona Herring. And no cracks about red herrings. I've heard them all. Who's this?" "Sergeant Hamish Macbeth, ma'am." "Heard of you. The pair of you get over to C Wing and search all the cells." "Where is Mr. Blair?" asked Jimmy. "Mr. Blair is in hospital." "What happened?" Her eyes lit up and she suppressed a laugh. "The detective inspector insulted a police dog called Fred. He told the dog it was a mangy, useless-looking cur and tried to kick it. Fred took offence and bit him in the arse. I have been called in from Inverness to take charge. Off with you." As Hamish followed Jimmy to C Wing, he reflected that when she had nearly laughed, Fiona had suddenly appeared a very attractive woman. At the end of a long dreary afternoon, they took their finds back to the governor's office: five knives, one replica gun, and a packet of Ecstasy tablets. The governor told them to take their contraband to the conference room. Laid out on the long table was a depressing selection of drugs, phones, and weapons. The weapons consisted of knives, sharpened toothbrushes, shivs, and five guns. "I have a list of the names and addresses of all the prison guards," said Inspector Fiona Herring. "I will allocate names to each officer. I want their backgrounds checked thoroughly. What is it, Governor?" Mrs. Ogilvie looked like a frightened rabbit. "The guards have gone on strike," she wailed. "Who is in charge of the union?" "Blythe Cummings." "I want him here. Now!" The governor hurried off. When it came Hamish's turn, Fiona said, "I think you may go back to your station, Sergeant. You have a large area to cover." Lovely woman, thought Hamish. The first person in authority to realise the extent of my beat. No rings. Wonder if there's a man in her life. When Hamish returned to his police station, he found Charlie loading up his old station wagon with his belongings. "You'd better come here every day and report for duty," said Hamish. "I'll miss your company in the evenings but not your big feet. You and Priscilla getting along all right?" "She's great. Just like a sister." Hamish pushed back his cap and scratched his red hair as he watched Charlie drive off. What man could survey the beauty that was Priscilla and look on her as a sister? After Charlie had left, Hamish decided to drive to Braikie. His previous constable, Dick Fraser, had left to buy a bakery shop with a Polish woman called Anka. Anka was glamorous. Hamish had tried several times to get her out on a date but without success. Surely she and tubby Dick could not be romantically involved. The shop had just closed for the night when he arrived. He noticed a shiny, brand-new BMW parked outside. If it was Dick's, business must be very good indeed. He rang the bell to the flat over the shop. Anka Bajorak answered the door. My world is beginning to be peopled by beautiful unavailable women, thought Hamish. But maybe Gloria is available. Anka walked ahead of him up the stairs, her auburn hair tied back in a ponytail and her long legs encased in tight jeans, giving one highland police sergeant a stab of lust. Dick had slimmed down. But with his grey hair and small figure, he certainly did not look like the type of man to capture the affections of such as Anka. He was comfortably ensconced in an armchair by the peat fire. "It's yourself, Hamish," cried Dick. "Like a dram?" "Tea will be fine." "I'll get it," said Anka. Hamish told Dick about the visit to the prison and then said, "There's a newcomer in the neighbourhood." "That'll be the wee nurse," said Dick. "Talk o' the place. Say she dresses like a nurse out o' one o' thae _Carry On_ movies. They say she's after the auld man's money." "The things people say!" complained Hamish. "I've met her. She's charming." "Oh aye? Got a date?" "Next Sunday." "Well, she wouldn't be going out wi' you if she was after money," said Dick. Anka came back with a cup of tea for Hamish and two cakes. "How's business?" asked Hamish. "Booming," said Anka. "We thought of opening another shop, but we decided to start a business on the Internet. It's called BapsareUs. We send parcels of baps all over Britain." "I'm not surprised," said Hamish. One of the usual Scottish laments was that it was almost impossible to get a decent bap, those large breakfast rolls. Anka's baps were famous. "We've had to build a new place to cope with all the baking and take on lots of staff," said Anka. "Several of the big companies have tried to buy us over." Hamish told them about Charlie moving out. "Won't you be lonely?" asked Dick. "No, I'm delighted to get my station back. Charlie is great but he's so clumsy, he's a walking disaster." "I would like to meet him," said Anka. "Bring him with you next time." "Will do," said Hamish. "I'd better get back." When Hamish returned to the station, he found a note on the kitchen table from Charlie. "I've taken Sonsie and Lugs up to the castle. They were mooching at the Italian restaurant and we don't want them getting fat. I'll drop them back later." The wind had risen, moaning around the police station. Hamish fought off a sudden feeling of loneliness. But then he had a vision of the pretty Gloria, living with him at the police station. Three days to Sunday and then he would see her again. Chapter Two Listen! You hear the grating roar Of pebbles which the waves draw back, and fling, At their return, up the high strand, Begin, and cease, and then begin again, With the tremulous cadence slow, and bring The eternal note of sadness in. —Matthew Arnold Colonel Halburton-Smythe arrived back at the Tommel Castle Hotel in a bad mood. He and his wife had been visiting Lord and Lady Fortross over near Oban. Unfortunately, their room had been directly above the bedchamber of their hosts and the fireplace chimney acted as a splendid conduit of sound. So on the first night, as he was getting ready for bed, he heard Lord Fortross's high complaining voice. "Why did you invite that boring little colonel? I can't abide retired military men who insist on keeping their titles. And the man's a damn stereotype." The colonel had backed away from the fireplace as if before a snake and had told his startled wife to pack up. They were leaving in the morning. He was an insecure little man, product of an ambitious father who had made his fortune with a chain of popular shoe shops. Using his fortune, his father had sent him to Eton and then on to Sandhurst Military Academy. The colonel had quickly adopted a personality to fit what he fondly believed was required. He worked hard and, with his father's money, entertained lavishly. He rose rapidly up the ranks and married Philomena Halburton, who hailed from an aristocratic family and had joined the name of Smythe to that of Halburton. His happiest day was when he quit the army and bought the castle and estates, only to go nearly bankrupt after being tricked into bad investments. Hamish Macbeth saved the day with the hotel idea. Because of excellent fishing and shooting and a first-class manager, the hotel quickly prospered. On his first day back, the colonel noticed a large man going down to the basement, someone he did not know. He went down and saw the man going into the old butler's apartment and followed him in. He blinked and looked around. A small coal fire was burning briskly. Two comfortable armchairs were drawn up beside it. A faded Chinese carpet that he remembered used to be in the morning room, now the hotel bar, covered the floor. Standing by the fire was a giant of a man with fair hair and child-like blue eyes. "Who the hell are you?" demanded the colonel. So Charlie, in his soft lilting voice, explained while the colonel paced up and down. "She had no right," raged the colonel. "Priscilla should have consulted me first." "Well, sir," said Charlie. "Miss Priscilla did think it might be a good idea to have a resident polis, protecting the place. But I'll pack up. Maybe a wee dram, sir?" The colonel suddenly sighed and sat down in one of the armchairs, all bluster gone. The cosy little room reminded him of the days of his childhood, before his father had become so rich and ambitious. They had lived in a neat little bungalow, warm and safe. "Yes, I will have a dram," he said. Charlie poured two stiff drinks and then sat down opposite. "Tell me about yourself," he said. So Charlie talked about his upbringing in South Uist in the Hebrides, his soft voice lulling the colonel into a rare feeling of peace. The colonel was suddenly overcome with a desire to tell this gentle giant about his humiliation. Charlie listened carefully. When the colonel had finished, Charlie said, "I mind Lord Fortross. I was visiting relatives in Tiree and himself was over for the snipe shooting. Awful pompous git. Nobody liked him. Talk about bores! Man, he was describing himself." The colonel beamed and stretched his feet out to the fire. "Any more whisky, laddie?" Hamish heard a knock at the door later that day and found Priscilla on the doorstep. "I came to say goodbye," she said. "I'm off to London tomorrow. Dad has discovered Charlie." "Oh, my," said Hamish. "Is he out on his ear?" "It's the oddest thing. He's taken Charlie trout fishing." "It isnae the season." "Sea trout. The pair of them are out on the loch." "Well, I'm blessed. Aren't you surprised?" "Not really. Charlie is so kind. All sorts of people gravitate to him." Hamish's hazel eyes narrowed with jealousy. Did Priscilla fancy him? Then he relaxed. If she was interested in Charlie, she would not be leaving for London. When they had been engaged, she had been so passionless. Had that been his fault? "You've gone off into a dream, Hamish," said Priscilla. "Sorry. I was just thinking how nice and quiet it is now." "Are Dick and Anka an item?" "No. Business partners. No romance there." "I wouldn't be too sure." "C'mon, Priscilla. Don't be daft. Tubby wee grey-haired Dick and the glorious Anka!" That evening in the bakery, Anka went upstairs to the living room and found Dick dressed in his best suit. "Are you going out somewhere?" she asked. "That's the suit you wear when we've a meeting with the bank manager. And roses and champagne! What's the occasion? Dick, you've gone quite white." Dick sank to one knee and held up a small jeweller's box. "Will you do me the very great honour of marrying me?" he said. Anka threw back her head and laughed. Red in the face, Dick got to his feet. "I'm sorry," he said. "I should have known there wasnae any hope." "Give me the ring, open the champagne, my love. I thought you would never ask." Charlie went about his duties during the day, visiting the outlying croft houses to make sure everything was all right. In the evenings, he was now expected to take his dinner with the colonel and his wife and then they all retreated to his little flat for a nightcap. Mrs. Halburton-Smythe was delighted with her husband's new friendship. She had never before known him to be so relaxed and so amiable. She would have liked to invite Hamish to join them, but the colonel stubbornly refused to have anything to do with that "lazy, mooching copper." He had snobbery enough to hope that his beautiful daughter might make a good match and he always feared she might have the folly to become engaged to Hamish again. On Sunday, Hamish brushed his red hair until it shone, put on his best suit, and made his way to the restaurant. He had reserved a table by the window. The evening was still and the first frost had arrived. The waiter, Willie Lamont, who was once his constable before he married the restaurant owner's daughter, approached with the menu. "Two menus," said Hamish. "I'm expecting company." "And who would that be?" "Mind your own business." Willie went off and came back with another menu. "What's special tonight?" asked Hamish. "Something sounds like awfy bokey." "Probably osso buco," said Hamish, who was used to Willie's malapropisms. Hamish waited and waited. At last, he found Mr. Harrison's number and phoned. An Eastern European voice answered—the Latvian, Hamish guessed. "May I speak to Miss Dainty?" he asked. "This is Hamish Macbeth. She was supposed to meet me for dinner this evening." "Mr. Harrison said she went for a walk. Hasn't come back." Probably forgot, thought Hamish dismally, after he had rung off. He ordered the osso buco but picked at it, finally gave up, paid the bill, and went back to the station. "For the first time in my life," he said to his animals, "I could do wi' a nice wee crime to take my mind off things." Two days went by while Hamish stubbornly stopped himself from phoning the hunting lodge to find out why Gloria had stood him up. It was a fine autumn day. The rowan trees planted at some of the cottage gates to keep the fairies away were bowed down with scarlet berries. The lower slopes of the two tall mountains behind the village were purple with heather. He took a stroll along the waterfront. He saw the Currie sisters, Nessie and Jessie, approaching and looked wildly round for some means of escape, but they had seen him, so he waited reluctantly until they came up to him. They were unmarried twins and looked remarkably alike with tightly permed grey hair, thick glasses, and identical camel-hair coats. "I'm glad to see Mr. Harrison's got himself a proper nurse," said Nessie, "and not some wee flibbertigibbet." "Flibbertigibbet," echoed the Greek chorus that was her sister. "You mean Gloria Dainty has left?" exclaimed Hamish. "Went off wi' her suitcase," said Nessie. "Never even left a note." "When was this?" "Sunday evening." Hamish felt a sharp pang of unease. He touched his cap to them and moved on. Suddenly he decided to go out to the hunting lodge. Juris, the Latvian, answered the door. He was a tall, powerful man. Hamish asked to see Mr. Harrison but was told the old man was lying down and did not want to be disturbed. "Why did Miss Dainty leave?" asked Hamish. "You were supposed to run her to Lochdubh to have dinner with me on Sunday evening." "I went to fetch her but she was not there and all her belongings had gone," said Juris. "On Monday, Mr. Harrison got a new nurse up from an agency in Inverness." "Didn't she leave a note?" "No, nothing." "But when I phoned, you said she'd gone for a walk." "That's what Mr. Harrison told me. The next day, my wife looked in her room and saw all her things were gone and told him, and he said, 'Good riddance.'" "Was Miss Dainty involved with a man?" "If she was, she didn't talk about it." Hamish could not get any further. He went back to the police station and rang around all the local taxi companies, but Gloria had not called for a taxi. So it followed that someone must have been waiting for her at the end of the drive. Well, she had gone, and that was that. A day later, a burglary was reported at an ironmonger's in Braikie. Hamish called Charlie, picked him up at the hotel, and sped off. The owner, a tall highlander called Josh Andrews, pointed to the door. "It looks as if they opened it with a crowbar," he said. "What was taken?" asked Hamish. "I have a list right here." Hamish looked down a long list of expensive power tools. "I'd better get the forensic boys over," he said. "We'll need to look for fingerprints. Have you contacted the insurance company?" "Not yet." "They'll want to send an investigator." "What for?" demanded Josh angrily. "You see the door's been jemmied. You've got the list. Chust put in your report, laddie." "It is like this," said Hamish gently. "Shopkeepers often stage a burglary when they fall on hard times. And their investigators are like ferrets. They'll search and search to make sure you're not pulling a fast one. I 'member some poor soul ower in Cnothan. Faked a burglary and got a criminal record." "Are you calling me a liar?" "Waud I dae a cruel thing like that," said Hamish, his accent strengthening. "I'll chust be having a wee keek out back." "What for?" "They could have escaped that way. I gather it took place at night?" "Must have done." "So they would not want to be seen loading stuff out on the main street. Stand aside." "No, you need a warrant." "Don't be daft," said Charlie. He moved forward and picked up the large man as if he weighed nothing at all and set him to one side. " _No!_ " shouted Josh, and a tear rolled down one cheek. Hamish looked at Charlie. "Do you see any signs of a break-in?" "Cannae say I do, sir." Hamish handed Josh back his list. "Listen to me. I cannot be bothered charging you. I know times are hard. Put a big sign in your window saying 'Autumn Sale. Everything Must Go. Everything Reduced.' Then you knock a couple of quid off the items you said were stolen, along with everything else. Folk love to think they're getting a bargain." "I'm sorry," said Josh brokenly. "Oh, get off your sorry arse and get to work," said Hamish. "Come along, Charlie." "It's a shame," said Charlie as they climbed into the Land Rover. "Never mind," said Hamish. "There's a grand wee café up the coast on the road to Kinlochbervie. We'll have a cup of coffee and a bun. It's a grand day." The café was called Westering Home. There were two tables outside facing a long curve of white sandy beach. Hamish and Charlie contentedly drank coffee and munched currant buns until Hamish reluctantly said they had better be getting back. They were driving along the one-track road beside the beach where two boys were playing when Hamish suddenly flung on the brakes and screeched to a halt. Lugs, in the back, let out a startled yelp. "What's up?" asked Charlie. But Hamish was out and running towards the boys. "Where did you get that?" he demanded. A small tousle-haired child held up a dripping wet nurse's cap. "It just floated in," he said. "We wasnae doing anything wrong." Charlie had followed Hamish. "What's up?" "Unless I am mistaken, that's thon missing nurse's cap," said Hamish, taking a forensic bag out of his pocket and sliding the cap in. "Let's search around a bit before we call Strathbane." "Strong currents here, I've heard," said Charlie. "If she's in the sea, she could be halfway to America. Here, you boys. Names and addresses and I'll call on your parents later." When the boys had scampered off, Hamish said, "I'll take the west end of the beach and you try the east." Hamish made his way to where the cliffs rose up against the pale-blue sky. Seagulls wheeled and dived. All the while, his mind worked busily. She surely wouldn't have left wearing her nurse's uniform. At the foot of the cliffs were jagged needle rocks like pointing fingers. As he approached, two things struck him. That old familiar smell of death and the buzzing of flies. With a beating heart, he picked his way among the rocks. Between two of the pointing rocks lay the shattered body of Gloria Dainty under a heaving canopy of black flies. After Charlie had joined him, they put police tape round the rocks. "I think she was thrown over," said Hamish. "Go up to the top of the cliffs and cordon off an area there as well. I've phoned it in. You're a bit white, Charlie. You've got the boys' addresses, haven't you?" "Aye, they're in Kinlochbervie." "Get ower there and take a statement, and then knock on some doors and see if anyone saw or heard anything. Take the Land Rover. When you've finished, let Sonsie and Lugs out for a run and then come back here." Hamish waited, sitting on a flat rock, hoping that the bane of his life Detective Chief Inspector Blair would decide not to come. He wanted to go back to the body, brush the flies away, and find out if she had been dead before she was thrown over. But he knew he would be accused of contaminating the crime scene. Flies, not yet maggots. If she had been killed elsewhere and then dumped, that would account for the flies. Had the seagulls been at the body? They ate carrion, that he knew. It was an hour before he heard the sound of the whole contingent from Strathbane arriving outside the café and stood up. With relief, he saw it was his friend Detective Jimmy Anderson heading the group. His foxy face looked as hung over as usual. "What have we got, Hamish?" he asked. "A private nurse to old Mr. Harrison. I had a date wi' her on the Sunday. She didnae show and I thought I had been stood up. Mr. Harrison said she had gone for a walk. The Latvian who works for him said her belongings were gone. I had finished investigating a false alarm in Braikie and came up here because it's on my beat. Two laddies, playing on the shore, had a nurse's cap and I recognised it as being the type that Gloria had worn. I searched and found her behind those rocks. I think she was thrown over. Lots of flies. But she disappeared four days ago." "Here's the pathologist, Hamish. Let's go to thon café and leave him to work." Jimmy found to his delight that the café sold liquor and bought a half bottle of whisky and poured a slug into his coffee. "So where's Blair?" asked Hamish. "Sulking. He wanted a transfer to Glasgow, but they didnae want him." "But he would be daft to get away from the protection of Superintendent Daviot!" "Aye. But he doesnae know that. Thinks he's the best detective since Sherlock Holmes." "Who was fictional," said Hamish. "Well, our Blair is a legend in his own lunchtime. It only takes a few drams to make him think he is Sherlock Holmes. So when was your date wi' the nurse?" "Sunday. Pretty lassie. It's a damn shame. Mind you, I heard our Gloria liked to go to the Tommel Castle Hotel on her day off and pick up men in the bar." "Would old Harrison have killed her?" "He's confined to a wheelchair." "What about this Latvian?" "Don't know much about him. He and his wife work for Harrison. The body's covered in flies. Doesn't it take about three days afore they turn into maggots?" "Something like that." "Or maybe she was killed elsewhere and then the dead body thrown over. Oh, here's Charlie. Found anything?" "Nothing," said Charlie. "I'm waiting for the pathologist's report," said Hamish, "and then we'll maybe look at the top of the cliffs, but it's no use looking up there if it turns out she wasn't thrown over." Charlie pulled up a chair and sat down. The incoming waves, green near the shore and aquamarine further out, curled and splashed on the beach while restless seagulls swooped and dived. At last, Hamish could see the pathologist emerging from the rocks. He was a man new to Hamish, tall and shambling with a long grey beard. He joined them at the table as an ambulance lurched down onto the beach. "I'll know better when I get a full autopsy," he said. "I would estimate she's been dead about four days, but possibly dumped over the cliff maybe yesterday. The flies are pretty fresh. She's been strangled but she's got a lot of broken bones showing that she was tossed from the cliffs." "Come on, Charlie," said Hamish. "We'd best get up there." "I'll get over to Harrison's," said Jimmy. "Oh, oh! Here comes trouble." Police Inspector Fiona Herring came striding up to them. The pathologist made his escape. "This is a cosy tea party," she said. "What are you doing here?" demanded Jimmy. "I have been drafted in to gee up what I am told is a slack lot," she said. "Fill me in." Jimmy told her what he knew. Hamish described his failed date. "I'm off to interrogate Harrison," said Jimmy, "and Hamish and Charlie are going to search the top of the cliffs." "I've a squad of men who can do that," she said. "Carter can join them. You can supervise, Anderson. I'll take Macbeth to Harrison's. He knows the man." "May I remind you, ma'am, that I am in charge of this case," said Jimmy furiously. "Not now. Superintendent Daviot's orders. Come along, Macbeth." "May I point out that Macbeth was trying to date her?" said Jimmy. "That makes him a suspect." "Dear me. A friend in need is a pain in the arse," said Fiona, flicking a contemptuous look at Jimmy. "She disappeared on Sunday evening. Where were you, Macbeth?" "Sitting in the Italian restaurant in Lochdubh, waiting for her until ten o'clock, ma'am. Then I went back to the station. I phoned my mother in Rogart for a wee chat and then I went to bed." "Sounds all right to me. Come along. We'll take my car." Hamish gave directions to her driver, fighting down a feeling of hurt that Jimmy had tried to suggest he was a suspect. "So you tried to date the girl," said Fiona. "I gather she was attractive when not thrown down a cliff and covered with flies." "She was very pretty," said Hamish sadly. "Dainty, like her name. I didn't know about her picking up men at the hotel although that might just be village gossip. I'll check later." "Hope it is village gossip," said Fiona, "or it widens the field." She took out her phone and called Jimmy, instructing him to get over to the Tommel Castle Hotel and make sure none of the guests was allowed to leave until they had been interrogated. "Why do they call these places 'boxes'?" she asked. "Well, it meant you had a grand mansion somewhere and this was just a place for the hunting, shooting, and fishing. But I call to mind, it was originally the residence of a snobbish family in Victorian times who wanted folk to think they were landed gentry. He manufactured drainpipes. They called it their hunting box but they didn't really have anywhere else. He had it built after he retired." "And what is Mr. Harrison's story?" "Now, there's a thing, ma'am. Usually I find out everything about a newcomer on my beat, but he was so obnoxious, my curiosity died. He's got a Latvian couple working for him. The man, Juris, speaks good English so I don't think they're new immigrants. But it's Mr. Harrison who bothers me. He doted on Gloria and yet his final comment was 'Good riddance.'" "What about heirs?" asked Fiona. "I mean, if it got on the family grapevine that he was sweet on his nurse, someone might have seen their inheritance at risk." Her mobile phone rang. "Yes, Blair," Hamish heard her say. He listened as outraged squawks came from the other end of the phone. Then Fiona said in a voice as cold as ice, "If you have any complaint about me being in charge of the case, take it up with your superiors. Furthermore, as there is no proof that the Latvian had anything to do with it, I would be careful about airing your prejudices against immigrants. If I may put it politely, sod off!" What an amazon, thought Hamish gleefully. The early dark of a highland autumn lay over the countryside as they drove up the drive to the hunting box. "Has this place got a name?" asked Fiona. "It's always been called Dunlop's Folly. Dunlop was the original owner." The black Gothic turreted building stood up against the starry sky. The police driver stopped the car outside the huge brass-studded front door. "Now," said Fiona. "Let's see what we can see." Chapter Three These are much deeper waters than I had thought. —Sir Arthur Conan Doyle Juris answered the door and surveyed them doubtfully. "I don't know if the boss is up to seeing you," he said. "We will start with you," said Fiona briskly. "Is there some room we can use for interviewing? And we will need to talk to your wife." "Maybe the library," said Juris. "It is never used." They walked across the shadowy hall under the glassy eyes of the stuffed animals, shining in the dim illumination of several wall lights. Juris pushed open a door and ushered them in after switching on the overhead light. The original owner had belonged to the class who bought their books by the yard. Great dreary calf-bound tomes lined the walls from floor to ceiling. There was a large desk against the window in front of dusty velvet curtains. Fiona sat behind the desk and indicated that Juris should sit in front of her. Hamish leaned against a wall and surveyed the man. Juris was tall and powerful, with a thick head of hair over a low forehead, marked by strong bushy eyebrows. Fiona took out a small tape recorder and laid it on the desk. Before she could begin, Hamish said, "You are a British citizen, aren't you?" "Yes, and the wife as well." "So why do they call you Latvian?" asked Fiona. "Our parents on both sides were Latvian. There is a Latvian community in Glasgow. Up here, if you're from Glasgow, you're a foreigner. Folk asked why we had such odd names. Told them. Called the Latvians ever since." "When did you start work for Mr. Harrison?" "Last February. He hired us from an agency in Glasgow." Juris's voice held only a trace of a Glaswegian accent. "And where were you before that?" "Worked for Lord Kinbochy in Gourock." "Why did you leave?" "He died and his place was being sold up by the heirs. Mr. Harrison offered good pay. My wife is a grand cook." "Right. Now to the night Gloria Dainty disappeared. Her body has just been found at the bottom of cliffs near Kinlochbervie." Juris bowed his head in silence. The highland grapevine is marvellous, thought Hamish. Probably the whole of Sutherland knew Gloria was dead. "So take your time. What happened on the night she disappeared?" "She had a date with Hamish Macbeth. When he phoned, I asked Mr. Harrison and he said she had gone out for a walk. But when my wife looked in her room the next day, all her belongings were gone. I told Mr. Harrison. He was furious. He said, 'Good riddance,' but I think he was hurt because he was sweet on her." "An old disabled man?" "She flirted with him something awful. My wife said she was hoping to be left money in his will, but I think she hoped to get him to marry her." "What makes you think that?" "I came in one day and she was sitting on his lap with her arms around his neck and saying, 'Don't you ever want a wife?'" Fiona opened her capacious handbag and took out a notepad. "Go away and write down all your movements for the evening she disappeared and the following day. I need your age and if you have any other address. But first send your wife in." When he was gone, Fiona asked Hamish, "What do you think?" "I think he's decent." "Your famous highland intuition tells you that?" "Maybe. It wasnae working verra well when it came to Gloria. But och, she dressed like a fantasy nurse." Hamish blushed. The door opened and Inga Janson came in. Fiona asked her all the questions she had asked her husband. Then Hamish said, "Tell me, Mrs. Janson. What did you think of Gloria Dainty?" "Wee hoor," she said viciously. "Couldn't leave anything in trousers alone. But the boss didn't know that. 'Ooh, I do like a mature man, Mr. Harrison, dear.'" Inga's voice had risen to a falsetto. She was a plain-faced woman with her hair screwed tightly back into a bun. "She even made a pass at my Juris," said Inga. "'I'll slit your throat if you try any more of that,' and so I told her." Inga gave an exclamation of dismay and covered her mouth with her hand. "Did you murder her?" asked Fiona bluntly. "No, I did not!" protested Inga. "I wish she'd never come here. Juris told me about her being murdered. I was glad. But I had nothing to do with it." Fiona gave her another notebook to write down all her movements. Before she left, Fiona said, "Tell Mr. Harrison we need to search the house. I can get a warrant but it would be easier if he would cooperate." Inga left and returned after ten minutes to say the search could go ahead. Fiona phoned and demanded a forensic team. "Now, Macbeth," she said, "if Harrison won't come to see us, we'd better go and see him." "I'll lead the way," said Hamish. "I think I know where he'll be. If Gloria was picking up men at the hotel, that does widen the field of suspects." But there was someone who was the last person that Hamish Macbeth would ever consider as a suspect. Charlie had been dismissed by Jimmy Anderson. Jimmy was enjoying looking as if he were in charge. He had addressed the press, who had gathered like gannets. He knew he would be on the evening news. He didn't want Charlie around because Hamish Macbeth had a nasty way of solving cases and he didn't want his sidekick reporting anything to him. When he descended to the hotel basement, Charlie was startled to find a white-faced and nervous Colonel Halburton-Smythe waiting for him. "You've got to help me!" cried the colonel. "I'll do what I can, sir," said Charlie. "What's up? Poachers?" "If that were all. We're friends, right? Call me George." "Well...er...George," said Charlie soothingly, "let's have a wee dram. I'll put some more peat on the fire. We'll get comfy." Once the fire was blazing and the colonel had knocked back a shot of whisky, Charlie said, "Let's be having it." "I hear that nurse has been found murdered," said the colonel. "Yes, sad business." "I'm a suspect," said the colonel miserably. "You! No, that cannae be right." "It was like this," said the colonel heavily. "My manager, Mr. Johnson, said he was feeling uneasy about her, that she was picking up men in the bar. He told me her name. I said I'd deal with it. There she was, with two of the male guests. She was wearing a very low-cut black dress and high heels. I'd got her name, so I said, 'Step outside, Miss Dainty. I would like a word with you.' "I took her into the office and sent the manager away. I told her about our concerns and she began to cry. She sobbed that she was lonely and only came up to the hotel for a bit of company. She threw herself into my arms. I felt like a beast. My wife was away. I soothed her down and said we would have a bit of dinner and talk about it. "I can't remember any woman ever flirting with me before. I was in raptures. She told me a sad story about being stuck out in the wilds with old Harrison and on very little pay. I was so sorry for her. I told her to wait a minute. I had bought my wife an expensive cashmere sweater. I got it and presented it to her, and she kissed me! On the mouth! And in front of the waiters." "When was this?" asked Charlie. "It would be the Sunday before she disappeared. Two days later, I went over to confront old Harrison and I demanded to know why he was paying her so little. He told me what she was earning and it was a lot. She was out. I left a message to say she was not welcome at the hotel again. I felt an old fool who had been conned. Now the staff at the hotel will be questioned and my dinner with her will all come out." "That sweater, was it wrapped up?" asked Charlie. "No, I hadn't wrapped it yet." "So she left it in the office and you went to get it for her. Now, as long as Detective Chief Inspector Blair keeps off the case, it won't be too bad. We'll work out a statement down at the station and make it look oh so innocent. I'll type it up." "What if Macbeth tells my daughter?" "You don't know him very well. As far as we are concerned, the little tart threw herself at you. Come along, sir—I mean, George—and we'll get it over with." Hamish was not at the station. Charlie typed up the statement and left it in the office after the colonel had signed it. They had just returned to the hotel when Charlie got a call from Hamish to say the inspector was driving him to the station and Charlie had better be there. Hamish Macbeth reflected sourly that he would never, ever understand women. Seated in the station kitchen, the normally hard-bitten Fiona had taken one look at Charlie and her face had softened. She had questioned him about his life, his ambitions, and whether he had a girlfriend. A transformed Charlie had glowed under all the attention. There was Anka as well, thought Hamish, who refused all his invitations unless they included Dick. Fiona read Charlie's report on the colonel and Charlie said, "He is an innocent, ma'am, and a great friend o' mine. He's frightened he'll be suspected of the murder." "I think that is highly unlikely," said Fiona. "I see from the first reports sent in from the hotel that the Sunday Gloria disappeared, the colonel and his lady were over in Caithness at Lord Clardey's shooting party. They left on the Friday and did not get back to the hotel until the Monday, so what's the silly man worried about?" "When there's a murder, ma'am," said Charlie sententiously, "everyone feels guilty." "You are a very wise young man," Fiona said, while Hamish felt like howling, _What in the name o' the wee man is so damn clever about that?_ Fiona looked around. "You are two very big men and this is a small station. How do you both fit in?" "We manage, ma'am," said Charlie quickly. "I see the statement from Colonel Halburton-Smythe was made to you, Charlie." Oh, first names, is it? thought Hamish. "I'll go up to the hotel and put his fears at rest," continued Fiona. "You come with me, Charlie. Macbeth, tomorrow, get back up to those cliffs. You have a reputation for finding out what everyone else misses." "How did you get on with Mr. Harrison?" asked Charlie. "He'd got himself a new slab-faced nurse who protects him like a rottweiler. When we approached him, his eyes were closed and the nurse, a Helen Mackenzie, said he had just had one of his turns and to please leave. I was about to insist that we wait until he felt better when she said if Mr. Harrison died because of our harassing him, his son would sue our socks off. He'd already been on to Daviot, so I got a phone call from the super to order me out of there." "The lawyer didn't block the search team, surely," said Charlie. "No, that went ahead. Couldn't find a thing." When they had left, Lugs stared up at his master with his odd blue eyes. "I hope she disnae find out Charlie's living at the hotel," said Hamish. "Oh, to hell with it. Come on. I'm going to the Italian restaurant. I could do wi' comfort food." Charlie had failed to tell the colonel that his bosses did not know he was living at the hotel. The colonel greeted Charlie warmly and Fiona nervously. "Is there somewhere we can sit?" asked Fiona as they stood in the entrance hall. And to Charlie's horror, he heard the colonel say, "We can use Charlie's place. I lit the fire." Fiona said nothing until they were in the little apartment and Charlie had arranged chairs for the three of them in front of the fire. "Peat fires are supposed to send out a pleasant scent," said Fiona, "but I always think they smell like old socks. Right, Colonel. According to Charlie here, you are worried about your dinner with the dead woman. But you have a cast-iron alibi." "Gloria kissed me in front of the staff," mumbled the colonel, staring at the worn hearthrug. "The dead woman had a reputation of being a shameless flirt at best and a nymphomaniac and gold digger at the worst. I am not here to interrogate you. I am here to ask you to go upstairs and gather the staff, such as are not on duty, in the reception. I want to ask them questions." "Certainly." The colonel beamed at Charlie. "Follow me up. I think your best bet is the maids. They have rooms at the top. I would start with them first. The waiters will be serving dinner." The most forthcoming maid was, to Fiona's relief, Scottish, and prepared to talk freely, unlike the other three who hailed from Eastern Europe. Her name was Elsie Dunbar, a small girl with a mop of black hair and a spotty face. "I can tell you about one man," she said. "It was Mr. Fitzwilliam. He's left now. I went to clean the room because he was due to leave and it was past the checkout time. I heard an angry voice and a woman shouting." "And you listened at the door?" prompted Charlie. She blushed. "Oh, well, I was that curious. I heard a woman shouting, 'I don't do this sort of thing for nothing.' Then I heard the man say nastily, 'Get out, you slut.' She came out crying and nearly knocked me over." Fiona turned to the manager, who was listening. "We'll need Fitzwilliam's address and phone number. Anyone else, Miss Dunbar?" "That's all I know. The other maids don't talk much to me, them being foreign." When she left, Charlie suggested, "What about the barman? That's where she was supposed to pick men up." The barman supplied six names of guests, but they all had left. Mr. Johnson, the manager, went off to check the records for addresses. "I think that's enough for now, and I'm hungry," said Fiona. "Charlie usually joins us for dinner," said the colonel. "I would be honoured if you would be my guest." Fiona flashed an amused look at Charlie and said, "Lead the way. Most kind of you." The colonel saw to his alarm that his wife was already seated at their usual table. But Fiona began to question Charlie about what he thought about the case so far. Charlie shrugged his broad shoulders. "The suspects seem to be building up," he said. "It's going to take a lot of research unless Hamish gets one of his flashes of intuition." "He seems to have a great track record," said Fiona. "Overrated," said the colonel crossly. "Now, dear," his wife put in, "you are only cross because he broke off his engagement with Priscilla. Priscilla is our daughter, Inspector." "I was delighted," said the colonel. "My only fear is that they might get back together again. I just wish Priscilla would find someone decent, like Charlie here." "I am sure all the local ladies are after Charlie." Fiona looked amused. "I havenae noticed," protested Charlie. Mrs. Halburton-Smythe began to talk about a fund-raiser to start a food bank in Braikie for the poor. "The trouble about those food banks," said Fiona, "is that the elderly who really need help are too proud to go and it is too often the layabouts who want to keep money for what they consider essentials like cigarettes and booze." "Maybe not all," said Charlie gently. "I'll help out on my day off, if you like." The colonel and his wife beamed at Charlie. They look on him almost like a son, thought Fiona. After a comforting dinner, Hamish strolled back to the station with his pets at his heels. Once inside, he phoned Mr. Johnson at the hotel and received the news that both Fiona and Charlie were dining with the colonel and his wife. He was in the office when he heard the kitchen door opening and then Jimmy Anderson's voice calling, "Anyone at home?" Hamish went through to the kitchen. Jimmy looked tired but sober. "What a day. I could do wi' a dram." "Oh, all right. But just the one." Jimmy sat down at the kitchen table. "Where's Old Iron Knickers?" "Herself is up at the castle, dining with Charlie and the colonel and his missus." "Charlie! But he's only a constable. What about me? Or at least, you." "She likes Charlie. I often wonder about our Charlie. Women fancy him but he doesnae even bat a hormone." Jimmy took a gulp of whisky. "Probably a virgin." "In this wicked day and age?" "Could be. Doesnae fancy you, does he?" "Not a bit. I've got to search the area up there again. Find anything?" "The pathologist said that the tide didn't reach where she was and maybe she was killed elsewhere and dumped." "Was she strangled with hands or a ligature?" "He thinks it could ha' been done wi' something like a scarf." "No sign of her luggage?" asked Hamish. Jimmy sighed. "Probably at the bottom of a peat bog somewhere." "You'd better stay the night," said Hamish. "I'll put clean sheets in the cell." "The mattress in that cell is as hard as buggery. Anyway, how do you know a storm is coming? Heard it on the radio?" "Heard it in my bones." "Don't believe you. I'm off. It's Hallowe'en on Saturday. Expect any trouble?" "Nothing up here," said Hamish. "Usually just wee kids out guising." Jimmy left by the kitchen door. The station was protected by the tall cliffs at the end of the sea loch. It was only when he was driving along the waterfront that he became aware of the force of the wind. As he moved up onto the moors, the wind shrieked and buffeted at the car. He had just gained the top of a hill when an enormous blast hit the car and blew it over on its side. Jimmy was pinned by the air bag. His car lights were still working, and he saw to his horror that the first flurries of snow were dancing in their beams. Jimmy felt like crying. He couldn't reach his pocket to get out his mobile phone. Then his car was lit up by an approaching vehicle. It stopped behind him. The next thing he knew Hamish Macbeth appeared on the passenger side, wrenched open the door, leaned over and stuck a knife in the air bag, and slowly and carefully hauled Jimmy out. "Thanks," said Jimmy. "I thought I was a goner. Miracle you turned up." "No miracle," said Hamish, helping him into the Land Rover. "I realised that wee car of yours might run into trouble. Anything broken?" "Don't think so." "I'll get the local garage to rescue your car in the morning. Let's get out o' here. It's going to get worse." The world had turned into a blinding white wilderness. Hamish drove through it, leaning forward to make sure he did not go off the road. Jimmy gave a gasp of relief as he was once more back in the sanctuary of the station. "I could do with a dram as well," said Hamish. "What a night!" "No point in you searching for clues tomorrow," said Jimmy, seizing the whisky bottle and pouring out a couple of stiff drams. "It'll be melted by then," said Hamish. "Listen! The gale's moved round to the west." "How the hell you opt to live in this scary part o' the world is beyond me," said Jimmy. "According to the Herring woman," said Hamish, "Harrison got a lawyer, had a faint fit, and they couldnae talk to him. Didnae they point out that you cannae get a lawyer in Scotland unless the police let you have one?" "I think that applies after you've been charged. Tell you what," said Jimmy. "Let's have a crack at the auld scunner ourselves. That'd be one in the eye for Iron Knickers." As they set out the next morning, Jimmy was amazed to see the snow had melted and only a light breeze danced over the glittering waves on the loch. "How disabled is old Harrison?" asked Jimmy. "When folk start calling lawyers, it's usually a sign they're as guilty as hell." "I thought of that," said Hamish. "I'd like a keek at his medical records. Have you thought of sending a search team to look over the hotel?" "That would be stepping on Herring's toes. Anyway, there wouldnae be any traces of blood. She was strangled." "I was thinking that there might have been some sort of a struggle. Furniture kicked. That sort of thing." "I'll put it to her." Jimmy phoned the hotel to find that Fiona and Charlie had left to go to Strathbane to study any reports on the guests that might already have come in. He phoned Fiona at police headquarters and told her _his_ idea. "Your idea, Jimmy?" "Och, Hamish, I need all the kudos I can get. You don't want promotion. I want Blair's job. He cannae go on knocking back the booze forever." Hamish drove up the drive towards the hunting box. "Michty me!" exclaimed Jimmy. "When folk say box you expect a square building. Now I see it in daylight, it looks as if it belongs to the Addams family." Juris answered the door. To Jimmy's request, he shrugged and said, "I'll try." They waited in the gloom of the hall. "This place is so creepy," said Jimmy, "wi' all those stags heads on the wall that you expect to see something awful up there, like a human head." Juris came back. "He will see you," he said. "Come this way." He led them into the room where Gloria had taken Hamish. Mr. Harrison was in his motorised wheelchair, covered in a tartan rug. Behind him as if on guard stood his new nurse, Helen Mackenzie. She was wearing a uniform consisting of a dark-blue dress with a white collar, thick stockings, and clumpy black shoes. She had thick grey hair under a plain white cap. She had small, very green eyes under heavy brows and a nose that any Roman emperor would have been proud of. Hamish never damned any woman as being plain or ugly because he knew that often they had charming characters. But Helen opened her mouth and said in a harsh, bullying voice, "Five minutes. That's all." "May we sit down?" asked Jimmy. "You won't be here long enough for that," said Helen, folding muscular arms across her flat chest. "Get them chairs, for God's sake," growled Mr. Harrison. Jimmy waited until he and Hamish were seated opposite Mr. Harrison. "How did you come to be crippled?" asked Hamish before Jimmy could speak. "Five years. Came off my horse and broke my back." "Where did you live before you came up here?" asked Jimmy. "Outside Ripon in Yorkshire." Hamish opened his mouth to ask if Mr. Harrison had originally hailed from the East End of London, because under his posh voice were undertones of Cockney, but Jimmy scowled at him as a signal to keep quiet. "Now, after Miss Dainty disappeared," said Jimmy, "you are reported to have said, 'Good riddance.' Had you had a quarrel?" "I had an anonymous letter saying that Gloria had been chatting up men at that hotel. I challenged her with it. She said it was all lies. I told her to get lost. When I heard she had gone out, I was still furious, but now I miss her like hell." "How did she get to the hotel?" "Juris usually ran her over." Jimmy turned to the nurse. "Get Juris in here." When Juris came in, Jimmy said, "According to you, Gloria had gone out for a walk." "That's what I was told. I had work to do so I left her to it. When my wife found her belongings missing the next day, we thought she'd decided to leave altogether." Jimmy turned back to Mr. Harrison. "So you employed Miss Mackenzie here." "Lucky to get her," said Harrison. "At first, no one at that agency in Strathbane wanted to bury themselves up here, but Miss Mackenzie took the job." "What is the name of the agency?" "Private Nursing. Juris will get you the address." "How does one get out of here apart from the front door?" asked Hamish. Juris said, "There's the kitchen door and beside that, the old tradesman's entrance. Then, often the windows in this room aren't locked because often Mr. Harrison likes to sit out on the terrace." Jimmy continued the questioning, asking Mr. Harrison for his previous address in Ripon, his age, and full name. "I am seventy-two and my full name is Percival Danby Harrison." "With your permission, sir, we'd like to take a look around." "Knock yourself out," said Mr. Harrison. "Pity he's so crippled," said Jimmy as they started to walk around the outside of the building, "or he might have strangled her in a rage." "That's a powerful motorised wheelchair," said Hamish. "Let's look in the garages. Might have an invalid car." Juris followed them and unlocked the door of one of the two garages. "Now, that's a pretty good invalid car," Jimmy said. "Mr. Harrison doesn't use it," said Juris. "He prefers to be driven. Your team of searchers went over it. Found nothing." Jimmy's phone rang and Hamish listened patiently as Jimmy said, "Yes, ma'am," and "No, ma'am." When Jimmy finally rang off, Hamish said, "What was that all about?" "She says you're to get back to where the body was found and look around. I'm to go back to headquarters. Checked on Juris's previous employment. Impeccable record." "What about Gloria's background?" "Did her training in Glasgow, worked a bit at Strathbane Hospital, but decided to go in for private nursing. Harrison was her second job. Found her sister, Joyce, who's on her road up. Charlie's coming up to join you." "So Herring has let him loose." "Seems like that. You'll need to take me back to see if they've got my car in working order." Apart from needing a new air bag, Jimmy's car was pronounced roadworthy. Charlie was waiting at the station. "How are you getting on wi' the new boss?" asked Hamish. "Grand. Blair is furious. All the time we were going through the stuff on the guests, he paced up and down behind us until she complained." "Blair can be dangerous when crossed," said Hamish. "He's probably planning something nasty for her. Let's get going. We'll take the animals." They were driving along the waterfront when the tweedy figure of Mrs. Wellington, the minister's wife, waved them down. "What is it?" asked Hamish. "Your constable has not been to church," she boomed. "There's a murder enquiry going on," said Hamish. "Charlie hasnae had time to go to the kirk." "If you do not ask the Good Lord for help, you will never solve it," said Mrs. Wellington. "I'll get in touch right away," said Hamish, letting in the clutch and speeding off. Outside Kinlochbervie, he parked outside the café and he and Charlie made their way along to where the body had been found. "I'm hungry," said Charlie. "We'll get a bite in a minute," said Hamish. "Now, if Dick Fraser were here, he'd have the table and stove out and be cooking up a full meal. Maybe we had better get up to the top of the cliffs. If she was thrown over, there would be nothing down here. Oh, hell, let's eat first." After bacon baps and strong tea and cans of animal food for Lugs and Sonsie, they climbed up to the top of the cliffs. "That storm might have wiped out anything useful," said Charlie. "And the trouble with heather is that any vehicle wouldn't leave tracks." "Let's walk back towards the road," said Hamish. "I would like to get my hands on her luggage. I don't think those guests, or Harrison or Juris, would know about peat bogs, and there aren't any around here. Say I'm the murderer. Unless I am some sort of serial killer, this is my first. I chuck the dead body over. I've got the cases in the back. What would I do with them?" "Throw them in the sea," said Charlie. "Och, this is a waste of time," grumbled Hamish. "It's getting dark." They made their way back to the Land Rover. "The guisers are out," commented Charlie. "Hallowe'en already." There were three small boys. "Penny for the guiser," they chanted. Hamish fished in his pocket. "Fifty pee, and that's your lot. Hey, wait a minute. Where did you get those clothes?" They were all wearing women's dresses which trailed on the ground, expensive-looking dresses. One was carrying a tattie bogle, a lantern made out of a scooped-out turnip. For hundreds of years in Scotland, it was the tradition to dress up as spirits of the dead until it changed to children wearing disguises and going out guising. "My mum found them," said one of the boys. "Finders keepers." "Listen you, laddie," said Hamish. "Those clothes are part o' a murder enquiry. We've got to talk to your mother right away." Chapter Four 'Tis now the very witching time of night, When churchyards yawn and hell itself breathes out Contagion to this world —Shakespeare The mother who had found the clothes was at first defiant. Her name was Annie Eskdale. She was a very small woman wearing an old-fashioned wraparound pinafore over a faded T-shirt and tracksuit bottoms. Although in her thirties, discontent had marred her face with early wrinkles. Her eyes were small and radiating suspicion. The council house she lived in was dingy and smelled of cabbage. At first, she whined that the clothes were her own. Hamish twisted back the neckline of the dress her son was wearing and said, "How could you afford to pay for an Armani dress?" "Thrift shop," she screeched. Charlie produced a pair of handcuffs and held them up. "I am charging you with defeating the ends of justice. A right shame it is, too. Social services will look after your boy." She broke down and, between sobs, said she had found two suitcases up on the moors. She hadn't meant to do wrong, but times were hard. Her man had left her. Hamish turned to the boys. "Take off those dresses and I'll give you five pounds. Gentle now," he cautioned as they scrambled out of them. "Now, Mrs. Eskdale, where are the cases?" "Out the back." They followed her out through a kitchen piled with dirty dishes and through a weedy garden to a shed at the end. She opened the door. "I havenae touched anything else," she said. "I only took out three gowns for the boys." "We cannae touch them until a forensic team gets here," said Hamish. He phoned headquarters and got through to Fiona. "Good work," she said. "Stay there until I arrive." They retreated into the house. Hamish gave the boys five pounds and they scampered off. "Do you just have the one son?" asked Charlie. "Aye, Sean." "Right, let's sit down and take your statement, and then after the forensic team arrive, we'll go up to the moors and you tell us where you found the cases. When did you find them?" "The Sunday morning, afore they found that body." "And didn't you think it might be evidence?" "I just thought some tourist had chucked them. Honest. I put them in the shed. I thought I'd wait to hear if anyone was asking for them. But my boy wanted to go out guising and I thought it wouldnae dae any harm just to let Sean and his pals have three frocks." At long last, the contingent from Strathbane arrived, headed by Fiona. "We'll go and look for where the suitcases were found," she said, "and leave the forensic team to do their work. But first, we'll need to take your fingerprints, Mrs. Eskdale." "Ochone, ochone!" she wailed. "It wasnae me who murdered the lassie." "It is just to eliminate you from our enquiries," said Charlie. After her fingerprints had been taken, she was told that once they had visited the place where the suitcases had been found, she would be taken to the police station in Lochdubh to make a statement. As they all left, Fiona taking Mrs. Eskdale in her car, Hamish watched the forensic team suiting up. "Where's Christine Dalray?" wondered Hamish, remembering the attractive forensic scientist who had been keen on him, and wondering why he had never encouraged her. "I heard she had gone to Glasgow," said Charlie. Children in all sorts of costumes and carrying turnip lanterns could be seen in the streets. "I forgot to ask her what she was doing up on the moors," said Hamish. "She doesnae have a dog." Following Fiona's Land Rover, they soon left the road and bumped across the moors to where great boulders left since the ice age loomed up in their headlights. Fiona stopped beside two of the largest boulders and Hamish pulled in behind her. They shone powerful torches into a space between the rocks. "Found them right there," said Mrs. Eskdale. "Nothing here that I can see," said Fiona. "You'd better get back here at daylight, Macbeth. I'll get the forensic boys up here when they're finished with the house." "What were you doing, walking up here, Mrs. Eskdale?" asked Hamish. "Cannae a body go for a walk?" she screeched. Hamish bent down suddenly and picked up something and held it aloft. "This is a roach. Do you come up here to smoke pot?" "That's no' mine!" "Mrs. Eskdale," said Hamish patiently, "if you say it isn't yours and we have to take it back to get it checked for DNA and find it is yours, you'll be in bad trouble." She began to wail that she had bad arthritis and there was no harm in a bit of weed. After more diligent questioning, she revealed she had got it from a neighbour, Hetty Jamieson, who grew a wee bit. Fiona phoned and ordered a raid on Hetty Jamieson's house before ordering Hamish and Charlie to take Mrs. Eskdale off to Lochdubh to type out a statement. By the time they had taken the long road back to Lochdubh and got the statement and had run Mrs. Eskdale back to her home, Hamish and Charlie were weary. They found that Hetty Jamieson had a whole cannabis field covered over in glass and heated in her back garden. She had broken down and said it was some nice Chinese gentlemen who were paying her to look after the crop. They were due the following week to check on it. But as the local press were on the scene, Hamish doubted any Chinese would turn up. Hamish missed Dick Fraser. Dick would have produced a tent and sleeping bags so that they would be fresh and ready to search the next day. But it was back to the station again for Hamish after dropping Charlie at the hotel. Hamish was just gulping down a cup of coffee the following morning when Detective Chief Inspector Blair marched into the kitchen. "You've got to help me," he said. "Thon bloody woman's trying to get me fired." "Why should I help you?" demanded Hamish. "All you've ever done is to try to get me out of this police station." Blair gave an oily smile. "Ah, weel. Let's make bygones be bygones. You help me and I'll make sure you keep this poxy station to the end o' time. I want you to say she's been sexually harassing you." "I've a better idea, sir," said Hamish. "I'll put in a report that _you've_ been sexually harassing me." "You cheeky teuchter! As if anyone would believe you." "Worth a try. Got to get off. Police work." "Watch your back from now on, laddie. You've made a bad enemy." "You always were a bad enemy," said Hamish. Sonsie let out a hiss and crept towards Blair, her fur raised, while Lugs began to growl. Blair let out a yelp of alarm and rushed out of the door. Hamish and Charlie arrived back at the giant boulders where the cases had been found. "This heather's God's gift to criminals," grumbled Hamish. "A truck could run across the stuff and not leave a trace. I don't know what we're doing here. Forensics will make sure there's nothing left to be found." "I wouldn't be too sure of that," said Charlie. "Since that Christine woman left, they've all gone back to their sloppy ways." Hamish was hungry and missed Dick again. Dick would have had sausages frying on the camper stove and a flask of coffee. It was a clear frosty morning. Sonsie and Lugs were chasing each other through the heather. "I wonder how her cap got in the sea," said Charlie. "Probably blew away when she was shoved ower the cliff," said Hamish. The sun shone into the space between the boulders and something in a cranny sparkled. Hamish went forward, put on latex gloves, and gingerly fished it out. It was a diamond necklace, a small diamond on a thin, gold chain. "Take a look at this, Charlie." Charlie came forward. "Maybe the murderer had decided to keep it and then decided to hide it and maybe pick it up later." Hamish fished out an evidence bag and dropped the pendant into it. "I wonder what she was wearing when she was murdered." "I mind the inspector telling me. She was wearing a short black dress." "Not her nurse's uniform?" "No." "We'll need to question the Eskdale woman again. It could be Sean and his friends were looking for outfits and played with the cap and then threw it away. Let's eat something first." They sat outside the café, eating ham rolls and drinking coffee. "You wouldnae think it was November already," said Charlie. The incoming tide crashed on the beach and the restless seagulls swooped and dived. "The only thing I miss in my diet is guga. I could murder a guga," said Charlie. "Baby gannets? I tried one once," said Hamish. "Didnae fancy it. Oh, well, let's face Mrs. Eskdale." It transpired that Sean and his friends had tried on the cap and the nurse's uniform found in one of the cases. Sean had gone out wearing the cap. It had blown into the sea. He had gone after it and got it back. Hamish then phoned Jimmy and told him about the find of the pendant and that it looked as if Gloria had dressed up to go out on a date and then was murdered. "I'd better get back to Harrison's," said Jimmy. "It's all beginning to look as if the woman was murdered at his place." "But forensics found nothing," Hamish pointed out. "I just feel like rattling the cage. If Gloria came on to all and sundry, then she may have made a pass at Juris. You pair, over to Strathbane and hand over that pendant. I'll tell Iron Knickers you're coming." "I hate going to Strathbane," grumbled Charlie when Hamish had told him what Jimmy had said. "I'm always frightened they won't let me go back to Lochdubh." When they had passed over the pendant to forensics to check for fingerprints, Hamish and Charlie were just about to leave when Blair approached them. "Not so fast, laddies," he said. "The super wants to see you." "Now what?" said Hamish. "Blair's been up to something nasty." They climbed the stairs to Daviot's office. "You are to go right in," said his secretary, Helen, with a smile that did not reach her eyes. She detested Hamish. "Ah, come in, come in," said Mr. Daviot. "No, don't stand. Make yourselves comfortable. Tea?" "Thank you, sir," said Hamish, who didn't want tea but who knew it would infuriate Helen. Daviot summoned Helen. "Tea all round," he said, "and a few Tunnock's tea cakes would go down well." "Certainly, sir," said Helen. Hamish had placed his cap on the floor beside his chair. Helen managed to tread on it on her road out. "Don't look so anxious, Macbeth," said the superintendent. "Your station is safe. The matter in hand concerns Constable Carter here." So that's the way the wind is blowing, thought Hamish wearily. Blair can't get at me but he can get at Charlie. "The fact is that we are seriously undermanned here. It has been pointed out to me—" "By Mr. Blair," said Hamish. "Don't interrupt," snapped Daviot. "Ah. Tea. Thank you, Helen. We'll help ourselves." Downstairs, Fiona was accosted by Blair. "Grand day," he said. "Have Carter and Macbeth left?" she asked. "They're up there with the super," said Blair. As Fiona marched towards the stairs, he called after her, "I wouldnae interrupt, if I were you." Charlie sat, looking stricken. Daviot had just told him he was being transferred back to Strathbane. The door opened and Fiona walked in. "Ah, Inspector Herring," said Daviot nervously. "Is it very important?" "When Mr. Blair has a smile all over his fat face," said Fiona, "I assume he has put the boot in for this pair. What's happening?" "This is an internal matter and nothing to do with you," said Daviot loftily. Fiona looked at Charlie's miserable face. "Who found that pendant our famous forensic team missed completely?" "Charlie found it," lied Hamish. "Got an eagle eye when it comes tae clues, ma'am." "The press are hammering at the doors demanding a solution to this murder," said Fiona. "So what's going on?" "We are understaffed," said Daviot. "I have just told Carter he is being transferred to Strathbane." "Like Macbeth, this constable has been helping me with the investigation," said Fiona, looming over Daviot. "Have you any idea of the enormous extent of Macbeth's beat? One detective chief inspector has stooped to spite. I do not know why you listened to him." "It was my idea," lied Daviot. "Very well. I want you to write me a report for the commissioner on why you are removing a constable who knows the area and knows the locals back there." "I may have been overhasty," blustered Daviot. "Have a tea cake." "I don't want one. I need this pair with me." "I feel now I have been overhasty. By all means, Carter, stay in Lochdubh." "Good," snapped Fiona. "Come along, you pair." Helen jumped back from the door where she had been listening. Charlie and Hamish followed Fiona down the stairs. Blair was waiting at the bottom. Fiona ignored him. "Right," she said, "Charlie, you come with me in my car and Macbeth can follow. We'll go to the station in Lochdubh and go over everything we've got." Charlie sat in the back of the unmarked police car with Fiona as her driver bore them out of Strathbane. "I am very grateful to you, ma'am," he said. She smiled and put a hand on his arm. "You are too useful to be got rid of." Charlie felt as if an electric shock had just gone through his arm. He stared at Fiona. who stared back and then abruptly took her arm away and looked out of the window. In the police station, Hamish lit the wood-burning stove and put the kettle on top to boil. Fiona looked amused. "Did you never hear of electric kettles, Macbeth?" "Aye, but Dick Fraser took the kettle away when he moved. I like the stove." "But I see you have central heating." "Yes, ma'am. But it's awfy drying. Cosy in here. After we have a coffee, I'll spread out the notes on the table." Sonsie approached Fiona and stared up at her. Fiona bent down and scratched the cat behind the ears. She began to purr. "What a huge beast," said Fiona. "Looks like a wild cat." "Och, no," said Hamish quickly. "Chust a big tabby." "If you say so." Hamish made three mugs of coffee and produced a plate of shortbread. "Right," said Fiona, "before we get down to the paperwork, let's see what we know. The late Gloria was a gold digger. None of the men she is believed to have had a fling with was anywhere near the Highlands at the time of her death. So the focus is on Harrison's place until we find anything else." "If I may make a suggestion, ma'am," said Charlie. Fiona gave him a warm smile, which transformed the usual hardness of her face. Oho! thought Hamish, his highland radar twitching. What goes on here? But before Charlie could speak, the kitchen door opened and Priscilla breezed in. "Oh, good, coffee," she said. "How are you, Charlie?" "Who are you?" demanded Fiona, surveying the beauty that was Priscilla. "I am Priscilla Halburton-Smythe. And you are?" "I am Inspector Herring and we are discussing a case. So if you don't mind clearing off." Priscilla shrugged. "See you tonight at dinner, Charlie," she said. "I'm only up on a flying visit." When she had left, Fiona said, "You were about to say something, Charlie." "What if it wasnae money?" said Charlie. "What if she was a nymphomaniac? There's other folk up at the box. There's a gamekeeper, Harry Mackay, and a shepherd, Tom Stirling." "How did you find that out?" "Asking around." "Jimmy Anderson is at Harrison's," said Hamish. "I'd better phone him. And it's too big a place for Inga to do the cleaning all by herself. If there's a cleaning woman, she might have a bit of gossip. Harrison is now denying he said Gloria had gone for a walk and Juris is now saying he might have been mistaken." She phoned Jimmy and rapped out instructions and, when she had rung off, took a computer out of its case and put it on the kitchen table. "Right! Let's see what we have so far. No fingerprints on that diamond pendant." Hamish brought in a sheaf of notes from the office. "She might have been killed by a woman," said Hamish at last. "Gloria might have been messing around with someone's husband. Or, I'm beginning to wonder, was she as bad as she's been painted? Now, I see from the notes that all these men she had dinner with swear blind that was all. They're all married, of course. We have only the maid Elsie Dunbar's word for it. Maybe it just amused Gloria to get free dinners in a posh hotel. Just so long as we go on thinking of her as some sort of tart, we'll be swamped wi' suspects." "But why would Elsie lie?" asked Charlie. "Maybe her boyfriend works at the hotel and got sweet on Gloria. I'd like to question her again." "I'll go, if you like," said Charlie. "No!" said Fiona with unnecessary force. "You go now, Macbeth." Hamish left with his pets following at his heels. At the hotel, Priscilla was in the gift shop and saw him driving up and ran out to meet him. "What a horrible woman!" she exclaimed. "Oh, herself is all right," said Hamish awkwardly. "I'd like another word wi' that maid, Elsie Dunbar." "I'll see if she's still in the hotel. Wait in reception." After a few minutes, Priscilla reappeared with Elsie in tow. "Now, Elsie," said Hamish, "let's go into the lounge and sit down. I'd like to go over your statement again." "I've said all I've got to say," said Elsie stubbornly. "Aye? Just a few more wee questions." When they were settled in a corner of the lounge, Hamish studied her mulish face and then said gently, "I know you were lying. And that's a crime. Defeating the ends of justice can mean a prison sentence. So let's have the real story." Elsie began to sob. Hamish waited patiently until she had dried her eyes and said, "If you tell the truth now, I'll make sure no charges are laid against you." She twisted her sodden handkerchief between her fingers. "My boyfriend, Graham Southey, works in the bar. She was always flirting with him and he was not charging her for drinks. I was sure he was going to propose, but after Gloria started her tricks, he stopped dating me. I hated the bitch. I wanted everyone to know she was nothing but a cheap hoor." "So you lied," said Hamish. She nodded dumbly. "And to your knowledge, did she ever go upstairs to any of the bedrooms?" Elsie shook her head. "No evidence in any of the beds that there had been any malarkey?" "No, sir. I'm right sorry." "I'll see what I can do, but don't ever lie to the police again." When Hamish reported back to Fiona, she said furiously, "Why haven't you arrested her?" "It's like this," said Hamish wearily. "The lassie would have a criminal record. I understand why she lied. You see, ma'am, up here, it's better to sort out these things without hauling people off to prison. That way, they feel safe to tell me things they might not otherwise think of doing." "It is a good way of doing things," said Charlie gently. "You see, the way things usually go, if Macbeth sends over a report, Mr. Blair will get his hands on it and before you know it, the lassie will be dragged in and accused of murder. Mr. Daviot is under such strong pressure from the press that he'll go along with it." "Surely not!" "It's happened in other cases," said Hamish. "I'll let it go for now. Now, Anderson called while you were out. The gamekeeper, Harry Mackay, said he called in at the kitchen with a brace of pheasant just before she was murdered. She was twirling round the kitchen, laughing and singing and saying she was going to be rich. But she didn't say how or why." "I wonder if the seer knows anything," said Hamish. "Good God!" exclaimed Fiona. "Are you going to consult the spirits?" "It's Angus Macdonald. He relies on a lot of local gossip so that it looks as if he knows everything. I'd better take him a present. I've a box of shortbread. That'll do." "We'll all go and see this Angus," said Fiona. "I'm intrigued." "We'd better all go in my Land Rover," said Hamish. "Otherwise, it's a steep climb up the brae." Angus opened the door as they arrived. "He certainly looks the part," remarked Fiona. "Looks daft," muttered Hamish. For Angus's latest addition to his wardrobe was a long white gown decorated with silver moons and stars. His grey beard seemed to have grown even longer. "Sorry to have got ye out o' bed," said Hamish maliciously. Angus ignored him. "Come ben, Miss Herring," he crooned. Fiona walked in and Angus slammed the door in Hamish's face. "You shouldnae have hurt the auld man's feelings," said Charlie. "I'll hurt more than that if he goes on like this." Hamish opened the door and he and Charlie walked in. "Sit by the fire," Angus was saying to Fiona. "It is the grand thing to have an experienced police officer in Lochdubh. If that is that cheap shortbread from Patel's, Macbeth, put it in the kitchen." Hamish walked to the kitchen, ducking his head under the low beams. A lit cigarette was burning in an ashtray on the counter. I didn't know the auld fool smoked, thought Hamish. Although he had given up smoking some time ago, he suddenly felt a sharp longing to pick up that cigarette and take just one puff. He shook his head angrily, stubbed the cigarette out, and returned to the living room. "So have you heard anything?" Fiona was demanding. "I will need to consult the spirits." Angus closed his eyes. Hamish stared at him in irritation, but Charlie was wide-eyed. "It is the money," crooned Angus. "Thon nurse meant to get the old man to marry her. But he found out about her peddling her arse and they had a row. He got an anonymous letter." "Who told you that?" snapped Hamish. Angus opened his eyes. "Now you've scared the spirits away." "I am afraid we will need to take you in for questioning," said Fiona. The seer's eyes suddenly held a mean look. "I wonder what your husband would say to that?" Fiona turned scarlet and Charlie looked shocked. Hamish looked quickly from one to the other. "May I have a word with you outside, ma'am?" said Hamish. Fiona followed him outside. "You take that fraud in and I'll tell you what will happen. Folk in Sutherland believe he has the gift. It'll be meat and drink to the newspapers because, trust me, Angus will call a press conference. During that conference, he will get a visit from the spirits, and if there is anything in your private life you do not want made public, then he will broadcast it. People come to him from all over and he has a gift of picking up juicy gossip." "How do I stop him?" "Leave him alone in future. But he's given us something to go on. Someone from Harrison's must have spilled the beans. We've got to interview Harrison again." Inside the cottage, Charlie was looming over the seer. "If you ever say anything to upset that lady again," he said, "I will break your neck." Then he turned and stalked out, crashing the door shut behind him. Hamish remained tactfully silent. It was not his business to ask a senior officer about her private life. But when he had said all that about Angus maybe holding a press conference and maybe revealing details of Fiona's private life, he had noticed a flash of fear in her eyes. And was there anything going on between Charlie and Fiona? She must command great respect to be allowed to investigate murder along with two local coppers. He almost missed Blair. Blair's interference and insults usually spurred Hamish on to greater efforts. A damp mist was settling down over the countryside. The stunted trees of Sutherland, blasted to near extinction by the severity of the gales, occasionally loomed up at the side of the road in the headlights like crouching old men. Hamish was driving. He had said bad weather was forecast and they would all be safer in the Land Rover. As he swung in at the gates, a wind sprang up and the fog shifted and danced in front of them. Then the Gothic horror that was the hunting box appeared out of the mist. "Castle Doom," said Hamish. "Here we are again." Chapter Five But onwards—always onwards, In silence and in gloom, The dreary pageant laboured, Till it reached the house of doom. —William Edmondstoune Aytoun As they waited for the door to be opened, Hamish felt suddenly weary. He had a longing for his usually lazy life. He wondered what it would be like to stop being a policeman, buy a bit of land, and become a crofter instead. But as the door opened, a cynical voice in his head said, Buy land? With what? Juris stood looking at them. "I don't know if I should let you in," he said. "The master is in a fair taking because of that detective who came earlier. He had to stop me being arrested. It was a Detective Chief Inspector Blair and he said, quote, 'Them damn immigrants are the curse o' this country and I am taking your Latvian back to headquarters for questioning.'" "Stay in the hall," snapped Fiona. "I have urgent calls to make." Hamish and Charlie waited under the glassy stare of the stuffed heads. "This'll be the end of Blair," said Charlie gleefully. "Don't bank on it," said Hamish. "That cheil would wangle his way out o' anything." Fiona came back in. "Juris, that detective had no authority being here. I can only apologise on behalf of the police force. Please explain matters to Mr. Harrison and say we have only a few questions to ask." After only a few minutes, the nurse, Helen Mackenzie, appeared. She was wearing her usual blue dress with a white collar and cuffs, thick black stockings, and flat, lace-up shoes with thick rubber soles. "Only a few minutes," she warned. They followed her into the room with the French windows where Hamish had been before. Mr. Harrison was seated in his wheelchair with a tartan rug over his knees. "Now what is it?" he barked. "We believe you received an anonymous letter from someone, saying that Miss Dainty hoped to marry you and was after your money. And that she was chasing other men. Do you still have that letter?" "I burnt it." "Now, that is a pity. You had a row with her on the night she disappeared, did you not?" "I'll fire that Latvian!" "It was nothing to do with Juris." "So who told you?" "We cannot reveal our source. Did you have a row with her or not?" "So what if I did? How the hell do you think a poor cripple like me could strangle the girl, take her to the cliffs, and throw her over?" "How did you know she was strangled, sir?" asked Hamish. "That was never in the newspapers." "This is the Highlands, or did you forget, laddie? Gossip, gossip, gossip. I think by now the whole o' Sutherland knows how she died." "You said to Juris that Gloria Dainty had gone out for a walk. Had she?" "I don't know. She wasn't around." "Have your fingerprints been taken?" asked Fiona. "No, they haven't. I'm tired. Show them out, Mackenzie." "Either we take them here or you will come with us to Strathbane." "Get Andrew in here," barked Mr. Harrison. "He's in the library. Andrew is my son and he's a lawyer." "Under Scots law," said Fiona, "you cannot ask for a lawyer until we say you can." The door opened and a tall man walked in. He had a large white face, a large nose, and a small pursed mouth. He was completely bald. He was dressed formally in a charcoal-grey suit and striped shirt with a silk tie. "What is going on, Father?" he asked. His voice was plummy. "These coppers want to take my fingerprints." "It is simply a process of elimination," said Fiona. "Get a warrant, dear lady," said Andrew. "I have already phoned Superintendent Daviot and put in a complaint. This is police harassment." "When did you arrive?" asked Hamish. "Yesterday, with my wife, Greta. I practise in London, and no, I was not up in the Highlands strangling a nurse. Now, if that is all, please leave." Outside, Hamish asked, "Do you think you can get a warrant?" "If Mr. Harrison was Jock McSporran, a crofter, I'd get it like a shot. But there's still a lot of class snobbery around, so I doubt if I'll get the permission." "But why didn't the forensic boys take the old fool's prints?" "They got Juris, his wife, the new nurse, the cleaner, the gamekeeper, and the shepherd. Harrison probably claimed to be ill." "I've an idea!" said Hamish. "Wait here." Before Fiona could protest, he darted off. The wind was getting stronger, soughing through the heather like the sound of the sea. He was glad that Harrison was not interested in gardening, because although there was a lawn at the front, the side and back of the house, along which Hamish silently made his way, were thick with heather. He saw a large square of light from the French windows and crept up. There was one large rhododendron bush by the windows. Hamish stood behind it and leaned forward. Andrew, Mr. Harrison, and the nurse were there, all laughing at something. Then Mr. Harrison threw aside the tartan rug. He slowly rose to his feet and made his way to a tray of drinks, where he poured himself a large whisky. Why have I stuck with this mobile dinosaur phone? mourned Hamish. Why didn't I have one of the ones that take photographs? And I left my iPad back at the station. He made his way swiftly back to where Fiona was impatiently waiting. "What do you think you are doing, Macbeth?" she demanded angrily. "You have no right to—" "The auld bugger can walk!" said Hamish. "What?" "I crept round and looked in the windows and he threw aside his rug, got to his feet, and helped himself to a whisky." "Now I'll get a warrant, and for his DNA as well. Let's go. I'm hungry." "There's a good restaurant in Lochdubh," said Hamish. "Right. That'll do." "I have a dinner date," said Charlie. "Cancel it," ordered Fiona. Blair stood miserably in front of Daviot's desk. "I've had one rocket after another. What the hell were you thinking of? You are suspended from...oh, what is it, Helen?" "Your wife's on the phone." Still glaring at Blair, Daviot picked up the phone. "Darling," his wife cooed. "To think I thought you had forgotten my birthday. French perfume and red roses! And such a lovely card. I'm making your favourite dinner tonight. Kiss, kiss!" Daviot had in fact forgotten her birthday. "Did you send birthday presents to my wife?" he asked Blair when he had rung off. "I thought you might ha' forgot," said Blair, all fake humility. "That is very kind of you," said Daviot, thinking of the tremendous and tearful row that Blair had saved him from. "Look, we will say no more about this. Leave the investigation to Miss Herring." "Where is our Charlie?" demanded the colonel at dinner that night. "Still working," said Priscilla. "You know, my dear, I am not a snob." "Of course not," said Priscilla, suppressing a smile. "He's a thoroughly decent lad. I would be proud to have him for a son-in-law." "Not much chance of romance up here," said Priscilla. "I'm off to London tomorrow. I see Elspeth Grant and her television team have arrived." Elspeth was furious at being once more taken off her job as presenter to report on the murder. She was always uneasy when she was away from Glasgow, fearing that she might return and find someone had pinched her job. Priscilla waved to her. Don't see any rings, thought Elspeth. Wonder if Hamish is still hankering after her. After dinner, her crew headed off to bed, but Elspeth felt restless and decided to go to the bar for a nightcap. As she was crossing the entrance hall, a giant of a policeman in uniform walked across the hall and disappeared behind a screen at the far corner. Curious, Elspeth walked behind the screen and found herself facing a door. She opened it and walked down the steps. She found herself in a musty unlit basement, stumbled over a trunk¸ and cursed loudly. A door opened at the far end and the tall figure of the policeman loomed up against the light. "Who's there?" he demanded. "A friend of Hamish Macbeth," said Elspeth. "I'm Elspeth Grant." She walked forward. Charlie stood aside to let her enter his apartment. "Is this yours?" asked Elspeth, looking around. "I'm too big for the police station," said Charlie. "Oh, you're thon woman from the telly. You're not to tell anyone about this." "I can see the headlines now," said Elspeth. "Policeman lives in hotel basement. Don't be daft." She looked up at him in sudden dismay. "You haven't replaced Hamish, have you?" "Come ben. Take a seat by the fire. No, no, I'm Hamish's constable. I mind now, you used to work up here and you're a great friend o' Hamish's." "You've made yourself very cosy," said Elspeth. "Funny. I don't break anything here. I'm right clumsy usually. Drove Hamish mad. A dram?" "Yes, thanks." Elspeth relaxed in her chair. There was something soothing about the big, fair-haired policeman with his lilting accent. "You're from the isles, aren't you?" she said. "South Uist." "And how do you like Lochdubh?" "Oh, it's the grand place." He handed her a glass of whisky. "I am surprised the colonel allows you to stay here." "Oh, George is a grand fellow. We go fishing together." "George! I thought that fussy little snob would never allow anyone to call him anything but Colonel." "He is the grand man and I won't hear a word against him," said Charlie severely. "Thanks for the drink," said Elspeth. "I'll be off." Hamish was just getting ready for bed when he heard a knock at the kitchen door. Lugs gave his welcome bark but Sonsie's fur was raised. He opened the door and looked down at Elspeth. It was a damp drizzly evening and her hair had frizzed up, making her look more like the old Elspeth he had once known. "Come in," said Hamish. "Want a dram?" "Already had one with your constable." Hamish's hazel eyes sharpened. He was beginning to learn that there was something about Charlie which attracted women. "So he's living in the hotel basement and seems to be dear friends with the colonel," said Elspeth. "Wonders will never cease. So what about this murder?" "Off the record?" "You know me, Hamish." "Aye, well, I wouldnae mind going over it." Hamish reflected that he had been uneasy during dinner. There was an electricity between Fiona and Charlie. He didn't want Charlie getting hurt and he had been unable to concentrate. He told her all they had found out. "It's too like a Hollywood movie," commented Elspeth when he had finished. "You know, it's always the one in the wheelchair that no one suspects is able to walk. When are you going back there?" "I'm to be there at ten in the morning," said Hamish. Good, thought Elspeth, I'll be there before nine. Aloud, she said, "So Dick Fraser and Anka have become bap celebrities. I might call in on them. Married yet?" "Dinnae be daft." "He might surprise you." Before he retired to bed, Hamish remembered he had forgotten to check for messages. There were two angry ones from local papers, claiming that the gamekeeper, Harry Mackay, had fired on them. Elspeth won't get very far, thought Hamish. But Hamish had forgotten about the magic of television. As the television van rolled up the drive, the crew were confronted by Harry, holding a shotgun on them. The van stopped and Elspeth got down. "Harry Mackay," she said. "Don't you remember me?" Harry lowered his gun and grinned. "Why, if it isnae yourself, Miss Grant. But Mr. Harrison is sore agin the press." "Oh, he'll see us," said Elspeth. "But before that, would you mind if I interviewed you?" "Me?" "You'd look good on film, Harry." Harry preened. "Maybe chust a few wee words." So everything was set up and Harry stated that it was a black day for the Highlands and it was his job to protect the estate. All the time, Elspeth fretted, anxious to get to the house before the police arrived. At last they got to the front door. Inga answered it but said firmly that Mr. Harrison was not seeing anyone. But Helen Mackenzie appeared and asked what was going on. "I am Elspeth Grant and I wanted to interview Mr. Harrison and yourself, of course. It is Miss Mackenzie, is it not?" "Well, I'll see," said Helen. "Wait in the hall." Ten minutes later, Helen reappeared. She had put heavy make-up on her face and her mouth was a scarlet slash. As she had a long thin mouth, it looked like an open wound made by a razor. "Just follow me," she said. It was soon revealed that Helen had spent the time putting on make-up rather than asking Mr. Harrison for his permission. "What the hell is going on, Mackenzie?" he roared. "I said, no press." "But it isn't the press, it's the telly," begged Helen. Andrew Harrison walked into the room. "Ah, Andrew, see these damn folk off the premises," said Mr. Harrison. "It's just a short interview," pleaded Elspeth. Andrew surveyed her. Elspeth had straightened her hair and was cleverly made up. Her large silvery eyes looked up into Andrew's face. He smiled. "Father, it'll only take a few moments. I'll get Greta. We don't get much excitement up here and my poor wife is bored." Sound and camera were already setting up lights and cables. Helen took up a position behind her boss's wheelchair and tried to look solicitous. Mr. Harrison sat glaring. Greta appeared, followed by her husband. She was a tall woman with a mannish, craggy face and hunting shoulders, wearing a shooting jacket and knee breeches. "Gosh, isn't this exciting?" she cried. "When will it be shown?" "At six this evening," said Elspeth. Greta went to stand behind her father-in-law's chair, elbowing Helen out of the way. Elspeth decided to go straight into the interview and do her piece to camera later. "Mr. Harrison," she began. "It must have been a dreadful shock when you learned that your previous nurse, Gloria Dainty, had been murdered." "The little tart had been asking for it," said Mr. Harrison. "Peddling her arse about the Highlands." "Did you know about her behaviour before she disappeared?" "Got an anonymous letter and checked around. Told her to pack up and leave. Thought she had when her stuff was gone." "Why didn't you tell the police about the anonymous letter?" "It made me mad and I took it out on Gloria. But then I thought, I wasn't going to blacken her name." Andrew, Greta, and Helen were now lined up behind Mr. Harrison's wheelchair, all smiling madly at the camera. "Could you all look a bit serious?" pleaded Elspeth. "Now, Mr. Harrison, can you think of anyone who might have done this dreadful murder?" He gave a bark of laughter. "Could be anyone. Can't be me. I can't move from this chair." The door opened and Juris came in. "The police are here with a warrant." "I'll see them," said Andrew. "We'd better pack up," said Elspeth. "Thank you all for your time." Andrew came back. "They've got a warrant, Father, to take your DNA and fingerprints and also to search the house again." "This is an outrage! Here I am, a cripple, and being tormented by the fascist police. I'll write to my member of Parliament." Elspeth had covertly signalled to her crew to keep on filming. "Andrew, what's the use of having a son who's a lawyer when he can do bugger-all to protect me? You always were useless," roared his father. "I'll get your medicine," said Helen. Mr. Harrison told her to take the medicine and shove it where the sun didn't shine. "They're still filming," warned Andrew. Mr. Harrison picked up a medicine bottle from the table next to him and hurled it at Elspeth, who ducked. Her crew began to hurriedly pack things away, afraid he might start throwing more things and damage the equipment. "And phone my lawyer," said Mr. Harrison. "I'm changing my will." "But I'm your lawyer," said Andrew. "Didn't know I had another one, hey? It's old Tinety down in Strathbane." When Elspeth and her crew left the building, it was to find a forensic team suiting up and Charlie and Fiona standing waiting. "Where's Hamish?" asked Elspeth. "He turned up with the cat and dog and the inspector here sent him back saying she didn't want animals contaminating the scene." "How did you get on?" asked Charlie. "Don't speak to the press," snapped Fiona. Elspeth shrugged. With any luck, she might meet Hamish on the road back. They were just leaving the estate when Elspeth recognised Hamish's Land Rover, leaned out the window, and signalled to him to stop. Both climbed out of their vehicles and met on the road. "I actually got an interview," said Elspeth. "It's going to look odd on film. Rather like the Addams family, all lined up behind the old man's chair. He lied. He said he couldn't move from the chair. Oh, and at the end, he threw a hissy fit and demanded his lawyer." "His son's a lawyer." "Doesn't want him. Got one in Strathbane." "This is getting more like a damn film every minute," said Hamish. "If it were a film, the old sod would be found dead before he could change his will. I checked the alibis this morning. Andrew and his wife were guests of people down in Somerset the weekend of the murder, so that rules them out." He got back into the Land Rover and drove on to join the others. Just after he arrived, the head of the forensic team came out. "They're all in the drawing room and we've taken their fingerprints and DNA samples. You can interview them." "Before we go in," said Hamish, "I'd better tell you what Elspeth Grant has found out." "You should not have spoken to the press without my permission," raged Fiona. "Elspeth is a good source of information. Listen to this." Hamish told her about Mr. Harrison changing his will. "These old folk with money can be murderees," said Fiona. "They use their wills as power over people. 'Be nice to me, or I'll cut you out.' Let's go in and see what we can find out." Just as they were about to enter the drawing room, Fiona stopped short and held up her hand. They could clearly hear Andrew pleading, "But we've always looked out for you, Father. It was your choice to bury yourself up in this godforsaken place. We offered you a home with us." "Maybe I've been a bit hasty," came Mr. Harrison's voice. "Get me another whisky, Mackenzie, and don't ever bleat on about my high blood pressure again." Fiona nodded and opened the door and they all walked in. "What now?" demanded Andrew. "Mr. Harrison misled us when he claimed he could not walk," said Fiona. "Macbeth here thought he saw someone lurking outside the building when we were last here and went to have a look. He saw you, Mr. Harrison, get out of your chair and go to get yourself a drink." "Police spies, that's what you are," shouted Mr. Harrison. "I can only walk a few yards." "That is the case," said the nurse, moving to stand between her employer and the police. "I drive him down once a week to Strathbane Hospital for physiotherapy." "I don't understand," said Fiona. "You said you came off your horse and broke your back. If you had a broken back you would not be able to walk at all." "I meant I damaged the nerves on my spine," said Mr. Harrison. Fiona painstakingly took him back through the events of the evening when Gloria had disappeared until Helen Mackenzie stepped forward. "That's enough," she said harshly. "You have tired him. It's time for his nap. Come along, sir." She seized the handles of his wheelchair and pushed him towards the door, which Andrew leapt to hold open. When he had gone, Fiona turned her attention to Andrew. "Do you know what is in his will?" "He said he had some lawyer in Strathbane," said Andrew, "but as far as I know, I am the heir." "And what is the name of the lawyer in Strathbane?" "Someone called Tinety, I think." Hamish left Charlie to take down what was being said while he studied Andrew. Pompous but hardly the murdering type, he thought. Still, it's hard to tell. When they were once more outside, Fiona phoned Jimmy Anderson and asked him to visit the lawyer in Strathbane and see if he could find anything out. When she rang off, she said to Hamish, "You go back to that cliff. There must be something we missed. Charlie will come with me to Strathbane where he can type up his notes, and then we'll go over what we've got." As he got into his Land Rover, Hamish watched Charlie and Fiona getting into the back of Fiona's car and pushed his peaked cap back and scratched his fiery-red hair in bewilderment. Fiona must have a lot of power to use the services of a lowly constable like Charlie. Was something going on there? She was married and Charlie was a great big innocent. I hope he doesn't get hurt, thought Hamish. He drove on up the coast, turning all he knew over in his mind. Gloria had been trying to seduce her employer. Gloria was a gold digger. Therefore it followed that anyone wanting her out of the way would surely be someone like Andrew or his wife, who felt they were about to lose their inheritance. But both were alibied up to the hilt. So that left only old Harrison, furious at finding out she had been playing around. Say he had strangled her in a rage. He could have paid Juris a large sum to dump the body. Better get Charlie to check his bank accounts. But where does he bank? Should have asked. He realised he was hungry and stopped at the café for a bacon sandwich and a cup of coffee. The café was quiet. "Do you do much business here?" asked Hamish. "We get a lot of folk in the summer. I'm Sheena Farquar." She was a small, rosy-cheeked, grey-haired woman. "Hamish Macbeth. Folk must have been talking a lot about the murder. Did anyone see anything?" "Only poor auld Jessie McGowan. The girl's daft. But it's believed she has the sight." Hamish knew she was referring to the second sight, certain highlanders supposedly blessed with seeing the future. Even Boswell and Johnson went searching for evidence of it in their tour of the Hebrides. "Where does she live?" "A wee house at the end o' Loan Road. It's got a purple door." "Does she live alone?" "Aye, her parents are dead. She can look after herself well enough, but she scares people, always mumbling and talking to herself." Hamish made his way to Loan Road and located the house with the purple door. There was no doorbell. But there was a brass knocker in the shape of a devil's head. He raised his hand to knock but the door was jerked open. At first he thought this could surely not be Jessie McGowan, for the small woman looking up at him seemed sane enough. "I am Police Sergeant Hamish Macbeth," he said. "I would like a few words with Miss McGowan." She nodded and stood aside to let him enter. There was a tiny square of a hall. She opened a door to the left. Hamish followed her in. It was a conventional living room with a rather battered three-piece suite in brown corduroy, a coffee table, a fireplace with ornaments on the mantelpiece, and lace curtains at the window. "I am Miss McGowan." She sat down on the edge of one of the armchairs and surveyed him. Despite her long grey hair, he guessed she might be in her late thirties. She was wearing a white Aran sweater over faded jeans. Her long thin face was very white, her grey eyes hooded with thick lids. "A body was found at the foot of the cliffs," said Hamish, putting his cap on the coffee table. "I believe you might have seen something." "That I did," she said. Hamish felt hopeful. The woman seemed perfectly sane. She continued, "It was Auld Nick himself." Hamish's heart sank. But he asked, "Are you sure it was the devil?" She nodded. "Describe him," said Hamish. "All black. Black face, black everything." "And what was he doing?" "He was standing on the top of the cliffs, looking down. Then he turned away and disappeared." "Where were you?" "I was down on the beach hiding behind a rock. I go there sometimes to talk to the dead. The seals, you know. Folk come back as seals." "Did you hear the sound of a car or any vehicle?" She looked at him solemnly out of her odd grey eyes. "Himself just goes back down to the nether regions. When I peeked round the rock again, he had gone." Hamish thought quickly. It could all be nonsense, or the murderer could have been dressed in black with the face covered by a black balaclava. "The thing that puzzled me," she said in her thin voice, "is why he did not take her down to hell." "Why would he want to do that in the first place?" asked Hamish patiently. "She caused hatred and fear." "Did you know the nurse?" "No, but I saw it all in my mind." "Pictures or emotions?" "Feelings. Nasty feelings. And there is more to come. Death is coming." "Who's going to die?" asked Hamish. "A man." "What man?" "I don't know. Just a man. There is danger surrounding you, Mr. Macbeth." "From the devil?" "Often the devil's instruments are human." She began to rock back and forth, mumbling incomprehensible things. Hamish got to his feet and walked out. He had just reached the front door when her voice stopped him. "Mr. Macbeth!" He swung round. "I have not offered you any tea." Once more, she looked quite sane. "Another time," said Hamish, and made his escape. He drove back to the hunting box to join Fiona, who was standing in the hall, telling her about his odd interview but saying it might be wise to search the house for any black clothing. Two detectives and three policemen who had been searching the house after the forensic team had finished their work and were just packing up were told about Hamish's discovery and told to go back in and look for black clothing. They were confronted by Andrew. "I thought you had finished here," he said angrily. "Macbeth's found a witness up at Kinlochbervie, some daft woman with the second sight, who says she saw the killer up on the cliffs. Mind you, she thought it was the devil." "Oh, I am so sick of all of you. I have complained to the procurator fiscal," said Andrew, and he went into the drawing room to report to the others this latest outrage. When they all moved outside, Hamish said to Fiona, "What do you hope to get from all the fingerprints and DNA? Was there anything on the body?" "They can maybe get fingerprints off the neck." "But they think she was strangled with a scarf or some sort of material." "Damn. I'd forgotten that." They were joined by Jimmy Anderson. "I've got heavy expenses," he said. "I had to take that lawyer, Cameron Tinety, out for a lot of drams to get information out of him. He says there was a will leaving everything to Gloria Dainty." "There's a motive!" exclaimed Fiona. "But he changed it and said he wanted the old will leaving everything to his son. But it was changed two weeks afore Gloria was murdered." "Andrew may not have known that," said Charlie. "I'll ask Juris if Andrew had visited the old man before." He went into the house. "Macbeth," said Fiona, "tell me exactly what this odd creature said." Hamish began to talk but she interrupted him. "Didn't you take notes?" "I was afraid it would put her off, ma'am. But I remember everything she said." When he had finished, Fiona sighed. "What a load of rubbish. Do you believe in this second sight nonsense?" "It's awfy hard to prove," said Hamish. "Folk usually tell you they saw whatever coming after it happens." "There are enough of us here," said Fiona. "Go back to your usual duties, Macbeth." "Yes, ma'am. I'll wait for Charlie." "No, leave him here. Anderson, you report back to Strathbane and type up a full report." Charlie came out to join them. "This was the son's first visit since the old man moved up here." "We'd better talk to him again," Fiona said with another sigh. "Let's go, Charlie." Back at the police station, Jimmy followed Hamish in. "Any whisky?" "I think you've already had a skinful," said Hamish. "You'd best be on your road." "Thon Fiona has the hots for Charlie." "But she's married?" "Aye, and to none other than Lord Staford McBean, high court judge." "Are you sure? He's in Edinburgh and she's out o' Inverness." "Sure as sure." "But she's called Fiona Herring! Not Lady McBean." "Keeps her maiden name for work. C'mon, laddie, give us a dram. I am your senior officer." Hamish sighed and took a new bottle of whisky down from a cupboard. "But she cannae fancy our Charlie," protested Hamish. "Why not? Big strong fellow like that." "Well, if that's true, there's one good thing. Our innocent Charlie seems to be woman-proof. Never really notices them. Treats Priscilla like a sister." Jimmy took a gulp of whisky. "It was a good thing it was you and not Blair interviewing that nutter up in Kinlochbervie. He'd ha' had the lassie sectioned and hauled off to the nut house. Do you believe that second sight stuff?" "Elspeth Grant sometimes seems able to see things coming." "Load o' bollocks, if you ask me." There followed a quiet few days for Hamish. Charlie wasn't even around, Fiona having kept him down at Strathbane going over and over statements. Charlie phoned once saying miserably that he wished the whole sorry business was over because he hated Strathbane and missed Lochdubh and the friendly dinners with the colonel and his wife. Hamish felt he should be glad to have the police station to himself again. But somehow, he felt lonely. He was just thinking of going to Braikie to see Dick and Anka when the phone rang. It was Fiona, sounding impatient. "Get back up to Kinlochbervie," she ordered, "and go from door to door. There must be something we've missed." Hamish was about to point out that the police had already been from door to door, but bit his lip and agreed to go. He whistled to Sonsie and Lugs, put them in the Land Rover, and set off. He realised he hadn't had any breakfast and decided to stop at the café first. Great mountainous waves were pounding the beach. Black clouds streamed in from the west. The air was full of salt and blowing sand. The gulls were huddled on the cliff shelves and crannies. It seemed as if the whole world were in motion. A rowan tree outside the café tossed its bare branches up as if pleading with the menacing sky. He pushed open the door and went in. "I was just about to phone you," said Sheena Farquar. "Why? What's up?" asked Hamish. "It's that daft lassie, Jessie McGowan. Herself hasnae been seen around. A neighbour knocked at her door but got no reply." "Have you any idea where she might have gone?" asked Hamish. "Could be anywhere. Mind you, she was always mumbling about some fairy cave in the cliffs, but if there was one, the schoolboys would have found it. She said the fairies sang to her." "I'll have a look," said Hamish, "afore the storm gets worse. Could you make me three bacon sandwiches to go?" "Right you are. You must be hungry." Hamish did not want to say that his cat and dog were partial to bacon sandwiches. He drank a cup of coffee while he waited, listening uneasily to the shrieking of the wind. He climbed into the Land Rover, unwrapped two of the bacon baps and passed them over to Lugs and Sonsie in the back, then ate his own while putting off the moment when he would need to get out and start to search the cliffs. At last, he took off his cap, knowing the gale would whip it away and he needed both hands if he had to climb. He stumbled along the sand, past where Gloria's body had been found, becoming increasingly uneasy. They had been inside Harrison's house when he had told Fiona what Jessie had said. Had he put her at risk? A great buffet of wind sent him flying into a tall standing rock and he cursed and rubbed his shoulder. He searched and searched but there was no sign of any cave. He was about to turn back when he heard a weird whistling and moaning sound coming from some way up the cliffs. He screwed up his eyes against the flying sand and dried seaweed. Halfway up the cliff, he saw a dark slit in the rock. He began to climb. As he grew nearer, he wondered if this was Jessie's fairy cave. The wind was causing unearthly noises to emanate from it, shrill keening sounds that he could hear despite the tumult of the storm. He finally edged his way in through the narrow entrance. It opened up into a cave. He unhitched a torch from his belt and shone it around. In a corner, crumpled up like a discarded doll, lay the body of Jessie McGowan. He bent over her. There was no pulse. Her face was contorted and there were signs all around that she had vomited. He took out his mobile phone but there was no signal. His journey down from the cave was perilous as the wind seemed determined to pluck him off the cliff face and throw him into the sea. Worse, the tide was up and he had to battle through breakers until he reached dry land, soaked to the skin. He went into the café and asked for a roll of paper towels. "How did you get like that?" asked Sheena. "Jessie's dead." He took out his phone. No signal. "Use the landline on the counter," said Sheena. "This is awful." A "weather bomb," as the forecasters now called it, was due to hit the northwest of Scotland. Hamish reflected sourly that one day they might wake up to the fact that hurricane-force winds were becoming more and more frequent. Fiona, Charlie, and Jimmy were the first to arrive and to find Hamish dressed in the late Mr. McGowan's old sweater and trousers. "Where is your uniform?" demanded Fiona. "It's hanging up in the kitchen to dry," said Hamish. "I nearly got drowned on the road back from the cave. We'll need to wait until the tide goes out." "But we had no trouble getting along the beach to Gloria's body," said Fiona. "There wasnae a hurricane like this, ma'am," said Hamish. Jimmy had bought a bottle of whisky. "You look as if you could do with a dram, Hamish," he said. "Give him one," snapped Fiona, "and then screw the top firmly back on the bottle. How long is this storm due to last?" "Until this evening," said Hamish. "And it's already as black as pitch," said Fiona. The café had three tables. She sat down at one and indicated that Charlie should join her. Hamish and Jimmy sat at another table. Fiona ordered coffee for all of them. Jimmy managed to get a slug of whisky into his cup when Fiona wasn't looking. The procurator fiscal arrived and Fiona settled down to give him a full report. I actually wish Blair were in on this one, thought Hamish. I'd like to see him trying to get his fat carcase up into that cave. But Blair was busy plotting the downfall of Fiona. Chapter Six The clouds dispell'd, the sky resum'd her light, And Nature stood, recover'd of her fright, But fear, the last of ills, remain'd behind, And horror heavy sat on ev'ry mind. —Dryden While Hamish and the rest waited for the full contingent from Strathbane to arrive, Detective Chief Inspector Blair was seated in the grimy office of private detective Willie Dunne. "I've got a wee job for you, Willie," said Blair. "You'll be paid well if you keep your mouth shut. Remember, I hae the power to shut ye down." Willie was nicknamed Creepy Willie. He was a small Glaswegian with a comb-over of dyed brown hair on his freckled pate and a face that seemed to be all nose. He specialised in divorces. "Out wi' it," he said. "There's this inspector o' police called Fiona Herring. That's her maiden name. She's married to a high court judge, Lord Staford McBean." "Haud it right there, mac," said Willie. "This is flying too high." "You'll do it," said Blair, "or I'll have you for dealing drugs out o' this office." "You wouldnae!" "Like a shot." Willie knew of Blair's reputation and that the detective would plant drugs in his office and arrest him if he didn't do what was asked. "Okay. Out wi' it." "This Fiona is sweet on a copper called Charlie Carter, based at Lochdubh. He's a big lummox of an islander. I've watched the way she looks at him. I want you to catch them in the act." "How the hell am I going to get into the polis station in Lochdubh?" "No need for that. A kiss would be good enough. Does Hamish Macbeth know you?" "No." "So I'll map out for you where they are and where they go. You pretend to be a local photographer. Thon bitch is ruining my career." Blair opened an envelope. "Here's a photo. I snapped it off when they werenae looking." Willie looked gloomily at the photo. It showed Fiona in her uniform, sitting at a desk. Charlie stood behind her. Fiona, thought Willie, looked as hard as nails. "So," said Blair, "you'd better start. They're up at a site outside Kinlochbervie. Found another dead body. The press will have gathered by now. The storm's died down." It was ten in the evening and the winds had charged off to plague the east. The café was open and a flushed and happy Sheena was busy serving food and drinks to the press. Hamish, in his dry uniform but with newspaper stuffed inside his still-damp boots, was with Fiona and Charlie, waiting for the forensic team to finish their work. The pathologist, an elderly man brought all the way over from Aberdeen, could not climb up to the cave and was waiting for the body to be stretchered down to where a tent had already been erected to receive it. "Someone up at that hunting lodge must have heard my report," fretted Hamish. "We'll get over there when we've got the pathologist's preliminary finding," said Fiona. "Perhaps Jimmy should go ahead," suggested Hamish. Fiona rounded on him. "I will do any interviews, Macbeth. Do try to remember who's in charge here. Go and interview the dead woman's neighbours." "Okay, let's go, Charlie," said Hamish. "Charlie will stay here with me," said Fiona. "And everyone, keep your voices down. The press are listening." Before he left, Hamish turned in the doorway and looked at the press. He recognised a few from the provincial papers, but there was one seedy-looking man and Hamish did not like the way he was studying Fiona. Sheena followed him out and gave him a flask of coffee and a wrapped ham sandwich. "That'll keep you going," she said. "That's very kind of you," said Hamish. "Aye, well, it's a pity you're not the one she fancies." "Are you talking about the inspector?" "She seems a hard woman, but when she looks at thon Charlie, her face goes all soft." "Maybe it's just maternal instinct," said Hamish. "Och, away wi' ye. Thon's a budding romance." "Have you got a camera?" asked Hamish. "Aye." "There's a fellow there wi' the press who disnae seem to belong, a ferrety wee man wi' a big nose and a comb-over. Could you get me a photo of him and e-mail it to me? Here's my card." "I can do that." Hamish climbed into the Land Rover and drove to Kinlochbervie. The first thing he saw were policemen going from door to door. He cursed Fiona but then remembered that Sonsie and Lugs had been locked up in the Land Rover for too long. So he drove up onto the moors and let them out and sat eating the ham sandwich and drinking coffee as his pets ran through the heather. The trouble with winter in the Highlands, thought Hamish, was that there was so little sunshine, it was like living in long hours of darkness. He was sure that Jessie had been poisoned. He had said nothing about the fairy cave. How could it have been done? Say someone called on her and Jessie had started to talk about the fairy cave. Maybe a present of a bottle of something and why don't you take some to the fairies? He had not searched the cave. He had backed out quickly so as not to contaminate the crime scene. Would the forensic team have been to her house yet? Would they even know what to look for? He called to his animals and set off full-speed for Jessie's home. There was no police tape yet outside. He put on his full forensic gear and then tried the door. It wasn't locked. He searched the kitchen first. Two cups and saucers had been washed and were lying on the draining board. He made his way quickly to the living room. He knew he had to be quick. As soon as the neighbours got the news, they would be gathering outside. And he didn't want to be caught by the forensic team. The living room was neat and clean. He was about to turn away when his eye caught something glittering on the floor near the sofa. He bent down and examined it. It was a strand of sparkling ribbon, the kind used to wrap a present. He hurried out and took off his forensic suit and went to question the neighbours. Had any strangers been seen? The woman next door said that only a couple of what she described as Bible bashers, a man and a woman, had called the day before. No one else. Their description didn't match anyone that Hamish had seen at the hunting box. Whoever it had been, thought Hamish, could have come during the night and left a package on the doorstep. Maybe Jessie had decided to share some treat with her fairies in the cave. Or could it have been suicide? No, he couldn't believe that. She had looked as if she had died in agony. He diligently knocked at doors up and down the street. Jessie had been well liked, considered daft but harmless, and the neighbours were shocked to learn of her death. More police arrived and started going from door to door. Police tape was put up in front of Jessie's house. Neighbours gathered in the street, talking in whispers. Hamish returned to the café to be told by a local reporter that the police had left. Guessing they had gone to Harrison's, he set off. As he was turning into the drive, his iPad clicked. He opened it. There was a message from Sheena. "You ran off before I could catch you. Attached is a photo of the man you're interested in." Hamish clicked on the photo and studied it. Then he moved on to park outside the house. Fiona, Charlie, and Jimmy were standing outside. "Why aren't you at Kinlochbervie?" demanded Fiona. "Overmanning," said Hamish. "You've already got the place covered in police. But I've got something to show you." He took out a forensic bag and held it up. Inside the clear material could be seen the little sparkly strip of ribbon. Hamish did not want to say he had found it inside the house so he said he had found it on the front doorstep. "If she's been poisoned," he said, "this could have come off some sort of present, maybe a bottle of something. She could have taken it up to her favourite cave, drunk it, and died there. Any idea what the poison might have been?" "No," said Fiona wearily. "Andrew Harrison has pulled so many strings that I've been ordered by the high-ups to tread carefully. There's not much we can do until the results of the autopsy come through. We'll meet here in the morning." Jimmy followed Hamish into the police station in Lochdubh, waiting impatiently for whisky while Hamish lit the stove and put out food and water for his pets. "At last," he grumbled when Hamish put the bottle of whisky and a glass on the table. "I've something to show you," said Hamish. He switched on his iPad and showed Jimmy the photograph Sheena had sent him. "Recognise this man?" "I've seen him before," said Jimmy. "Gie me a moment. Nothing like whisky to lubricate the brain." Hamish was sure he had recognised the man immediately and simply wanted an excuse for another drink. "Aye, I've got it now. Thon's Creepy Willie." "And who in the name o' the wee man is Creepy Willie?" "He's a sleazeball o' a private detective. Divorce cases. Think he deals drugs but haven't been able to catch him yet." Hamish's mind raced. Could Fiona's husband be checking up on her? Hardly. He would employ a reputable man from Edinburgh. Was there really anything going on between Charlie and Fiona? "I think it may have something to do with our boss. I'd better get up to the castle and warn Charlie." He seized the whisky bottle and put it back in the cupboard. "No more, Jimmy, or you won't be fit to drive." Fiona and Charlie were relaxing in front of the fire in Charlie's apartment. Fiona yawned and stretched. "I feel too tired to go back to Strathbane." "I can ask the manager to find you a room here," said Charlie. She smiled at him and said softly, "You have a bed here, Charlie." Charlie blushed to the roots of his hair. "It is the double bed." "So? Oh, who the hell is this?" They could hear someone clattering down the stairs. Charlie jumped to his feet and stood barring the doorway. "It's yourself, Hamish," he said with relief. "Miss Herring and I were just having a final discussion." "Look. There's no one in the lounge upstairs. Follow me up. It's urgent." Fiona had appeared behind Charlie. Silently they followed Hamish upstairs and through to a corner of the hotel lounge. "There is a private detective who specialises in divorce," said Hamish. "He is checking on you for some reason, ma'am." "What reason could he have?" said Fiona coldly. "It can't be anyone employed by your husband," said Hamish. "He would surely not employ such as Willie Dunne, a lowlife from Strathbane. He was at the café earlier and he is now in this hotel." "I still don't know why you should think this lowlife had anything to do with me," said Fiona angrily. "I will go now and see if I can get hold of him," said Hamish, "and find out what he's up to." The porter on reception recognised Willie from Hamish's photograph. "He was asking about Charlie and thon inspector and where were they. I told him to get lost. I followed him to the car park and made sure he left." Hamish returned to the lounge. Two spots of colour burned on Fiona's cheeks when Hamish reported that Willie had been asking about her and Charlie. "Don't worry," he said. "I'll call on him tomorrow and shake it out of him." When Hamish had left, Fiona rose to her feet. Charlie stood up as well. "I'll take a room at the hotel," she said stiffly. "Does your driver need accommodation?" asked Charlie. "I dismissed him," she said curtly. "I will meet you at Lochdubh police station in the morning." Hamish paced restlessly up and down the police station, too worried to go to bed. At last he decided to phone Willie. He found his home number and rang it. When Willie answered, Hamish said, "Why are you checking up on Inspector Herring? This is Sergeant Macbeth from Lochdubh." "I'm not," screeched Willie. "I do a wee bit for the papers, see." "Havers! You were asking questions at the hotel. Who's employing you?" "I'm telling you. No one!" Willie was terrified that if he gave up Blair, then Blair would find a way to get him arrested. He suddenly saw a way out. "Thae murders you're on," he said. "I think I ken who's done them. I was thinking o' telling the inspector but I got cold feet." "Tell me!" "Come in the morning to the office," said Willie, and hung up. As soon as he was finished with Hamish, Willie made a call. He spoke rapidly, finishing with, "I don't know if it's you, or not, but I've got to give the police something. Get your passport ready." Charlie and Fiona arrived at the station to find a note on the table from Hamish. "Gone to see Willie. He says he's got news of our murderer." "We'd better go as well," said Charlie. "No," said Fiona sharply. "This station should be manned. You stay here." She strode out. Sonsie and Lugs stared at Charlie. "Must be serious," said Charlie, "or he would ha' taken you pair. It's a grand day. Let's go for a walk." As Hamish rounded into the grimy street where Willie had his office, he found his way blocked by police cars and fire engines. He got out and made his way forward to where Detective Inspector Blair was talking to the fire chief. Blair scowled at Hamish. "What are you doing here?" "Willie Dunne told me he had information about the murderer. He told me to call this morning. What's happened here?" "Too early to tell," said the fire chief. "And Willie Dunne?" "Burnt to a crisp." "Murder?" "Too early to tell." "Wait a minute," roared Blair. "This is my case." Hamish stared at him for a long moment. Surely if anyone wanted to destroy Fiona's reputation, it would be Blair. "A word with you, sir," said Hamish, walking a little away. Blair followed him. "Willie was employed by someone to spy on Miss Herring," he said. "Rubbish!" roared Blair, turning a muddy colour. "Get oot o' here, ye great daft gowk." He watched uneasily as Hamish walked away. Thank heavens everything in that office, including Willie, had been burnt to cinders. Hamish drove up onto the moors. He needed peace and quiet to think. If it had been Blair who had employed Willie, and feared he had been found out, would he go to the lengths of murdering the man? Willie may have phoned Blair during the night and told him that he, Hamish, was on his trail. But murder? Willie had been just the sort of creature to blackmail some of his clients. What if he had warned the murderer? Any evidence that might have been in the office was now lost. His phone rang. It was Fiona. "I have just heard the news about the fire." "On my road back from it," said Hamish. "You should have phoned me immediately. Go back to your station and I'll meet you there." Hamish drove to Lochdubh as fast as he could. It was one of those rare balmy days when a mild west wind blew in from the Gulf Stream. The mountains soared up to a pale-blue sky. He longed for the case to be over. Fiona was waiting outside the police station. There was no sign of Charlie. "Where's Charlie?" asked Hamish. "I have sent him to Kinlochbervie. I asked him to man this station but when I checked, he was out walking those ridiculous pets of yours. He might be able to find out something the other policemen have missed." They walked into the police station where Hamish gave her a rapid report of his conversation with Willie. "I think," he concluded by saying, "that Willie was just the sort of lowlife to maybe blackmail his clients. So, say he knew something about someone that might lead us to the identity of the murderer. He was prepared to do that rather than give up the name of whoever asked him to spy on you." "Have you any idea who might have employed Willie to spy on me?" she asked. Hamish hesitated only a moment before he said, "I cannae think o' anyone, ma'am." He knew that if he said he suspected Blair, there would be a full enquiry. He would be asked to present all his suspicions and findings in triplicate and nothing would come of it. Fiona took out her phone. "I'd better get headquarters to find out the identity of all phone calls to that hunting box last night." When she had finished, she said, "What on earth are you doing, Macbeth?" "I'm lighting the stove, ma'am." "There's no time for that. You get off and join Constable Carter. And don't take your weird animals with you." He saw Fiona out and waited until she had been driven off, then made his way to his friend Angela Brodie's house. Angela was the doctor's wife and an author. Hamish often wondered why she bothered to write anything at all because she seemed to hate the process so much. She was seated at a cluttered kitchen table where three cats prowled among the breakfast debris. One had its head in the milk jug. She smiled at Hamish. "I'm glad to see you. Coffee?" "No thanks," said Hamish, reflecting that Angela was amazingly unsanitary for a doctor's wife. "One of your cats has its head in the jug and another is licking the butter." "Shoo!" said Angela, waving her hands. "What do you want, Hamish?" "I've left Sonsie and Lugs back at the station. I know they frighten your cats so I didn't bring them. But if you could pop in from time to time and see they've got water and food." "All right. But they'll probably go along to the restaurant kitchen and mooch something. How's the case?" "Dead, slow, and stop. What do you think of immigrants, Angela?" "Apart from thinking occasionally that if you took all the Eastern Europeans out of Scotland, the hotels would be self-service, and if you took the Indians and Pakistanis out of the National Health Service, it would collapse?" "Right. But a lot o' folk complain so much about them that I'm inclined to lean too far the other way," said Hamish. "Now, Juris and Inga Janson are called Latvians. But they are British citizens. In reaction to xenophobia, I haven't been studying them that closely." Angela had been typing on a laptop at the table. With a sigh of relief, she closed it down and pushed a wisp of hair away from her gentle face. "You have to ask yourself what the motive is," she said. "Surely, money is the motive." "In that case, the one that had the most to lose," said Hamish, "would be the son, Andrew, but he's got a cast-iron alibi." "You always used to say that the ones with cast-iron alibis were suspicious. Oh, do get off, Flopsy." Angela gently removed a fat cat from her computer and put it on the floor. "Let me think," said Hamish. "Andrew and his wife claim to have been guests of friends in Somerset the weekend of the murder. Maybe they got the friends to lie for them. I'll check it out." As Hamish had expected, he found Charlie at the café. "It's no use, Hamish. Everyone's been interviewed over and over again and they've got nothing to add. Does anyone know what poisoned her?" "Too early," said Hamish, sitting down to join him. "Why are you banished from Fiona's side?" Charlie gave a massive shrug. "Don't know. I think that detective scared her." "Did you hear about him being killed?" "Yes, herself briefed me afore sending me off." "I wish I could get down to England and check out Andrew's alibi." "I've got my computer in my car," said Charlie. "We can find out their names and make a call. Say something like doubts have been cast on their alibi and the dire consequences of perverting the course of justice." They walked out to Charlie's old Volvo, one of the long ones that looks like a hearse but is big enough to accommodate his height. They both climbed in. Charlie switched on his laptop and began to scroll through the notes. "Here we are," he said. "Bunty and Jeremy Thripp. Who is going to phone?" "I'll have a try," said Hamish, "because if Andrew gets to hear we've been checking up on him, someone's going to get it in the neck and it may as well be me." Hamish took out his phone, squinted at the computer screen, and dialled a number. A woman answered. "Is that Mrs. Thripp?" asked Hamish. "Yes, but I'm not buying anything." "This is Police Sergeant Hamish Macbeth from Lochdubh in Sutherland. You and your husband claim that Andrew Harrison and his wife were with you on the weekend a nurse who had been looking after his father was murdered." "Yes, that's right," she said. "Why are you asking again?" "Someone has come forward," lied Hamish, "with a suggestion that you may be guilty of perverting the course of justice by giving them an alibi. If this is true, you do realise you will be charged and maybe go to prison?" "My lawyer will be in touch with you," she shouted, and banged down the phone. "No good?" asked Charlie. "Says she'll get her lawyer." "Are they tapping the calls at the hunting box?" Hamish shook his head. "The inspector said she couldn't get permission. But look at it this way: Why did she say she would get her lawyer? Why not honest outrage at the very suggestion? We'll wait and see. If nothing at all happens, I'll need to pluck up my courage and tell your inspector what I've done. Inaction would suggest guilt. And if it had been an innocent person getting that call, they would have surely asked for my phone number and called me back to make sure it was me. Finding it was someone on a mobile, she'd have hung up and called Andrew, who would then call Daviot." "What do we do now?" asked Charlie. "Forget about the whole thing until the axe falls, if it's going to fall. I know. Let's go and see Dick Fraser at the bakery. No point in hanging around here. It's half day in Braikie, so the shop'll be closed." Dick and Anka welcomed them. Charlie's clumsiness returned. He dropped his coffee cup on the floor and, bending over to retrieve it, fell on the carpet. As they all helped him up and Anka gave him a fresh cup of coffee, Charlie thought sadly that while he had been with the colonel or Fiona, he hadn't broken anything at all. Anka had been working on Internet orders and excused herself to go through to the office, leaving Hamish and Charlie with Dick. Dick eagerly asked how the case was going. He listened carefully while Hamish talked. When Hamish had finished, Dick said, "I don't think it can have anything to do with the son." "Why?" asked Hamish. "Look at it this way. If Willie had the goods on someone, it must be someone in Sutherland. He'd hardly know anything about a London lawyer. This Juris: Did Gloria make a pass at him?" "Yes, according to his wife, who threatened to kill her." "Or," said Dick, folding his hands over his stomach, "it could be someone out of Gloria's past in Strathbane. You think Willie might have been a blackmailer? Gloria liked money. Maybe she supplied him with the goods on somebody. Maybe no one's dug into her background properly." "That's a good idea," said Hamish. "I just assumed that our inspector would have found out everything there was to know. Let's see. Gloria worked in Strathbane Hospital before going into private nursing. I'd like to get down to that agency and see who she was taking care of before she got the job with old Harrison." "We'd better tell the inspector," said Charlie cautiously. "I mean, we're supposed to be in Kinlochbervie." "I'll try anyway." Hamish phoned Strathbane, but was told that Fiona and Jimmy were back at the hunting lodge. He phoned Fiona's mobile and it went straight to the answering service. So he left a long message about where they were about to go and what they were about to do. He then switched off his own phone and told Charlie to do the same. Charlie left his car at the police station and joined Hamish in the Land Rover. The sun was crawling reluctantly over the horizon as they drove into Strathbane. The agency, Private Nursing, was in a former villa near the hospital. Before he rang the bell, Hamish said, "I'd like to interview the nurse that Gloria replaced. She may have known her." He pushed the round white bell set in brass by the door. It was opened by a thin woman with a haggard face. Hamish explained who they were and what they wanted. "I am the secretary here, Alexandra Chisholm," she said. "Come into the office." They followed her into what had once been a front parlour, now furnished only with a desk and computer, two chairs in front of the desk, and one behind it. She waved a hand to indicate they should sit down and surveyed them with dark-brown suspicious eyes. "The nurse who originally looked after Mr. Harrison is one of our best, Harriet Macduff. Out of the blue, Mr. Harrison demanded Gloria Dainty. He said she was an old friend of the family and he had promised to keep an eye out for her. At that time, Gloria was nursing a Miss Whittaker and so Harriet took over her job and Gloria was sent to Mr. Harrison." "And where can we find Miss Macduff?" asked Hamish. "Number five, Tomintoul Brae, just outside the town on the Lairg road." "What was your opinion of Gloria Dainty?" asked Hamish. "She appeared to be a good nurse. She had been working at the hospital before deciding to go into private nursing. She seemed quiet and modest." "Did she have any boyfriends?" asked Hamish. "No one who called here, and we definitely do not encourage that sort of thing." "Do you have a photo of her?" asked Charlie. "There is a staff photo taken before she left to go to Mr. Harrison. Wait a minute." Alexandra left the room. "Why do you want to see her photo?" asked Hamish. "I know what she looks like." "Just an idea." Alexandra came back. She held out a photograph. There were ten nurses in the photograph. "Which is Gloria?" asked Hamish, puzzled. "Second from the left in the front row." The Gloria in the photograph had brown hair. Like the other nurses, she was dressed in a dark-blue uniform with white collar and cuffs. She wore no make-up. "May I take this?" asked Hamish. "I'll give you a receipt." "Yes, if you think it will help you." Outside, Hamish said, "You're a clever man, Charlie. Did you think she might have changed her appearance?" "It crossed my mind. You said she looked like a fantasy nurse and I couldn't see that agency letting her go around dressed like that. I wondered suddenly if there might be a connection to Willie Dunne. Gloria wanted money. Maybe she hoped someone elderly might pop off and leave her some. She finds out which nurse is looking after which client and maybe finds out Harrison is the richest by getting Willie on the job." "And," said Hamish excitedly, "all she had to do is wait until it's Harriet Macduff's day off, go up there all blonded and tarted up. Harrison agrees to tell the agency she's a friend o' the family. Let's go and see what Macduff has to say." Miss Whittaker lived in a large sandstone house with a short drive leading up to it, bordered by rhododendron bushes. There was a large garage to one side of the house and a small Ford Escort was parked outside it. Hamish rang the bell. The door was opened by a tall woman in nurse's uniform. Hamish judged her to be in her fifties. She had a pleasant face and thick grey hair tied back. "Miss Macduff?" "Yes." "Police. Sergeant Hamish Macbeth and Constable Carter. We would like to ask you some questions about Gloria Dainty." "I barely knew the lassie. But come in. Be quiet because I've just got her down for her nap." She led the way through to a kitchen. They all sat down at the table in the centre. "Were you surprised when you were replaced by Gloria?" asked Hamish. "Very surprised," she said. "Mr. Harrison and I got on just fine. When I protested, he was insulting and said he was tired of my ugly face. I was told to pack up and leave immediately. I was afraid I might have done something wrong. I tried afterwards to phone Gloria several times, but it was always answered by Juris and he always said she was busy." "Did you know her well?" "No. I met her at the Christmas party. She seemed quiet, rather prim. The stuff that came out about her in the newspapers, you know, about her being blonde and beautiful amazed me." "Did Miss Whittaker talk about her?" "Not much. Oh, when I first arrived, she said, 'Don't expect any money in my will like that last one. I told her it all goes to my niece.'" "Did she have any gentlemen callers?" asked Charlie. She smiled. "What an old-fashioned laddie you are. Boyfriends? Maybe. Miss Whittaker told me she didn't want any men hanging around." "I wish we could speak to her," said Hamish. "Come back at four in the afternoon and I'll see what I can do." As they were getting in the Land Rover, Hamish's phone rang so he switched it off. "Switch off yours again as well, Charlie. It'll be Fiona wondering what the hell we're doing and I don't want to be taken away from here until we find out what Miss Whittaker has to say." Hamish realised he was very hungry. He always seemed to be hungry these days. He had been so accustomed to Dick feeding him. They found a café and ordered mutton pies, peas and chips, and a pot of tea. "You were thinking," said Hamish, "that maybe Gloria had a boyfriend who put her up to it. She didn't have a criminal past. We never got to interview her sister, but I read the notes. Blameless background. And how would she know a sleazeball like Willie Dunne unless someone suggested him?" "I think you'd better call the inspector," said Charlie, "or she may descend on the nursing agency looking for us and then go straight to Miss Whittaker's before we get a chance to talk to the old lady. If you tell her what we've got, she'll go straight to Harrison and ask why he didn't tell her about saying Gloria was a friend of the family." "Maybe you're right, but thon one frightens me to death. I just hope it wasnae herself that burnt Willie to death." "Don't be daft!" shouted Charlie. "She's an angel!" "And a married one," said Hamish. "Oh, well, here goes." Charlie listened dismally to the angry squawking coming down the phone, until Hamish interrupted, saying, "You must listen, ma'am. Charlie has had this brilliant idea." Hamish talked rapidly and at length, finishing by telling her where they were and that they were waiting to interview Miss Whittaker. When he had finished, there was another brief squawk down the line before Hamish rang off. "Don't worry, Charlie," he said. "She would ha' ordered us back if she didnae think we were on to something." Fiona arrived at quarter to four and, with Hamish leading, followed them to Miss Whittaker's. Harriet said, "Miss Whittaker said she will be pleased to talk to you. She doesn't get many visitors. But be careful. She tires easily. She's ninety-three." She led them up an oaken staircase and into a large bedroom. Miss Whittaker was seated in a chair by the window. She had dyed red hair and her old face was heavily made up. She was dressed in a long black velvet gown. Diamond rings sparkled on her thin hands, and a huge diamond-and-emerald brooch was pinned at the throat of her gown. Her faded-blue eyes were magnified by strong glasses. Chairs had already been set up in a half circle in front of her. She waved an imperious hand for them to sit down. Fiona switched on a tape recorder and began. "You are Miss Whittaker of number five, Tomintoul Road, and—" "For goodness' sakes!" snapped the old lady. "I am not a suspect and I am not under arrest. I don't like bossy women. Let that nice young man with the hair the same colour as my own ask any questions and switch off that stupid machine!" Fiona gave a little shrug and nodded to Hamish. "What did you make of Gloria Dainty?" asked Hamish. "At first, she was fine. Very correct. Good at her job. Then the cracks began to appear." "In what way?" "Before I fell asleep, she would hold my hand and say things like, 'You must feel very lonely with no one but Gloria, who feels like your daughter.' Then once, when she thought I was asleep, I saw her taking a brooch out of my jewel box and trying it on. I shouted at her and she dropped it. She blushed and said she had only been admiring it. There have been various attempts during my long life to con money out of me. Once I heard a man's voice downstairs. I managed to drag myself to the landing and listened. "'It's no use,' she was saying. 'We'll need to find someone else.' "He said, 'I know someone. Hang on a bittie longer.' I rang the bell and when she came up I asked her who the man was. She said he was her brother. Two days later, she gave notice." "She didn't have a brother," said Hamish. "I think she and this man were looking for someone to prey on and found out about Mr. Harrison." "Macbeth," ordered Fiona, "go and question the neighbours and see if you can get a description of this man." "Go yourself, Miss Hoity-Toity," said the old lady. "I like talking to this young man." "Oh, very well. Come along, Carter," said Fiona. No more Charlie, noted Hamish. When they had left, Miss Whittaker rang the bell and told Harriet to bring tea and cakes. "Tell me all about it," she said to Hamish. So Hamish told her about the case from the beginning, drinking tea and eating fruit cake while Fiona and Charlie waited impatiently outside. When he had finished, she said, "So you think that Gloria and this man hoped I would take to her and leave her money in my will?" "I think that might have been the case," said Hamish. "I think this man employed a seedy detective to find out some rich mark in the Highlands who needed a nurse." "Will you come back and see me when you know more about it?" she asked. "I certainly will. Now I had better join my boss. Before I leave, do you keep records of your phone bills?" "I send everything to my accountant, Mr. Gerald Wither." She rang the bell and when Harriet came in asked her to fetch the accountant's address. When Hamish emerged from the house, he saw Fiona and Charlie seated in the back of Fiona's car, their heads together, talking intently. He rapped on the window. Fiona looked up and scowled, and then she and Charlie got out of the car. "You took your time," she said. "I have the address of her accountant," said Hamish. "I thought it would be a good idea to go through her old phone bills. If Gloria phoned this man from the house, we might be able to find out who he is." "I'll let you do that," said Fiona. "Charlie and I will go to headquarters to see if there is any further news about Andrew's alibi." She and Charlie got back into her car, her driver let in the clutch, and they drove off. So it's Charlie again, thought Hamish sadly. I wish she'd leave that innocent alone. He looked at his watch. It was nearly five thirty. He got into his Land Rover and raced off, hoping to find the accountant still in his office. Chapter Seven He's an Anglo-Saxon Messenger—and those are Anglo-Saxon attitudes. —Lewis Carroll Hamish caught Mr. Wither as the accountant was just about to leave his office. He thought that Wither was a good name for the bent little old man. Surely he must be nearly as old as Mrs. Whittaker. He explained the reason for his visit and Mr. Wither put his grey head on one side like a bird searching for a worm. Then he said in a high, thin voice, "My! This is very exciting. Yes, I keep all the papers. Come into the office. I am afraid my secretary has left for the evening. Not that she would be much good. She has pictures of David Bowie painted on her nails and that seems to go along with lethargy and inefficiency. It's very hard to get good help these days when all the young want is to be famous without doing any work at all to get there." Hamish stared in awe at the banks and banks of dusty files rising from floor to ceiling. "Don't you computerise this lot?" "I wouldn't know where to start," he said ruefully. "I have an analog brain. But fear not. If you will just bring that ladder over." "If you just point to what you want," said Hamish anxiously, "I'll get it for you." "No, no. I'm quite spry." He scuttled up the ladder and pulled out a file. "Here we are. Whittaker. Phone bills. Catch!" He threw the file down and Hamish caught it. "Have you a copying machine?" he asked. "Oh, yes," said Mr. Wither proudly. He descended the ladder and went over to a corner of the office. He removed a pile of papers and said, "There it is." "I'll just copy what I think are the relevant dates," said Hamish. "Yes, yes, go ahead. Perhaps we might have a meal together when you are finished?" Hamish turned round to refuse but was stopped short by the loneliness looking out of the old man's eyes. "Aye, that would be grand," he said. The copying machine was so old that Hamish was relieved when it sprang into life. After he had copies of all the bills he wanted, he switched off the machine and reluctantly followed Mr. Wither out of his office, wishing he didn't have to waste time going for dinner. Mr. Wither led the way to a nearby restaurant called Scottish Fayre. It was in a converted haberdasher's. Hamish gloomily surveyed the menu. Why did they have to give everything silly descriptions? He settled for "Flora Macdonald's Cock-a-Leekie Soup," followed by "Over the Sea to Skye Cod and French Fries." Mr. Wither said he would have the same and ordered a carafe of the house wine. "Can't you get a decent secretary?" asked Hamish. "I had Mrs. Richards for years and then she died. After that, I got temps from an agency. I advertise from time to time, but no one wants to work much in Strathbane. They prefer to register as unemployed and then work on the black." "I might be able to help you out," said Hamish. "Mr. Patel runs the shop in Lochdubh and he's got a nephew here on a visit, a young lad who's a whiz wi' computers. I could send him over and you could see how you get on. He could computerise all your files and then give you lessons." The old man gave a mischievous grin. "You are dragging me into the twenty-first century." "Doesnae hurt," said Hamish. Mr. Wither asked about the murders and Hamish told him all about them, and when dinner was over, he promised to return and give both Miss Whittaker and Mr. Wither the latest news. When he got back to the police station, he phoned Mr. Patel and asked him if his nephew would be interested in working for Mr. Wither. "Jump at the chance," said Mr. Patel. "The laddie's bored out o' his skull." Hamish then went into the office and studied the phone bills. There was a message from Fiona on his answering machine, demanding why he had not phoned to report progress. Hamish repressed a sigh. Such as the inspector would never understand Hamish's brand of policing, which was to help members of the public whenever possible. He then settled down to check the phone numbers for the month preceding Gloria's murder. He underlined five calls to a Strathbane number, picked up the phone, got through to the operator, and started the trace. He prayed the calls would not have come from a throwaway mobile. At last he was told the number belonged to an M. Hartford, 201 Bevan Mansions, in Strathbane. Hamish was delayed from setting out by Lugs banging his food bowl on the floor and Sonsie trying to climb up him. He gave them tins of animal food and they both stared at him accusingly. "Oh, stop sulking," he said. "I'll get you fish-and-chips on the road home." He felt uneasy on the drive to Strathbane. He should really inform police headquarters. Before he reached Strathbane, he pulled over to the side of the road and called Jimmy Anderson. It took some time to fill Jimmy in, but when he had finished, Jimmy said, "I'll meet you there. Let's hope this is our lad." When Hamish drove up to Bevan Mansions, a seedy tower block down by the docks, it was to find not only Jimmy but also several police cars. "If he looks out o' the window and sees this lot," complained Hamish, "he'll scarper." "Stop bitching," said Jimmy, "and let's get on with it." The lift didn't work and so they toiled up the filthy stairs. The walls were scarred with graffiti. Sounds of blaring television sets, crying children, and shouting voices assaulted their ears. "He's got form," said Jimmy. "What for?" "Drugs possession, carrying an offensive weapon, and drunk and disorderly. Malky Hartford. Lowlife." "Whoever designed these flats should be shot," said Hamish, as they emerged onto the top-floor balcony. A biting wind blew discarded debris against their legs. Jimmy knocked at Malky Hartford's door. Nothing but silence. Then the letterbox opened and two eyes stared out at them before closing it again. "Police!" shouted Jimmy. "Open up!" He put his ear to the door and heard scuffling sounds from inside. He signalled to a policeman behind them with a battering ram who moved forward and crashed the door open. "There's a fire escape," shouted Hamish. He and Jimmy rushed through to the open window and looked out. "Oh, my God!" yelled Jimmy. The rusting fire escape with Malky clinging to it had detached itself from the building. In the orange glare of the sodium streetlights below, they watched appalled as the whole huge fire escape swayed back and forth like some iron monster with Malky screaming and clinging to it, then went crashing down onto the roof of a disused warehouse opposite. "No use rushing down," said Hamish. "There won't be much of him left." He could make out the crushed body of Malky under twisted pieces of rusty iron. "I'll bag up that computer," said Jimmy. "And his mobile. I'll get the pathologist and the procurator out o' bed. We'll go back to the station and see if there's anything on the computer." "Silly sod hasn't even encrypted the thing," said Jimmy at headquarters. "Let's get into his e-mail and see if we can find anything. By God! E-mails to none other than Gloria. Listen to this one, Hamish. 'I need a cut when you marry the old bugger. I paid Willie to find out the best mark. Didn't I tell you what to wear and how to get at him? Meet me down at the gates on Sunday...' We've got our man, Hamish. The e-mail is dated for the night o' her murder." "What else?" "'If you don't show, I'll let the polis know you was pinching drugs and flogging them through me.'" "Go back to the earlier ones," said Hamish. "No, go to the in-box. Look, there's some from Gloria." Jimmy read out: "'I paid you in drugs, Malky, so consider yourself paid off and get out of my life. It was fun while it lasted, but I'm heading for the big time and I don't want you round my neck. Remember, I've got the goods on you and can shop you anytime I feel like it.'" "No, she couldn't," said Hamish. "Not without Malky telling us about her." "I 'member, Malky was pretty thick. He wouldnae think o' that." "I wonder if she had a fling with him?" "Could have," said Jimmy. "He was a good-looking fellow. Curly black hair and big blue eyes." "If he's got family around," said Hamish, "they'll be able to afford a grand funeral after they sue the council over that fire escape." He sighed wearily. "Let's print it all off. Check the mobile for texts and I'll let the inspector and Daviot know in the morning." "I'll let them know, laddie," said Jimmy. "I'm your senior officer." Hamish gave him a hurt look. "I'll give you credit," said Jimmy. "Honest." "Then do the report yourself!" said Hamish furiously. "No, no. Calm down. Start typing and explain what put you on to Malky." A glaring red dawn was turning the frost on the heather to rubies as Hamish wearily drove back to Lochdubh. He let himself into the police station. Too tired to make breakfast, he went into his bedroom where his pets lay sleeping in his bed, tore off his uniform, crawled in beside them, and immediately fell asleep, down and down into a nightmare where Malky clung screaming to the disintegrating fire escape. He was awakened five hours later by the sound of a large crash from the kitchen. He struggled out of bed and hurried through to find Charlie gazing miserably at a shattered milk jug on the floor. "I'm right sorry, Hamish. I heard ye had a rough night so I thought I'd make you breakfast." "It's all right," said Hamish, scrubbing the sleep from his eyes. "I never use that milk jug anyway. I aye just put the bottle on the table." "I gather the case is solved," said Charlie. "Malky Hartford of all people." Charlie stooped and shovelled up pieces of china into a dustpan, put them in the bin, and then mopped up the floor. "I'll shower and shave," said Hamish, "and we'll talk about it. Where's the inspector?" Charlie blushed. "Herself gone to consult wi' Daviot and the procurator fiscal and then she's off to Inverness." Hamish eyed Charlie and thought, I hope he hasn't been seduced. He washed and dressed and went back to the kitchen, where Charlie was frying up a large pan of venison sausage. "I put a bit extra on for Lugs and Sonsie," said Charlie. "They're right partial to a bit o' venison. One egg or two?" "Two, please." "It's like the nightmare is over," said Charlie. "Mind you, I'd never ha' believed it o' Malky." "You knew him?" "Aye. A wee druggie. Do anything for a fix. But a handsome lad for all that. But murdering people! I cannae believe that. Now it turns out that lassie up in Kinlochbervie was poisoned wi' antifreeze. That's a slow, vicious death. Still, drugs can change folks' characters. Just as well for Andrew and his missus. They werenae in Somerset." Hamish sat down at the table. "Where were they?" "In Edinburgh." "What were they doing?" "It's a high-class wife-swopping club. Most of them English." "Crivens!" said Hamish, a picture of Andrew's angular wife appearing in his mind. "Talk about Anglo-Saxon attitudes!" "The inspector was going to charge both of them wi' perverting the course of justice, or defeating the ends of justice as we say in Scotland, when she got the news that the murders were solved. She was so delighted that she let them off with a caution." Charlie put four sausages and two eggs on a plate and put it on the table along with a pot of tea. "I cannae believe it's all over. Did you and herself celebrate?" Charlie bent over to put sausages into the animals' bowls. "No time for that," he mumbled. I do believe they've been and gone and done it, thought Hamish. Damn the woman. What now? Will she get a divorce? Will I lose this decent copper who suits me just fine? Instead, he said, "I put my report in. Do they want anything more from me?" "I shouldnae think so," said Charlie, easing his great height down onto a kitchen chair and helping himself to tea. "Daviot is holding a press conference and taking all the credit, no doubt. If you don't want me for anything today, I thought maybe me and George, I mean the colonel, might take the rods out." "Fishing season's over, Charlie." "I meant, take the boat out and maybe get some fresh mackerel." "Go ahead. I'll eat this and take Sonsie and Lugs for a walk. It looks like a grand day." When he walked along the waterfront, dressed in comfortable old clothes, having decided to give himself the day off, Hamish looked at the little white houses of the village and wondered why he could not experience any feeling of relief. He saw the Currie sisters approaching. Had he not had the dog and cat with him, he would probably have jumped over the wall onto the beach to escape them. He always thought of the spinster twins as the Greek chorus of Lochdubh. Doom and gloom from the pair of them. "I see that clever Mr. Daviot solved the case for you," said Nessie. "Solved," intoned her sister. "It is just as well someone was on the job and not lazing around with a dog and cat," said Nessie. "Dog and cat," moaned her sister. "Oh, shove off, the pair of you," said Hamish. They stared up at him, shocked eyes behind thick spectacles, rigidly permed white hair, and crumpled white faces, the skin like tissue paper. They marched off. "Sorry!" shouted Hamish after them. "I'm so sorry." He scratched his fiery hair in distress. What had come over him? He saw the fisherman Archie Maclean sitting on the wall outside his little cottage at the harbour and went to join him. "I'm going daft," said Hamish. "I've just insulted the Currie sisters." "They'll get over it," said Archie. "I hear those murders have been solved." "Yes, it's all over," said Hamish. But he experienced the first sharp pang of doubt. "You'd better settle down now and find yourself a wifie," said Archie. "I'm beginning to think I have no luck at all in that direction," said Hamish. Archie deftly rolled up a cigarette, shoved it in his toothless mouth, lit it, and said, "You should ask the fairies." "You don't believe in that rubbish, do you, Archie?" "All you do," said Archie, "is put out a bit o' milk, salt, and iron outside your door and wait." "You're joshing. I'm off to get some weight off these beasties o' mine." When Hamish returned to the police station, he saw with a mixture of irritation and amusement that outside the kitchen door Archie had placed a small saucer of milk, a little open glass jar of salt, and a piece of iron. Well, thought Hamish with a shrug, if I had a wife like Archie's, I'd need to believe in something daft to keep me going. Archie's wife was a fanatical housecleaner. She boiled all the household laundry in an old-fashioned copper, including Archie's trousers and jackets—which explained why the fisherman always went around in tight clothes. He passed the day cleaning up the police station and giving his small flock of sheep winter feed. He walked the dog and cat again, wondering whether to call on the Currie sisters and apologise, but found himself unable to face up to it. When Hamish walked back into the police station, he experienced a sharp pang of loneliness. There was no point in going to join Charlie, because the big policeman would be settling down for a family evening with the colonel and his wife. Sonsie came up and put a large paw on his knee. "You don't believe in the fairies, do you, Sonsie? Load o' superstitious rubbish!" There came a sharp scream of rising wind which rattled the kitchen door. Hamish stood, startled. Then the door opened and Elspeth Grant walked in. "It's me," she said. "You look as if you've seen a ghost." "I'm fine. Sit down. Windy out?" "No, it's as still as the grave. Going to be a sharp frost. I've just been down to Strathbane. Boring footage of Daviot. I suppose you broke the case." "In a way." "So it's all over?" "I suppose. We'll never know. I am sure that Malky's family will sue the socks off the council." "I've tried to interview the provost, but he's hiding behind his lawyer and everyone else in the council has been taught to say, 'No comment.'" Elspeth was wearing a silver puffa jacket that matched the colour of her odd eyes. She shrugged it off. Underneath she was wearing a blue cashmere sweater. She had small, high, firm breasts. "I've got a bottle of Hungarian champagne out in the shed," said Hamish. "We could have a glass to celebrate." "Bring it on, just so long as it doesn't have any antifreeze in it." "That was Austria," said Hamish, referring to an old scandal. He went out to the shed. The champagne had been a present from a grateful woman after Hamish had tracked down her lost dog. Antifreeze, he thought suddenly. That's what killed Jessie McGowan. Now, why would someone like Malky get to hear about her? And even if he had, would Malky, a druggie and city boy, believe in anyone being able to have the second sight? Even if he did, the second sight meant the future. Elspeth appeared behind him, making him jump. "I thought you'd got lost," she said. "No. Just thinking. It's right cold. Let's get indoors." On the way in, Elspeth glanced down at the milk, salt, and iron. "Didn't know you were a believer, Hamish." "I'm not. It is just Archie's nonsense." She gave a sudden shiver. "Now, why do I suddenly feel you are soon going to need a lot of protection?" Hamish looked down at her uneasily. He knew from past experience that Elspeth, who came from a Gypsy family, was psychic. He lifted two wineglasses down from the cupboard. "I havenae got champagne flutes. These'll need to do." "There's been a recent report that flutes are out of fashion," said Elspeth. "Something to do with them spoiling the taste." Hamish popped the cork and filled two glasses. "Here's to a quiet life," he said. "Here's to your safety," said Elspeth. "So let's have it, Hamish. You don't think Malky did the murders. How did that detective die?" "Willie? The latest was smoke inhalation. Now, that could have been Malky. He was in cahoots wi' Gloria. He may not have known that Willie would be in the office. It was a Sunday morning. I had an appointment with him." "How was the fire started?" "Oily flaming rags shoved through the letter box. That might indeed have been Malky. But there's another thing." He told Elspeth about Willie spying on Fiona. "I'm sure that could have been Blair. The inspector is keen on Charlie, and it shows." "Blair's a monster," said Elspeth, "but I can't believe he would murder Willie." "He may not have known he was in the office." "If I were you," said Elspeth, "I would take time out and forget about the whole thing and clear your mind of every idea. Maybe then you'd hit on something." Elspeth then began to talk about her job and her seemingly eternal fears of being replaced permanently by another presenter while she was off in the Highlands reporting until they realised with surprise that they had finished the bottle of champagne. If only, thought Hamish wistfully, we could roll into bed and make love for the rest of the day. But as if she had read his mind, Elspeth put on her coat and said abruptly, "Thanks for the drink." "Will I see you again this trip?" "No, I'm heading off south," said Elspeth. As she walked to the car she had borrowed from the hotel, not wanting to take the large television van down to the police station, she had a sudden urge to turn back. She had lied to Hamish. She had planned to prepare her report and leave on the following morning. She could have invited Hamish to dinner. Hamish was leaving the police station to walk the dog and cat. He looked down in disgust at Archie's offerings to the fairies and gave the lot a kick with his regulation boot and sent them flying. Elspeth had half turned back when a voice in her head said, Going to get hurt again? She squared her shoulders, got into the car, and drove off. As he walked along, Hamish saw a sign outside the church hall, TAI CHI EXERCISES. A faint sound of Asian music tinkled through the frosty air. Curious, he walked up to the village hall and quietly pushed open the door. Eight village women, dressed in sort of satin pyjamas, were slowly following movements by an instructor, who, Hamish realised, was none other than Mrs. Wellington. He had seen tai chi exercises on television and they had been nothing like this. The women seemed to be all sharp, awkward movements. "The hell wi' this," said Mrs. Patel, sitting down suddenly on the floor. "I feel right daft." The other women followed suit. "Now, ladies," boomed Mrs. Wellington in distress. "On your feet. Now!" Muttering rebelliously, they started again. Hamish fled the church hall and hung on to the fence, laughing. He felt better than he had done for a long time. When he returned to the police station, he saw Charlie's old Volvo parked outside. The tall policeman got out of the car when he saw Hamish arriving. "I should ha' reported in earlier," said Charlie, "but I overslept." There was a miserable hangdog air about him. "Come in and have coffee," said Hamish. "No, better still. Let's walk along to the Italian's and have a wee celebration. I suppose the case is closed." They walked in silence to the restaurant. Inside, Lugs and Sonsie vanished into the kitchen. "Now," said Hamish when they had placed their orders. "Out wi' it." "Out wi' what?" demanded Charlie mutinously. "You look miserable and guilty as sin. Is it our inspector? I thought she'd cleared off." Charlie stabbed his fork into the new tablecloth. "Here!" screeched the waiter, Willie Lamont. "Thon's a new cloth. You're a right wondle." "I suppose you mean vandal," said Hamish. "Shove off and get the food." When Willie had gone, Hamish said gently, "What has she done?" Charlie heaved a great sigh. "Do you believe in hell?" "Of course not." "I was brought up Wee Free," said Charlie, meaning the Free Presbyterians. "A woman taken in adultery is a sin." "Damn the woman!" said Hamish. "She seduced you." "Well, Hamish, it takes two. Aye, we spent the night together. I told her I loved her and I would make an honest woman of her and she laughed her head off and said it was only a fling." "Here's the wine. Have a glass. It's my belief you were more sinned against than sinning." "I felt such a rage, I damn nearly broke her neck. Oh, I'm so ashamed. Will God forgive me?" "Look, Charlie, I cannae believe in a God who punishes or even rewards because they are both human failings. Forget it. Put it down to experience. Were you a virgin?" Charlie shook his head. "Just the odd widow here and there." "Not here I hope," said Hamish sharply. "Don't shit on your own doorstep." "No, no, I promise you that." "Look, after we eat, we'll go to the manse and you tell the minister about it. He's a genuine Christian and you need one o' those. Then I'd like to go down to Strathbane on the quiet and see if I can talk to people who knew Malky. There's something nagging me. Okay, Andrew and his wife were at some wife-swopping party in Edinburgh. One of them could have slipped out and driven north. Anyway, it would make me feel easier. We won't wear our uniforms and we'll take your car." After lunch, they left the animals at the station and walked up to the manse. To Hamish's relief, there was no sign of Mrs. Wellington. Mr. Wellington led them into his dark and gloomy study. "Charlie here needs help," said Hamish. The minister listened carefully as Charlie blurted out his story. When Charlie had finished, Mr. Wellington said, "I have seen the inspector. She is a much older woman, is she not?" Charlie nodded. "Married?" He nodded again. "You have been preyed upon by an older, experienced woman," said Mr. Wellington. "You must ask the Lord to heal your hurt. But the fault lies with her. There are plenty of bonny lassies in the Highlands, and I suggest you find one. What do you feel now?" "I feel like you do when you've been drinking too much the night afore," said Charlie, "and you wake up feeling dirty and smelly." "That's good. A broken heart is a more difficult matter. Is your heart broken?" Muddled thoughts like cloud shadows chased across Charlie's face. "I think it's all right, sir." "Grand. Be more careful next time. There are harpies around. Not," added the minister wistfully, "that I have ever met one." The door crashed open and Mrs. Wellington appeared. "What is going on here?" "Charlie here is Wee Free," said Hamish, "but he's thinking o' changing to the Church of Scotland. Come along, Charlie." Outside, Charlie said, "That man's a saint." "He'd have to be, married to a wife like that," said Hamish. Chapter Eight O, wally, wally, gin love be bonnie A little time while it is new! But when 'tis auld it waxeth cauld And fades awa' like morning dew. —Scottish ballad But when they arrived at the tower block, it was to find the area swarming with council officials. "We can't hang around here," said Hamish, "or we'll be caught by someone from Strathbane. I know a café where the druggies hang out." The sky above had darkened and a little hard flake of snow drifted down, followed by another. By the time they entered the café, a full blizzard was blowing outside. Hamish looked around. "See anyone from your days down here?" he asked. "Aye, over in the corner," said Charlie. "Jonty Hill. Used to give me wee bits o' information." They collected cups of tea from the counter and joined Jonty, who squinted up at them nervously. He was an ill-favoured youth with a pasty face and greasy hair. He was huddled into a stained donkey jacket. "It's yourself, Charlie." "What can you tell us about Malky?" asked Charlie. He took out a twenty-pound note and rolled it in his fingers. Jonty eyed it greedily. "Malky was a right nice wee guy. All this talk about him being some sort of serial killer is havers. Wouldnae even kill a cockroach." "I think he might have burned Willie Dunne to death," said Hamish. "If he set fire to thon office, it would be because he thought there was no one inside." "What relatives does he have?" "It was on the telly this morning. His ma is suing the council. 'Her darling boy,' and all that. She chucked him out three years ago." "Did Malky have a girlfriend?" asked Hamish. "They were more druggies in arms," said Jonty. He seemed to think he had made a very witty remark because he doubled up with laughter which ended in a wheezing cough. "Where does she live and what's her name?" asked Charlie. "Gemma Burns. There's an auld house out on the Lairg road. Called Brae House. It's a squat." Charlie passed over the note. "Try spending that on food, Jonty." "Aye, sure, man. I'm clean." Hamish and Charlie hurried through the blizzard to Charlie's car. "It's a good thing the heater still works in this old bus and I got the snow tyres put on last week," said Charlie. "Do you think we should try to make it back to Lochdubh? I don't want to be stuck down here in this hellhole." "Oh, let's get it over with," said Hamish. "It may stop snowing. What was the weather forecast?" "Snow flurries." "I don't think those weather folk ever look out the damn window. Look, there's a gritter up ahead on the Lairg road. That'll make the going easier." "I remember where this Brae House is," said Charlie. "When I was working down here, we had to evict a lot o' druggies. The owner went bankrupt and it was claimed by the bank, but by that time it was such a ruin, no one wanted to buy the place." They moved forward through the white world in silence, until at last Charlie said, "There's the place. Up on the left. And there's smoke coming from one o' the chimneys." They drove up the short drive and parked outside. "Don't knock," ordered Hamish as they got out. "If the door's open, just walk in." The door was unlocked. They walked into a square hall and were hit by a foul smell caused by bad drains, unwashed bodies, old food, and a fresh smell of pot. Following the smell of hashish, Hamish opened a door on the left of the hall. Three miserable specimens of humanity were huddled round the fireplace. A young man who had been about to pass the roach in his fingers to a girl next to him threw it in the fire. "You're cops," accused a young girl with so many piercings on her face that Hamish wondered if the metal was a good idea in such a freezing winter. Surely it added to the misery. "We're not here about drugs, nor are we here to evict you," said Hamish. "Did any of you know Malky? Is Gemma Burns here?" There was a silence. Then, "That's me," said the girl with the piercings. Another long silence. Snow pattered against a cracked window and wind howled in the chimney. Then a youth with a large black beard and a bald head said, "I kent Malky. He wasnae a murderer." "What makes you say that?" asked Charlie. "Well, he'd steal a bit, maybe, for the drugs. But kill anyone? I cannae believe it." Charlie was about to ask for his name, but a warning look from Hamish, whose highland radar had immediately known what he was about to ask, stopped him. Hamish only wanted to hear about Malky and didn't want this source of information to dry up. "Did he have a girlfriend?" asked Hamish. "I mean, other than Gemma?" "He said he had a posh lassie who gave him drugs, methadone and stuff. He said she was a right cracker and had a scam that would see him all right." "Did you ever see her?" He shook his head. "But what makes you think he couldn't murder anyone?" pursued Hamish. "If Malky was into hard drugs, then his brain could have been twisted and fried." Gemma piped up. "Well, he couldn't have murdered thon nurse." "What makes you say that?" "Because from the night she disappeared until her body was found, Malky was here wi' us, chilling out." Hamish stared at them, his brain whirling. If he took them in and got their statements, the fury of Daviot would know no bounds. Daviot had gloried in the "solution" to the murders. He, Hamish, would be suspended for going out on his own on Strathbane's patch. The inspector, he thought. Fiona Herring, he knew, would be intrigued. He was furious with her for having seduced Charlie, but he knew her to be a good officer. Another girl said, "Will we have to leave here?" "I'd like to suggest you all check into a clinic and get off drugs," said Hamish. "I'll keep quiet about it until I figure out what to do." When he and Charlie were outside, Hamish said, "If we take them in, they won't be listened to. Daviot wants the case kept closed. I'll be cursed for dragging in three filthy druggies who probably don't know the day of the week. Charlie, I'm going to see the inspector when this blizzard blows over." "I never want to see that woman again," howled Charlie. "I'll deal with her." Unlike the busier parts of Scotland, the roads of the Highlands were usually kept clear with gritters and snow ploughs. As they reached Lochdubh, the snow stopped and the clouds parted. "You go to the hotel," said Hamish. "I'll let you know what happens." "You'll want this," said Charlie, handing him a small tape recorder. "I taped the whole thing." "Man, you're a genius. Off you go." Hamish went into the police station and collected the dog and cat while he went up to check on his sheep. Returning to the police station, he began the job of getting snowballs out of their coats before feeding them. Then he put on his uniform and set out for Inverness. Christmas lights sparkled in the windows of shops when he drove into Inverness. The whole place looked like a Christmas card. He suddenly wished he had phoned first. What if Fiona were down in Edinburgh with her husband? With a sinking heart, he learned that Fiona was off duty. He asked if his friend Mungo Davidson was on duty, found to his relief that he was, and asked to see him. "Why do you want to contact Old Iron Knickers?" asked Mungo. "It's too long a story. Do you know where she lives?" "I know where she is at the moment. Her ladyship is out wi' her husband for dinner. They're at the Taste Of France restaurant in the High Street." "Let me use the phone in your office. I'll call her." Fiona, when she came to the phone, appeared to be furious that her caller was none other than Hamish Macbeth. "What the hell do you think you are doing, interrupting my evening off?" she raged. "Listen!" said Hamish urgently. He began to tell her rapidly and concisely what they had learned about Malky. When he had finished, she said, "Get back to your station and I will call on you in the morning." Mungo, who had left his office while Hamish was phoning, met him on the road out. "Flea in both ears?" he asked sympathetically. "Something like that," said Hamish, and hurried off. In the morning, he awoke early, showered, and put on his uniform. He reluctantly allowed the dog and cat out to play. He walked to Patel's and bought the morning paper. He was relieved to learn that the wild cat sanctuary of about five hundred square miles at Ardnamurchan was being extended to Morven. I hope the beasties breed and breed, he thought, so that there'll be so many wild cats no one will bother about Sonsie. He heard a knock at the kitchen door. He reluctantly went to open it, hoping that his dislike for the inspector would not show. Why couldn't the wretched woman have left Charlie alone? But it was Charlie who came lumbering in. "Maybe I should send you away on something," said Hamish. "I'll probably have to see her sometime," said Charlie. "I've brought you a tray o' shortbread from the chef, some bones for Lugs, and a fish for Sonsie." "I'll phone him later and thank him. Coffee?" "Grand." Hamish turned and put the kettle on the stove. "Where is that bloody woman?" he said. "Here," said a voice from the kitchen door. Fiona had walked in quietly. Her eyes, hard and mean, fell on Sonsie. The cat was lying by the stove. "That _is_ a wild cat," she said. "And I feel it my duty to report it." Hamish's hazel eyes blazed, but before he could say anything, Charlie commented, "It's just a big pussycat. It would be a shame to take up police time with a false report—like some of the reports of sexual harassment." Fiona glared at him. Unfazed, Charlie smiled back. She pulled out a chair and sat down. "What's all this about?" she demanded. "Just what I told you on the phone, ma'am," said Hamish. "Would you like some coffee?" "No! Oh, well yes." Hamish reached into the cupboard for cups and said over his shoulder, "Play the tape for the inspector, Charlie." She listened intently. When it was finished, she said, "Why didn't you arrest them?" "And let Strathbane know we'd been poaching on their patch? It is my belief that Mr. Daviot would be so furious, he would discount the whole thing. He would say that druggies would say anything and they never knew what day it was. Then there is the alibi of Andrew Harrison. He claims that he and his wife were at a wife-swopping party in Edinburgh. Now why say that? He could just have claimed to have been at an ordinary party and I'm sure the other people there would ha' backed him up. They must all be furious with him. So if by any chance he or his wife could have slipped out at any time, I'm sure they would tell us." He put a mug of coffee and a plate of shortbread down in front of her. She drank coffee and ate a finger of shortbread. Hamish and Charlie waited in silence. "I tell you what I'll do," she said at last. "I will handle the Edinburgh end. You go about your normal duties and wait to hear from me." "Yes, ma'am," said Hamish, thinking he would be glad of a day off. He waited uneasily, praying she would not ask Charlie to accompany her, but she rose, nodded to them, and walked out. There was a long silence. Then Hamish asked, "How do you feel, Charlie?" He looked puzzled. "I don't feel anything. It's like having a bad fall and then finding nothing's broken. Is the snow still deep?" "Pretty deep," said Hamish, "and no sign of a thaw. I was hoping we might have a day off, but we'd better check up on the old people and see they're all right." After a long and tiring day, Hamish said, "I never want to see another cup of tea again." At each place they had visited on their enormous beat, highland hospitality demanded they accept refreshment. Charlie said he would go back to the hotel. He was welcomed by the colonel. "Just in time to join us for dinner, Charlie. Priscilla is back on one of her flying visits." Charlie hesitated. "All right. But I'll just have a salad or something. I'm up to the eyeballs in tea and scones. Been out wi' Hamish, checking on the old folk. I'll just change out of my uniform." "No need for that," said the colonel. "You're one of the family." Charlie was once more taken aback by the beauty that was Priscilla. From the perfect bell of her golden hair to her slim figure dressed in a mid-blue trouser suit that matched her eyes, he thought she looked stunning. "You're busy," said Charlie, looking round the crowded dining room. "I hope I haven't made a mistake," said Priscilla. "There's probably going to be a sighting of the northern lights this evening, so I put it on the website and people came rushing up. If nothing happens, I hope they don't ask for their money back." Charlie suddenly noticed that Priscilla was wearing an engagement ring. "It looks as if congratulations are in order," he said. "Who's the lucky fellow?" "Probably another waste of space," muttered her father. "It's an old friend of the family," said Mrs. Halburton-Smythe. "Harold Fox-Enderby." "He's too old," growled the colonel. "Can I get a word in here?" demanded Priscilla. "He'll be joining us soon, Charlie. I met him in London. He's a stockbroker for a firm I used to do computer work for." I wonder how Hamish will take this news, thought Charlie. I wonder if he ever really got over her. The dining room began to clear, and soon huddled-up figures appeared on the terrace outside the long windows. "I hope I haven't made a terrible mistake," said Priscilla. "About your engagement?" asked Charlie. "No, of course not! I meant the aurora borealis. I wish now I had employed some technician from the film industry to fake it for me." Suddenly there was a great cheer from the terrace, the waiters switched off the lights in the dining room, and the great, swirling spectacle of the northern lights filled the room with greenish light. "Hullo there!" called a voice. Charlie looked up. A burly middle-aged man was bending over to kiss Priscilla on the cheek. "Harold," said Priscilla, "meet my parents. And Charlie Carter, a friend of the family." What on earth does she see in him? marvelled Charlie. He's too old for her. Harold had a sallow, pugnacious face with designer stubble. He had small eyes and a fleshy nose and large thick lips. His shirt was open at the neck, displaying tufts of hair. "What's all this?" he asked. "Son et lumière?" "No, it's the aurora borealis," said Charlie. "Can we get you something to eat?" asked the colonel. "No, I had something on the road up. I'll have a coffee." He sat down next to Priscilla and put an arm around her shoulders. "And how is your dear mother?" asked Mrs. Halburton-Smythe. "Lost her wits. She's in a home." "Oh, dear. Poor Bertha. How awful." "Happens to all of us, some time or another," said Harold. "Mind you, the home costs a mint. Daylight robbery. I can see my inheritance going down the tubes with every day that passes." "Is your father dead?" asked Charlie. "Yes, broke his neck on the hunting field ten years ago. What a godforsaken part of the country this is. Miles and miles of nothingness." The lights came on again in the dining room. But it was as if a shadow had crossed Priscilla's face. "You'll see more of it tomorrow," she said. "It is very beautiful." Charlie stifled a yawn. "If you folk will forgive me, I've had a hard day and I'd like to get to bed." The colonel rose to his feet. "I'll see you downstairs, Charlie." No sooner were they in Charlie's flat than the colonel started. "Why did she choose that ape? He's been married before." "Divorce?" "No, fell downstairs and broke her neck. I bet he pushed her," said the colonel viciously. "I've never believed psychiatrists to be any good, but I wish now I'd sent her to one after that episode." "What episode?" asked Charlie. "Never mind. Long time ago. What about a dram?" "I'll make up the fire," said Charlie. "Don't need to. The central heating works down here." "George, I like a fire," said Charlie stubbornly. The fire was set and ready to light. He struck a match, lit it, and then got out a bottle of whisky and two glasses. The colonel settled back in an armchair. "Would you like to earn a bit o' money, Charlie?" "If you want me to do something for you, I'll do it for nothing," said Charlie. "This is serious stuff. I want you to get rid of Harold." "Kill him?" "No, no. Cut him out with Priscilla. You're a good-looking fellow. Pitch in there!" "How long is your daughter up here for?" asked Charlie. "Just a couple of days." "Even if I wanted to, I couldnae romance any lassie in two days. Priscilla has been engaged before and I don't mean just to Hamish." "Never came to anything." "So," said Charlie, "I'll bet you this one will fizzle out." "But there were nasty rumours about Harold when he was married. Said he beat his wife." Charlie sat, nursing his glass of whisky and looking into the leaping flames of the fire. At last he said, "I have this chap I went to school with, Lochy Cullen. He was christened Lochinver by his ma who was a fan o' Walter Scott. That got him picked on in school. I beat off his tormentors because he was a puny wee chap. But I couldnae be there for him all the time. When he got to his teens, he shot up in height and started bodybuilding, and then he began to punch everyone who had tormented him. He works as a bouncer at a posh club in London. Now, here's an idea. You could pay him to keep an eye on Priscilla. Maybe just for the next fortnight. He might be glad o' a break from the club. He phones me from time to time. Have you got keys to Priscilla's flat in London?" "Yes, me and the wife stay there when we're in London. Why?" "Just in case Lochy hears noises of violence and has to burst in." "Phone him now!" "Right. I may get him at the club. You go upstairs. Leave your watch behind. If I come up and hand it to you, you'll know everything's been set up. Now, to the money business." The colonel came up with a generous sum, left Charlie, and went reluctantly back to the dining room. His wife was sitting alone with Priscilla. "Where's Harold?" asked the colonel. "The poor lamb was tired and he's gone to bed," said Priscilla. Lamb, thought the colonel furiously. More like wolf in sheep's clothing. Priscilla began to talk about hotel business while the colonel only half listened until he heard, with relief, Charlie's voice saying, "You left your watch." "Thanks, Charlie. Thanks a lot!" Charlie reported to the police station in the morning and Hamish listened in dismay to his news. When he had finished, Hamish said, "I got a call from the inspector. She's still working on Andrew's alibi. Probably be back up here tomorrow if she gets a breakthrough. We'd better get up to the hotel and see her while she's here. I'll see if Angela will look in on Sonsie and Lugs." Angela said she didn't mind as long as the animals were left in the police station and not in her home, frightening her cats. Hamish and Charlie set out for the hotel. They called on the manager, Mr. Johnson, first of all and explained the problem. He said he would alert the staff to keep an eye on Priscilla. "But right now they've gone out for a run," said the manager. "Damn! We'd better search for them," said Hamish. "Any idea where they went?" "I think Priscilla said something about going to visit Dick and Anka." "Right. We'd better get over there." In Braikie, they headed up the side stairs to the flat above, knowing that Dick and Anka would be doing business online while staff served in the shop. They paused outside the door and listened. They could clearly hear Harold saying, "What is a divine creature like you doing living in a dump like this? I could get you a job in London as a model. I also know people in the television and film industry." Enough, thought Hamish, and he opened the door. Four faces turned to look at them. Priscilla's was a frozen mask. Dick looked furious. Harold was plainly leering at Anka, and Anka greeted them with patent relief. "Come in, Hamish and Charlie. We are so glad to see you." "I am afraid we are just leaving," said Priscilla. "Come along, Harold." He gave her a baffled look but followed her out. "Tell you later," said Hamish. "Got to follow them." He hurried down the stairs and peered round into the street. Harold and Priscilla were getting into Harold's Range Rover. As it started up, Hamish noticed with delight that one of the brake lights wasn't working. "His brake light's out," he said to Charlie. "Let's stop them. Tell you what. You go to Braikie garage and tell Jake there's fifty pounds for him if he finds something else wrong or makes something else wrong." Hamish jumped in his Land Rover and with siren wailing and blue light flashing, he set off in pursuit. Harold pulled to the side of the road. Hamish got out and rapped on the driver's window. When Harold lowered it, Hamish said, "You have a broken brake light and you cannot proceed unless you get it fixed." "Do we need to do it now, Hamish?" asked Priscilla. "It's just a minor thing." Hamish ignored her and said to Harold, "There's the garage a few yards back. Take your vehicle there." Muttering about highland peasants, Harold turned his car around and headed for the garage. Charlie saw him coming and quickly moved out of the garage and went to join Hamish. "That'll keep the scunner busy for a while," said Hamish. "Let's go to the pub for lunch." But when they emerged an hour later and strolled to the garage it was to find that Harold and Priscilla had gone. "What went wrong?" demanded Hamish. "I tried my best," said Jake. "But thon fellow knew as much about cars as me. Here's your fifty back." "Any idea where they went?" asked Hamish. "I told them the Falls of Shin over by Lairg would look right pretty in the snow." "We'll try there," said Hamish. By the Falls of Shin, Harold shouted above the roar of the water, "Are we going to stand here freezing all day? Think of it, Priscilla. We could be in London, instead of freezing our arses up here. Mind you, I know a good way to keep warm." He jerked her into his arms and forced his mouth down on hers. Priscilla began to struggle. "Not here," she pleaded, jerking her mouth back. He abruptly released her and then swore. A snowball had struck him on the back of the head. He looked wildly around. "Where did that come from?" "Probably kids," said Priscilla. "We'll go back to the car and find somewhere to eat." They climbed back up to the car park. That was when Harold found that his car would not start. Cursing, he got out and lifted the bonnet. "The distributor leads have gone!" he yelled. He looked up at the sound of an approaching vehicle to see the police Land Rover turning into the car park. Hamish Macbeth climbed down and approached them. "Oh, it is yourselves," he said. "Some wee laddies phoned up and said a woman was being raped down at the falls." "You can help out," snarled Harold. "Someone has stolen the distributor leads." "I'll get someone from the nearest garage over. It'll be quicker than phoning the Automobile Association. We'll take Priscilla with us because it's too cold for a lady to wait here." "I'll come, too," said Harold. "Och, no need for that," said Hamish. "What if the thief came back and took the whole car?" "It's all right, Harold," said Priscilla. "I won't be long." Charlie moved into the back and Priscilla climbed into the passenger seat. "Now," she said angrily, "did you stage this?" "Why would I do that?" asked Hamish. "To spoil my fun." "Oh, my." Hamish threw on the brakes. "I should ha' known you'd prefer to be wi' your fiancé." "Just drive on!" snapped Priscilla. The garage in Lairg was closed for DINNER, as the notice on the door said, dinner still being served in the middle of the day. They found out that the garage owner lived in a bungalow down by the loch, but he refused to move until he had finished his dinner of barley soup, stew, and apple crumble. Priscilla tried to phone Harold but could not get a reply. The reason was that Harold was sure Hamish had planned the whole thing. Thirsting for revenge, he phoned police headquarters in Strathbane and said he wished to report Sergeant Hamish Macbeth, who had deliberately sabotaged his car. Blair heard of the call and said he would deal with it. This, he was sure, was Hamish trying to cover up something sinister. For Hamish had not put in a report. Careless of expense, he commandeered the police helicopter and set off. Harold heard the whir of the helicopter overhead and got out of his car. The helicopter descended, covering him in a small blizzard. Blair and two policemen got out. "Come with us," ordered Blair. "We'll sort this out at headquarters." "I am not going anywhere, you stupid moron," raged the snowman that was Harold. "This is like the Keystone Cops." "Handcuff him," ordered Blair. "I am charging you with abusing a senior police officer." Hamish, Priscilla, and Charlie looked up in the sky and saw the helicopter lifting off. "I think that was ower at the falls," said Charlie. "Probably some poor soul has had a heart attack or something," said Hamish. "We'd better get to his car and fix it." He raced ahead of the mechanic. "You stay in the car, Priscilla," said Hamish. "Don't want you getting cold." He quickly replaced the distributor leads before the mechanic arrived. But Harold had taken the car keys with him. Hamish looked around and then down at the blown circle of snow. "He must have had an accident," he said. "That helicopter must have been for Harold." He phoned the Air Ambulance, but they said they had not picked anyone up from Lairg. Detective Chief Inspector Blair was a very unlucky man. Daviot was leaving the police station just as a handcuffed Harold was being marched inside. "I wish to use my phone," Harold was shouting. "My fiancée, Priscilla Halburton-Smythe, will wonder what has happened to me." "May I be of assistance?" asked Daviot. Harold burst out with the whole story. Daviot's pale eyes fastened on Blair. "Why is this gentleman in handcuffs?" "He insulted me," said Blair. "What exactly did he say?" "He said that Macbeth had sabotaged his car." "Did you phone Macbeth and demand an explanation?" "It seemed too important to wait. So I took the helicopter up there." "You _what_?" roared Daviot. "Do you know the cost of that thing? You are a bloody moron. I am so deeply sorry, sir. I will take you back and we will settle this whole matter. Get the handcuffs off him, now!" Hamish got a call from Jimmy Anderson, who gleefully related the whole scene. "It seems as if Harold reported you to headquarters for deliberately sabotaging his car and Blair came flying up. Harold insulted him. Blair arrested him and they're on their way back." When she heard the story, Priscilla said in a voice as cold as the snowy scene outside the Land Rover, "I wouldn't put it past you, Hamish." "Priscilla, I was nowhere around when the car wouldnae start. I thought someone was in trouble when a wee boy reported a woman was getting raped." "So how did you get here so quickly from Braikie?" "False report of a burglary." Soon they heard the whir of a helicopter. When it landed, Hamish got out and went to meet Daviot. He noticed Charlie had disappeared. "Report, Macbeth," commanded Daviot. Hamish said that a boy had reported a rape at the Falls of Shin and he had raced there. He found it was a false alarm. Then Harold's car wouldn't start so he had gone off to find a mechanic and had to wait until the man finished his dinner. "I'll hae the keys," said the mechanic, and Harold passed them over. Soon they heard the engine of his car roar into life. "Seems just fine," he said. "Maybe your spark plugs got damp." "Rubbish! The distributor caps had been stolen. Where is this schoolboy?" said Harold. "I don't believe he exists." "Here," came Charlie's voice. He walked up to them leading two small boys whose faces were smeared with chocolate. "Go on, Declan," he said to one of the boys. "Tell the nice superintendent what you saw." "Me and Rory was up by the falls making a snowman," said Declan, "and we saw this wumman and a man seemed to be attacking her. I've got a mobile from my ma so I called the police." Daviot turned to Priscilla. "Is there any truth in this? Were you in difficulties?" Priscilla turned red with embarrassment. "My fiancé was kissing me, but I struggled free because it didn't seem the right place or time. I'm afraid these little boys got the wrong idea." Harold rounded on Priscilla. "I am going back to civilisation right now. We are going to the hotel and then we are going straight back to London." "Not here," said Priscilla. "We'll discuss this on the road back to the hotel." "I want pay for my time," said the mechanic. "You can take your time and stuff it up your highland arse," shouted Harold. "Send your bill to police headquarters in Strathbane," said Daviot, "and maybe we'll call it quits." "No, we won't call it quits," said Harold. "I'm suing you lot for wrongful arrest." "It'll make a right amusing story for the press," said Hamish, "when it gets to court. London stockbroker reported falsely for trying to rape his fiancée. Arrested and taken off in handcuffs. Although nothing up with his car, told hardworking mechanic to shove his bill up his arse. I can see the headlines now." "Oh, drop the whole thing," said Harold. He helped Priscilla into his car and drove off. Daviot nodded curtly to Hamish and climbed into the helicopter. "Make that bill a big one," said Hamish to the mechanic. "Come on, Charlie. Do the kids live nearby?" "Aye, they'll be all right. A croft just ower the brae." "We may as well follow them. We're all going to Lochdubh anyway." As they drove along, Hamish asked, "How much did it cost you?" "Two bars o' chocolate and a fiver." "Parents all right with that?" "The father, John Sweeney, is a friend o' your mother's. No trouble at all." "That's them up ahead," said Hamish, looking down the long road. "I don't like this. I think he's a brute. Priscilla's always looking for someone suitable to please her parents. Now what's happening? He's driven off the road and up thon forestry track. We'd better follow them." "I wouldnae do that," said Charlie. "You'll give Harold a good reason to say we're stalking him." "You're right," said Hamish. "You stay here and I'll go on foot." "What on earth are we doing here?" demanded Priscilla. "It's time you got to know who's boss in this relationship," said Harold. "Get in the backseat." "No, I will not. Drive me back to the hotel immediately." Harold leaned across her, flicked open the glove compartment, and drew out a knife. He held it to her throat. "Do as you're told." Priscilla wrenched off her engagement ring and threw it in his face. "The engagement is over." She opened the car door and got out. "I'll walk." Harold got out as well, seized her, and threw her down in the snow. He brandished the knife. "You are going to do exactly as you're told, you frigid bitch." The next moment he was seized by the collar and jerked backwards. Hamish Macbeth stamped on his wrist. Harold let go of the knife. Hamish picked it up and threw it off into the trees. "I am charging you with attempted rape," said Hamish, "and with carrying a dangerous weapon. You—" "Hamish," pleaded Priscilla, "let it go. I can't bear the scandal. I feel like an absolute fool. Please, Hamish." "Oh, all right," said Hamish. Harold was still lying on the ground. He gave him a vicious kick in the ribs to relieve his feelings. "Go down to the road, Priscilla. You'll find Charlie there. I'll join you in a moment." He walked to Harold's Range Rover and took the keys out of the ignition. "You can walk back to the hotel, you scunner," he raged. He put the keys in his pocket and strode back down the track. Harold had to wait two hours before the Automobile Association, already overloaded with emergency calls, managed to get someone out to him. He was freezing because without his car keys, he had been unable to put on the car heater. By the time he had thought to phone the hotel manager and ask that someone should go up to his room and find his spare keys, Hamish had already been on to the hotel. He was told that his cases were packed and waiting for him in the hall and he was no longer welcome. Hamish kept Priscilla at the police station until he heard that Harold had left. He then asked Charlie to take her back. Priscilla was badly shaken. She had told him that Harold had seemed so romantic. He had sent her roses and taken her out to the best restaurants in town. Hamish felt he was listening to a description of a psychopathic control freak. He had heard of cases where men like Harold would start off as loving and caring. But usually they waited until the woman was secure in marriage before they started making life a hell. Would Priscilla ever realise that there was something up with her? He remembered when they were engaged, how her coldness had made him want to weep. He was just settling comfortably in front of the television with Lugs and Sonsie beside him on the sofa when his mobile rang. It was Fiona. "I'll be with you in an hour. There's a lot to discuss." Chapter Nine "Come, come," said Tom's father, "at your time of life, "There's no longer excuse for thus playing the rake— "It is time, boy, you should think of taking a wife"— "Why so it is, father—whose wife shall I take?" —Thomas More By the time the inspector arrived, Hamish was fast asleep. Fiona had let herself in. She stood looking down at him and made to shake him awake. The cat's eyes blazed with a yellow light and she let out a warning hiss. "Macbeth!" Fiona shouted. "What?" Hamish struggled awake and then got to his feet. "Sorry, ma'am. It's been a long day." "Where's Carter?" "At the hotel." "Get him here!" Charlie arrived in ten minutes' time, glad to escape from a dinner with the Halburton-Smythe family. Priscilla was miserable and her parents looked wretched. He shied like a large carthorse when he saw Fiona, but all she said coldly was, "Now you are here, Carter, we can get down to business." She took her laptop out of its case and switched it on. "Here's what I have found. Yes, Andrew and Greta Harrison were at this wife-swopping party. The people who indulge in that sort of thing! There was even a judge there." "Not your husband, I hope," said Hamish. "Don't get cheeky with me, Sergeant. Now, how this sleazy party works is that they draw out slips of paper, and whoever's name's on it chooses a partner. It's a great big place out at Morningside. That couple go off to one of the many bedrooms. But the one who was not chosen was Greta because there was one woman too many. What did she do then? Nobody knows. Her husband tried to swear she was waiting for him when he had finished his business. That was how he put it. But all the others, now terrified of scandal, and promised secrecy provided they were honest, all swore that Andrew had left alone. She could have driven to the hunting box, lured Gloria outside, and strangled her. She and Andrew may have been terrified that old Harrison would leave everything in his will to her. "I am keeping quiet about this for the moment until we talk to her. That will be all. I will see you both here at nine in the morning." "How do you feel about her now?" Hamish asked Charlie. "I don't feel anything. In fact, it's all like some sort of dream. Herself will be staying at the hotel. Maybe I should stay here." "Oh, you'll be all right," said Hamish. "She's taken to calling you Carter and there was anything but lovelight in her eyes when she looked at you." When Charlie returned to the hotel, he asked the night porter if he had a key for the door at the top of the basement stairs. "I'll look in the office," he said. He was only away a few minutes before coming back and handing Charlie an old-fashioned rusty key. He had a job turning the key to lock the door but at last succeeded. Half an hour later, the night porter looked up from the sports page of the newspaper he was reading to find Fiona Herring in front of him. She held out an imperious hand. "I need the key to the basement," she said. "The door is locked." "Mr. Carter locked it," he said. "But there's nothing down there but old rubbish apart from Mr. Carter's wee flat. Can I get you anything?" "No. I can wait until morning," said Fiona harshly. Charlie awoke very early the next morning to get down to the police station before Fiona. The night porter was about to go off duty. "Oh, Mr. Carter," he said. "Thon inspector wanted the key to the basement last night, but I told her you had it." Charlie blushed red. "Oh, it's nothing but work with that woman," he said, and made his escape. Hamish was up early as well and listened in dismay to Charlie's news. "The trouble is," said Charlie, "she might want to get her own back by saying I wasnae living in the station." "I think she'd be too frightened to do that," said Hamish, putting a frying pan on the stove. "If she's got her wits about her, she might be worried you'd bring a case of sexual harassment. Sit down. What we both need is a good breakfast." After a large fry-up of haggis, black pudding, eggs, and bacon, Charlie took a saucer and poured milk into it, and then salt into another. "What the hell are you doing?" demanded Hamish. "I'm putting this out for the fairies," said Charlie stubbornly. "I'm going to ask them for another blizzard. That way, we cannae go up there and I'll hae another day where I don't have to look at her." "You're daft." Charlie disappeared. When he came in, he tripped over the dog, clutched the kitchen table, and fell down in a rain of crockery. "Och, get a dustpan and brush," said Hamish, helping him to his feet. "You should have asked the wee folk to help you stop breaking up my home. Hurry up, man. It's nearly nine o'clock." Charlie hurriedly cleaned up the mess and had just finished when Fiona walked in. "Any sign of snow, ma'am?" asked Charlie. "No. Make me a strong coffee, Macbeth, and then we'll get off. You can both follow my car." They had just crossed the humpbacked bridge leading out of Lochdubh when a great gust of wind rocked the Land Rover and then the view ahead disappeared in a blinding snowstorm. Hamish gave a superstitious shiver and felt like crossing himself. Fiona's driver turned her car into the hotel car park. Her driver got out and rapped on the window of the Land Rover. "The inspector says we can do nothing today," he said. "She will call you when the storm is over." "A reprieve," said Charlie. "I'll keep to the station all day." "I keep hoping Priscilla will be all right," said Hamish. "I sent Lochy a photo of Harold so he knows what he looks like. I also told him what happened." While Harold was still stuck by his car, Priscilla had gone back to the hotel, packed her bags, taken a cab to Inverness airport, and caught a flight to London. She could not bring herself to face her parents with another broken engagement. Upon her return, she switched on the television and settled down for a quiet evening. That whole episode with Harold seemed like a horrible dream. She switched on the news. She saw a report that an enormous blizzard had blanketed the north of Scotland and passengers had to be lifted off by helicopter from the Wick-to-Inverness train. Harold stood outside on the pavement, swaying slightly, for he was very drunk. He wondered if Priscilla had changed the locks, for she had given him a set of keys. He thirsted for revenge. He walked into the entrance hall of the flats. Priscilla had been so glad to be back in her flat that she had failed to either change the locks or to tell the porter to stop Harold from entering. Harold nodded to the porter and made his way up the thickly carpeted stairs to Priscilla's flat on the first floor. The porter stared as a huge man like a heavyweight boxer strode into the hall. "Here! Where are you going?" he demanded. Lochy flashed a fake warrant card and growled, "Police." He strode up and listened at the door. Silence. He took out the keys he had been given and quietly opened the door. He heard movement from a room at the end of the corridor. He gently tried the door. It was locked. Oh, well, thought Lochy with a mental shrug. Here goes. He raised one metal-capped boot and kicked the door open. Harold was in the act of handcuffing Priscilla to the bed. Harold swung round. Lochy gave him a savage uppercut and knocked him unconscious. Priscilla stared up at him, speechless with horror. "There now," said Lochy soothingly. "Let's get you out of this. Charlie Carter told me to look after you, lassie." He unfastened the handcuff and helped her to sit up. "Do you want to call the police?" "Yes. No," said Priscilla. "The newspapers. The scandal." "All right, miss. I'll just handcuff this bastard. Right. Got anything to tie his feet?" Priscilla climbed out of bed and staggered over to a drawer where she extracted a leather belt. "That's the ticket," said Lochy. "You'd better get the locks changed and a burglar alarm. Do you want me to get rid of this?" "Don't kill him," said Priscilla through white lips. "I'm no' in the killing game. But I wouldnae mind a wee dram." "Of course," said Priscilla weakly. "Come through to the sitting room." She led the way and Lochy lumbered after her. She poured a generous measure of Glenlivet into a glass and handed it to him, then poured one for herself. "I feel so stupid," she mourned. "I should have changed the locks. What happens now?" "I'll take him away somewhere and make sure it disnae happen again." There came thumps and yells from the bedroom. "Didnae hit him hard enough," said Lochy. "Back in a minute." He went into the bedroom and took a roll of tape out of his pocket, sliced off a section, and pasted it across Harold's mouth. Then he returned to the sitting room and picked up his glass. "That should shut him up for a minute. Aye, it was Charlie and Hamish were right worried about ye and asked me to keep an eye on ye." "I must pay you something." "No, your pa did that." Priscilla began to cry. "I'm useless," she said at last. "We all make mistakes," said Lochy sententiously. "Now, I'd better do my job and get him out of here." "Won't the porter call the police?" Lochy grinned. "He thinks I am the police." He went back to the bedroom and ripped the tape from Harold's mouth. "I've got a gun," said Lochy. "One peep out o' you and you're a dead man." He unfastened the belt from round Harold's ankles but kept the handcuffs on him. Harold in all his bullying life had never known such terror. He allowed Lochy to march him past the porter without saying a word. Outside, Lochy shoved him into the passenger seat of his car, got in himself, and drove off. "Do you want money?" pleaded Harold. "I want you to shut up. There's brandy in the glove box if you need some Dutch courage." "I'm handcuffed." "Poor wee soul." Lochy jerked the car to a halt. He fished out the flask of brandy, opened it, and held it to Harold's lips. Harold took a great gulp, not knowing it was heavily drugged. In no time at all, he was fast asleep. Lochy drove steadily northwards until he reached one of the less salubrious parts of Birmingham. He stopped his car, went round, and hauled Harold's body out of the car, took off the handcuffs and dumped him on the pavement, and then drove off. Harold awoke at dawn the next morning. He stumbled to his feet and looked wildly up and down the deserted street. He tried to find out the time but discovered his gold Rolex had gone. Terrified, he felt in his pockets. No wallet, no phone, no driving licence. Nothing. He saw a sanitation truck coming down the street and stood in the road waving his hands for it to stop. He shouted that he had been mugged. "You'll find a police station round the next corner," said the driver. Harold thirsted for revenge. But outside the police station, he stopped in dismay. If he told them about Lochy, the man would be arrested, but the whole story of his own attempted rape would come out. He squared his shoulders and walked in. He told the desk sergeant that he had been drinking in a pub in London when someone must have slipped him a mickey. The next thing he knew, he had woken up in a Birmingham street to find he had been mugged. It seemed to take ages to give a statement to a detective. Then a wait until the firm he worked for started for the day to confirm his identity and say they would send a car for him. At last, having been told to take the day off, he returned to London to find his apartment had been burgled. He sat down amid the chaos and began to phone to cancel all his credit cards and phone the insurance company and the police. Charlie was awakened during the night by a call from Lochy and listened in horror to his story of the attempted rape. Before Fiona arrived at the station, he told Hamish what Lochy had said. "What's up with her?" howled Hamish. "Why does she always pick losers?" Charlie politely forbore from pointing out that Hamish himself had been one of the losers. Fiona arrived. "The snow has stopped and I think we can make it," she said briskly. "I don't like all this havey-cavey stuff but we'll need something concrete to take to Daviot." "All she had to do is deny it, ma'am," said Hamish. "We'll interview her on her own and see if we can break her." "Fairies aren't working today," said Hamish as they followed Fiona's car. The snow ploughs and gritters had done a good job. It was still dark because in winter in Sutherland the sun only crept over the horizon around ten in the morning. "Don't mock the wee people," said Charlie. They made their way slowly to the hunting lodge. A grey dawn was beginning to cover the sky as they moved up the now familiar drive. Juris answered the door and told them that the family were at breakfast. "We wish to interview Mrs. Harrison," said Fiona. "We will use the study." They seated themselves in the study and waited. Greta walked in, followed by her husband. "We wish to speak to your wife alone," said Fiona. "This is an outrage," spluttered Andrew. "I shall phone Mr. Daviot and—" "Do that," said Fiona, "and I will make sure the newspapers find out how you and your wife pass your time in Edinburgh." Andrew beat a hasty retreat. Hamish surveyed Greta. She was a big powerful woman with strong hands. "Mrs. Harrison," began Fiona. "You were odd woman out at that wife-swopping party. You could have left and driven up here to strangle Gloria Dainty." "Why on earth would I want to do that?" "Perhaps you were afraid your father-in-law might change his will and leave everything to Miss Dainty." "I never even met the woman," snapped Greta. "When you left this Edinburgh party, where did you go?" "I went back to the George Hotel and went to bed. I ordered room service. The staff will be able to vouch for me." "Why did you leave?" Greta suddenly looked weary. "I don't like the games Andrew likes to play. I find it all rather sad. But do check up on me by all means and if that's all you've got, get the hell out of here." They looked at each other after she had left. "I've an awful feeling her alibi will check out," said Fiona. "What about the statements from the druggies?" suggested Hamish. "We could pull them in." "As you pointed out earlier, Mr. Daviot is so determined the case is closed," said Fiona, "that he will simply insist that drug addicts will say anything. It's a dead end. I've got time owing. I am going to Edinburgh for a break. A word in private with you, Carter. Wait outside, Macbeth." Hamish waited in the hall. Fiona came out after a few moments. Her colour was high. She did not speak to Hamish but went on through the hall, out into the snow, and slammed the door behind her. "What happened?" asked Hamish when Charlie came out of the study. "Just a private matter," said Charlie. "Let's go." Christmas came and went. The New Year dawned. Hamish and Charlie went about their duties. Only Charlie was happy. He and the colonel spent a great deal of time together. Hamish, however, felt the murders were unsolved. The fact that there might be a murderer out there, feeling safe and secure, kept coming back to haunt him. After Christmas, Andrew and his wife had gone back to London. Then one fine day, he saw Juris and his wife coming out of Patel's shop. "How is Mr. Harrison?" asked Hamish. "Same as ever," said Juris. "His son and daughter-in-law are coming up next weekend on a flying visit." "Is Mr. Harrison leaving you anything in his will?" asked Hamish. "Oh, he says he is. But he tells everyone around he's leaving them money. It's to keep us all sweet. But the lawyer was round last week. I listened at the door. Andrew gets it all. I told the gamekeeper, Harry Mackay, and the shepherd, Tom Stirling. You should ha' seen their faces. The old man had promised them the ownership of their cottages and a good sum when he died, because it's no secret Andrew plans to sell the place off. Man. Harry was that furious, he said he felt like putting a bullet in the old man." "And what about you?" asked Hamish. "Oh, me and Inga never believed him. I mean, it's right typical of rich old people. They promise this one and that one to keep them all running around." Hamish uneasily watched them both go. He hoped Mr. Harrison's promises would not turn out to be a sort of Russian roulette and someone might be tempted to help him to an early grave. Chapter Ten Life is one long process of getting tired. —Samuel Butler As a few weeks of rare fine weather continued, Hamish was almost able to put the murders out of his mind. He had dutifully called on Miss Whittaker and the accountant, Gerald Wither, to give an account of the closing of the case—an account he could not quite believe in. He had a niggling worry to plague him which had nothing to do with the murders. He was walking his pets accompanied by Charlie when a pretty hitchhiker approached him and cried, "A wild cat! I never thought to be so close to one." "It iss not the wild cat," said Hamish, his accent becoming stronger as it did when he was distressed or worried. "It is chust the large tabby." The girl was small, carrying a huge pack on her back. She had curly fair hair dyed with streaks of shocking pink and a cheeky face. "Suit yourself," she said. "But that's a wild cat and it should be with its own kind. Unnatural to keep it as a pet." She waved to him and walked on, leaving Hamish worried. He looked down at Sonsie. Would the cat really be better in the wild? And what would become of Lugs without his friend? "What do you think?" he asked Charlie. "Maybe she's right," said Charlie awkwardly. "I'm always afraid that one day someone's going to take you to court and get the beast. We could take her ower to Ardnamurchan and let her loose. If she doesnae run away, well, that's that. We'll take her home. But maybe give her a chance o' freedom." "Oh, leave her be," said Hamish. But the next day, something happened to change his mind. He had forgotten about Blair's long campaign against him. The detective chief inspector's wife, Mary, had been reading about the extension of the Ardnamurchan sanctuary. She showed Blair the article, saying, "Doesn't that wild cat look like Hamish's pet?" Blair studied the article and his bloodshot eyes gleamed with malice. When his wife had left to meet friends, he found the e-mail address of the trust and informed them that one local policeman in Lochdubh was keeping a wild cat as a pet. Fortunately for Hamish, a scientist and his assistant called at the hotel first for lunch and told the waiter that they were going to the local police station because there had been a report of a wild cat. The waiter told the manager, who phoned Hamish. Charlie took Sonsie off. Hamish ran to the vet and borrowed a large domestic tabby and sat down to wait. The scientist and his assistant when they called were plainly disappointed. When they left, Hamish had a sudden intuition that Blair was behind it. He managed to get Mary on the phone when Blair was out and asked her if her husband had shown any interest in wild cats. "Funny you should say that," said Mary. "I was looking in the papers about the wild cat sanctuary and there was a photo and I said to him that it looked like your cat. He grabbed the paper and shot out the door." When he had rung off, Hamish put his head in his hands. He knew Blair would never give up. Somehow, the wretched man would get a photo of Sonsie and then the game would be up. When Charlie returned, he told him what had happened. "Well, now," said Charlie. "We'll drive to Ardnamurchan and let her out. If we're stopped, we can say we're going to visit the lighthouse. If she comes back, we'll take her home and find some way to get Blair to shut up." Ardnamurchan is wild and very beautiful with only a sparse population. The tip of the peninsula—Britain's westernmost point—extends between the islands of Mull to its south and Eigg, Rum, and the more distant Skye to its north. They had left Lugs at the hotel in the care of the chef. A magnificent sunset was blazing across the sky as they followed a one-track road, looking nervously to right and left in case any scientists leapt out of the heather. "Here'll do," said Hamish, pulling onto the side of the road. "We'll settle down and light the stove as if we're having a picnic and see how Sonsie reacts." "Cats are very territorial," said Charlie. "What if she gets mauled?" "Then her attacker is going to be one stun-gunned cat." Hamish got out and lifted out the stove. "I brought sausages," said Charlie, producing a pack. "Sonsie is right fond of sausages." "Grand," said Hamish, feeling suddenly cheerful. He felt sure Sonsie would not leave him. Soon the sausages were frying and Charlie was pouring cups of coffee from a thermos. "Let the cat out, Hamish," said Charlie. "We'll need to try sometime." Suddenly uneasy, Hamish let the cat out. Sonsie's great head turned this way and that and then she bounded off across the heather. "She'll be back," said Hamish. "I'll put a couple of sausages on a dish for her." They waited and waited. Then Hamish whistled, that whistle that had always brought Sonsie running back, but there was nothing but the sound of the breeze soughing through the weather. The stars blazed overhead. "I'd better go and look for her," said Hamish. Charlie put a hand on his arm. "Something's there. Sit right quiet." Creeping out of the heather came Sonsie and what looked like a great wild tom cat. They grabbed a sausage each and fled back into the heather. "I think that's that," said Charlie. But Hamish would not be moved. Charlie got a sleeping bag out and made himself a bed in the heather, but Hamish sat all night long, his heart heavy. When Charlie awoke in the morning, he found Hamish slumped against the side of the Land Rover, fast asleep. He gently shook him awake. "Come on home. It's all over." "What about Lugs?" asked Hamish on the road back. "We'll see if the vet has any strays," said Charlie. "Get him a wee puppy to look after. You get some more sleep and I'll see to it." Hamish awoke later in the day. He and Lugs walked slowly along the waterfront. Charlie's car screeched to a halt. He got out carrying a small white poodle in his arms. "Meet Fifi," he said proudly. "That's no dog for a man," said Hamish. "Take it away." "Oh, Hamish. It belonged to old Mrs. Murchison what died last week and no one wants her wee pet. It's got no home." Charlie put the poodle down. She pranced up to Lugs and nuzzled his ear. Lugs licked her face. "See?" said Charlie. "Isn't she cute?" "I'm not having any animal called Fifi." "Then call her something else." "Look, Charlie. Okay. So long as Lugs is happy. Could you settle them in and feed them? I've got to be somewhere." All day long, Hamish sat in Ardnamurchan where he had left Sonsie and called and whistled. Night fell and still he waited until he fell asleep. In the morning, stiff, cold, and miserable, he drove the long way back. As he drove along the waterfront, he saw Charlie standing in the middle of the road, waving his arms. "Just in time," said Charlie. "Got a call. Andrew Harrison has been murdered!" It became clear to Hamish and Charlie when they arrived at the hunting box that they were no longer to be privileged investigators. Fiona, Jimmy, Blair, and two detectives were waiting outside for the forensic team to finish their work and for the pathologist to give his report. Fiona swung round when she saw them and said loudly and clearly for all to hear, "Your presence will not be necessary. Get back to your normal duties." Blair gave a fat grin. "Well, that's that," said Hamish as they both climbed back into the Land Rover. "Talk about hell having no fury." As they drove off, Daviot was arriving. In the rearview mirror, Hamish saw Blair taking Daviot to one side. Despite all the detective chief inspector's frequent gaffes, Daviot felt comfortable with him. They were members of the same lodge. Blair always kowtowed to him and never made him feel like a fool. "It looks as if Malky could not have been the murderer," said Daviot. "Isn't that just what I was thinking," said Blair eagerly. "And I know who's to blame for that." "Who?" "Our inspector. Didnae you think it weird, sir, that instead of investigating the murders with professional detectives, she should go out on her own and demand the presence of two local highland bobbies?" "Yes, that does seem strange," said Daviot. He had not liked Fiona's high-handed attitude. "I mean, sir, the police commissioner would be quite shocked if he heard. There were rumours around that she was sweet on Carter and her a married woman and to a judge, too." "Keep your eye on things here," ordered Daviot. "I'm going back to police headquarters." Once back at his desk, Daviot sent a long e-mail to the police commissioner, putting the blame for pinning the murders on Malky fair and square on Fiona's shoulders. He felt a warm glow of gratitude towards Blair, feeling that the detective had managed to exonerate him, Daviot, from blame. In the police station, Hamish absentmindedly patted the little poodle and scratched Lugs's ears. His dog looked up at him out of his odd blue eyes. "Sorry, old boy," said Hamish, "but Sonsie isn't coming back." "I'll make us some tea," said Charlie. "Good idea." Hamish stretched and yawned. "Then I think I'll catch up on more sleep. I'm so tired I can't think straight. Do me a favour, Charlie, and take Lugs and that other ridiculous animal out for a walk after we've had some tea." "You'll have to give the wee poodle a name." "I'll call it It for the moment." "What about Frenchie? Pretty wee thing." "If you want." They drank their tea in silence. Then Hamish said slowly, "Fiona is going to be in trouble over this." "Why?" "Just a feeling. As we drove off, I saw Blair talking to Daviot. Daviot won't want to take the blame for a botched case. What if it came out that she took us around with her, instead of proper detectives?" "She seems to have a lot of power. Probably won't come to anything. I'm off. I'll wake you later. It's a good thing old Harrison didn't promise to leave us something in his will or we'd be dragged in for questioning as well." "They won't get far," said Hamish. "Juris won't tell Blair a thing once he starts his usual shouting and bullying." Charlie walked the animals, glad in a way to be off the case and away from Fiona. The little poodle was a big hit with the locals. Even the Currie sisters bent down to pet her. He then drove them up to the hotel, had a cosy chat with the colonel, and promised to go fishing with him the next day. When he returned to the station, he saw with a sinking heart that Fiona was sitting in her car outside. She got out and waited while he parked and let the dogs out. "I've been suspended," she said abruptly. "Why, ma'am?" "Some malicious bastard put in a report that instead of using highly trained detectives, I was covering the case with two highland coppers. I mistakenly relied on reports of Macbeth's successes." "Ma'am, he was the one who told you that I did not think the murderer was Malky." She looked at him sullenly, got into her car, and her driver drove off. "Will Daviot call us in for an explanation?" asked Charlie when he had told Hamish what had happened. "He can't," said Hamish. "He knows damn well we were following orders and that he went along with it. I'm sick o' the whole business. I need to think. I'll do some chores." "I'll help you," said Charlie. Hamish was well aware that Charlie was capable of breaking more things around the station. "No, you take the day off," he said. "I'll phone you if I think of anything." Hamish went indoors, made himself a cup of coffee, and then went into the office to go through his notes on the computer. Lugs came in and put a paw on his knee and stared up at him. "She isnae coming back," said Hamish sadly. "You'll just need to make do wi' that piece of fluff called a poodle." After a few minutes, Hamish heard the large flap on the kitchen door bang. He rose and went through to the kitchen to get a piece of shortbread. He looked out of the kitchen window. Lugs and the poodle were chasing each other round the back field in the sunshine. I wish I could get ower the loss of Sonsie that easy, thought Hamish. He went back to the office, put his hands behind his head, and stared into space, letting all the scenes from the investigation run through his head. Forget about old Harrison's will, he thought. I wonder if his life was insured. I wonder if they needed money. But Andrew must have been making a fair whack as a London barrister. But maybe Greta was sickened by the sex games. Still, if she wanted rid of her husband, surely the time to do it would have been at the height of the murder investigations. How had Andrew been murdered and where? He phoned Jimmy on his mobile. "I'll lose my job if they know I'm talking to you," whispered Jimmy. "How was Andrew murdered and where?" asked Hamish. "Savage blow to the head out in the grounds. Look, get the whisky ready and I'll drop in on you later." After he had rung off, Hamish began to think about drugs. Malky had been a good-looking young man to judge from the photos of him published in the newspapers. He had been handsome enough to attract Gloria and help her get the job with Harrison. Why hadn't that nursing agency noticed if any of their drugs were missing? They must keep some on the premises. It didn't seem likely. And surely nurses couldn't write out prescriptions. He had a sudden urge to see if there was a chemist near the nursing agency. He phoned Angela and begged her to look after the dogs. "I heard Sonsie has gone and you've got a poodle," said Angela. "I'll look in at the station. What's the poodle called?" "You think o' something," said Hamish. "Thanks, Angela." Hamish called first at the hotel and asked Charlie if he could borrow his car, not wanting to alert Strathbane that he was on their patch. He parked near the clinic and looked around. There was a small chemist's a few yards away. Hamish went in and asked the girl behind the counter if he could speak to the pharmacist. The pharmacist introduced himself as George Stoddart. He was a tall, thin man with a face as white as his coat and a shock of white hair. He looked as if he had been bleached all over. Hamish asked if he could remember a nurse called Gloria Dainty coming in with prescriptions. "The one that was murdered? Yes, I remember her. She used to collect medicine for patients." "Is it possible you could find out from your records what the prescriptions were for and which doctor signed them?" "Wait a minute. It shouldn't take long." He went into the back where a computer lay on a desk in front of shelves of medicines. Hamish waited impatiently. It was a quiet residential area. Customers came and went. Hamish noticed the computer had a huge back on it instead of a flat screen. Probably take an age even to warm up, he thought. At last the pharmacist came back. "The prescriptions are all from Dr. Strachan." "Where is his surgery?" "Blythe Road, just round the corner." "And what were the prescriptions for?" "Methadone and diazepam. It seemed odd to me that she would want such a quantity, but Dr. Strachan said it was all in order." Hamish walked out into the sunshine and made his way round the corner to the surgery. The waiting room was full, but he flashed his warrant card and demanded to see the doctor immediately. He was ushered in after a patient had left. Dr. Strachan rose to his feet and held out his hand. "Welcome. How can I help the police?" He was a small brown-haired man, somewhere, Hamish judged, in his forties. He had a square, pugnacious face. "The nurse Gloria Dainty received a great number of prescriptions from you for methadone and diazepam," said Hamish. The doctor studied his hands, which were large with thick fingers. "As part of her job. She needed the stuff for patients." Hamish loomed over him. "Rubbish," he said. "Before she went to Mr. Harrison, she had one patient and that was Miss Whittaker. Tell me what is going on or I will report you to the medical council." He buried his head in his hands and then looked up. "We had a brief fling," he said. "She wasn't a patient of mine and she came on to me strong. Then it was over, but the pharmacist phoned me to query prescriptions brought in by her. I called her and demanded an explanation. She said she had stolen a prescription pad from me but if I said anything, she would go to my wife and she had the photos to prove it. She had taken some photos on her phone when we were...er...fooling around. I couldn't bear the scandal. Officer, if this gets out, I'll lose my job, my wife, and my children." "I think I can keep quiet about it," said Hamish. "But if it becomes relevant to an investigation I'm on, then I'll need to say something." "Oh, God bless you," said the doctor, and he began to cry. So, thought Hamish, as he drove back north. That doesn't really get me any further. I knew already that Gloria was supplying Malky with drugs. If I report it, I'll get a row for not telling police headquarters that I was going to Strathbane. They'll arrest the doctor and maybe decide it was he who murdered Gloria. That's just the sort of thing Blair would do. It all goes back to Harrison and his damn will. That's the only reason for bumping off Andrew. As he climbed down from the Land Rover outside the station, Angela came to meet him. "That poodle is so sweet," she said. "Not a man's dog," said Hamish huffily. "Neither is Lugs," pointed out Angela. "I mean, Lugs is not a working dog, like a sheepdog. Have you ever thought that attitude is why you have so much trouble with women?" "What are you talking about?" "Gloria Dainty was a shallow gold digger. But you never saw that; neither did any of the other men in the village. All you saw was the blonde hair and the sexy outfit. Until you learn to look below the surface, you'll never get married. There's some ordinary-looking woman out there with a good heart and you wouldn't even give her a second look. That's why you keep missing out." Hamish stared at her. Angela, with her gentle face and wispy hair, did not turn heads and yet Hamish had always thought the doctor fortunate in his choice of wife. But there was something in what she said. Something he had missed. "I wonder," he said. "I just wonder." He turned abruptly on his heel and marched into the police station. The poodle jumped up and down in welcome and Lugs rattled his food bowl. Still turning over what Angela had said, Hamish fried up venison liver for the dogs. He waited until the meat had cooled, chopped it up, and put it down in their dishes. The kitchen door crashed open. Jimmy walked in, pulled out a kitchen chair, and sat down. "I deserve a dram, Hamish. What a carry-on! Herring goes off, threatening us all with the wrath of God, Blair shouts and bullies, Greta in tears, lawyer called, Blair charged with police harassment, and everyone screaming and cursing and yelling." Hamish poured him a dram of whisky. "And what did Helen Mackenzie have to say for herself?" "What? The boot-faced nurse? Why? She's the only one in the clear." "Harrison has gone round promising everyone money in his will, even the shepherd. What about Helen? How did he get her?" "You remember, when Gloria was murdered, he said he phoned for a replacement and they sent Helen." "I remember. I'd like to know more about Helen. She must have known Gloria. Jimmy, I've been warned off. Why not ask the agency if there was any friendship between Gloria and Helen?" "Not me. After today, I'm not taking the initiative in anything." After Jimmy had left, Hamish drove up to the hotel and went down to Charlie's apartment. He and the colonel were sitting by the fire. "I thought Charlie had time off," complained the colonel. Hamish ignored him. He told Charlie about his concern about Helen Mackenzie, Harrison's nurse whom they had never once suspected. Had the colonel not been such a fan of Poirot, he would have gone off in a huff. But instead he listened intently. "The trouble is, we're stuck," said Hamish. "We daren't show our faces in Strathbane now." To his surprise, the colonel said, "My wife is going to spend a week with friends in Helmsdale. What if I employed a nurse from the agency? Then I might be able to get all the gossip." "But you're as fit as a fiddle," said Charlie. "I can pretend to have had a fall." "That would be grand if you could do that," said Hamish. "Anything for Charlie," said the colonel, eyeing him coldly. The colonel went upstairs to phone. The agency said it would normally be difficult to find a nurse for only a week, but fortunately Nurse Betty Freeme was just between jobs and could attend immediately. She would bring the necessary papers with her. The colonel sat back at his desk, feeling excited. He could see all the suspects gathered in the library and he would say, "You did it!" Chapter Eleven Many a woman has a past, but I am told she has at least a dozen, and that they all fit. —Oscar Wilde Betty Freeme was a sturdy woman in her late twenties with ginger hair, freckles, and pale-blue eyes. She did wonder why the colonel needed a nurse. He asked to be pushed around in a wheelchair, but any suggestion of bathing him or putting him to bed was met with horror. At last, she decided he was lonely with his wife being away. He seemed to want to talk a lot. The colonel got her to talk about the agency and then asked if the late Gloria Dainty and Helen Mackenzie had been friends. "Oh, them!" laughed Betty. "I'd say they hated each other. They were all right for a bit. Both were working locally and got together on their nights off. Then Gloria started dating that chap Malky, the one who murdered her, and I saw them out in front of the agency one day shouting at each other, but I couldn't hear what they said." "And what did the police say when you told them this?" "They didn't ask me. It's just gossip anyway. I mean, Helen is one of the strict-type nurses, everything by the book. I couldn't ever understand her friendship with the likes of Gloria. Gloria was flighty. Goodness, it's not yet dark, sir. I'll just pull those curtains back." "Leave them!" shouted the colonel. "The light hurts my eyes. Ask one of the waiters to bring me a whisky and soda." Betty reached for the phone. "No," barked the colonel. "You'll lose the use of your legs. Get it from the bar." When she had gone, Charlie and Hamish emerged from behind the curtains. "Ask her if Helen has any family," said Hamish. "We need to find a lot more about her." Charlie and Hamish retired behind the curtains as Betty returned with the drink. "The reason for all these questions," said the colonel, "is because I am a friend of Mr. Harrison and he is in a terrible state over the killing of his son. I trust this Helen will look after him?" "She's highly qualified, I believe," said Betty. "Got family in Scotland?" "I remember she said she was an orphan, but she sometimes took time off to visit her aunt in Kinlochbervie." "What is the aunt's name?" "I forget. But the aunt was her father's sister and hadn't married, so she'd be a Miss Mackenzie." "I might take a run up there tomorrow," said the colonel. "I really am concerned for Mr. Harrison's welfare." "You could ask the agency for her details," said Betty. "No, no. I couldn't do that. Run along now. I'll ring if I need you." When she had gone and Hamish and Charlie had emerged from their hiding place, the colonel said excitedly, "Kinlochbervie! Now there's a coincidence. I'll go up there and—" "No!" exclaimed Hamish. "If by any chance Helen should turn out to be a killer, you'll be next. Leave it to me and Charlie." "Please, George," begged Charlie. "It could be awfy dangerous. Hamish and I will go up there." After they had left, the colonel sat in his wheelchair, feeling frustrated. He had this rosy dream of unmasking the killer. He had to move quickly before his wife came back to demand what he was doing in a wheelchair. Then he hit on it. There was nothing to stop him paying a visit to old Harrison. He would get Betty to drive him over. Harrison would surely be sympathetic to what he would see as a fellow sufferer. And he could have a chance to examine Helen closely. He rang the bell. On the road to Kinlochbervie, Hamish and Charlie discussed how they should approach the aunt. "We don't want to alert Helen," said Hamish. "We could say there's been a report of a couple of burglaries," said Charlie, "and we're just going from door to door." "Aye, that might just do," said Hamish. "I hope your friend George leaves things alone." "Nothing he can do," said Charlie. "We're on the only lead." By asking around, they finally located Miss Mackenzie's home. It was a small bungalow, a box of a place, on the outskirts of the village. There were no flowers in the garden fronting the house, only two squares of grass intersected with a brick path. Hamish tucked his cap under his arms and rang the bell. A tall, gaunt woman answered the door, leaning on two sticks. Hamish introduced them and explained about the fictitious burglaries. "The first I've heard of it," she said. "But come ben. I've just put the kettle on and I never have much company." She led the way into a sunny front room. A comfortable old sofa and chairs flanked a low coffee table. In one corner was an old-fashioned television set and in another a set of shelves crammed with paperbacks. "I'll get the tea," she said. "Sit down." "I'll help," said Charlie. "I can manage." When she had left the room, Hamish looked around. There were no photographs. Above the fireplace was a Russell Flint print. The carpet was beige and fitted. An arrangement of pinecones decorated the fireplace. Outside, the wind had risen and they could hear the noise of waves on the beach and the scream of the plunging and flying gulls. A newspaper pressed against the window as if staring in before being whipped away again by the wind. Miss Mackenzie came back in pushing a laden trolley, her two sticks lying on the bottom ledge. Charlie would have risen to help, but Hamish put a hand on his arm to stop him. He was frightened that clumsy Charlie might start breaking things. She handed them each a thin china cup decorated with roses. They waited patiently until she poured cups of tea and handed round a plate of scones before recovering her sticks and lowering herself into an armchair. "Arthritis?" asked Hamish sympathetically. "Bad today," she said. "My niece is a nurse and she was supposed to bring me some medicine." "Who would that be?" asked Hamish. "Helen. She's working for a man called Harrison down near Braikie." "That's where all those murders have been," said Hamish. "Aren't you worried about her?" "No, she's as tough as old boots. Turned out well, mind. I used to worry about her." "And why was that?" asked Charlie. "Oh, she was a bit o' a handful at one time. My poor brother and his wife were killed when their house went on fire and Helen was put out to foster parents. I wasn't considered suitable, being a maiden lady. Mind you, I had her here on holidays until...Well, never mind." "Lovely scones," said Charlie. "Light as a feather. Did she do something bad?" "It was odd. I had this cat, Tufty. I was right fond of it. Helen was only eight. I used to smoke. I had one of those Ronson lighters you fill with petrol. Helen was out in the garden one day. I looked out of the window. She poured petrol over the cat and set it alight. I couldn't believe my eyes. I sent her packing and told her never to call again. But she turned up last year and told me she was a qualified nurse, and she cried over Tufty and said she must have been jealous of my affection for the cat. After that, she called from time to time and brought me drugs for my arthritis." "Was an awful business about that poor second sight woman being killed," said Charlie. "Oh, poor Jessie McGowan. Never harmed a soul. Now, what about these burglaries?" Hamish gave her a fictitious story. "It's drugs," said Miss Mackenzie when he had finished. "The pushers are always looking for new markets." "Did you ever consult Miss McGowan yourself?" asked Hamish. "No, the poor woman was mad. Helen believed in that rubbish." They thanked her and went outside and drove out of town to the café on the beach where Hamish let the dogs out to play. He watched them sadly. He could not banish the hope that one day, he would look up and see Sonsie playing with them. They ordered coffee and sat looking at the glassy waves curling on the beach. "What about this," said Hamish. "Maybe Malky was romancing the two of them to get drugs. But he drops Helen for Gloria because he's thought up this scheme with Gloria of trying to get old Harrison to leave her money in his will, or even to marry her. Helen set that cat on fire. Psychos often start off with killing animals. She gets Gloria out of the way. Then she hears about the witness in Kinlochbervie and gives her a present of wine laced with antifreeze. "Now, we know Harrison is an old scunner. He treats everyone like dirt. But he's led Helen to believe that she'll get something in his will. Then she finds out it all goes to Andrew. So out goes Andrew. Harrison will be a shattered man and might begin to cling to her. But surely she must come under suspicion. Now that your friend George has done his bit, I hope he keeps out of it." "Oh, he'll be all right. What can we do now?" asked Charlie. "We wait until the dust settles and keep an eye on the lodge until, say, next Sunday when Helen gets her day off, and see where she goes and try to have a word with her." "Got a name for the poodle yet?" "Cannae think o' anything," said Hamish. "What about Bella? Pretty wee thing." "I'll think about it." Betty Freeme heaved a sigh of relief as she turned into the drive leading to the hunting lodge. The colonel had criticised her driving every few yards. She pulled up in front of the house, glad the journey was over. Juris answered the door and to the colonel's request said that Mr. Harrison was not seeing anyone. The colonel handed over his card. "He'll see me," he said. "Hop to it." They waited in the hall. Betty wished they could leave. The hall was as dark as usual with only glimmers of light shining on the glass eyes of the stuffed animals. The wind moaned around the building like a banshee. Juris came back. "He can give you a few moments," he said. Betty seized the handles of the wheelchair and pushed the colonel towards the drawing room. Mr. Harrison was seated by the French windows, staring out. Helen was standing on guard behind him. "Colonel Halburton-Smythe," announced Juris. Harrison slowly turned round. "What's up with you?" "Strained my back," said the colonel. "I'm sorry for your loss." "Well, well," said Mr. Harrison, his old eyes bleak. "He wasn't much of a son but he was all I had and now he's gone. I wish I'd never come to this cursed place. As soon as the coppers are finished, I'm selling up and going back to Yorkshire. I should never have left." "Will you be taking your staff back with you?" asked the colonel. "Probably not. I'll always wonder if it was one of them who killed my poor son. Helen, make yourself useful and get me a whisky and soda." The colonel studied Helen, but her face was like mask. "Is there anything I can do to help?" asked the colonel. "Perhaps you might like to stay at the hotel as my guest? Change of scene and all that." "I'll think about it," said Mr. Harrison fretfully. Helen handed him a whisky and soda and he took a great gulp. "That's better. I'll never know what came over Andrew." "What did he do?" "He was trying to get power of attorney. Said I was past it. I told him I'd see him in hell first. Mind you, I blame Greta. Always plotting and scheming to get my money." Juris came in. "The police are back again, sir." "Oh, God, will this never end? Sorry, Colonel, but I might take you up on that offer." "Anytime," said the colonel. "You are lucky to have such an efficient nurse." "Oh, Helen's all right. Only one around here I trust." To Betty's surprise, when they arrived back at the hotel, the colonel told her he did not need her services any longer. He assured her she would be paid for the whole week. When Charlie and Hamish joined him later, the colonel was bursting with ideas. Hamish was, however, alarmed. "You're putting yourself in danger," he said. "If Harrison accepts your invitation, then Helen will come to the hotel with him. Then there is Harrison himself. He can walk. Andrew trying to get power of attorney might have turned his brain and the wretched Helen might be his accomplice. Let's hope he doesn't turn up." The following Sunday was one of those grey days in the Highlands when all colour seemed to have been bleached out of the landscape. All was silent except for the occasional mournful call of a curlew. Hamish and Charlie in plainclothes, and with Charlie at the wheel of his old car, lay off the road near the hunting box and waited. At last, they saw a small Ford with Helen at the wheel driving past. She did not notice them. They gave her plenty of time to get ahead and then set off in pursuit. She drove steadily on and took the road to Strathbane. Fortunately, there were one or two cars on the road and Charlie hung well back. "I wonder if she's going to the agency," said Hamish. "Why?" "She might want to get in touch with Betty and find out all about the colonel." "Let's hope not," said Charlie. They followed Helen to the agency, parking carefully round the corner. "We'll watch until she leaves," said Hamish, "and then go in and see if we can find out what she was trying to find out." He peered round the corner, but after only a few moments, he said, "She's out again. There's a truck coming along. Tuck in behind it, Charlie, so she doesn't see us." After a few streets, the truck turned off, leaving them feeling exposed. Charlie hung back before setting off again in pursuit. Finally Helen stopped outside a large villa on the outskirts. Again, Charlie parked around a corner. Hamish got out to discreetly watch the villa. Helen was inside for a quarter of an hour before coming out again and getting in her car. "Right," said Hamish. "Let's go in and see if Betty is working there." It was Betty herself who answered the door. She looked at them in surprise as Hamish produced his warrant card and said they would like to speak to her. "Only a few minutes," said Betty. "I've just started work here and my gentleman will be wanting tea soon." She led them into a gloomy Victorian front parlour dominated by a large stuffed owl in a glass case. The room was cold and damp. "We wondered why Helen Mackenzie called on you," said Hamish. "I'd been working for Colonel Halburton-Smythe," said Betty. "Helen said she was tired of Mr. Harrison and wondered if the colonel would be needing a new nurse. I told her there seemed to be nothing up with him and he was all right now. She asked if the colonel had been curious about the murders and I told her everyone was. That's all. I've really got to go." Hamish begged her to say nothing about their enquiries, and he and Charlie took their leave. "I don't like this at all," said Hamish. "We've got to keep an eye on the colonel." They went back to Lochdubh and straight to the hotel to find the colonel triumphant with news. Mr. Harrison had phoned him and had decided to accept the colonel's invitation to stay at the hotel. "That nurse Helen had been asking questions about you," said Hamish. "She may not hesitate to murder again." "Pooh! Charlie will look after me," said the colonel. But Hamish fretted. "There's so many ways she could get at you. Poison, a blow on the head, anything." Mr. Harrison was allocated one of the large rooms on the ground floor. Its barred windows looked out over the back. Hamish saw that there were several laurel bushes outside the windows and decided to watch and see what happened when Helen was alone with her patient. If only, he thought, they had enough on her to get a search warrant. And yet her room at the hunting lodge had been searched twice along with all the other rooms. He and Charlie were told they could have dinner that evening, but at another table. To Hamish's dismay, he heard the colonel moving into Poirot mode and beginning to question Harrison and Helen all about the murders. They were on first-name terms, but at last Harrison seemed to weary of all the questions and said sharply, "Look, George. I am still mourning the death of my son. I don't want to talk about it." The colonel reluctantly dropped the subject. Helen did not contribute to the conversation. When Harrison retired for the night, Hamish went out to take up his post outside the bedroom window. It had begun to rain, steady drenching rain, pattering down on the laurel leaves and dripping down the back of his neck. To his dismay, thick curtains had been drawn across the windows. He pressed his ear to the glass. "I think you would be more comfortable in your own home," he heard Helen say. "Nonsense," came Harrison's voice. "The food's great here and I need a change of scene. Leave me. I'm tired of your fussing around." "Now, then. What would you do without your Helen?" "Find another nurse. Like taxis in a rank." "Now, aren't we cruel? You said you loved your Helen." "Oh, shove off. I want to be on my own. I wish George would stop playing detective. I believe he thinks you're a murderer, Helen. What do you think of that?" "I could sue him." "You wouldn't get very far. He suspects everyone." The days dragged by. Harrison finally took his leave. Nothing sinister had happened. A FOR SALE board was now outside the hunting lodge. The days were sunny, just the sort of weather that Hamish usually enjoyed. But the dark shadow of unsolved murders plagued him. He was sure Helen Mackenzie was a ruthless murderer. Charlie and the colonel were sitting one evening in Charlie's apartment when the colonel said, "I feel Percy Harrison should really be warned about that nurse." "We've no real proof," said Charlie. "Helen's got an aunt in Kinlochbervie. The second sight woman was killed there. She and Gloria were both dating Malky, we think, and no doubt supplying him with drugs, but we've no proof. We've proof Gloria was doing it but nothing on Helen. We think Helen bumped off Gloria so she could get her job and maybe woo Harrison herself, but she looks like the back of a bus. So surely no hope there." "I think I should give him a clear warning," said the colonel. Hamish came clattering in wearing his big boots. The colonel looked at him crossly. He didn't like Hamish interrupting his cosy evenings with Charlie. "George is thinking of giving Harrison a clear warning about Helen," said Charlie. "Is Greta still in residence?" asked Hamish. "I believe she went south after the funeral," said the colonel. "You surely don't suspect her?" "I think it's all about money," said Hamish. "If Harrison dies, then surely Greta inherits." "Maybe not." The colonel brightened. "I could just ask him who he's leaving his money to now." "Oh, keep out of it," said Hamish wearily. "I am not taking orders from some useless copper who had the damn cheek to jilt my daughter," raged the colonel. He got to his feet and stomped off up the stairs. The colonel set out for the hunting lodge the next day. He asked Harrison to dismiss Helen, saying he wanted to talk to him in private about a serious matter. The day was sunny and warm and the long windows were open onto the terrace. "It's like this, Percy," began the colonel, and he plunged into a long story about why he suspected Helen of being a murderer. He ended up by saying, "If I were you, I'd put it about you haven't signed a will. That should keep you safe." "I'm leaving Helen money in my will," said Harrison. "And I'm taking her to Yorkshire with me." "Why? You could get any amount of nurses." Harrison grinned. "I'm telling you, Percy, Helen does the best hand job in the Highlands." "Is that a type of massage?" asked the colonel. Harrison rocked with laughter and then told him in graphic detail exactly what a hand job was. The colonel turned bright scarlet. "I've got to go," he said hurriedly. He fled from the hunting lodge, followed by the cackle of Harrison's laughter. The colonel did a detour to the florist's in Braikie and bought his wife a dozen red roses, thanking God for his clean life and a decent wife. Charlie called in at the police station that evening to tell Hamish about the colonel's adventure. When he had finished, Hamish sighed. "I'm sick o' the whole business. Let her bump him off in Yorkshire and let the police down there sort it out." "Not like you, Hamish. When did you last have a holiday?" "Can't quite remember. I don't usually bother when things are quiet like this. Slope around. Take things easy. Heard anything of Fiona?" "Not a word." "Jimmy's not come near me, either. I mean, surely they must know now it couldn't have been Malky. But the way I see it, they got such a bruising in the press that the last thing they want is to open up that can o' worms again." "We could be looking in the wrong place," said Charlie. "Could ha' been Juris or Greta." "No, it all points to Helen. Damn! I cannae leave it alone. Do you know what I'm going to do? I'm going up there and I'm going to tell Helen I think she committed the murders." "She'll report you to Strathbane. She'll sue you. You'll lose your job." "So what? I cannae go on in the job wi' this hanging over me. Something's got to break." "I'll come with you." "No. One of us in trouble is enough. Take the dogs with you for the day." Hamish set out for the hunting lodge. He could feel his fury against Helen mounting. He found Harrison and Helen in the drawing room and told Harrison sharply that he had called on police business and wanted to see Helen Mackenzie alone. Mr. Harrison protested, but Helen said she was sure it would only take a few moments. Harrison shrugged and wheeled himself out of the room. Helen sat primly on the edge of an armchair and Hamish pulled up a hard chair and sat opposite her. Helen's eyes were flat and cold and betrayed neither interest nor curiosity. Hamish began. "I know you murdered Gloria Dainty, Jessie McGowan, and Andrew Harrison. Maybe you killed Willie Dunne as well. You killed Gloria to get her job so that you could seduce Harrison into either marrying you or leaving you money in his will. When you learned he had left it all to Andrew, then Andrew had to go. If that old fool Harrison does make out a will leaving money to you, he will be next. Here's what I have found out so far." As he talked, she sat there, unmoving, her reddened hands folded on her uniform lap. When he had finished, she stood up and said coldly, "I am going to report you to your superiors." "Please do," said Hamish, "and tell them exactly what I have said." "And I am going to sue you." "Grand. The newspapers will have a field day. Hear this: I'll be watching you every step o' the way." Hamish turned and left the room. As he got to the front door of the hall, he had a feeling of being watched. He swung round but could see no one in the shadows. He suddenly felt lighter and freer. He had burnt his boats. Now let's see what she will do. Two days later, Hamish received a call from Juris. "The nurse has disappeared," he said. "All her stuff is in her room, but she's gone." "I'll get over there," said Hamish. He called Charlie. Then he phoned Jimmy and explained what had happened. "I can't say anything about confronting her," said Hamish as they sped off. "I'll be hauled over the coals. Damn! Did she run for it? But why leave her belongings behind?" As if to suit his mood, black rain clouds were being driven in from the west on a rising gale. The gamekeeper was on guard at the gates to keep the press at bay. How did they find out so soon? wondered Hamish. A small huddle of men stood in the now driving rain. Juris let them in. "We'll interview you after we've seen her room," said Hamish. "We cannae go in because we'll need to leave it clear for forensics, but we can stand at the door and look in." They followed Juris up the shadowy stone staircase. Outside the wind had risen to an eldritch scream. Lightning flickered across the glass eyes of the stuffed animals, and then came a great roll of thunder. Juris went on up to the second floor and pushed open a stout oak door. Hamish peered in. He put a handkerchief over his hand and switched on the light. Not much had been changed since the days when it had probably housed a governess. There was a single brass bed against the wall with a side table, holding a Bible. By the opposite wall was a toilet table with an old-fashioned ewer and basin. No wash hand basin with running water. Beside it stood a large Victorian wardrobe, the door standing open to reveal coats, dresses, and skirts. There were no books or pictures. The mullioned windows let in very little light. "Right, Juris," said Hamish. "We'll go down to the study and start the questioning." But as they descended the staircase, there came a pounding at the door. Juris hurried to open it. Blair, Jimmy, several policemen, and a forensic team crowded in. "We'll take over," said Blair. "There's enough o' us here. You pair, get back to your station." Hamish and Charlie climbed into the Land Rover. Hamish stared moodily out at the pouring rain. "This is all wrong," he said. "Why should she leave her belongings behind? I didn't see a handbag in that room. Maybe she took her money and cards and left. Let's go to the garage. I want to see if her car is there." He reached into the back for his oilskins and shrugged into them before getting out into the storm. Followed by Charlie, he made his way to the garages, which had been converted from the old stables. Hamish swung open the door and went into the musty interior, smelling of petrol, oil, and dust. "That's her car," said Hamish. He took out a pair of latex gloves and slipped them on. The car was not locked. He flipped open the glove compartment. Nothing but a roll of peppermints. He opened the boot. It was clean and empty. He studied the tyres. There was no sign that the car had been driven recently. In fact, the car looked as if it had been recently washed, inside and out. "Now, did she get it washed herself or did someone else? Where's the nearest car wash, Charlie?" "Nothing till you get to Strathbane," said Charlie. "Fine Foods supermarket on the outskirts." "Let's try there," said Hamish. The whole of the Highlands seemed to be in motion as they drove south to Strathbane. Lightning stabbed down and thunder rolled. At one point, their way was blocked by a fallen tree and they had to bump over the moor to get round the blockage. As they neared Strathbane, the sky began to clear to the west, and by the time they drove into the supermarket car park a watery sun was shining down. The manager said they did not take a note of car registrations at the car wash, only entered the type of cleaning required in the books. The cars were all washed by hand by a gang of Eastern Europeans. Hamish asked to see the security tapes for the past two days. He and Charlie settled down in the manager's office to go through them. But after hours of searching, there was no sign of Helen's car. Charlie scratched his head. "You seem to be thinking something nasty happened to her," he said. "But she's the main suspect." "It's the way she left," fretted Hamish. "Leaving it all behind, even her car. And why was that car so clean inside and out? Is there any other car wash?" "Not that I know of," said Charlie. "There'll be one in Inverness." "Too far. It would show some signs of mud by the time it was brought back." "Couldn't she just have asked Juris to clean it for her?" Hamish phoned the hunting box. When Juris answered, he asked him if he had cleaned the nurse's car and was told firmly that he had not. "It is not my job to work for the help," said Juris with all the haughtiness of a stage butler. "Let's get something to eat," said Hamish. "I'm starving and I cannae think on an empty stomach." They found a café which sold all-day breakfasts and tucked into fried haggis, black pudding, eggs, bacon, tomatoes, and mushrooms. "Think the dogs will be all right?" asked Charlie. "They'll be fine," said Hamish. "I left them dog food but Lugs has probably introduced the poodle to the delights of the Italian restaurant's kitchen. Now let's think. Just suppose Helen has been murdered. Let's try that one. Who would murder her and where would they dump the body?" "Well," said Charlie slowly, "the only one who might have it in for Helen is Greta. What if she found out that Harrison had changed his will in Helen's favour?" Hamish phoned Juris again. When he had rung off, he said, "Greta is in residence. Harrison has refused another nurse and says Greta will look after him. She's been there for the last week and she's a powerful woman. Maybe she guessed Helen had bumped off her husband and took her revenge. I hate being out o' the loop. It's like detecting in Victorian times, Charlie. They could have found all sort of hairs and DNA and we don't know about it." "If you wait until this evening when all the reports are in," said Charlie, "I could try my hand at hacking into Blair's report and the forensic reports." "So for now let's try to figure out where Helen's body could have been dumped," said Hamish. "That car bothers me. So clean. Let's try this way. Someone kills Helen and uses her car to dump the body. It's a wee Ford, not a four-by-four, so no use for going over the moors. So the body would need to be dumped near a road. And whoever would not want to be away from the hunting lodge for too long." "That drug business bothers me," said Charlie. "I mean, say she was in some drug racket, then someone from Strathbane could have got rid of her." "Maybe, but would they use her car and then get it cleaned? Let's get back up there and start searching." They drove back to outside the hunting lodge. "Right or left, I wonder," said Hamish. "Let's try left," said Charlie. "The instinct would be to veer left away from the road to Braikie." The days had drawn out and they knew the evenings would be light and that they had plenty of time for their search. But they could find no trace of anything. "Let's call on Dick," said Hamish. "He might have some ideas." Dick gave them a warm welcome, but to Hamish's disappointment, the beautiful Anka said she had orders on the computer to work on and left them to it. Over excellent mugs of coffee and scones, Hamish told Dick all he knew. "There's a car wash here now," said Dick. "At that wee garage. Couple o' Poles. You could try there. Do me a favour. At the bottom of the stairs, there's a big bag o' cans. Could you dump them at the recycling unit? You know where it is, Hamish. Out on the Lochdubh road before you get to the new seawall." They thanked him for the coffee and made their way to the garage. But it was shut up for the night and no one around could tell them where the Poles lived. "I'm weary," said Hamish. "Let's get rid o' Dick's rubbish and start again tomorrow." The recycling unit was considered a disgrace because it was rarely cleared. Great mounds of cans, bottles, and newspapers reared up against the evening sky. Seagulls swooped and dived. Two seagulls fought over a hamburger wrapper. Silly birds, thought Hamish. No food there. He dumped the sack of cans on top of a pile of others. A seagull shat on his regulation sweater and he shook his fist at it. He made to turn away. Something was bothering him although it was hard to think with all the noise of the waves crashing on the shore and the wheeling, screaming birds. He turned slowly round, looking to right and left. A supermarket trolley had been dumped at the far end of the unit. It was overflowing with cans and plastic bottles. Nothing sinister there apart from one black shoe. Hamish unhitched his torch from his belt and walked forward. One black regulation shoe. He began to claw at the cans and bottles, sending them flying. Stuffed in the very bottom of the trolley was the dead body of Helen Mackenzie. Her empty eye sockets stared up at him. The seagulls had had her eyes. Chapter Twelve How often have I said to you that when you have eliminated the impossible, whatever remains, _however improbable_ , must be the truth. —Sir Arthur Conan Doyle Blair was furious. Had Daviot not been on the scene, he would have suspended Hamish from duty for destroying valuable evidence by throwing the cans and bottles which had covered the body all over the place. "Why is it," Daviot asked Jimmy, "that one highland policeman can find out what we have missed?" "Maybe it's old-fashioned policing," said Jimmy. "Hamish doesn't have any of the benefits of forensic science and so he has to use his brain." A crowd had gathered outside the recycling unit, their faces avid with curiosity in the lights of the halogen lamps which had been erected. Helen's body and the supermarket trolley were now shielded inside a tent. "She's been strangled," whispered Hamish to Charlie. "Bruises on her neck and her poor face black. I wish these seagulls would go away. I hate them." "I think they'll be here when we're all gone," said Charlie. "I mean, that's the creepy thing about Sutherland when you're out on your own under the stars. You feel like an intruder. But the birds belong." Jimmy came up and demanded a full report. He listened carefully to Hamish's story about the car. "Get back into Braikie," he ordered, "and see if you can find where that garage owner lives and then find those Poles." They found the garage owner lived in the bottom half of a house near the garage. He was sleepy and cross at being woken up, but he volunteered that the Poles lived in a bed-and-breakfast at the back of the garage. The door of the B&B was opened by a small woman wrapped in a tatty dressing gown and with her hair in rollers. The minute she saw their uniforms, she began to shriek that she kept a respectable house. Charlie told her in a soothing voice that they simply wanted to speak to her Polish residents. "First floor left," she said sulkily. They made their way past her and up the stairs. The car washers turned out to be two brothers. They were not Polish but Lithuanian and their English was not very good. But with patient questioning and showing them a photo of Helen's car, which Hamish had snapped on his phone, they volunteered that a man had driven it in two days ago. They described him as being tall and dark and dressed in jeans and a T-shirt. He had been wearing a baseball cap pulled down over his eyes. "That doesn't sound like anyone we've come across so far," said Charlie gloomily as they left. "We'll need to come back in the morning," said Hamish, "and ask all around." He reported back to Jimmy, who told him to write up what he'd got and see if he could find out anything else. Blair was holding an impromptu press conference, swollen up with ego like a bullfrog until a reporter asked him what Strathbane thought about the mistake in pinning the murders on Malky, upon which Blair abruptly stalked to his car and got driven off. In the morning, Charlie arrived with the news that Mr. Harrison had phoned and wanted to book himself and his daughter-in-law into the hotel. He said he was weary of what seemed like a constant police presence. "George has said he'll try to get as much information out of him as possible," said Charlie. "Let's hope the colonel is careful. If our murderer comes for Harrison, he might take out the colonel as well. You'd better nursemaid them, Charlie, and I'll cover for you. I'll get back up to Braikie and see if I can find out more about our mysterious car cleaner." Before he left, Hamish took the dogs for a walk. He met the Currie sisters and, remembering how rude he had been to them, blurted out an apology. "What you need is a good woman," said Nessie. "Good woman," echoed Jessie. Hamish touched his cap and hurried on. Nessie scampered after him. "There's the widow Banks up at the churchyard at the grave of her wee boy what died of meningitis. She would make a man a good wife. Rosie Banks needs to move on." Hamish looked across at the churchyard where a woman was slumped in front of a gravestone. "I'll maybe have a word with her later," he said, and made his escape. He had taken photographs of everyone at the hunting box on his iPad. He set out for Braikie. The landscape was glittering from the recent rain. He glanced up at the mountains, steel grey against the washed-out sky, noticing every gully and crag sharply defined, and knew that was a sign of more rain to come. He had not taken his pets with him. Since the loss of Sonsie, he did not feel the need for their constant company. He often thought about Sonsie and mourned the loss of his big cat. He went straight to the car wash and showed the photographs to the two Lithuanians. They studied them closely and then one of them pointed to the photo of Juris. "Maybe," he said. "Was he Eastern European like you?" asked Hamish. They said he hadn't spoken, merely handed over a piece of paper asking that the car be cleaned inside and out. "Anything odd about the inside?" asked Hamish. "Bloodstains? Signs of violence?" They looked at him, puzzled. Hamish went to the translation app on his iPad, typed in a series of questions, got them translated into Lithuanian, and passed them over. They typed back that the boot had been muddy. Nothing in the car but a scarf. What had they done with the scarf? Handed it over when the man came back for the car. What did the scarf look like? Paisley pattern. Hamish wondered how he could get Juris on his own. Police would still be combing the hunting box for clues. Then he remembered that Juris always answered the phone. He rang him up and said he wanted to talk to him away from the house and suggested Juris drive to a pub called the Drop Inn in Braikie. The pub was thin of customers. A brewery had tried to encourage more customers by turning it into a gastropub, but it seems the hard drinkers of Braikie preferred the dinginess of the Red Lion. He took a table by the window and waited. He was just beginning to think Juris would not come when he saw him parking outside. Juris joined him and asked abruptly, "What's up?" "You know Helen's body has been found?" Juris nodded. "Do you mind if I have a beer?" he asked. Hamish went to the bar and got him a pint. He stared straight at Juris and said, "Why did you have Helen's car cleaned?" He expected a hot denial but Juris said calmly, "It's my job." "What!" "Look, Mr. Harrison has a mania about clean cars. That includes Helen's. I protested before that I wasn't there to be a servant to a nurse and he told me to obey orders. It was my job. So I check the garages as usual and there's her wee car covered from top to toe in mud. So I took it to the car wash. Got a receipt and put it down on my expenses." "When did you find the car?" "It was the morning before we found she'd disappeared." "And did you report this to the police?" "It's like this. That man, Blair, is out to pin it on me because I'm a foreigner in his eyes. If I told him, he would have dragged me off. You know he would. That's why I lied to you and told you I hadn't had the car cleaned." "You could be accused of tampering with evidence," said Hamish. "I was only doing my job as usual," said Juris stubbornly. "Describe the car." "Like I said, it was top-to-bottom in mud. Helen was a bit of a slob and the inside was full of sweetie wrappers and old beer cans. I looked in the boot and it was all muddy." "There was a scarf. Do you have it?" "It's in my car." "I'll need that. I'm sorry, Juris, but you're in for a rough time. I'm afraid I'll need to call Strathbane. That could have been the scarf that strangled her. I'll try to get Jimmy Anderson to deal with it." After Hamish had called Jimmy, he was told not to let Juris out of his sight. He, Jimmy, would take Juris in for questioning. Jimmy eventually arrived with two police cars following. Is he really innocent? wondered Hamish. Or am I leaning backwards against Blair's hatred of foreigners? There seemed to be nothing else to do but go back to Lochdubh, look over his notes, and hope there might be just something he had missed. As he drove along the waterfront, a thin drizzle was beginning to fall. He saw that Mrs. Banks was still in the graveyard. He stopped his vehicle and got out. He walked up to her and said gently, "You'll get soaked. Come away, lassie. There's nothing you can do now but move on." She was a plump little woman in her thirties with rosy cheeks, cheeks that were now blotched with tears. She had lost her husband to cancer and then immediately afterwards, her six-year-old to meningitis. Hamish helped her up. "You need bereavement counselling," he said. "Go and see Dr. Brodie and he'll fix you up. Would your husband and boy want you to live like this?" She scrubbed her eyes with the back of her hand and sighed. "I almost envy folk whose bairns are murdered." "Why?" "Because when the murderer is caught and punished, that's closure." "I think that's a television fiction," said Hamish sadly. "If it's a child, there is no closure. Just courage. I'll walk you to the doctor's now." After he had delivered her to Dr. Brodie, he walked through the rain and up to a hill overlooking Lochdubh to where his first dog, Towser, was buried. He sat down on the wet heather and stared at the simple cross that marked the dog's grave. How he had grieved over the loss of Towser! How he had sworn never to have another pet. But Archie had given him Lugs and then the vet had given him Sonsie. Hamish sat there for a long time until he realised he was soaking wet. He made his way back to the station and changed into civilian clothes. A seed of an idea was beginning to take place in his brain. It was far-fetched. It was outrageous. But somehow, it fit. He phoned Charlie and said, "Call down here. I've an idea and I need your help." The colonel was sitting with his wife, Mr. Harrison, and Greta when Hamish arrived with Charlie. "We would like a word in private with Mr. Harrison," said Hamish. "May we use the manager's office?" "You can't walk in here and order me around," said the colonel. "Please, George," said Charlie quietly. "It's important." "Oh, very well. Push me along, Greta." "It's all right. I can manage," said Hamish, seizing the wheelchair. The office was lit with a shaded green lamp on the desk. Hamish took out a powerful tape recorder and laid it down on the desk. "What's up with you?" snarled Harrison. "Mr. Percy Harrison," said Hamish. "I am charging you with the wilful murder of Helen Mackenzie." "Why on earth would I kill the bitch?" "Grief," said Hamish. "She killed your son. You overheard me accusing her of the murder of Andrew and of Gloria and Miss McGowan. Andrew was your only son. Somehow, you shook a confession out of her and then you strangled her. You can walk. I know that. I saw you once. You're a powerful man. You waited until the middle of the night, maybe slung the dead body over your knees in the wheelchair, and took the body out to her car and dumped it in the boot. You had strangled her with her scarf. You took the body to the dump, shoved it in an old trolley, and piled the trolley up with cans and bottles. You put the car back, knowing Juris would find it and clean it. You hated her so much, you didn't even bother to hide anything. You could have cleared out her room and made it look as if she had fled. "But you had murdered her and got your revenge and that was all you wanted." "You gormless idiot," roared Harrison. "What proof do you have?" "Your DNA is on the scarf that strangled her," lied Hamish. He knew it would take ages for any results to come in. "Forensics took the DNA of everyone at the hunting box ages ago." Harrison sat for a long time, staring at the lamp on the desk as if hypnotised. Then he said, "Yes, I did hear you. Andrew might be pompous but he was my son. I told Helen to wheel me over to the garage because I wanted to look for something. Then I got her by the throat. I said if she confessed, I would let her escape. If she said nothing, I would kill her. I took a gun and jammed it in her mouth until she nodded. She went on about how she thought I loved her. Rubbish. She said Gloria had always been scoring off her in the past and had taken her boyfriend away. One day, Gloria had called on her and shown her that diamond pendant I gave her. Helen wailed it just wasn't fair. She started pleading and babbling that she had done it all for me. That she had killed Gloria to protect me. I could have shot her then and there. But I put the gun in my pocket. I told her I would let her go if she came back into the house and typed out a confession. "It seemed to take hours with her breaking off to try to justify herself and begging and weeping. She was the one who sent that filthy anonymous letter so that my last memory of poor Gloria was shouting at her. At last she was finished and I got her to sign it. She even confessed to wearing the scarf with which she had strangled Gloria. I made her fetch it. "I stood behind her with the scarf around her neck and strangled her. It seemed right that she should die by the very scarf with which she killed my Gloria. I got into my wheelchair, slung her dead body over my knees, and went out to the garage. Why didn't I take one of my own cars? I didn't want to muck them with her filthy body. I crammed her in the boot. I had to break her legs with a tyre iron so that she would fit. "I was going to dump her on the moors but her wee car couldn't cope with going off-road, and then I remembered the recycling place and thought it fitting she should end up with all the other rubbish." He fell silent. "I will type out a statement for you to sign," said Hamish. "You will now be locked in your room until reinforcements arrive from Strathbane. Charlie, go ahead and search for that gun." "He won't find it," said Harrison. "I left it in the safe in the hunting box." To Hamish's relief, they made their way to Harrison's room without encountering anyone. Harrison gave Hamish the statement from Helen. Hamish locked him in, pocketed the key, then went back to the office and called Jimmy. The colonel wondered what was going on. He went to the office and peered through the glass panels. He could see Hamish and Charlie sitting there. He asked the night porter where Mr. Harrison was, and was told he was in his room. He knocked at the door and called, "Percy! Have you gone to bed?" There was a silence and then Harrison's voice came from just behind the door. "The door's locked," he said, "and I could murder a whisky and soda." "I'll have it open in a minute," called the colonel. "We use that room for friends. I keep a key under this big vase outside the door. People are always losing that key." He opened the door. "I'll get you a drink from the bar. Won't take a moment." The colonel felt that Hamish Macbeth was cutting him out from the investigation. He hurried to the bar and shouted for a whisky and soda. When he got back to Harrison's room, the door stood open but there was no sign of the old man. The colonel hurried to the office. "Do you know where Percy is?" he demanded. "He is locked in his room, waiting to be taken off to Strathbane," said Hamish. "What! Why?" "He has confessed to the murder of Helen Mackenzie and given me a statement from Helen Mackenzie where she states she was responsible for the other murders." "But I unlocked the door for him," wailed the colonel. Hamish and Charlie rushed out of the office. To their demands, the night porter said that Mr. Harrison in his wheelchair had gone out of the hotel. Percy Harrison bowled along the road towards Lochdubh in his wheelchair. It was a balmy night with a small moon riding high overhead. He reached the humpbacked bridge and stopped. The river was in full spate because of all the melting snow coming down from the mountains. The water roared and sparkled in the moonlight. He heaved himself out of his wheelchair, wincing as the pain from his back shot down through his legs. Gasping, he clung to the parapet. Far behind him, he heard the wail of sirens. He leaned over the parapet and gazed hypnotically down at the racing foaming water. As Hamish and Charlie rushed down to the bridge, Harrison gave his crippled body one monumental heave and plunged down into the river. He suddenly decided he did not want to die. There was no death penalty. He struggled and fought as the strong current sent him tumbling down into the loch and pulled his body under. Hamish ran down to the shore and stripped down to his underwear, wading into the loch. He began to swim towards where he had seen Harrison disappear. He dived and dived again, searching in the blackness until his fingers grabbed hold of cloth. He hauled the body of Harrison to the surface and dragged it ashore and set about trying to pump the water out of the man's lungs. But there was no sign of life. Harrison's eyes revealed no life at all, only the reflection of the stars above, causing a sort of false intelligence. Hamish Macbeth was in disgrace. He began to feel like the murderer himself as the accusations from Daviot and Jimmy went on and on. Hamish could only be thankful that no one had been able to find Blair. First Hamish was questioned at the hotel and then taken off to Strathbane with Charlie, where they were interrogated separately. Why was it, demanded Daviot, that two police officers locked up a confessed murderer and did not put a guard at the door? On and on it went, all night long, until Jimmy took pity on Hamish. "Look, sir," he said to Daviot, "the media are going to give you a lot of kudos for solving the case. There isn't going to be a court case so it's best to leave Macbeth out of it. Just say the case is solved and that you have a taped and written confession and don't say how you came by them." Daviot brightened. "Do you agree to that, Macbeth?" "Yes, sir." "Well, well, now. I may have been a bit hard on you." He turned to a police officer posted by the door. "I think we could do with some coffee here and some Tunnock's tea cakes." When the coffee and cakes arrived, Daviot continued. "So. Why on earth did you think of Harrison?" "Grief for a dead son," said Hamish. "I was sure Helen was the murderer and if Harrison thought she had murdered his son, he might take revenge." Hamish decided not to tell the superintendent about being overheard accusing Helen of the murders. "I am sure we would have forensic evidence eventually," said Daviot, who had such faith in DNA and forensics that he had quite forgotten that police were supposed to use their brains and intuition. Hamish and Charlie eventually returned to Lochdubh, agreeing to meet at the station at four in the afternoon when Daviot was to hold a press conference. Charlie went to the hotel and to his apartment, where he found an angry colonel waiting for him. The colonel's dreams of being Poirot had been shattered and he blamed Hamish for keeping him out of the investigation. "I don't blame you, Charlie," said the colonel. "You have to follow orders. But that lazy long drip of nothing deliberately kept all the investigation to himself." Charlie opened his mouth to say that Hamish was a police officer and the colonel had no standing whatsoever, but diplomatically remained silent to let, as he thought, the wee man get it out of his system. Hamish was chased along the waterfront by the press, who had gathered at the bridge when he drove up. He dived into the station and ignored the batterings on the door. He awoke later and shaved and dressed again. The press had given up, no doubt having gone to Strathbane for the press conference. Charlie arrived and they went into the living room and settled down to watch the conference on television. Daviot, tailored and barbered, was flanked on one side by Jimmy and on the other by a grinning, smirking Blair. He made a statement saying that Mr. Harrison before his suicide had confessed to the murder of Helen Mackenzie. Mr. Harrison had found out that Helen Mackenzie had murdered his son and so he had taken his revenge after forcing her to write a signed statement. Then came the questions. How had the police suddenly come to the conclusion that Mr. Harrison might have murdered his nurse? Daviot smoothed back his silvery hair. "We use our intuition," he said. "It is known as good old-fashioned policing." Blair pushed forward to the microphone. "I would like to say that all the credit for solving this difficult case is due to the efforts of Superintendent Daviot." " _Northern Times_ ," called a reporter. "Was Hamish Macbeth anything to do with it?" "Hamish Macbeth," said Daviot smoothly, "is merely one of our officers on the case. He is to be commended for trying to save Mr. Harrison. That is all. No more questions." "And that's that," said Hamish. "Well, at least there won't be any suggestions of promotion and moving me to Strathbane. Oh, damn, there's the door. Leave it. Probably some reporter." "Open this door immediately, Macbeth," called a peremptory female voice. "Oh, God. It's Fiona," said Charlie. Hamish went and opened the kitchen door. Fiona strode in. "What the hell has been going on?" she raged. "Did you precious pair not think to keep me in the loop?" "It's like this," said Hamish quietly. "There was no time to contact you in Inverness. It all happened so quickly. Sit down. Have a dram and I'll tell you all about it." Hamish poured three shots of whisky and then began to talk. Fiona listened carefully until he had finished. She said, "So because of your mistake in not guarding Harrison's hotel room door, you get no credit at all. That must rankle." "It doesn't," said Hamish. "If I keep a low profile, then it means I can keep my police station here." "I fail to understand an unambitious man," said Fiona. "Surely you, Charlie, don't want to be buried up here forever?" "Suits me fine, ma'am," said Charlie. "The pair of you are a waste of intelligence," said Fiona. "I'm off. Coming, Charlie?" "I've got stuff to type up," said Charlie, his normally pleasant face closed down like a shutter. Fiona stalked to the door and nearly tripped over the little poodle. "What a ridiculous dog," she said. "Got a name for it yet?" asked Charlie when the door had slammed behind Fiona. "Sally." "That's not French." "It's a British poodle," said Hamish. He bent down and stroked the dog's springy fur and thought of Sonsie with a sudden wrenching pang. He almost wished the wild cat had died to spare him the agony of constantly wondering how she was. An hour later, the kitchen door opened and Jimmy walked in. "I saw Old Iron Knickers driving away," he said. "Bet she was in a right taking." "Something like that," said Hamish. "So is everything quiet at Strathbane?" "Aye. Daviot has almost come to believe he's a genius. I see the whisky on the table. Don't worry. I'll help myself. The things that go on up here in peasantville! Murderous nurses. Old boys in wheelchairs who can walk. What next?" "Absolutely nothing, I hope," said Hamish. Epilogue I must down to the sea again, to the vagrant gypsy life, To the gull's way and the whale's way where the wind's like a whetted knife. —John Masefield The wrapping up of the murders seemed to take an immense amount of paperwork. At some point, Hamish Macbeth began to feel he would never, ever be able to return to his lazy life. But at last it was all over and he and Charlie spent long lazy sunny days on their vast beat or out in the loch, fishing. Down in Strathbane, Chief Detective Superintendent Blair dreamt of winkling Hamish out of his station. Then one day he thought he had found a glimmer of hope. Blair was sure there had been something going on between Fiona Herring and Carter. If only he could get proof, then Carter would be removed and it would be one crack at least in that lazy Macbeth's life. Opportunity finally came his way one night when he was driving home. The car in front of him, a Jaguar, was slewing across the road. He drove in front of it, forcing the driver to stop. From his gold Rolex to his Savile Row suit, the driver was just the sort of "posh git" who got up Blair's nose. He demanded his driving licence. The driver's name was Peter Tuck of London. He said he was booked into the Tommel Castle Hotel for a fishing holiday. Blair breathalysed him and found he was well over the limit. "Get out of your car. I am impounding it," ordered Blair. "You will come with me to headquarters, where you will be formally charged." Peter was a florid middle-aged man, his face covered in a sheen of sweat. He took out his wallet. "Maybe we can settle it here," he said. "Are you trying to bribe a police officer?" roared Blair. "Wouldn't dream of it, Ossifer," slurred Peter, putting his wallet away. Blair liked bullying. And bullying posh people was something he really enjoyed. Peter was locked up in the cells for the night to sober up and was told he would be up before the sheriff in the morning. During the night, Blair began to wonder if he could put this drunk to use. The man would be staying at the hotel. As a guest, he could talk to the staff and find out if there had been anything going on between Fiona and Charlie Carter. A sober and frightened Peter listened to Blair's suggestion. "If you do this for me," said Blair, "you can have your car and licence and we'll say no more about it." Peter readily agreed. Blair stared at him out of his piggy bloodshot eyes. "Talk to anyone about this arrangement," he said, "and I'll have ye. Get it?" "Yes, yes," said Peter. "Just get me out of here." By the time Peter had checked into the hotel and was settled in the bar with a large whisky, he began to look back on the adventure as a bad dream. The day was sunny. The luxury hotel soothed his rattled nerves. He would make this his one drink, get some fishing, and try to lead a healthy life. The fees for fishing on the Anstey were steep, but he was a rich man. But one drink led to another and by the time he got to the river, he was unsteady on his feet. Charlie, fishing downstream from Peter, looked along the sparkling peaty waters of the Anstey just in time to see Peter falling off the bank and into a salmon pool. He hurried along and pulled Peter out and dumped him on the bank. The smell of whisky coming off the man, thought Charlie, was polluting the very air. Charlie had the benefit of free fishing and the use of the hotel's Land Rover to get to the river. He heaved Peter up and, escorting him to the Land Rover, dumped him in the passenger seat, then drove back to the hotel. He found where Peter's room was and took him along. He stripped off his wet clothes and tossed them on the floor, got him into his pyjamas, and threw him on the bed. Charlie was turning to leave when a mobile phone on the bedside table began to ring. Charlie picked it up and stared down at the number on the screen. Strathbane! He decided to answer it. "This is Blair," snarled the familiar voice. "What have you found out?" Charlie was a good mimic. He put on an upper-class English voice and said, "I've only just got here." "You've had time enough, laddie," said Blair. "I want proof that the inspector was being bonked by Charlie Carter and I want it soonest or I'll have you." Charlie sat down on a chair beside the bed, his superstitious highland soul telling him that he would never, ever get away with that night with Fiona. He rose stiffly and went out into the hall and phoned Hamish, asking him to come quickly because Blair was on the warpath. Then Charlie went out into the car park and waited for Hamish to arrive. Hamish listened carefully to what Charlie had discovered. "Blast the man!" he said. "You'd better phone Fiona." "I cannae!" wailed Charlie. "Every time I look at her, I see her with no clothes on." "Some men have all the luck," said Hamish. "Phone her. She's got the clout to deal with this." Miserably, Charlie phoned Inverness and told Fiona that Blair was trying to find out about their affair through some drunk called Peter Tuck. He obviously had some hold on him. "The man's a chronic drunk," said Charlie. "Maybe Blair let him off on a charge in return for spying." "I'll see to it," said Fiona. "You'll hear from me later." Blair was glad it was a quiet day. He had enjoyed a liquid lunch and was leaning back in his chair with his feet on his desk, his hands folded over his paunch, his eyes slowly closing. His feet were suddenly swiped off the desk. He sat up, blinking his eyes, to see Daviot and Fiona looming over him. "My office. Now!" snapped Daviot. Blair climbed up the stairs to Daviot's office, terror gripping him. When they were seated, Fiona began. "There is a man called Peter Tuck, staying at the Tommel Castle Hotel, who has orders from you to find out if I had been having an affair with policeman Charlie Carter." "He must be fantasising," said Blair. "As if I waud do such a thing." "I have checked with the custody sergeant," said Fiona. "Last night you arrested this Mr. Tuck for being over the limit. He spent a night in the cells and was due in the sheriff's court this morning. The charges were dropped. His impounded car was returned to him and he was sent on his way. Why did you drop the charges?" "We're overburdened with petty cases and the court is overworked," said Blair sanctimoniously. "I made up my mind just to let him go." "Your Mr. Tuck got drunk and fell in the river. Charlie Carter rescued him and put him to bed. While he was passed out, his mobile rang. Charlie answered it and it was you, Blair, and under the impression you were speaking to Tuck, you ordered him to find out if I was having an affair with Carter. What have you to say before I drag your fat carcase to court?" "Oh, Inspector Herring," pleaded Daviot. "Think of the scandal. Blair, you are suspended from duty. Leave us." Charlie and Hamish waited and waited at the hotel until Fiona arrived in the late evening. "Blair has been suspended though he should have been sacked," she said. "But I want this whole business buried as soon as possible. If Blair gets vindictive, he may hire a private detective. Now let's see Mr. Tuck." Hamish was almost sorry for Peter as Fiona told him to pack up and leave for London or she would have him arrested on a number of charges. If he left immediately, no more would be said of the matter. Babbling his thanks, Peter packed as quickly as possible, settled his bill, and roared off. It was unfortunate that he stopped in a pub in Inverness to still his shaking nerves with several large drinks and even more unfortunate that he should buy a bottle of whisky for the car to refresh himself on his journey. It never really gets dark in the summer in the Highlands. Late in the evening, there is a sort of grey gloaming. It can trick the eyes, particularly the eyes of a very drunk man. South of Inverness, Peter was sure there was a woman in white standing in the middle of the road. He swerved violently and the Jaguar plunged off the road and rolled down and down, turning and turning and finally crashing into a great ice age boulder. Peter died in the crumpled wreck of his car. "And that, in its way, is murder," said Hamish Macbeth. "If Blair had booked him and kept his car impounded, this would never have happened. Did Fiona leave all right, Charlie? Why did she want to see you in private?" "Wanted to give me a proper goodbye," said Charlie, blushing to the roots of his hair. "But I couldnae. Herself was right angry. You haven't looked at your post." "It's all junk these days," said Hamish, flipping through it. "Oh, what's this?" He opened a stiff square envelope. Inside was an embossed card. It was an invitation to Dick and Anka's wedding. Hamish handed it to Charlie and said bitterly, "I never will understand women. Wee Dick and gorgeous Anka! How did he do it?" "Just being Dick," said Charlie. "He's sort of cosy." "I'm beginning to think there'll never be a lassie for me," said Hamish. When Charlie had left, Hamish sat turning the invitation over and over in his long fingers. Then he thought that he had never really seen beyond Anka's beauty. He leaned down and patted Lugs and then Sally for comfort. "I'm done wi' beauty," he told them. "If a gorgeous female turns up on my doorstep, I'll tell her to take a hike." He left the station and walked up to his favourite spot where the roaring Atlantic waves at the entrance to the loch pounded the cliffs. There was something mesmerising about the towering green-and-black waves, something about the noise and tumult which soothed his brain. Back at the police station, he was just about to make a cup of coffee when there came a knock at the kitchen door. He opened it. Christine Dalray, the forensic scientist, stood there, her attractive face lit up in a smile. She was wearing a pretty, floaty summer dress, quite short, revealing her long, long legs to advantage. "I'm back to sort out the mess in the lab at Strathbane," she said. "Do you know that despite the cleaning there was one hair lodged under the seat in Helen Mackenzie's car and the DNA was that of Harrison?" "No, I didnae know that," said Hamish. "What a waste of an investigation." "Never mind. I'm here to take you to dinner." Hamish hesitated only a moment. "Grand," he said. As he walked out of the station with her, Hamish noticed that Charlie had left an offering to the fairies. "Do you believe in fairies?" he asked Christine. "Not a bit of it. I've never even seen a ghost. Don't believe in them, either." Little did Hamish Macbeth know that he was shortly to meet one as murder once more was due to return to his beat. # More Hamish Macbeth Mysteries by M. C. Beaton _Death of a Liar_ _Death of a Policeman_ _Death of Yesterday_ _Death of a Kingfisher_ _Death of a Chimney Sweep_ _Death of a Valentine_ _Death of a Witch_ _Death of a Gentle Lady_ _Death of a Maid_ _Death of a Dreamer_ _Death of a Bore_ _Death of a Poison Pen_ _Death of a Village_ _Death of a Celebrity_ _Death of a Dustman_ _Death of an Addict_ _Death of a Scriptwriter_ _Death of a Dentist_ _Death of a Macho Man_ _Death of a Nag_ _Death of a Charming Man_ _Death of a Travelling Man_ _Death of a Greedy Woman_ _Death of a Prankster_ _Death of a Snob_ _Death of a Hussy_ _Death of a Perfect Wife_ _Death of an Outsider_ _Death of a Cad_ _Death of a Gossip_ _A Highland Christmas_ ### Thank you for buying this ebook, published by Hachette Digital. To receive special offers, bonus content, and news about our latest ebooks and apps, sign up for our newsletters. Sign Up Or visit us at hachettebookgroup.com/newsletters ## Contents 1. Cover 2. Title Page 3. Welcome 4. Dedication 5. Chapter One 6. Chapter Two 7. Chapter Three 8. Chapter Four 9. Chapter Five 10. Chapter Six 11. Chapter Seven 12. Chapter Eight 13. Chapter Nine 14. Chapter Ten 15. Chapter Eleven 16. Chapter Twelve 17. Epilogue 18. BackAd 19. More Hamish Macbeth Mysteries by M. C. Beaton 20. Newsletters 21. Copyright ## Navigation 1. Table of Contents This book is a work of fiction. Names, characters, places, and incidents are the product of the author's imagination or are used fictitiously. Any resemblance to actual events, locales, or persons, living or dead, is coincidental. Copyright © 2016 by Marion Chesney Cover illustration by Griesbach / Martucci Cover copyright © 2016 by Hachette Book Group, Inc. All rights reserved. In accordance with the U.S. Copyright Act of 1976, the scanning, uploading, and electronic sharing of any part of this book without the permission of the publisher constitute unlawful piracy and theft of the author's intellectual property. If you would like to use material from the book (other than for review purposes), prior written permission must be obtained by contacting the publisher at permissions@hbgusa.com. Thank you for your support of the author's rights. Grand Central Publishing Hachette Book Group 1290 Avenue of the Americas New York, NY 10104 hachettebookgroup.com twitter.com/grandcentralpub First ebook edition: February 2016 Grand Central Publishing is a division of Hachette Book Group, Inc. The Grand Central Publishing name and logo is a trademark of Hachette Book Group, Inc. The Hachette Speakers Bureau provides a wide range of authors for speaking events. To find out more, go to www.hachettespeakersbureau.com or call (866) 376-6591. The publisher is not responsible for websites (or their content) that are not owned by the publisher. ISBN 978-1-4555-5826-1 E3
def make_instance(self, include_optional): if include_optional : return CreateVideoBody( source_url = '0', profiles = '0', payload = '0', pipeline = '0', subtitle_files = [ '0' ], extra_files = { 'key' : [ '0' ] }, extra_variables = { 'key' : '0' }, path_format = '0', clip_end = '00:00:06:00@25', clip_length = '00:20:00', clip_offset = '00:00:10', starting_timecode = '0', store_id = '0' ) else : return CreateVideoBody( )
//! Return a number between [0;max[ in integer in a uniform distribution /*! \ingroup an */ inline unsigned intRand(unsigned max) { if (max) return rand() % max; else return 0; }
Dialysis patients' attitudes about cardiopulmonary resuscitation and stopping dialysis. Dialysis patients are a unique population because of their chronic dependence on complex medical technology. Furthermore, their illness forces them to make critical decisions about medical care (mode of dialysis, renal transplantation, withdrawal from dialysis). The reasons dialysis patients discontinue therapy are not well understood, nor is it known whether they view dialysis therapy differently from other life-support interventions. We asked four groups of patients - in-center hemodialysis (HD), peritoneal dialysis (PD), renal transplant, and ambulatory elderly - questions about their wishes for medical information, participation in medical decision-making, life-supporting therapy including cardiopulmonary resuscitation (CPR) and ventilatory support, and stopping dialysis at the time of the study and in certain hypothetical situations. All groups wanted information and involvement in making medical decisions. Most patients desired CPR (96% of renal transplant, 76% of HD, 63% of PD, 82% of elderly), but PD patients chose CPR less often in all circumstances (at study, p = 0.004; in coma, p = 0.004; in permanent coma, p = 0.04), and they were less willing to undergo chronic ventilation (p = 0.001). PD patients were more likely to stop dialysis (p = 0.02) in coma than were HD patients. PD patients attended religious services more frequently and were less comfortable with machines, but these differences did not correlate with their decisions about life-support therapy. Dialysis patients have rarely considered stopping dialysis; they are similar to ambulatory elderly patients with regard to decisions about CPR and desire for involvement in medical decision-making. PD patients are a distinct subgroup worthy of further study.
NEW YORK – The mood of U.S. consumers brightened unexpectedly in August as an improving job market outweighed rising gasoline prices, a survey showed Tuesday. The Conference Board (search) said its consumer confidence (search) index rose in August to 105.6 from a revised 103.6 in July. Analysts had predicted a decline in August to a reading of 101.5. Consumers were buoyed by better employment prospects, with the index of "jobs plentiful" rising to 23.5 percent from 22.9 percent and the one saying jobs are hard to get easing to 23.2 percent from 23.8. It was the first time since October 2001 that those claiming jobs were plentiful outnumbered those saying jobs were hard to get. The research group's present situation reading improved to 123.6 from 119.3 in July, its highest in nearly four years. The expectations index measure edged up to 93.7 from 93.2. Consumer spending (search) is the backbone of the U.S. economy, accounting for two-thirds of activity, so changes in confidence are seen as a possible precursor to softer or stronger growth. In recent years, however, the correlation between confidence and retail sales has weakened, as consumers buy cars and homes even as they tell surveys things are getting worse.
void chn_cond(double *fr, double *tau,double V, string ntype){ double alp,beta; if( ntype=="OLMa" || ntype=="OLMb" ||ntype=="OLMr"){ if(ntype=="OLMa"){ *fr =1/(1+exp(-(V+14)/16.6)); *tau=5; } else if(ntype=="OLMb"){ *fr =1/(1+exp((V+71)/7.3)); *tau=1/( 0.000009/exp((V-26.0)/18.5) + 0.014/(0.2+exp(-(V+70)/11.0)) ); } else if(ntype=="OLMr"){ *fr=1/(1+exp((V+84)/10.2)); *tau=1/( exp(-14.59-0.086*V) + exp(-1.87+0.0701*V) ); } return ; } if(ntype=="Em"){ alp =0.32*(V+54)/(1-exp(-(V+54)/4.)); beta=0.28*(V+27)/(exp((V+27)/5.)-1); } else if(ntype=="En"){ alp =0.032*(V+52)/(1-exp(-(V+52)/5.)); beta=0.5*exp(-(V+57)/40.); } else if(ntype=="PVm"){ alp =0.1*(V+35)/(1-exp(-(V+35)/10.)); beta=4*exp(-(V+60)/18.); } else if(ntype=="PVh"){ alp =0.07*exp(-(V+58)/20.); beta=1/(exp(-0.1*(V+28))+1); } else if(ntype=="PVn"){ alp =0.01*(V+34)/(1-exp(-(V+34))); beta=0.125*exp(-(V+44)/80.0); } else if(ntype=="OLMm"){ alp =-0.1*(V+38)/(exp(-(V+38)/10)-1); beta=4*exp(-(V+65)/18); } else if(ntype=="OLMh"){ alp =0.07*exp(-(V+63)/20); beta=1/(exp(-0.1*(V+33))+1); } else if(ntype=="OLMn"){ alp =0.018*(V-25)/(1-exp(-(V-25)/25.0)); beta=0.0036*(V-35)/(exp((V-35)/12.0)-1); } else if(ntype=="EC5p"){ alp =1/(0.15*(1+exp(-(V+38)/6.5))); beta =exp(-(V+38)/6.5)/(0.15*(1+exp(-(V+38)/6.5))); } else if(ntype=="EC5m"){ alp =-0.1*(V+23)/(exp(-0.1*(V+23))-1); beta=4*exp(-(V+48)/18.); } else if(ntype=="EC5h"){ alp =0.07*exp(-(V+37)/20.); beta=1/(exp(-0.1*(V+7))+1); } else if(ntype=="EC5n"){ alp =-0.01*(V+27)/(exp(-0.1*(V+27))-1); beta=0.125*exp(-(V+37)/80.); } else if(ntype=="EC5_caL_q"){ alp =-0.055*(V+27)/(exp(-(V+27)/3.8)-1); beta=0.94*exp(-(75+V)/17.0); } else if(ntype=="EC5_caL_r"){ alp=0.000457*exp(-(V+13)/50.0); beta=0.0065/(exp(-(V+15)/28)+1); } else if(ntype=="EC5_pyr_m"){ // Middleton,PNAS,2008 alp =-0.32*(V+54)/(exp(-0.25*(V+54))-1); beta= 0.28*(V+27)/(exp(0.2*(V+27)) -1); } else if(ntype=="EC5_pyr_n"){ // Middleton,PNAS,2008 alp =-0.032*(V+52)/(exp(-0.2*(V+52))-1); beta= 0.5*exp(-0.025*(V+57)); } else if(ntype=="EC5_pyr_h"){ // Middleton,PNAS,2008 alp =0.128*exp(-1*(V+50)/18.0); beta=4.0/(exp(-0.2*(V+27))+1); } else if(ntype=="EC5_pyr_ahp"){ // Middleton,PNAS,2008 alp =1/(exp(-0.1*(V+41))+1); beta=500.0/(3.3*exp(0.05*(V+41))+exp(-0.05*(V+41))); //check point original value (400 [ms]), 400->600 2017.6.30 update) } (*fr)=alp/(alp+beta); (*tau)=1/(alp+beta); if(ntype=="EC5_pyr_ahp"){ (*fr)=alp; (*tau)=beta; } if(ntype=="PVh" || ntype=="PVn") *tau=*tau*0.2; return; } void difffunc_EC3_E(double x[], double dx[], STR_PARA *paras){ // Rotstein,et al., 2006, JCN //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]: p x[4]:p, x[5]: rf, x[6]: rs static double gNa=52.0,gK=11.0,gL=0.5,gp=0.5,gh=1.5; static double VNa=55.0,VK=-90.0,VL=-65.0,Vh=-20; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,pinf,rfinf,rsinf; double tm,tn,th,tp,trf,trs; double tmpI =paras->I; chn_cond(&ninf,&tn,x[0],"EC5n"); chn_cond(&hinf,&th,x[0],"EC5h"); chn_cond(&minf,&tm,x[0],"EC5m"); chn_cond(&pinf,&tp,x[0],"EC5p"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gp*x[4]*(VNa-x[0])+gh*(0.65*x[5]+0.35*x[6])*(Vh-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(pinf-x[4])/tp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; return; } // this is an identical function void difffunc_EC2_stell(double x[], double dx[], STR_PARA *paras){ // Rotstein,et al., 2006, JCN //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]: p x[4]:p, x[5]: rf, x[6]: rs static double gNa=52.0,gK=11.0,gL=0.5,gp=0.5,gh=0.4; static double VNa=55.0,VK=-90.0,VL=-65.0,Vh=-20; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,pinf,rfinf,rsinf; double tm,tn,th,tp,trf,trs; double tmpI =paras->I; chn_cond(&ninf,&tn,x[0],"EC5n"); chn_cond(&hinf,&th,x[0],"EC5h"); chn_cond(&minf,&tm,x[0],"EC5m"); chn_cond(&pinf,&tp,x[0],"EC5p"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gp*x[4]*(VNa-x[0])+gh*(0.65*x[5]+0.35*x[6])*(Vh-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(pinf-x[4])/tp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; return; } void difffunc_EC3_E_pyr(double x[], double dx[], STR_PARA *paras){ // Rotstein,et al., 2006, JCN, Saravanan, 2015,<NAME>, 2008,PNAS //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.6,gh=0.0; //check point in old version, gh=0.25 (2017.6.30 update) check point gahp=0.4->0.5 static double VNa=50.0,VK=-90.0,VL=-65.0,VAHP=-100,Vh=-20; //check // static double C=1.0 [uF/cm^2], thus, inverse of system time scale is mS/uF = 1/ms double minf,ninf,hinf,ahpinf,rfinf,rsinf; double tm,tn,th,tahp,trf,trs; double tmpI =paras->I; double tmpgCAN =paras->gCAN; chn_cond(&ninf,&tn,x[0],"EC5_pyr_n"); chn_cond(&hinf,&th,x[0],"EC5_pyr_h"); chn_cond(&minf,&tm,x[0],"EC5_pyr_m"); chn_cond(&ahpinf,&tahp,x[0],"EC5_pyr_ahp"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gAHP*x[4]*(VAHP-x[0])+gh*(0.65*x[5]+0.35*x[6])*(Vh-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ahpinf-x[4])/tahp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; return; } #if VER_PROG != 9 void difffunc_EC5_E_CAN(double x[], double dx[], STR_PARA *paras){ // Rotstein,et al., 2006, JCN (we modified sttelate cells in EC2 with decreasing AHP current (see Heys's review in 2012 ), Saravanan, 2015,Hipp //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]: p x[4]:p, x[5]: rf, x[6]: rs static double gNa=52.0,gK=11.0,gL=0.5,gp=0.5,gh=1.0; // original in *6.cpp.bak: gh=1.5 check point 4/7 static double VNa=55.0,VK=-90.0,VL=-65.0,Vh=-20,VCAN=-20; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,pinf,rfinf,rsinf; double tm,tn,th,tp,trf,trs; double tmpI =paras->I; double tmpgCAN =paras->gCAN; double tmpgate_CAN=paras->gate_CAN; chn_cond(&ninf,&tn,x[0],"EC5n"); chn_cond(&hinf,&th,x[0],"EC5h"); chn_cond(&minf,&tm,x[0],"EC5m"); chn_cond(&pinf,&tp,x[0],"EC5p"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gp*x[4]*(VNa-x[0])+gh*(0.65*x[5]+0.35*x[6])*(Vh-x[0])+gL*(VL-x[0])+tmpI +tmpgCAN*tmpgate_CAN*(VCAN-x[0]); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(pinf-x[4])/tp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; return; } void difffunc_EC5_E_pyr_CAN(double x[], double dx[], STR_PARA *paras){ // the neuron model is based on pyramidal cell in EC2 (E cell in Middleton, 2008,PNAS) + modution on Ca dynamics. (See also Fransen 2006 and 2002. the former paper builds a model of EC5 neuron which is based on EC2 neuron (Fransen 2002). //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp, x[5]: rf, x[6]: rs static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.2,gh=0.0; // (modification on 6/19, gahp:0.4->0.2,gh:0.25) check point 0.1->0.2 static double VNa=50.0,VK=-100.0,VL=-65.0,VAHP=-100,Vh=-20,VCAN=-20; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,ahpinf,rfinf,rsinf; double tm,tn,th,tahp,trf,trs; double tmpI =paras->I; double tmpgCAN =paras->gCAN; double tmpgate_CAN=paras->gate_CAN; chn_cond(&ninf,&tn,x[0],"EC5_pyr_n"); chn_cond(&hinf,&th,x[0],"EC5_pyr_h"); chn_cond(&minf,&tm,x[0],"EC5_pyr_m"); chn_cond(&ahpinf,&tahp,x[0],"EC5_pyr_ahp"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gAHP*x[4]*(VAHP-x[0])+gh*(0.65*x[5]+0.35*x[6])*(Vh-x[0])+gL*(VL-x[0])+tmpI +tmpgCAN*tmpgate_CAN*(VCAN-x[0]); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ahpinf-x[4])/tahp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; return; } #endif // last update 2017.6.28 void difffunc_EC5_E_pyr_Ca_dyn(double x[], double dx[], STR_PARA *paras){ // the neuron model is based on pyramidal cell in EC2 (E cell in Middleton, 2008,PNAS) + Ca dynamics (Saravanan,2015). (See also Fransen 2006 and 2002. the former paper builds a model of EC5 neuron which is based on EC2 neuron (Fransen 2002). // CAN channel is based on Destexhe 1994 // Ca dynamics is based on Destexhe 1994 and Saravanan 2015 //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp, x[5]: rf, x[6]: rs, x[7]:qca, x[8]:rca, x[9]:Ca concentration, x[10]:m_can static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.1,gh=0.0,gCaL=0.01; // [mS/cm^2] (modification on 6/19, gahp:0.4->0.2,gh:0.25) static double VNa=50.0,VK=-100.0,VL=-65.0,VAHP=-100,VCAN=-20,VCaL=120; //[mV] static double I2C=0.51819378374737; //-k/Fd current of Ca to concentration static double Cainf=0.24; //[uM] // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,ahpinf,rfinf,rsinf,alpha_qca,beta_qca,alpha_rca,beta_rca,mcaninf; double tm,tn,th,tahp,trf,trs,t2Ca,tmcan; double tmpI =paras->I; double tmpgCAN =paras->gCAN; double ICaL=0.0; chn_cond(&ninf,&tn,x[0],"EC5_pyr_n"); chn_cond(&hinf,&th,x[0],"EC5_pyr_h"); chn_cond(&minf,&tm,x[0],"EC5_pyr_m"); chn_cond(&ahpinf,&tahp,x[0],"EC5_pyr_ahp"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; alpha_qca=0.055*(-27-x[0])/(exp((-27-x[0])/3.8)-1); beta_qca =0.94*exp(-(75+x[0])/17.0); alpha_rca=0.000457*exp(-(x[0]+13)/50.0); beta_rca =0.0065/(exp(-(x[0]+15)/28.0)+1); t2Ca = 250.0; // [ms] mcaninf=20.0*x[9]*x[9]/(20.0*x[9]*x[9]+6); //chenge the inflection point (2000 (0.02[ms-1]*10^6) -> 100) check point 1 8->6 tmcan =1.0/(20.0*x[9]*x[9]*0.002+0.003); // change from original values 0.002 -> 0.004 ICaL=gCaL*x[7]*x[7]*x[8]*(VCaL-x[0]); dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gAHP*x[4]*(VAHP-x[0])+gL*(VL-x[0])+tmpI +ICaL+tmpgCAN*x[10]*x[10]*(VCAN-x[0]); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ahpinf-x[4])/tahp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; dx[7]=alpha_qca*(1-x[7])-beta_qca*x[7]; dx[8]=alpha_rca*(1-x[8])-beta_rca*x[8]; dx[9]=I2C*ICaL+(Cainf-x[9])/t2Ca; dx[10]=(mcaninf-x[10])/tmcan; return; } void difffunc_EC5_E_pyr_Fransen(double x[], double dx[], STR_PARA *paras){ // the neuron model is based on pyramidal cell in EC2 (Fransen 2006) // original unit system: [s], [S/m^2], [F/m^2],[V] -> [ms],[mS/cm^2],[uF/cm^2],[mV] //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp, x[5]: s for CaL //x[6]: x for M , x[7]: m for Na p, x[8]: h for Na p, x[9]: a for K A, x[10]:b for K A //x[11]: concentration of Ca //x[12]: c for CAN //x[13]: c for KC static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.05,gKC=196,gM=3.5,gCaL=0.15,gNap=0.2,gKA=0.5; // [mS/cm^2] // original values of conductances [S/m^2] for capacitance C=0.01 [F/m^2] (unit time=[s]), here mS/cm^2, uF/cm^2, thus we just multiply 0.1 to values of conductance and set capacitance 1 (unit time=[ms]). static double VNa=50.0,VK=-100.0,VL=-65.0,VCAN=-20,VCa=140; //[mV] static double I2C=0.51819378374737; //-k/Fd current of Ca to concentration double tmpI =paras->I; double tmpgCAN =paras->gCAN; double ICaL=0.0; double t2Ca=250; double s_inf, tau_s; double alpha_s, beta_s; double tmp_s; double dtmp; dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0]); // Na channel dx[0]+=gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0]); // delayed K channel dx[0]+=gAHP*x[4]*x[4]*(VK-x[0]); // K ahp channel ICaL=gCaL*x[5]*x[5]*(VCa-x[0]); // CaL channel dx[0]+=ICaL; dx[0]+=gM*x[6]*(VK-x[0]); // K M channel dx[0]+=gNap*x[7]*x[8]*(VNa-x[0]); // Na persistent channel dx[0]+=gKA*x[9]*x[10]*(VK-x[0]); // K A channel dx[0]+=tmpgCAN*x[12]*x[12]*(VCAN-x[0]); // CAN channel dx[0]+=gKC*x[13]*(VK-x[0]); // K C channel dx[0]+=tmpI; chn_cond(&s_inf,&tau_s,x[0],"EC5_pyr_n"); dx[1]=(s_inf-x[1])/tau_s; chn_cond(&s_inf,&tau_s,x[0],"EC5_pyr_h"); dx[2]=(s_inf-x[2])/tau_s; chn_cond(&s_inf,&tau_s,x[0],"EC5_pyr_m"); dx[3]=(s_inf-x[3])/tau_s; // ahp if(x[11]*1000>15){ dtmp=(3.0+0.8*(1000*x[11]-15.0)); alpha_s= dtmp>15.0 ? 15.0 : dtmp; //check point x[11] -> x[11]*30 } else alpha_s= 1000*x[11]*0.2; beta_s=1.0; tmp_s=x[4]; dx[4]=0.001*(alpha_s*(1-tmp_s)-beta_s*tmp_s); // CaL alpha_s=1.6/(1+exp(-0.072*(x[0]-65.0))); beta_s =0.02*(x[0]-51.1)/(exp((x[0]-51.1)*0.2)-1.0); tmp_s=x[5]; dx[5]=alpha_s*(1-tmp_s)-beta_s*tmp_s; //KC if(x[0]<50.0){ alpha_s=exp(0.053782*x[0]-0.66835)/18.975; beta_s =2.0*exp((6.5-x[0])/27.0)-alpha_s; } else{ alpha_s =2*exp((6.5-x[0])/27.0); beta_s =0.0; } tmp_s=x[13]; dx[13]=alpha_s*(1-tmp_s)-beta_s*tmp_s; //KM s_inf=1/(1+exp(-(x[0]+35.0)/5.0)); tau_s=1000.0/(3.3*exp((x[0]+35)/40.0)+exp(-(x[0]+35)/20.0)); tmp_s=x[6]; dx[6]=(s_inf-tmp_s)/tau_s; //Nap s_inf=1/(1+exp(-(x[0]+48.7)/4.4)); dtmp=x[0]+38.0; tau_s=1/( (0.091*dtmp/(1-exp(-dtmp/5.0))) + (-0.062*dtmp/(1-exp(dtmp/5.0))) ); tmp_s=x[7]; dx[7]=(s_inf-tmp_s)/tau_s; s_inf=1/(1+exp(-(x[0]+48.8)/9.98)); tau_s=1/( (-0.00000288*(x[0]-49.1)/(1-exp(-(x[0]-49.1)/4.63))) + (0.00000694*(x[0]+44.7)/(1-exp((x[0]+44.7)/2.63))) ); tmp_s=x[8]; dx[8]=(s_inf-tmp_s)/tau_s; //KA from Traub 1991 alpha_s=0.02*(x[0]-13.1)/(1-exp((13.1-x[0])/10.0)); beta_s =0.175*(x[0]-40.1)/(exp((x[0]-40.1)/10.0)-1); tmp_s=x[9]; dx[9]=alpha_s*(1-tmp_s)-beta_s*tmp_s; alpha_s=0.0016*exp(-(x[0]+13)/18.0); beta_s =0.05/(1+exp(10.1-x[0])/5.0); tmp_s=x[10]; dx[10]=alpha_s*(1-tmp_s)-beta_s*tmp_s; // Ca dyn dx[11]=I2C*ICaL-x[11]/t2Ca; // CAN check point s_inf=48.0*100*x[11]*x[11]/(48.0*100*x[11]*x[11]+0.03); tau_s=1.0/(48.0*100*x[11]*x[11]+0.03); tmp_s=x[12]; dx[12]=(s_inf-tmp_s)/tau_s; } // last update 2017.7.25 void difffunc_EC5_E_pyr_Ca_dyn_M(double x[], double dx[], STR_PARA *paras){ // the neuron model is based on pyramidal cell in EC2 (E cell in Middleton, 2008,PNAS) + Ca dynamics (Saravanan,2015). (See also Fransen 2006 and 2002. the former paper builds a model of EC5 neuron which is based on EC2 neuron (Fransen 2002). // Ca-dependent K (AHP) is introduced based on Destexhe 1994 // CAN channel is based on Destexhe 1994 // Ca dynamics is based on Destexhe 1994 and Saravanan 2015 // M current is based on Saravanan, 2015 (this is model for CA1, but ECV model in Fransen 2006 used CA3 model in Traub 1992.) //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp, x[5]: rf, x[6]: rs, x[7]:qca, x[8]:rca, x[9]:Ca concentration, x[10]:m_can static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.4,gM=0.004,gCaL=0.01; // [mS/cm^2] (modification on 6/19, gahp:0.4->0.2) static double VNa=50.0,VK=-100.0,VL=-65.0,VAHP=-100,VCAN=-20,VCaL=120; //[mV] static double I2C=0.51819378374737; //-k/Fd current of Ca to concentration static double Cainf=0.24; //[uM] // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,ahpinf,rfinf,rsinf,alpha_qca,beta_qca,alpha_rca,beta_rca,mcaninf,Minf; double tm,tn,th,tahp,trf,trs,t2Ca,tmcan,tM; double tmpI =paras->I; double tmpgCAN =paras->gCAN; double ICaL=0.0; chn_cond(&ninf,&tn,x[0],"EC5_pyr_n"); chn_cond(&hinf,&th,x[0],"EC5_pyr_h"); chn_cond(&minf,&tm,x[0],"EC5_pyr_m"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; alpha_qca=0.055*(-27-x[0])/(exp((-27-x[0])/3.8)-1); beta_qca =0.94*exp(-(75+x[0])/17.0); alpha_rca=0.000457*exp(-(x[0]+13)/50.0); beta_rca =0.0065/(exp(-(x[0]+15)/28.0)+1); t2Ca = 250.0; // [ms] mcaninf=20.0*x[9]*x[9]/(20.0*x[9]*x[9]+6); //chenge the inflection point (2000 (0.02[ms-1]*10^6) -> 100) check point 1 8->6 tmcan =1.0/(20.0*x[9]*x[9]*0.002+0.003); // change from original values 0.002 -> 0.004 Minf=1.0/(1.0+exp(-(x[0]+35)/10.0)); tM =1000/(3.3*exp((x[0]+35)/20.0)+exp(-(x[0]+35)/20.0)); ahpinf =48.0*x[9]*x[9]/(48.0*x[9]*x[9]+90); tahp =1.0/(48.0*x[9]*x[9]*0.002+0.015); // change from original values 0.002 -> 0.004 ICaL=gCaL*x[7]*x[7]*x[8]*(VCaL-x[0]); dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gAHP*x[4]*x[4]*(VAHP-x[0])+gL*(VL-x[0])+tmpI +ICaL+tmpgCAN*x[10]*x[10]*(VCAN-x[0])+gM*x[11]*(VK-x[0]); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ahpinf-x[4])/tahp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; dx[7]=alpha_qca*(1-x[7])-beta_qca*x[7]; dx[8]=alpha_rca*(1-x[8])-beta_rca*x[8]; dx[9]=I2C*ICaL+(Cainf-x[9])/t2Ca; dx[10]=(mcaninf-x[10])/tmcan; dx[11]=(Minf-x[11])/tM; return; } void difffunc_EC5_E_pyr_Ca_dyn1(double x[], double dx[], STR_PARA *paras){ // the neuron model is based on pyramidal cell in EC2 (E cell in Middleton, 2008,PNAS) + Ca dynamics (Saravanan,2015). (See also Fransen 2006 and 2002. the former paper builds a model of EC5 neuron which is based on EC2 neuron (Fransen 2002). // Cal-dependent Kahp is introduced instead of normal AHP (Destexhe 1994) // CAN channel is based on Destexhe 1994 // Ca dynamics is based on Destexhe 1994 and Saravanan 2015 //x[0]: membrane potential,x[1]: channel function n, x[2]: h, x[3]: m,x[4]:ahp, x[5]: rf, x[6]: rs, x[7]:qca, x[8]:rca, x[9]:Ca concentration, x[10]:m_can static double gNa=100.0,gK=80.0,gL=0.5,gAHP=0.1,gh=0.0,gCaL=0.01; // [mS/cm^2] (modification on 6/19, gahp:0.4->0.2,gh:0.25) static double VNa=50.0,VK=-100.0,VL=-65.0,VCAN=-20,VCaL=120; //[mV] static double I2C=0.51819378374737; //-k/Fd current of Ca to concentration static double Cainf=0.24; //[uM] // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf,ahpinf,rfinf,rsinf,alpha_qca,beta_qca,alpha_rca,beta_rca,mcaninf; double tm,tn,th,tahp,trf,trs,t2Ca,tmcan; double tmpI =paras->I; double tmpgCAN =paras->gCAN; double ICaL=0.0; chn_cond(&ninf,&tn,x[0],"EC5_pyr_n"); chn_cond(&hinf,&th,x[0],"EC5_pyr_h"); chn_cond(&minf,&tm,x[0],"EC5_pyr_m"); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; alpha_qca=0.055*(-27-x[0])/(exp((-27-x[0])/3.8)-1); beta_qca =0.94*exp(-(75+x[0])/17.0); alpha_rca=0.000457*exp(-(x[0]+13)/50.0); beta_rca =0.0065/(exp(-(x[0]+15)/28.0)+1); t2Ca = 250.0; // [ms] ahpinf =48.0*x[9]*x[9]/(48.0*x[9]*x[9]+90); tahp =1.0/(48.0*x[9]*x[9]*0.002+0.015); // change from original values 0.002 -> 0.004 mcaninf=20.0*x[9]*x[9]/(20.0*x[9]*x[9]+6); //chenge the inflection point (2000 (0.02[ms-1]*10^6) -> 100) check point 1 8->6 tmcan =1.0/(20.0*x[9]*x[9]*0.002+0.003); // change from original values 0.002 -> 0.004 ICaL=gCaL*x[7]*x[7]*x[8]*(VCaL-x[0]); dx[0] =gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gAHP*x[4]*x[4]*(VK-x[0])+gL*(VL-x[0])+tmpI +ICaL+tmpgCAN*x[10]*x[10]*(VCAN-x[0]); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ahpinf-x[4])/tahp; dx[5]=(rfinf-x[5])/trf; dx[6]=(rsinf-x[6])/trs; dx[7]=alpha_qca*(1-x[7])-beta_qca*x[7]; dx[8]=alpha_rca*(1-x[8])-beta_rca*x[8]; dx[9]=I2C*ICaL+(Cainf-x[9])/t2Ca; dx[10]=(mcaninf-x[10])/tmcan; return; } void difffunc_CA1_E(double x[], double dx[], STR_PARA *paras){ //x[0]: membrane potential,x[1]: channel function n static double gNa=100.0,gK=80.0,gL=0.1; static double VNa=50.0,VK=-100.0,VL=-67.0; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf; double tn; double hfrc; double dummy; double dtmp; double tmpI =paras->I; chn_cond(&minf,&dummy,x[0],"Em"); chn_cond(&ninf,&tn,x[0],"En"); dtmp=(1-1.25*x[1]); hfrc=( dtmp> 0 ? dtmp : 0); dx[0]=gNa*minf*minf*minf*hfrc*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; return; } void difffunc_CA1_E_Ih(double x[], double dx[], STR_PARA *paras){ //x[0]: membrane potential,x[1]: channel function n, x[2]: ahp, x[3]:fast , x[4]: slow static double gNa=100.0,gK=80.0,gL=0.1,gAHP=0.2,gh=0.1; //check point gh0.1->0.2->0.1 static double VNa=50.0,VK=-100.0,VL=-67.0,VAHP=-100,Vh=-20; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,ahpinf,rfinf,rsinf; double tn,trf,trs,tahp; double hfrc; double dummy; double dtmp; double tmpI =paras->I; chn_cond(&minf,&dummy,x[0],"Em"); chn_cond(&ninf,&tn,x[0],"En"); chn_cond(&ahpinf,&tahp,x[0],"EC5_pyr_ahp"); dtmp=(1-1.25*x[1]); hfrc=( dtmp> 0 ? dtmp : 0); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; dx[0]=gNa*minf*minf*minf*hfrc*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gL*(VL-x[0])+gAHP*x[2]*(VAHP-x[0])+gh*(0.65*x[3]+0.35*x[4])*(Vh-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(ahpinf-x[2])/tahp; dx[3]=(rfinf-x[3])/trf; dx[4]=(rsinf-x[4])/trs; return; } void difffunc_CA1_E_Ih_Caspk(double x[], double dx[], STR_PARA *paras){ // cal. spike dynamics is in Chua, 2015,front. //x[0]: membrane potential,x[1]: channel function n, x[2]: ahp, x[3]:fast , x[4]: slow static double gNa=100.0,gK=80.0,gL=0.1,gAHP=0.2,gh=0.1; static double VNa=50.0,VK=-100.0,VL=-67.0,VAHP=-100,Vh=-20; static double gca=1.0,Vca=30.0,tmca=5.0,thca=50.0; // in the paper, gca = 70 nS on a dendritic part. here, we consider point neuron(presumably soma) and set gca=1. // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,ahpinf,rfinf,rsinf,mcainf,hcainf; double tn,trf,trs,tahp; double hfrc; double dummy; double dtmp; double tmpI =paras->I; chn_cond(&minf,&dummy,x[0],"Em"); chn_cond(&ninf,&tn,x[0],"En"); chn_cond(&ahpinf,&tahp,x[0],"EC5_pyr_ahp"); dtmp=(1-1.25*x[1]); hfrc=( dtmp> 0 ? dtmp : 0); rfinf=1/(1+exp((x[0]+79.2)/9.78)); trf =0.51/(exp((x[0]-1.7)*0.1) + exp(-(x[0]+340)/52.0)) + 1; rsinf=1/pow((1+exp((x[0]+2.83)/15.9)),58); trs =5.6/(exp((x[0]-1.7)/14) + exp(-(x[0]+260)/43.0)) + 1; mcainf=1/(1+exp(0.5*(x[0]+18.0))); // original 21 hcainf=1/(1+exp(-0.5*(x[0]+21.0))); // original 24 dx[0]=gNa*minf*minf*minf*hfrc*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gL*(VL-x[0])+gAHP*x[2]*(VAHP-x[0])+gh*(0.65*x[3]+0.35*x[4])*(Vh-x[0])+gL*(VL-x[0])+gca*x[5]*x[6]*(Vca-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(ahpinf-x[2])/tahp; dx[3]=(rfinf-x[3])/trf; dx[4]=(rsinf-x[4])/trs; dx[5]=(mcainf-x[5])/tmca; dx[6]=(hcainf-x[6])/thca; return; } void difffunc_CA1_OLM(double x[], double dx[], STR_PARA *paras){ //x[0]: membrane potential,x[1]: channel function n,x[2]: channel function h, x[3]: channel function m, //x[4]: channel function a,x[5]: channel function b,x[6]: channel function r, static double gNa=40.0,gK=23.0,gL=0.05,gA=16.0,gh=6.0; // gNa:30->40 static double VNa=60.0,VK=-100.0,VL=-70.0,VA=-90.0,Vh=-32.0; static double Cinv=1/1.3; double minf,ninf,hinf,ainf,binf,rinf; double tm,tn,th,ta,tb,tr; double dtmp; double tmpI =paras->I; chn_cond(&minf,&tm,x[0],"OLMm"); chn_cond(&ninf,&tn,x[0],"OLMn"); chn_cond(&hinf,&th,x[0],"OLMh"); chn_cond(&ainf,&ta,x[0],"OLMa"); chn_cond(&binf,&tb,x[0],"OLMb"); chn_cond(&rinf,&tr,x[0],"OLMr"); dx[0]=Cinv*(gNa*x[3]*x[3]*x[3]*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0]) +gA*x[4]*x[5]*(VA-x[0])+gh*x[6]*(Vh-x[0])+gL*(VL-x[0])+tmpI); dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; dx[3]=(minf-x[3])/tm; dx[4]=(ainf-x[4])/ta; dx[5]=(binf-x[5])/tb; dx[6]=(rinf-x[6])/tr; return; } void difffunc_CA1_PV(double x[], double dx[], STR_PARA *paras){ //x[0]: membrane potential,x[1]: channel function n,x[2]: channel function h static double gNa=35.0,gK=9.0,gL=0.1; static double VNa=55.0,VK=-90.0,VL=-65.0; // static double C=1.0; C is unity here, so we neglect this term. double minf,ninf,hinf; double tn,th; double hfrc; double dummy; double dtmp; double tmpI =paras->I; chn_cond(&minf,&dummy,x[0],"PVm"); chn_cond(&ninf,&tn,x[0],"PVn"); chn_cond(&hinf,&th,x[0],"PVh"); dx[0]=gNa*minf*minf*minf*x[2]*(VNa-x[0])+gK*x[1]*x[1]*x[1]*x[1]*(VK-x[0])+gL*(VL-x[0])+tmpI; dx[1]=(ninf-x[1])/tn; dx[2]=(hinf-x[2])/th; return; } void RG4(double x[],int n_DOF, double *tp, STR_PARA *paras,void (*p_diff_func)(double xtmp[],double dx[],STR_PARA *paras)){ int i0; double htmp,hh,h6; double dxm[n_DOF],dxtmp[n_DOF],xtmp[n_DOF],dxdt[n_DOF]; htmp=hstp; hh=0.5*htmp; h6=htmp/6.0; (*p_diff_func)(x,dxdt,paras); // 1st step for(i0=0;i0<n_DOF;i0++)xtmp[i0]=x[i0]+hh*dxdt[i0]; (*p_diff_func)(xtmp,dxtmp,paras); // 2nd step for(i0=0;i0<n_DOF;i0++)xtmp[i0]=x[i0]+hh*dxtmp[i0]; (*p_diff_func)(xtmp,dxm,paras); // 3rd step for(i0=0;i0<n_DOF;i0++){ xtmp[i0]=x[i0]+htmp*dxm[i0]; dxm[i0]+=dxtmp[i0]; } (*p_diff_func)(xtmp,dxtmp,paras); // 4th step for(i0=0;i0<n_DOF;i0++) x[i0]+=h6*(dxdt[i0]+2.0*dxm[i0]+dxtmp[i0]); return; }
Prisco Nilo Prisco Duarte Nilo (born 1957) is a Filipino meteorologist. He is the former administrator of the Philippine Atmospheric, Geophysical and Astronomical Services Administration (PAGASA). Nilo joined the Philippine Atmospheric, Geophysical and Astronomical Services Administration (PAGASA) in March 1984 as a meteorologist. He was appointed as PAGASA director in November 2007 by former President Gloria Macapagal-Arroyo. On August 6, 2010, the weather forecaster was relieved of his post as administrator of PAGASA by President Benigno Aquino III. The former PAGASA chief had been criticized repeatedly for supposed errors in storm predictions by the agency. According to Aquino, Nilo was fired due to inaccurate predictions of typhoon, particularly during the rush of Typhoon Basyang (international codename: Conson). The new Agency executive was named by Secretary of Science and Technology Mario Montejo, who eventually appointed Graciano Yumul in the position. After such events, the meteorologist was reassigned to another office at the Department of Science and Technology (DOST) where PAGASA is one of the attached agencies. Biography Nilo entered PAGASA in March 1984 as a meteorologist. The metereologist was appointed as PAGASA director in November 2007 by former President Gloria Macapagal-Arroyo. Typhoon Conson In July 2010, the Philippines were hit by Typhoon Basyang, the second tropical cyclone during the 2010 Pacific typhoon season to impact the nation. Conson was poorly forecast by PAGASA. From July 12 to 13, Conson was forecast to hit Aurora and Isabela provinces. But, at 11 pm PST (1500 UTC) on July 13 PAGASA changed its forecast from hitting Aurora and Isabela provinces, to Quezon province, Metro Manila and southern Luzon provinces. However, residents living in those areas were not advised that the typhoon would hit their area and they also were not informed that public storm signal number 2 was raised. With this, severe damage ensued in the said areas. Later that same day, President Benigno Aquino III reprimanded PAGASA for failing to predict that Conson would pass over Manila. As a result, Aquino criticized PAGASA for not warning the residents of Metro Manila about the strong tropical storm that struck the nation's capital. However, according to Dr. Nilo and PAGASA, the agency didn't have adequate equipment to "accurately" predict a movement of a storm and the weather forecasting instruments were too old and needed to be upgraded.
<gh_stars>100-1000 // +build go1.8 package util import "strings" var StringCompare = strings.Compare
package seedu.bookmark.model.wordstore; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static seedu.bookmark.testutil.TypicalBooks.HARRY_POTTER; import static seedu.bookmark.testutil.TypicalWords.CORRECT_AND; import static seedu.bookmark.testutil.TypicalWords.CORRECT_HARRY; import static seedu.bookmark.testutil.TypicalWords.HARRY; import static seedu.bookmark.testutil.TypicalWords.MISSPELT_HARRY; import org.junit.jupiter.api.Test; public class WordTest { @Test public void getFieldValues_validFields_distanceSet() { Word validWordWithDistance = new Word("Word", 4); final String word = "Word"; final int count = 1; final int distance = 4; assertEquals(validWordWithDistance.getWord(), word); assertEquals(validWordWithDistance.getCount(), count); assertEquals(validWordWithDistance.getDistance(), distance); } @Test public void getFieldValues_validFields_noDistanceSet() { Word validWord = new Word("Word"); final String word = "Word"; final int count = 1; final int distance = 0; assertEquals(validWord.getWord(), word); assertEquals(validWord.getCount(), count); assertEquals(validWord.getDistance(), distance); } @Test public void addCount() { Word validWord = new Word("Word"); int counter = 1; counter++; validWord.addCount(); assertEquals(validWord.getCount(), counter); } @Test public void minusCount() { Word validWord = new Word("Word"); int counter = 1; counter--; validWord.minusCount(); assertEquals(validWord.getCount(), counter); } @Test public void setDistance() { Word validWord = new Word("Word"); int distance = 3; validWord.setDistance(3); assertEquals(validWord.getDistance(), distance); } @Test public void isSameWord() { // same object -> returns true assertTrue(CORRECT_HARRY.isSameWord(CORRECT_HARRY)); // different word -> returns false assertFalse(CORRECT_HARRY.isSameWord(CORRECT_AND)); // same word with typo -> return false Word misspeltHarry = new Word(MISSPELT_HARRY); assertFalse(CORRECT_HARRY.isSameWord(misspeltHarry)); // same word with different distance -> returns true Word distanceHarry = new Word(HARRY, 3); assertTrue(CORRECT_HARRY.isSameWord(distanceHarry)); // same word with different count -> returns false String harry = CORRECT_HARRY.getWord(); Word countChangedHarry = new Word(harry); countChangedHarry.addCount(); assertTrue(CORRECT_HARRY.isSameWord(countChangedHarry)); // null -> returns false assertFalse(HARRY_POTTER.isSameBook(null)); } @Test public void equals() { // same object -> returns true assertTrue(CORRECT_HARRY.equals(CORRECT_HARRY)); // different word -> returns false assertFalse(CORRECT_HARRY.equals(CORRECT_AND)); // same word with typo -> return false Word misspeltHarry = new Word(MISSPELT_HARRY); assertFalse(CORRECT_HARRY.equals(misspeltHarry)); // different distance -> returns false Word distanceHarry = new Word(HARRY, 3); assertFalse(CORRECT_HARRY.equals(distanceHarry)); // different count -> returns false String harry = CORRECT_HARRY.getWord(); Word countChangedHarry = new Word(harry); countChangedHarry.addCount(); assertFalse(CORRECT_HARRY.equals(countChangedHarry)); // different object -> returns false assertFalse(CORRECT_HARRY.equals("harry")); // null -> returns false assertFalse(HARRY_POTTER.equals(null)); } }
RIVERSIDE, Calif. -- A teenager who turned himself in to police confessed to molesting some 50 children over the past several years across Southern California, authorities said. Eighteen-year-old Joseph Hayden Boston was brought to a Riverside police station on Saturday by his mother after he allegedly told her he had sexually assaulted two boys, ages 8 and 4, at a motel, according to Riverside police spokesman Officer Ryan Railsback. During an interview with investigators, Boston confessed to the motel assaults and also admitted molesting "upwards of 50 children" since he was 10 years old, Railsback said in a statement. The incidents happened in different cities where he had lived, including Riverside. Boston was arrested on suspicion of two counts of oral copulation on a child under the age of 10 and jailed in lieu of $1 million bail, the statement said. CBS Los Angeles reports that the suspect had recently been staying at the Simply Home Inn & Suites, located in the 9800 block of Magnolia Avenue in Riverside. It was there he befriended 8-year-old and 4-year-old males, who were also staying at this motel with their parents. The children were allowed to go into Boston's room at night when the molestation allegedly occurred. "Hours later, the suspect called his own mother stating what he had just done," Railsback said in the statement. The suspect was staying in Riverside since early November 2017, but also resided in the cities of Lakewood and Buena Park in Southern California. The County of Riverside Child Protective Services took custody of both juvenile victims from the motel, Railsback said. It wasn't immediately clear if Boston had an attorney, and a publicly listed phone number for him couldn't be located by The Associated Press on Sunday. Boston is scheduled to appear in court Wednesday. CBS Los Angeles says detectives believe Boston and his claims that he has victimized other children who have not yet come forward. Authorities are asking for anyone with information about this investigation or the suspect, to contact Detective Paul Miranda at (951) 353-7945 or pmiranda@riversideca.gov.
Deacetylation of the retinoblastoma tumour suppressor protein by SIRT1. The activity of Rb (retinoblastoma protein) is regulated by phosphorylation and acetylation events. Active Rb is hypophosphorylated and acetylated on multiple residues. Inactivation of Rb involves concerted hyper-phosphorylation by cyclin-CDK (cyclin-dependent kinase) complexes combined with deacetylation of appropriate lysine residues within Rb. In the present study, using in vivo co-immunoprecipitation experiments, we identified mammalian SIRT1 (sirtuin 1) as a binding partner for Rb and its family members p107 and p130. Formation of Rb-SIRT1 complexes required the pocket domain of Rb. p300 catalysed the acetylation of Rb, and SIRT1 was a potent deacetylase for Rb. The ability of SIRT1 to catalyse the deacetylation of Rb was dependent on NAD and was inhibited by the SIRT1 inhibitor nicotinamide. Deacetylated lysine residues within Rb formed a domain similar to the SIRT1-targeted domain of the p53 tumour suppressor protein. Cultures of arrested cells, via contact inhibition or DNA damage, exhibited decreased Rb phosphorylation and increased Rb acetylation. Overexpression of SIRT1 in either confluent or etoposide-treated cells resulted in a significant reduction in Rb acetylation, which was restored with nicotinamide. Gene knockdown of SIRT1 by siRNA (short interfering RNA) produced an accumulation of acetylated Rb. This increase was augmented further when siRNA against SIRT1 was used in conjunction with nicotinamide. In conclusion, our results demonstrate that SIRT1 is an in vitro and in vivo deacetylase for the Rb tumour suppressor protein.
<reponame>Sumit2792/logisticsApplication package com.fw.dao.impl; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.dao.DataAccessException; import org.springframework.dao.EmptyResultDataAccessException; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowMapper; import org.springframework.stereotype.Repository; import com.fw.beans.BidsBean; import com.fw.beans.DashBoardBean; import com.fw.beans.NotesBean; import com.fw.beans.PaymentFilters; import com.fw.beans.UserDetailsBean; import com.fw.beans.PaymentHistoryBean; import com.fw.dao.IBidManager; import com.fw.dao.IBidNotesManager; import com.fw.dao.IDashboardManager; import com.fw.dao.ILoadRequestManager; import com.fw.dao.IUserManager; import com.fw.domain.LoadRequest; import com.fw.enums.BidStatus; import com.fw.enums.CurrencyCodes; import com.fw.enums.InBetweenCitiesExist; import com.fw.enums.LoadRequestStatus; import com.fw.enums.PaymentDirection; import com.fw.enums.PaymentReceiveMethod; import com.fw.enums.TruckType; import com.fw.exceptions.APIExceptions; import com.fw.exceptions.InvalidUsernameException; import com.fw.utils.MLogisticsPropertyReader; @Repository public class DashboardManagerImpl implements IDashboardManager { @Autowired private JdbcTemplate jdbcTemplate; @Autowired private MLogisticsPropertyReader mLogiticsPropertyReader; Logger log = Logger.getLogger(DashboardManagerImpl.class); @Autowired private IBidNotesManager notesManager; @Autowired private IUserManager userManager; @Autowired private IBidManager bidManager; @Autowired private ILoadRequestManager loadRequestManager; @Override public DashBoardBean getDashBoard() { // TODO Auto-generated method stub return null; } @Override public List<LoadRequest> getAllLoadRequest() { try { String sql = "select * from load_requests lr join load_request_details lrd on lrd.load_request_id=lr.load_request_id where lr.is_deleted=false and " + " lr.load_request_status NOT IN ('"+LoadRequestStatus.DELIVERED.getValue()+"','"+LoadRequestStatus.CANCELLED.getValue()+"','"+LoadRequestStatus.BLOCKED_REQUEST.getValue()+"','"+LoadRequestStatus.EXPIRED.getValue()+"') ORDER BY lrd.shipping_start_datetime ASC; "; return jdbcTemplate.query(sql, new RowMapper<LoadRequest>() { @Override public LoadRequest mapRow(ResultSet rs, int rownumber) throws SQLException { LoadRequest lr = new LoadRequest(); lr.setLoadRequestId(rs.getLong("load_request_id")); lr.setBiddingEndDatetime(rs.getTimestamp("bidding_end_datetime")); lr.setBiddingStartDatetime(rs.getTimestamp("bidding_start_datetime")); lr.setInsuranceNeeded(rs.getBoolean("insurance_needed")); String truckType = rs.getString("truck_type"); if(truckType !=null && !"".equals(truckType)) lr.setTruckType(TruckType.fromString(truckType)); lr.setUserId(rs.getLong("user_id")); lr.setLoadRequestStatus(LoadRequestStatus.fromString(rs.getString("load_request_status"))); lr.setCreatedBy(rs.getLong("created_by")); lr.setModifiedBy(rs.getLong("modified_by")); lr.setCreatedDate(rs.getTimestamp("created_date")); lr.setModifiedDate(rs.getTimestamp("modified_date")); return lr; } }); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } /** * Get bids which are active , awarded or not awarded. */ @Override public List<BidsBean> getBidsByLoadRequestId(long loadRequestId) { try { String sql = "SELECT * from bid where load_request_id=? and is_deleted=false and " + " bid_status NOT IN ('"+BidStatus.LOAD_REQUEST_CANCELLED.toDbString()+"');"; return jdbcTemplate.query(sql, new RowMapper<BidsBean>() { @Override public BidsBean mapRow(ResultSet rs, int rownumber) throws SQLException { BidsBean bid = new BidsBean(); long bidderId = rs.getLong("bidder_id"); bid.setBidId(rs.getLong("bid_id")); bid.setAmount(rs.getDouble("amount")); bid.setBidderUserId(bidderId); bid.setFaberCharges(rs.getDouble("faber_charges")); bid.setCreatedBy(rs.getLong("created_by")); bid.setCreatedDate(rs.getTimestamp("created_date")); bid.setCurrency(CurrencyCodes.fromString(rs.getString("currency"))); bid.setLoadRequestId(rs.getLong("load_request_id")); bid.setModifiedBy(rs.getLong("modified_by")); bid.setModifiedDate(rs.getTimestamp("modified_date")); bid.setStatus(BidStatus.fromString(rs.getString("bid_status"))); bid.setDeliveredTime(rs.getTimestamp("expected_delievery_time")); bid.setOnlinePaymentCharges( getOnlineCharges(rs.getDouble("amount"), rs.getDouble("faber_charges"))); List<NotesBean> notes = notesManager.getAllNotesByBidId(rs.getLong("bid_id")); bid.setNotes(notes); try { UserDetailsBean userDetials = userManager.getUserInfoByUserId(bidderId); if (userDetials != null) { bid.setBidderRating(userDetials.getRating()); } } catch (InvalidUsernameException e) { log.error("Error : " + e.getMessage(), e); } return bid; } }, loadRequestId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } // this should be moved in reusable component private double getOnlineCharges(double actualAmount, double faberCharge) { double onlineCharges = ((((actualAmount * 0.02) + (faberCharge * 0.02)) / 0.98) + 3) + 0.5; onlineCharges = Math.round(onlineCharges); return onlineCharges; } @Override public List<LoadRequest> getAllLoadRequestByUserId(long userId) { try { String sql = "select * from load_requests where user_id=?;"; return jdbcTemplate.query(sql, new RowMapper<LoadRequest>() { @Override public LoadRequest mapRow(ResultSet rs, int rownumber) throws SQLException { LoadRequest lr = new LoadRequest(); lr.setLoadRequestId(rs.getLong("load_request_id")); lr.setBiddingEndDatetime(rs.getTimestamp("bidding_end_datetime")); lr.setBiddingStartDatetime(rs.getTimestamp("bidding_start_datetime")); lr.setInsuranceNeeded(rs.getBoolean("insurance_needed")); String truckType = rs.getString("truck_type"); if(truckType !=null && !"".equals(truckType)) lr.setTruckType(TruckType.fromString(truckType)); lr.setUserId(rs.getLong("user_id")); lr.setLoadRequestStatus(LoadRequestStatus.fromString(rs.getString("load_request_status"))); lr.setCreatedBy(rs.getLong("created_by")); lr.setModifiedBy(rs.getLong("modified_by")); lr.setCreatedDate(rs.getTimestamp("created_date")); lr.setModifiedDate(rs.getTimestamp("modified_date")); return lr; } }, userId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } @Override public List<LoadRequest> getAllBookedLoadRequestByUserId(long userId) { try { String sql = "select * from load_requests where user_id=? and load_request_status IN ('"+LoadRequestStatus.DELIVERED.getValue()+"','"+LoadRequestStatus.BOOKED.getValue()+"');"; return jdbcTemplate.query(sql, new RowMapper<LoadRequest>() { @Override public LoadRequest mapRow(ResultSet rs, int rownumber) throws SQLException { LoadRequest lr = new LoadRequest(); lr.setLoadRequestId(rs.getLong("load_request_id")); lr.setBiddingEndDatetime(rs.getTimestamp("bidding_end_datetime")); lr.setBiddingStartDatetime(rs.getTimestamp("bidding_start_datetime")); lr.setInsuranceNeeded(rs.getBoolean("insurance_needed")); String truckType = rs.getString("truck_type"); if(truckType !=null && !"".equals(truckType)) lr.setTruckType(TruckType.fromString(truckType)); lr.setUserId(rs.getLong("user_id")); lr.setLoadRequestStatus(LoadRequestStatus.fromString(rs.getString("load_request_status"))); lr.setCreatedBy(rs.getLong("created_by")); lr.setModifiedBy(rs.getLong("modified_by")); lr.setCreatedDate(rs.getTimestamp("created_date")); lr.setModifiedDate(rs.getTimestamp("modified_date")); return lr; } }, userId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } @Override public BidsBean getAwardedBidByLoadRequestId(Long loadRequestId) throws APIExceptions { try { String sql = "select * from bid where load_request_id=? and bid_status='"+BidStatus.AWARDED.toDbString()+"';"; return jdbcTemplate.queryForObject(sql, new RowMapper<BidsBean>() { @Override public BidsBean mapRow(ResultSet rs, int rownumber) throws SQLException { BidsBean bid = new BidsBean(); bid.setBidId(rs.getLong("bid_id")); bid.setAmount(rs.getDouble("amount")); bid.setBidderUserId(rs.getLong("bidder_id")); bid.setFaberCharges(rs.getDouble("faber_charges")); bid.setCreatedBy(rs.getLong("created_by")); bid.setCreatedDate(rs.getTimestamp("created_date")); bid.setCurrency(CurrencyCodes.fromString(rs.getString("currency"))); bid.setLoadRequestId(rs.getLong("load_request_id")); bid.setModifiedBy(rs.getLong("modified_by")); bid.setModifiedDate(rs.getTimestamp("modified_date")); bid.setStatus(BidStatus.fromString(rs.getString("bid_status"))); bid.setDeliveredTime(rs.getTimestamp("expected_delievery_time")); return bid; } }, loadRequestId); } catch (EmptyResultDataAccessException empty) { log.info("Empty result."); return null; } catch (IncorrectResultSizeDataAccessException e) { log.error("Error : " + e.getMessage(), e); throw new APIExceptions( "Incorrect Result : there is more than one bid in AWARDED status for same load request."); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); throw new APIExceptions("Internal server error."); } } @Override public List<PaymentHistoryBean> getPaymentHistory(PaymentFilters filters) { String Query = paymentQueryFilter(filters); //log.info("============="+Query); try { return jdbcTemplate.query(Query.toString(), new RowMapper<PaymentHistoryBean>() { @Override public PaymentHistoryBean mapRow(ResultSet rs, int rownumber) throws SQLException { PaymentHistoryBean payment = new PaymentHistoryBean(); payment.setPaymentId(rs.getLong("payment_id")); payment.setAmountRecieved(rs.getDouble("amount_received")); payment.setAmountRequested(rs.getDouble("amount_requested")); payment.setCurrency(rs.getString("currency")); payment.setBidId(rs.getLong("bid_id")); payment.setLoadRequestId(rs.getLong("load_request_id")); payment.setReceiveMethod(PaymentReceiveMethod.fromString(rs.getString("receive_method"))); payment.setUserName(rs.getString("user_name")); payment.setPaymentDirections(PaymentDirection.fromString(rs.getString("payment_directions"))); payment.setPaymentStatus(rs.getString("payment_status")); payment.setPaymentDateTime(rs.getTimestamp("payment_time")); payment.setCreatedBy(rs.getInt("created_by")); payment.setModifiedBy(rs.getInt("modified_by")); payment.setCreatedDate(rs.getTimestamp("created_date")); payment.setModifiedDate(rs.getTimestamp("modified_date")); return payment; } }); } catch (DataAccessException e) { log.error(e.getMessage()); return new ArrayList<PaymentHistoryBean>(); } catch (Exception e) { log.error(e.getMessage()); return new ArrayList<PaymentHistoryBean>(); } } private String paymentQueryFilter(PaymentFilters filters) { StringBuilder paymentQuery = new StringBuilder( " SELECT p.*, u.user_name from payment p " + " join users u on u.user_id=p.user_id "); String paymentDirectionsFilter =((filters.getDirectionType() != null)? " and p.payment_directions='" + filters.getDirectionType().toDbString() + "'": " "); boolean betDates = (filters.getStartDate() != null && filters.getEndDate() != null); String betweenDatesFilter = ""+((betDates)? " and p.payment_time between '" + filters.getStartDate().toString() + "' " + " and '" + filters.getEndDate().toString() + "'": " "); String paymenStatusFilter = " " + ((filters.getPaymentStatus() != null) ? " and payment_status='" + filters.getPaymentStatus() + "'" : " "); String loadRequestId = ((filters.getLoadRequestId() == null) ? " ": " and p.load_request_id IN (" + filters.getLoadRequestId() + ") "); String userId=(filters.getUserId() != null)?" and p.user_id =" + filters.getUserId():" "; if(!paymentDirectionsFilter.trim().isEmpty() || !betweenDatesFilter.trim().isEmpty() || !paymenStatusFilter.trim().isEmpty() ||!loadRequestId.trim().isEmpty() || !userId.trim().isEmpty()) { paymentQuery.append(" WHERE 1=1 "); } paymentQuery.append(paymentDirectionsFilter).append(betweenDatesFilter).append(paymenStatusFilter).append(loadRequestId).append(userId); if( filters.getLimit()!= null ) { paymentQuery.append(" LIMIT "+filters.getLimit()); if( filters.getPage() != null ) { paymentQuery.append(" OFFSET "+ ((filters.getPage()-1)*filters.getLimit())); } } else if( filters.getLimit() == null && filters.getPage() != null ) { paymentQuery.append(" OFFSET "+ filters.getPage()); } return paymentQuery.toString(); } @Override public List<LoadRequest> getAllLoadRequestCreateByCSRId(long userId) { try { String sql = "select * from load_requests lr join load_request_details lrd on lrd.load_request_id=lr.load_request_id where " + " lr.created_by=?;"; return jdbcTemplate.query(sql, new RowMapper<LoadRequest>() { @Override public LoadRequest mapRow(ResultSet rs, int rownumber) throws SQLException { LoadRequest lr = new LoadRequest(); lr.setLoadRequestId(rs.getLong("load_request_id")); lr.setBiddingEndDatetime(rs.getTimestamp("bidding_end_datetime")); lr.setBiddingStartDatetime(rs.getTimestamp("bidding_start_datetime")); lr.setInsuranceNeeded(rs.getBoolean("insurance_needed")); String truckType = rs.getString("truck_type"); if(truckType !=null && !"".equals(truckType)) lr.setTruckType(TruckType.fromString(truckType)); lr.setUserId(rs.getLong("user_id")); lr.setLoadRequestStatus(LoadRequestStatus.fromString(rs.getString("load_request_status"))); lr.setCreatedBy(rs.getLong("created_by")); lr.setModifiedBy(rs.getLong("modified_by")); lr.setCreatedDate(rs.getTimestamp("created_date")); lr.setModifiedDate(rs.getTimestamp("modified_date")); return lr; } }, userId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } @Override public List<BidsBean> getAllBidsByUserId(long bidderUserId) { try { String sql = "SELECT * from bid where bidder_id=?;"; return jdbcTemplate.query(sql, new RowMapper<BidsBean>() { @Override public BidsBean mapRow(ResultSet rs, int rownumber) throws SQLException { BidsBean bid = new BidsBean(); bid.setBidId(rs.getLong("bid_id")); bid.setAmount(rs.getDouble("amount")); bid.setBidderUserId(rs.getLong("bidder_id")); bid.setFaberCharges(rs.getDouble("faber_charges")); bid.setCreatedBy(rs.getLong("created_by")); bid.setCreatedDate(rs.getTimestamp("created_date")); bid.setCurrency(CurrencyCodes.fromString(rs.getString("currency"))); bid.setLoadRequestId(rs.getLong("load_request_id")); bid.setModifiedBy(rs.getLong("modified_by")); bid.setModifiedDate(rs.getTimestamp("modified_date")); bid.setStatus(BidStatus.fromString(rs.getString("bid_status"))); bid.setDeliveredTime(rs.getTimestamp("expected_delievery_time")); List<NotesBean> notes = notesManager.getAllNotesByBidId(rs.getLong("bid_id")); bid.setNotes(notes); try { UserDetailsBean userDetials = userManager.getUserInfoByUserId(bidderUserId); if (userDetials != null) { bid.setBidderRating(userDetials.getRating()); } } catch (InvalidUsernameException e) { log.error("Error : " + e.getMessage(), e); } return bid; } }, bidderUserId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } @Override public List<BidsBean> getAllBidsCreatedByCSRId(long bidderUserId) { try { String sql = "SELECT * from bid where created_by=?;"; return jdbcTemplate.query(sql, new RowMapper<BidsBean>() { @Override public BidsBean mapRow(ResultSet rs, int rownumber) throws SQLException { BidsBean bid = new BidsBean(); bid.setBidId(rs.getLong("bid_id")); bid.setAmount(rs.getDouble("amount")); bid.setBidderUserId(rs.getLong("bidder_id")); bid.setFaberCharges(rs.getDouble("faber_charges")); bid.setCreatedBy(rs.getLong("created_by")); bid.setCreatedDate(rs.getTimestamp("created_date")); bid.setCurrency(CurrencyCodes.fromString(rs.getString("currency"))); bid.setLoadRequestId(rs.getLong("load_request_id")); bid.setModifiedBy(rs.getLong("modified_by")); bid.setModifiedDate(rs.getTimestamp("modified_date")); bid.setStatus(BidStatus.fromString(rs.getString("bid_status"))); bid.setDeliveredTime(rs.getTimestamp("expected_delievery_time")); List<NotesBean> notes = notesManager.getAllNotesByBidId(rs.getLong("bid_id")); bid.setNotes(notes); try { UserDetailsBean userDetials = userManager.getUserInfoByUserId(bidderUserId); if (userDetials != null) { bid.setBidderRating(userDetials.getRating()); } } catch (InvalidUsernameException e) { log.error("Error : " + e.getMessage(), e); } return bid; } }, bidderUserId); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } @Override public List<LoadRequest> getAllLoadRequestByRegion(String country, String state, String city, InBetweenCitiesExist cityExist) { try { StringBuilder providerQuery = new StringBuilder( "select DISTINCT(lr.*),lrd.shipping_start_datetime from load_requests as lr left join load_request_details as lrd on lr.load_request_id = lrd.load_request_id " + " "); if (cityExist != InBetweenCitiesExist.ALL) { providerQuery.append( " left join postal_addresses as p on lrd.start_location_id = p.postal_addresses_id OR lrd.end_location_id = p.postal_addresses_id" + " join load_request_cities city on p.city LIKE CONCAT('%',city.source_city,'%' ) "); } providerQuery.append(" where lr.is_deleted=false and lr.load_request_status NOT IN ('" + LoadRequestStatus.DELIVERED.getValue() + "','" + LoadRequestStatus.CANCELLED.getValue() + "','" + LoadRequestStatus.EXPIRED.getValue() + "','"+LoadRequestStatus.BLOCKED_REQUEST.getValue()+"') "); if (cityExist != InBetweenCitiesExist.ALL) { if (cityExist == InBetweenCitiesExist.NOT_EXISTS) providerQuery.append(" and (city.cities ='[]' or city.cities ='' )"); if (cityExist == InBetweenCitiesExist.EXISTS) providerQuery.append(" and (city.cities !='[]')"); } /* * if ((country != null && !"".equals(country)) || (state != null && * !"".equals(state)) || (city != null && !"".equals(city))) { * providerQuery.append("and ("); if (country != null && !"".equals(country)) * providerQuery.append(" p.country='" + country + "'"); if (state != null && * !"".equals(state)) providerQuery.append(" and p.state_province='" + state + * "'"); if (city != null && !"".equals(city)) * providerQuery.append(" and p.city='" + city + "'"); * providerQuery.append(")"); } */ providerQuery.append(" ORDER BY lrd.shipping_start_datetime ASC; "); return jdbcTemplate.query(providerQuery.toString(), new RowMapper<LoadRequest>() { @Override public LoadRequest mapRow(ResultSet rs, int rownumber) throws SQLException { LoadRequest lr = new LoadRequest(); lr.setLoadRequestId(rs.getLong("load_request_id")); lr.setBiddingEndDatetime(rs.getTimestamp("bidding_end_datetime")); lr.setBiddingStartDatetime(rs.getTimestamp("bidding_start_datetime")); lr.setInsuranceNeeded(rs.getBoolean("insurance_needed")); String truckType = rs.getString("truck_type"); if(truckType !=null && !"".equals(truckType)) lr.setTruckType(TruckType.fromString(truckType)); lr.setUserId(rs.getLong("user_id")); lr.setLoadRequestStatus(LoadRequestStatus.fromString(rs.getString("load_request_status"))); lr.setCreatedBy(rs.getLong("created_by")); lr.setModifiedBy(rs.getLong("modified_by")); lr.setCreatedDate(rs.getTimestamp("created_date")); lr.setModifiedDate(rs.getTimestamp("modified_date")); return lr; } }); } catch (DataAccessException e) { log.error("Error : " + e.getMessage(), e); return null; } } }
In the biggest haul in Jammu and Kashmir, police on Friday recovered narcotics worth Rs 100 crore hidden in a truck coming from Pakistan-occupied Kashmir (PoK) as part of the cross-border trade in Uri sector. Sources said the vehicle challan mentioned almonds as the goods being imported from PoK, while Bandipora's Shoukat Habib Trading Corporation was named as the importer. "We have recovered 114 packets of brown sugar from a truck at the Salamabad trade facilitation centre in Uri today," said Govind Ratan, sub-divisional police officer, Uri. Ratan said the seized contraband weighed nearly 100 kg, which is worth around Rs 100 crore in the international market. The driver of the vehicle has been detained for questioning, and the matter would be taken up with cross-Line of Control trade officials of PoK. This is the second incident of its kind since the beginning of the cross-LoC trade between the divided parts of Kashmir in 2008. In August last year, police recovered cocaine worth Rs 10 crore from a truck plying on the Srinagar-Muzaffarabad route, at Sheeri in Uri sector.
<reponame>EmanuelHerrendorf/mapping-core /* * exp_util.cpp * * Created on: 14.01.2016 * Author: mika */ #include "cache/experiments/exp_util.h" #include "cache/experiments/cheat.h" #include "cache/priv/connection.h" #include "datatypes/raster.h" #include "datatypes/pointcollection.h" #include "datatypes/linecollection.h" #include "datatypes/polygoncollection.h" #include "datatypes/plot.h" #include "util/sizeutil.h" #include "util/gdal.h" #include <chrono> #include <deque> #include <algorithm> time_t parseIso8601DateTime(std::string dateTimeString) { const std::string dateTimeFormat { "%Y-%m-%dT%H:%M:%S" }; //TODO: we should allow millisec -> "%Y-%m-%dT%H:%M:%S.SSSZ" std::get_time and the tm struct dont have them. //std::stringstream dateTimeStream{dateTimeString}; //TODO: use this with gcc >5.0 tm queryDateTime; //std::get_time(&queryDateTime, dateTimeFormat); //TODO: use this with gcc >5.0 strptime(dateTimeString.c_str(), dateTimeFormat.c_str(), &queryDateTime); //TODO: remove this with gcc >5.0 time_t queryTimestamp = timegm(&queryDateTime); //TODO: is there a c++ version for timegm? //TODO: parse millisec return (queryTimestamp); } void parseBBOX(double *bbox, const std::string bbox_str, CrsId crsId, bool allow_infinite) { // &BBOX=0,0,10018754.171394622,10018754.171394622 for (int i = 0; i < 4; i++) bbox[i] = NAN; // Figure out if we know the extent of the CRS // WebMercator, http://www.easywms.com/easywms/?q=en/node/3592 // minx miny maxx maxy double extent_webmercator[4] { -20037508.34, -20037508.34, 20037508.34, 20037508.34 }; double extent_latlon[4] { -180, -90, 180, 90 }; double extent_msg[4] { -5568748.276, -5568748.276, 5568748.276, 5568748.276 }; double *extent = nullptr; if (crsId == CrsId::from_epsg_code(3857)) extent = extent_webmercator; else if (crsId == CrsId::from_epsg_code(4326)) extent = extent_latlon; else if (crsId == CrsId::from_epsg_code(0x9E05)) extent = extent_msg; std::string delimiters = " ,"; size_t current, next = -1; int element = 0; do { current = next + 1; next = bbox_str.find_first_of(delimiters, current); std::string stringValue = bbox_str.substr(current, next - current); double value = 0; if (stringValue == "Infinity") { if (!allow_infinite) throw ArgumentException("cannot process BBOX with Infinity"); if (!extent) throw ArgumentException( "cannot process BBOX with Infinity and unknown CRS"); value = std::max(extent[element], extent[(element + 2) % 4]); } else if (stringValue == "-Infinity") { if (!allow_infinite) throw ArgumentException("cannot process BBOX with Infinity"); if (!extent) throw ArgumentException( "cannot process BBOX with Infinity and unknown CRS"); value = std::min(extent[element], extent[(element + 2) % 4]); } else { value = std::stod(stringValue); if (!std::isfinite(value)) throw ArgumentException( "BBOX contains entry that is not a finite number"); } bbox[element++] = value; } while (element < 4 && next != std::string::npos); if (element != 4) throw ArgumentException("Could not parse BBOX parameter"); /* * OpenLayers insists on sending latitude in x and longitude in y. * The MAPPING code (including gdal's projection classes) don't agree: east/west should be in x. * The simple solution is to swap the x and y coordinates. * OpenLayers 3 uses the axis orientation of the projection to determine the bbox axis order. https://github.com/openlayers/ol3/blob/master/src/ol/source/imagewmssource.js ~ line 317. */ if (crsId == CrsId::from_epsg_code(4326)) { std::swap(bbox[0], bbox[1]); std::swap(bbox[2], bbox[3]); } // If no extent is known, just trust the client. if (extent) { double bbox_normalized[4]; for (int i = 0; i < 4; i += 2) { bbox_normalized[i] = (bbox[i] - extent[0]) / (extent[2] - extent[0]); bbox_normalized[i + 1] = (bbox[i + 1] - extent[1]) / (extent[3] - extent[1]); } // Koordinaten können leicht ausserhalb liegen, z.B. // 20037508.342789, 20037508.342789 for (int i = 0; i < 4; i++) { if (bbox_normalized[i] < 0.0 && bbox_normalized[i] > -0.001) bbox_normalized[i] = 0.0; else if (bbox_normalized[i] > 1.0 && bbox_normalized[i] < 1.001) bbox_normalized[i] = 1.0; } for (int i = 0; i < 4; i++) { if (bbox_normalized[i] < 0.0 || bbox_normalized[i] > 1.0) throw ArgumentException("BBOX exceeds extent"); } } //bbox_normalized[1] = 1.0 - bbox_normalized[1]; //bbox_normalized[3] = 1.0 - bbox_normalized[3]; } // // Test extensions // TestNodeServer::TestNodeServer(const NodeConfig &config ) : NodeServer(config, NodeCacheManager::from_config(config)) { } bool TestNodeServer::owns_current_thread() { for (auto &t : workers) { if (std::this_thread::get_id() == t->get_id()) return true; } return (delivery_thread != nullptr && std::this_thread::get_id() == delivery_thread->get_id()) || std::this_thread::get_id() == my_thread_id; } void TestNodeServer::run_node_thread(TestNodeServer* ns) { ns->my_thread_id = std::this_thread::get_id(); ns->run(); } NodeCacheManager& TestNodeServer::get_cache_manager() { return *manager; } // Test index TestIdxServer::TestIdxServer(const IndexConfig &cfg) : IndexServer(cfg) { } void TestIdxServer::trigger_reorg(uint32_t node_id, const ReorgDescription& desc) { Log::info("Triggering reorg"); for ( auto &n : nodes ) { if ( n.first == node_id ) { n.second->send_reorg(desc); wakeup(); return; } } throw ArgumentException(concat("No node found for id ", node_id)); } TestIdxServer::~TestIdxServer() { QueryStats cumulated; for (auto &p : nodes) { Node &n = *p.second; cumulated += n.get_query_stats(); } cumulated += query_manager->get_stats(); std::cout << "Cumulated " << cumulated.to_string() << std::endl; std::cout << query_manager->get_stats().to_string() << std::endl; } void TestIdxServer::wait_for_idle_control_connections() { bool all_idle = true; // Wait until connections are idle; do { if (!all_idle) std::this_thread::sleep_for(std::chrono::milliseconds(10)); all_idle = true; for (auto &kv : nodes) { all_idle &= kv.second->is_control_connection_idle(); } } while (!all_idle); } void TestIdxServer::force_stat_update() { wait_for_idle_control_connections(); for (auto &kv : nodes) { kv.second->send_stats_request(); } wakeup(); wait_for_idle_control_connections(); } void TestIdxServer::force_reorg() { force_stat_update(); reorganize(true); wakeup(); wait_for_idle_control_connections(); } void TestIdxServer::reset_stats() { for (auto &p : nodes) p.second->reset_query_stats(); query_manager->reset_stats(); } SystemStats TestIdxServer::get_stats() { return query_manager->get_stats(); } // // Test Cache Manager // NodeCacheManager& TestCacheMan::get_instance_mgr(int i) { return *instances.at(i)->manager; } CacheWrapper<GenericRaster>& TestCacheMan::get_raster_cache() { for (auto i : instances) if (i->owns_current_thread()) return raster_wrapper.at(i); throw ArgumentException("Unregistered instance called cache-manager"); } CacheWrapper<PointCollection>& TestCacheMan::get_point_cache() { return get_current_instance().get_point_cache(); } CacheWrapper<LineCollection>& TestCacheMan::get_line_cache() { return get_current_instance().get_line_cache(); } CacheWrapper<PolygonCollection>& TestCacheMan::get_polygon_cache() { return get_current_instance().get_polygon_cache(); } CacheWrapper<GenericPlot>& TestCacheMan::get_plot_cache() { return get_current_instance().get_plot_cache(); } void TestCacheMan::add_instance(TestNodeServer *inst) { instances.push_back(inst); raster_wrapper.emplace(inst, TestCacheWrapper<GenericRaster>(inst->manager->get_raster_cache(), costs)); } NodeCacheManager& TestCacheMan::get_current_instance() const { for (auto i : instances) { if (i->owns_current_thread()) return *i->manager; } throw ArgumentException("Unregistered instance called cache-manager"); } void TestCacheMan::reset_costs() { costs.all_cpu = 0; costs.all_gpu = 0; costs.all_io = 0; costs.self_cpu = 0; costs.self_gpu = 0; costs.self_io = 0; costs.uncached_cpu = 0; costs.uncached_gpu = 0; costs.uncached_io = 0; } LocalTestSetup::LocalTestSetup( int num_nodes, const NodeConfig &cfg, const IndexConfig &icfg) : ccm("127.0.0.1", icfg.port), idx_server( std::make_unique<TestIdxServer>(icfg)) { uint nport = cfg.delivery_port; for (int i = 1; i <= num_nodes; i++) { NodeConfig ncfg(cfg); ncfg.delivery_port = nport++; nodes.push_back( std::make_unique<TestNodeServer>(ncfg) ); } for (auto &n : nodes) mgr.add_instance(n.get()); CacheManager::init(&mgr); threads.push_back( std::make_unique<std::thread>(&IndexServer::run, idx_server.get())); std::this_thread::sleep_for(std::chrono::milliseconds(100)); for (auto &n : nodes) threads.push_back( std::make_unique<std::thread>(TestNodeServer::run_node_thread, n.get())); std::this_thread::sleep_for(std::chrono::milliseconds(100)); } LocalTestSetup::~LocalTestSetup() { for (auto &n : nodes) n->stop(); for (size_t i = 1; i < threads.size(); i++) threads[i]->join(); idx_server->stop(); threads[0]->join(); Log::warn("Test-Setup done!"); } ClientCacheManager& LocalTestSetup::get_client() { return ccm; } TestIdxServer& LocalTestSetup::get_index() { return *idx_server; } TestNodeServer& LocalTestSetup::get_node(uint32_t id) { for (auto &n : nodes) if (n->get_id() == id) return *n; throw ArgumentException(concat("No node with id: ", id)); } std::vector<std::unique_ptr<TestNodeServer> >& LocalTestSetup::get_nodes() { return nodes; } TestCacheMan& LocalTestSetup::get_manager() { return mgr; } ProfilingData& TestCacheMan::get_costs() { return costs; } template<class T, CacheType TYPE> TracingCacheWrapper<T, TYPE>::TracingCacheWrapper( std::vector<QTriple>& query_log, size_t &size) : size(size), query_log(query_log) { } template<class T, CacheType TYPE> bool TracingCacheWrapper<T, TYPE>::put(const std::string& semantic_id, const std::unique_ptr<T>& item, const QueryRectangle& query, const QueryProfiler& profiler) { (void) semantic_id; (void) item; (void) query; (void) profiler; query_log.push_back(QTriple(TYPE, query, semantic_id)); size += SizeUtil::get_byte_size(*item); return false; } template<class T, CacheType TYPE> std::unique_ptr<T> TracingCacheWrapper<T, TYPE>::query(GenericOperator& op, const QueryRectangle& rect, QueryProfiler &profiler) { (void) op; (void) rect; (void) profiler; throw NoSuchElementException("NOP"); } TracingCacheManager::TracingCacheManager() : size(0), query_log(), rw(query_log, size), pw(query_log, size), lw( query_log, size), pow(query_log, size), plw(query_log, size) { } CacheWrapper<GenericRaster>& TracingCacheManager::get_raster_cache() { return rw; } CacheWrapper<PointCollection>& TracingCacheManager::get_point_cache() { return pw; } CacheWrapper<LineCollection>& TracingCacheManager::get_line_cache() { return lw; } CacheWrapper<PolygonCollection>& TracingCacheManager::get_polygon_cache() { return pow; } CacheWrapper<GenericPlot>& TracingCacheManager::get_plot_cache() { return plw; } ParallelExecutor::ParallelExecutor(const std::deque<QTriple>& queries, ClientCacheManager& mgr, int num_threads) : queries(queries), mgr(mgr), num_threads(num_threads) { } void ParallelExecutor::execute() { { std::lock_guard<std::mutex> lock(mtx); for (int i = 0; i < num_threads; i++) { threads.push_back( std::make_unique<std::thread>(&ParallelExecutor::thread_exec, this)); } } for (auto &tp : threads) tp->join(); } void ParallelExecutor::thread_exec() { while (true) { QTriple qt; { std::lock_guard<std::mutex> lock(mtx); if (queries.empty()) return; qt = queries.front(); queries.pop_front(); } CacheExperiment::execute_query(mgr, qt); } } // // Query Stuff // QTriple::QTriple() : type(CacheType::UNKNOWN), query(SpatialReference::unreferenced(), TemporalReference::unreferenced(), QueryResolution::none()) { } QTriple::QTriple(CacheType type, const QueryRectangle& query, const std::string& semantic_id) : type(type), query(query), semantic_id(semantic_id) { } QTriple& QTriple::operator =(const QTriple& t) { type = t.type; query = t.query; semantic_id = t.semantic_id; return *this; } // // SPEC // std::default_random_engine QuerySpec::generator( std::chrono::system_clock::now().time_since_epoch().count()); std::uniform_real_distribution<double> QuerySpec::distrib(0, 1); QuerySpec::QuerySpec(const std::string& workflow, CrsId crsId, CacheType type, const TemporalReference& tref, std::string name) : workflow(workflow), crsId(crsId), type(type), tref(tref), name(name), bounds( SpatialReference::extent(crsId)) { } QueryRectangle QuerySpec::rectangle(double x1, double y1, double extend, uint32_t resolution) const { return QueryRectangle( SpatialReference(crsId, x1, y1, x1 + extend, y1 + extend), tref, type == CacheType::RASTER ? QueryResolution::pixels(resolution, resolution) : QueryResolution::none()); } QueryRectangle QuerySpec::random_rectangle_percent(double p, uint32_t resolution) const { return random_rectangle((bounds.x2 - bounds.x1) * p, resolution); } QueryRectangle QuerySpec::random_rectangle(double extend, uint32_t resolution) const { double rx = bounds.x2 - bounds.x1 - extend; double ry = bounds.y2 - bounds.y1 - extend; double x1, y1; x1 = distrib(generator) * rx + bounds.x1; y1 = distrib(generator) * ry + bounds.y1; return rectangle(x1, y1, extend, resolution); } std::vector<QueryRectangle> QuerySpec::disjunct_rectangles(size_t num, double extend, uint32_t resolution) const { size_t guard = 0; // Create disjunct rectangles std::vector<QueryRectangle> rects; while (rects.size() < num && guard < 10000) { auto rect = random_rectangle(extend, resolution); bool add = true; for (auto &r : rects) { add &= (rect.x2 < r.x1 || rect.x1 > r.x2) && (rect.y2 < r.y1 || rect.y1 > r.y2); } if (add) { guard = 0; rects.push_back(rect); } else guard++; } if (rects.size() < num) throw OperatorException("Impossible to create disjunct rectangles"); return rects; } std::vector<QueryRectangle> QuerySpec::disjunct_rectangles_percent(size_t num, double percent, uint32_t resolution) const { return disjunct_rectangles(num, (bounds.x2 - bounds.x1) * percent, resolution); } size_t QuerySpec::get_num_operators() const { auto op = GenericOperator::fromJSON(workflow); return get_num_operators(op.get()); } size_t QuerySpec::get_num_operators(GenericOperator *op) const { size_t res = 1; for (int i = 0; i < op->MAX_SOURCES; i++) { if (op->sources[i]) res += get_num_operators(op->sources[i]); } return res; } std::vector<QTriple> QuerySpec::guess_query_steps( const QueryRectangle& rect) const { std::vector<QTriple> result; auto op = GenericOperator::fromJSON(workflow); result.push_back(QTriple(type, rect, op->semantic_id)); get_op_spec(op.get(), rect, result); std::reverse(result.begin(), result.end()); return result; } void QuerySpec::get_op_spec(GenericOperator* op, QueryRectangle rect, std::vector<QTriple> &result) const { int offset = 0; CacheType type[] = { CacheType::RASTER, CacheType::POINT, CacheType::LINE, CacheType::POLYGON }; if (op->type == "projection") { auto casted = dynamic_cast<ProjectionOperator*>(op); GDAL::CRSTransformer transformer(casted->dest_crsId, casted->src_crsId); QueryRectangle projected = casted->projectQueryRectangle(rect, transformer); rect = projected; } else if (op->type == "timeShiftOperator") { auto casted = dynamic_cast<TimeShiftOperator*>(op); TimeModification time_modification = casted->createTimeModification( rect); auto shifted = time_modification.apply(rect); rect = QueryRectangle(rect, shifted, rect); } for (int i = 0; i < GenericOperator::MAX_INPUT_TYPES; i++) { for (int j = 0; j < op->sourcecounts[i]; j++) { result.push_back( QTriple(type[i], rect, op->sources[offset + j]->semantic_id)); get_op_spec(op->sources[offset + j], rect, result); } offset += op->sourcecounts[i]; } } // // Experiments // void CacheExperiment::execute_query(GenericOperator& op, const QueryRectangle& query, CacheType type, QueryProfiler &qp) { switch (type) { case CacheType::RASTER: { op.getCachedRaster(query, QueryTools(qp)); break; } case CacheType::POINT: op.getCachedPointCollection(query, QueryTools(qp)); break; case CacheType::LINE: op.getCachedLineCollection(query, QueryTools(qp)); break; case CacheType::POLYGON: op.getCachedPolygonCollection(query, QueryTools(qp)); break; case CacheType::PLOT: op.getCachedPlot(query, QueryTools(qp)); break; default: throw ArgumentException("Illegal query type"); } } void CacheExperiment::execute_query(const QTriple& query, QueryProfiler &qp) { auto op = GenericOperator::fromJSON(query.semantic_id); execute_query(*op, query.query, query.type, qp); } void CacheExperiment::execute_query(ClientCacheManager& mgr, const QTriple& t) { QueryProfiler qp; auto op = GenericOperator::fromJSON(t.semantic_id); switch (t.type) { case CacheType::RASTER: mgr.get_raster_cache().query(*op, t.query, qp); break; case CacheType::POINT: mgr.get_point_cache().query(*op, t.query, qp); break; case CacheType::LINE: mgr.get_line_cache().query(*op, t.query, qp); break; case CacheType::POLYGON: mgr.get_polygon_cache().query(*op, t.query, qp); break; case CacheType::PLOT: mgr.get_plot_cache().query(*op, t.query, qp); break; default: throw ArgumentException("Illegal query type"); } } void CacheExperiment::execute_queries(const std::vector<QTriple>& queries, QueryProfiler &qp) { for (auto &q : queries) execute_query(q, qp); } size_t CacheExperiment::duration(const TimePoint& start, const TimePoint& end) { return std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count(); } CacheExperiment::CacheExperiment(const std::string& name, uint32_t num_runs) : name(name), num_runs(num_runs) { } void CacheExperiment::run() { std::cout << "Running experiment " << name << " (" << num_runs << " times)" << std::endl; TimePoint start = SysClock::now(); std::cout << "Setting up environment..." << std::flush; global_setup(); std::cout << " done" << std::endl; for (uint32_t i = 1; i <= num_runs; i++) { std::cout << "Executing run " << i << "/" << num_runs << "..." << std::flush; setup(); run_once(); teardown(); std::cout << " done" << std::endl; } std::cout << "Results: " << std::endl; print_results(); std::cout << "Tearing down environment..."; global_teardown(); std::cout << " done" << std::endl; TimePoint end = SysClock::now(); std::cout << "Finished experiment " << name << ". Total execution time: " << duration(start, end) << "ms" << std::endl; std::cout << "==============================================================" << std::endl; } void CacheExperiment::global_setup() { } void CacheExperiment::global_teardown() { } void CacheExperiment::setup() { } void CacheExperiment::teardown() { } CacheExperimentSingleQuery::CacheExperimentSingleQuery(const std::string& name, const QuerySpec& spec, uint32_t num_runs) : CacheExperiment(name + " - " + spec.name, num_runs), query_spec(spec) { } CacheExperimentMultiQuery::CacheExperimentMultiQuery(const std::string& name, const std::vector<QuerySpec>& specs, uint32_t num_runs) : CacheExperiment(concat(name, " - ", specs.size(), " queries"), num_runs), query_specs(specs) { }
Corrigendum: Informational approach to the quantum symmetrization postulate (2015 New J. Phys.17 013043) Q Q, * p p = ( ) ( ) and equation, Q 1, p =  ( ) only hold for permutations p that are self-inverses,, 1 p p = not for all p as stated. As it turns out, the remainder of the argument, contained in subpart (ii) and continuing thereafter, can be minimallymodified in such away that it does not requiremaking use of equation at all.We now give this modification. For the sake of clarity, we give themodified argument, culminating in the final expression for H,,...,, N 1 2 a a a p p p ( ) ! in full. (ii)Establishing Q Q p p = ¢ ( ) ( )whenever p and p¢ are both odd or both even. In equation (A11), let k,,, i i i a d d = + p p p p p ¢ ( ) where k is some constant. Then, using equations (A18), namely where 1 pdenotes the inverse permutation to, p that is 1 ppis the identity permutation. 1 p The reason is that, under reversal, the permutation p with amplitude a p yields the amplitude 1 a¢ p -for the permutation 1 p -(see figure 1). Consequently, the unnumbered equation that follows and equation, only hold for permutations p that are self-inverses,, 1 p p = not for all p as stated. As it turns out, the remainder of the argument, contained in subpart (ii) and continuing thereafter, can be minimally modified in such a way that it does not require making use of equation That is, any two permutations,,, p p that are connected by a pair of transpositions have the same Q-value. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. But every even permutation can be written as a product of an even number of transpositions and the identity permutation. Therefore, all even permutations have the same Q-value, Q e. Similarly, every odd permutation can be written as a product of an even number of transpositions and a given odd permutation. Therefore, all odd permutations have the same Q-value, Q o. Finally, equation where sgn p ( ) takes the value 1 + or 1 according to whether p is even or odd. Insofar as the probability of the transition of the system of N indistinguishable particles is concerned, the multiplicative phase factor Q 1 p ( )and the complex conjugation are irrelevant. More generally, consider a system,,  that consists of subsystems 1  and, 2  where 1  consists of N indistinguishable particles of one type (say, electrons). Suppose, first, that 2  only contains particles that can be distinguished from those in. be performed on 1  at times t 1 and t 2. Additionally, let measurements U and V be performed on 2  at t 1 and t 2, respectively, yielding outcomes u and v. Let a p be the amplitude of the transition of  from (ℓ: u) to (m: v) in which the particles in 1  are treated as distinguishable and make the transition described by. p Then, by the same argument as described above, the amplitude of the process from (ℓ: u) to (m: v) where the particles in 1  are treated as indistinguishable is given by H,,...,, N 1 2 a a a p p p () ! and the transition probability is again unaffected by the overall sign or complex conjugation of H. In the case that 2  does contain, say, M particles that are indistinguishable from those in, 1  the boundaries of 1  must be redrawn to encompass them. The resulting situation, namely a system composed of subsystem, 1  ¢ containing N + M indistinguishable particles, and subsystem, 2  ¢ containing only particles that are distinguishable from those in, 1  ¢ is of the same type the as one previously considered. Therefore, in general, the overall multiplicative factor Q, 1 p ( ) which has modulus unity 2, and the complex conjugation in equation (5b), are irrelevant insofar as predictions are concerned, and can be discarded without any loss of generality. Hence, without loss of generality, we can take equation (5a) with Q 1, 1 p = ( ) namely ℓ ℓ ℓ at t 2. The amplitude of this process can be computed in two different ways. As shown on the left, one can first take the amplitude of the indistinguishableparticle process with the measurements in their original order, and then take its complex-conjugate to get H, ;, where 0 s = or 1 s = is the only remaining degree of freedom, corresponding respectively to bosons and fermions. The above result for the amplitude holds for a particular labelling of the outcomes at times t 1 and t 2. However, the corresponding transition probability is invariant under relabelling of these outcomes. To see this, suppose that the outcomes at t 1 and t 2 are relabelled such that i
// GetConfig gets the values from ./config/config.yaml and parses them into a Config struct. func GetConfig() *generator.Config { c := &generator.Config{} fp, err := ioutil.ReadFile(configYaml) if err != nil { cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("failed to read config file %v: (%v)", configYaml, err)) } if err = yaml.Unmarshal(fp, c); err != nil { cmdError.ExitWithError(cmdError.ExitError, fmt.Errorf("failed to unmarshal config file %v: (%v)", configYaml, err)) } return c }
Nano-scale Biophysical and Structural Investigations on Intact and Neuropathic Nerve Fibers by Simultaneous Combination of Atomic Force and Confocal Microscopy The links between neuropathies of the peripheral nervous system (PNS), including Charcot-Marie-Tooth1A and hereditary neuropathy with liability to pressure palsies, and impaired biomechanical and structural integrity of PNS nerves remain poorly understood despite the medical urgency. Here, we present a protocol describing simultaneous structural and biomechanical integrity investigations on isolated nerve fibers, the building blocks of nerves. Nerve fibers are prepared from nerves harvested from wild-type and exemplary PNS neuropathy mouse models. The basic principle of the designed experimental approach is based on the simultaneous combination of atomic force microscopy (AFM) and confocal microscopy. AFM is used to visualize the surface structure of nerve fibers at nano-scale resolution. The simultaneous combination of AFM and confocal microscopy is used to perform biomechanical, structural, and functional integrity measurements at nano- to micro-scale. Isolation of sciatic nerves and subsequent teasing of nerve fibers take ~45 min. Teased fibers can be maintained at 37°C in a culture medium and kept viable for up to 6 h allowing considerable time for all measurements which require 34 h. The approach is designed to be widely applicable for nerve fibers from mice of any PNS neuropathy. It can be extended to human nerve biopsies. INTRODUCTION Schwann cells (SCs) are of crucial importance for the development, maintenance, and regeneration of the peripheral nervous system (PNS) (Jessen and Mirsky, 2005). They form myelin around peripheral axons, thereby enabling the high-speed propagation of action potentials. In addition to myelin secretion around large and small caliber axons, myelinating SCs, and their associated axons are enwrapped in a continuous basal lamina secreted by SCs which is only 25 nm thick. Different roles have been proposed for this basal lamina, including SC proliferation, survival, migration, and myelination (;;;Colognato and Tzvetanova, 2011), but very little is known about its role in the biomechanical support to the nerve fiber. Interestingly, it has been suggested that impaired peripheral nerve biomechanics is directly linked to various neuropathies (Suter and Scherer, 2003;), but the links between nerve biomechanics and neuropathies remain poorly understood. Only a few experiments have described the biomechanical properties of peripheral nerves in vivo (;Topp and Boyd, 2012). In some cases, the mechanical measurements were performed on single nerve fibers (). However, the fibers were fixed and therefore the physiological interpretation remains debatable (;;). To gain a better understanding of the biomechanics of PNS nerves, we developed a novel strategy enabling biomechanical investigation of isolated living native peripheral nerve fibers based on simultaneous combination of AFM and confocal microscopy. Biomechanical, structural, and functional investigations were carried out on isolated nerve fibers from wild-type animals and the neuropathic animal model Pmp22 −/−. This knockout model is especially relevant because the peripheral myelin protein 22 (PMP22) is closely connected with several hereditary human PNS neuropathies (Suter and Scherer, 2003;), including Charcot-Marie-Tooth1A (CMT1A) and hereditary neuropathy with liability to pressure palsies (HNPP). CMT1A and HNPP are associated with mechanical vulnerability and structural remodeling of nerves, in particular myelin and basal lamina of nerve fibers (Amici, 2006;). They are also associated with an increase in the permeability of myelin and disruption of cell junction complexes in the peripheral nerve (). Impaired biomechanical integrity (vulnerability to mechanical compression and lack of recovery) and leakiness are paralleled by severely reduced nerve conduction velocity and are therefore assumed to account for the clinical symptoms (;). The AFM-confocal microscopy setup we present here provides novel insights into understanding the links between nerve fibers biomechanics and neuropathies. Experimental Design AFM is simultaneously combined with confocal microscopy to investigate native never fibers from multiple structural and biophysical aspects. AFM is applied as a mechanical and structural nano-tool alike. It enables structural investigation of nerve fibers surface at nano-resolution. At the same time, it is used to indent nerve fibers and study their response to the mechanical load. The simultaneous combination with confocal microscopy is used to perform biomechanical, structural and functional integrity measurements at nano-to micro-scale. The role of biomechanics in diverse biomedical research areas is gaining substantial attention. This includes development, maintenance, differentiation of cells, and tissues as well as diseases (Ingber, 2003;;;). The protocol presented here combines the biophysical nano-approach AFM and confocal microscopy simultaneously to investigate biomechanics of native peripheral nerve fibers from wild-type and neuropathic mice. Hence, this step-by-step protocol can be applied to investigate biomechanical properties of a variety of mouse animal models of peripheral neuropathies such as CMT1A among others (). In addition, this protocol can be utilized to investigate nerve biomechanics of young animals including rats, extending its applicability to an increased number of PNS diseases (Meyer Zu Hrste and Nave, 2006). Nerves may be investigated in the same way as their individual building blocks. Nerve biopsies from human patients with PNS neuropathies can also be tested. Such investigations will provide valuable information about the biomechanical changes in the peripheral nervous tissue during development and disease. All in all, the protocol targets a broad audience from biophysical, biomedical and clinical research. Step-by-Step Protocol (Timing for Each Step) The steps in sections 4 and 5a involve the preparation of the AFM-Confocal system for biomechanical and viability investigations. These can be done before step 1 in order to save time (∼30 min) between the sample preparation and the measurements. 1 Preparation of Adhesive Surfaces (Time: 10 min) Nerve fibers can be mechanically separated (teased) on 25 mm glass coverslips or 35 mm glass-bottom dishes coated with the adhesive protein CellTak TM. (a) For coverslips: Clean 25 mm round glass coverslips by first immersing them in 70% ethanol and then in dH 2 O. Repeat four times both the ethanol and dH 2 O washes. Start and finish with 70% ethanol. Let surfaces dry out (2 min). (b) For coverslips and glass-bottom dishes: Cover the glass surface with tissue adhesive Cell-Tak TM (mixed in + 5% acetic acid) and mechanically spread the liquid over the surface with a pipette tip to form a thin layer. After the acetic acid evaporates, a film of Cell-Tak TM is left behind. (c) Wash the surface two times with 70% ethanol and two times with dH 2 O by pipetting up and down. Let the surface dry out for 5 min. Note: Prepared substrates can be stored at 4 C for several days. Troubleshooting: we recommend immediate use for maximum adhesion of nerve fibers to the surface. 2 Isolation of Mouse Sciatic Nerve AND Teasing of Nerve Fibers (Time: 25-30 min) This part of the protocol describes a step-by-step procedure to isolate adult mouse peripheral nerve fibers for biomechanical AFM-Confocal indentation measurements. Note: The protocol can be adjusted to young, wild-type, and different neuropathic animal models. (a) Anesthetize the animal using an overdose of isoflurane contained in a closed receptacle under fume hood. Wait ∼1 min for the animal to fall asleep. Remove the anesthetized mouse from the container and kill the animal by applying cervical dislocation-in accordance with the European Convention for Animal Care and Ethical Use of Laboratory Animals (State Office for Nature, Environment and Consumer Protection, North Rhine-Westphalia, Germany; File reference 84-02.05.20.12.146). (b) Spray 70% ethanol over the mouse's hind-limbs to dampen the fur. Using scissors make an incision at the level of midthigh ( Figure 1A) to expose the leg muscles. Introduce the scissor between the muscle junction to separate them and expose the sciatic nerve. (c) Using forceps, thoroughly separate the sciatic nerve from the muscles and using microdissection scissors, cut a 1 cm segment. Repeat the same procedure to dissect the sciatic nerve on the opposite leg. Troubleshooting: special care must be taken to avoid stretching the nerve during dissection. The latter can cause changes in myelin structure and nerve fiber degeneration. (d) Transfer the sciatic nerves to a 35 mm plastic petri dish halfway filled with ice-cold Neurobasal medium. (e) The following steps are performed under binocular stereomicroscope. Remove (peel off) the perineurial tissue using two extra fine tip #5 forceps. This can be performed by holding one end of the nerve with one forceps and thoroughly stripping away the perineurium with the second forceps. After perinuerium removal, different caliber fascicles are visible ( Figure 1B). Note: This step is crucial to release the nerve fascicles from the ensheathing connective tissue and facilitates the fibers' mechanical separation. (f) Using the same set of extra fine tip forceps, separate individual fascicles from the main nerve trunk and transfer one edge of a Cell-Tak TM -pre-coated glass surface. Add a drop of ice-cold Neurobasal medium over the transferred fascicle if necessary to avoid drying out. (g) Holding the end of a bundle of nerve fibers with forceps, separate a small number of the fibers from the main bundle. Using the same sharp tip forceps (alternatively a very sharp needle), further separate the nerve fibers from each other very gently by pushing them across the pre-coated surface to areas where Cell-Tak R is still dry. This procedure helps to separate the nerve fibers that promptly adhere to the substrate. Hence, single and separated nerve fibers ( Figure 1C) are necessary for biomechanical investigations with the AFM tip ( Figure 1D). Potential pitfall: Teasing of nerve fibers is the most challenging step and requires practice and patience. x 1024 pixels (approximate image size 100 100 m) until a region is found where the nerve fibers are sufficiently separated from one another, and whereby the nerve fiber in view shows homogeneous myelin staining and structural integrity (Figure 2). Potential pitfall: Breaks or damage on the nerve fibers that occurred during mechanical separation (teasing) increase the presence of FITC-Dextran in the fibers' interiors and can be visualized with the confocal microscope (Supplementary Figure 1). (h) Once a nerve fiber is targeted, drive the AFM tip down to a distance of 25-30 m from the glass surface. (i) Change the (X,Y) coordinates on the AFM software in order to position the AFM tip close to an individual nerve fiber (Figure 3 and Supplementary Video 1). 6 Simultaneous AFM-Confocal Measurements (Time: 3-4 h) (a) Once the tip is placed above a myelinated axon, rotate the confocal scanning angle in order to orient the nerve fiber vertically (Figure 3B). Note: Vertical orientation of nerve fibers is important to generate transverse views of myelinated axons (Figure 4). The AFM approaches the sample to start the indentation (blue curve). Then, it retracts and breaks loose of the sample (red curve) in order to start a new approach-retract cycle. The recorded force-separation or force-deformation curve can be used to obtain numerous parameters; for instance, indentation depth, stiffness (slope of the fitted approach curve) and elastic modulus (using the appropriate model, which depends on the shape of the AFM tip as an indenter; refer to "Point 7: Data interpretation and analysis ") (). Loss of mechanical integrity may be detectable as ruptures or "breakthrough" events in the curve (). Modified from Rosso et al.. myelinated axon. Make sure that the AFM tip is placed in the center of the image and above the nerve fiber as shown in Figure 3C. Open the images with the AFM data analysis. Convert the obtained force-distance curves to force-indentation curves by correcting the cantilever deflection caused by the piezo movement. Provide the software (if necessary) with the calculated cantilever's spring constant. The elastic Young's modulus of nerve fibers is determined with the Hertz-Sneddon model corrected for pyramidal indenters (). For a sharp pyramidal AFM tip, the tipsample force (F) is proportional to the square of the sample indentation (), and its relation is given by the following equation: F is the loading force, E is the elastic Young's modulus, is the Poisson's ratio of the sample ( = 0.5 is a value commonly used for cells), is the half-opening angle to the face of the tip ( = 10.7 ) and is the indentation depth. Note: For the calculation of the MSCT tip semi-included face angle, a regular pyramid with a 15 vertex angle (based on the manufacturer information) can be assumed. The corresponding semi-included angle to the face is ∼10.7. (b) Force-curve fitting and biomechanical analysis. Elasticity values from wild-type and neuropathic nerve fibers can be obtained by fitting the slope of the recorded force-indentation curves using software analysis. For the calculation of overall nerve fiber elasticity (Young's modulus) only the extension curve (approach) is considered. The elasticity is determined by compressing the nerve fiber at a given loading force. The resulting force-indentation curve can be fit from the contact point to the end (maximum indentation, Figure 4B). Curve fitting analysis can be carried out using different computer programs such as Protein Unfolding and Nano-Indentation Software (PUNIAS, site.voila.fr/punias) or JPK/SPM data processing software (JPK, Germany, www.jpk.com) among others. Estimated elasticity values can be exported and processed using Origin Pro 8.0 software for graphic production and statistical analysis (Origin Lab Corporation, USA). Advantages The method has broad applicability to investigate biophysical properties of biological samples at the nano-and macro-scale levels. Samples are preserved in their native state without any chemical treatment throughout the whole process of investigation. Biomechanical (AFM) and structural (confocal) measurements are carried out simultaneously and correlated immediately and directly to one another. The vast majority of related publications so far have investigated the biomechanical and structural integrity of biological samples separately from one another. The method is adaptable to the demands of the samples of interest (normal and pathological nerve samples, such as demyelinopathies and axonopathies). Disadvantages In-depth training is needed to perform the teasing of nerve fibers and safely use the combined AFM-Confocal setup. Biomechanical investigations are limited to samples that are not too stiff for AFM tips. Measurements can only be done in vitro. ANTICIPATED RESULTS Neuropathic animal models, Pmp22 −/−, exhibit biomechanical vulnerability and are prone to conduction block when exposed to compression (). We anticipate significant differences in biomechanical, structural and functional integrity between intact and neuropathic nerve fibers. Representative AFM-Confocal images for biomechanical, functional, and structural integrity investigations on myelinated nerve fibers from intact and Pmp22 −/− mice are shown in Figures 4, 5. Nerve fibers are kept in a medium containing 70 kDa dextran. They are then exposed to incremental loading forces and their response is tested. The high molecular weight dextran is excluded from axonal entry unless fibers lose their biomechanical, structural or functional integrity. Surface Morphology The basal lamina of nerve fibers from Pmp22 −/− mice is assumed to be loose and we therefore anticipate marked differences in the surface architecture of Pmp22 −/− compared to intact fibers. As a matter of fact, Pmp22 −/− nerve fibers exhibit a basal lamina arrangement pattern (parallel) which is significantly different from the pattern in intact fibers (interwoven) (Figure 5). The basal lamina is crucial for mechanoprotection of nerve fibers. Hence, we expect that alteration in its structure will impair the biomechanical integrity of nerve fibers. Indeed, chemical digestion of collagen from the basal lamina is paralleled by high vulnerability to mechanical compression ( Figure 5). Elasticity/Viscoelasticity Fully elastic materials strain when stretched and rapidly restore their original shape once the stress is removed. Viscoelastic materials possess both elastic and viscosity properties and exhibit time-dependent strain rate. The elastic Young's modulus provides information about stiffness and elasticity and can be derived from force-deformation curves obtained with AFM (Figure 4 and "Point 7: Data interpretation and analysis"). Likewise, the elastic/viscoelastic behavior of fibers can be derived from the force-deformation curves upon fibers indentation (Figure 4). We anticipate no full elastic behavior of nerve fibers. We also anticipate significantly lower elastic modulus of Pmp22 −/− compared to intact fibers. Indeed, the apparent overall elasticity of myelinated nerve fibers from intact mice (31.4 ± 8.8 kPa, N = 11) is significantly higher compared to Pmp22 −/− (15.6 ± 5.2 kPa, N = 11) fibers (). Viscoelasticity presents as an hysteresis loop in force-deformation curves; approach and retract curves are non-linear and do not coincide. Intact nerve fibers show viscoelastic behavior whereas (Figure 4) Pmp22 −/− are plastic and thus strain irreversibly when exposed to stress (). Recovery Time This is the average time necessary for nerve fibers to recover after force removal. We expect either a lack or slowdown of recovery time after compression in neuropathic nerve fibers. Based on the analysis of force-indentation curves, it takes intact nerve fibers 2-6 s to fully recover after removal of the force (Figure 5A, right image). In contrast, nerve fibers from Pmp22 −/− mice fail to recover ( Figure 5C). Digestion of collagen from the basal lamina of intact fibers deprives them of the ability to recover ( Figure 5C). Functional, Structural, and Biomechanical Integrity Functional, structural, and biomechanical integrity is crucial for high conduction velocity of myelinated nerve function. We therefore anticipate mechanical resilience of intact myelinated nerve fibers. As a matter of fact, exposure of intact myelinated nerve fibers to substantial mechanical forces in incremental steps to the extent of squeezing fail to inflict structural or functional damage upon them. The sharp and stiff AFM tip can be likened to a needle exerting remarkable local pressure while mechanically probing the fibers, and yet the resulting pressure is resisted. Not only the axon caliber but also the tightness of myelin which is reinforced by the correct assembly of compact myelin proteins such as PMP22 is critical to ensure the high conduction velocity (). Increase in nerve fiber permeability across the myelin sheath in paranodal regions has been shown to severely reduce the nerve conduction velocity (). Therefore, structural, functional, and biomechanical integrity of intact nerve fibers naturally prevents leakiness. We anticipate leakiness to naturally excluded large macromolecules, 70 kDa FITC-dextran, in nerve fibers lacking biomechanical integrity. Consistently, following digestion of collagens from the mechanoprotective basal lamina in nerve fibers from intact mice, leakiness is visualized as dextran entry into axons in combined AFM-Confocal images (). Breakthrough Events Lack of mechanical resilience is detectable as "breakthrough events" in force-deformation curves. These events represent the disruption, softening and destabilization of nerve fibers when mechanically probed by the sharp AFM tip during sample indentation. They can be visualized in the approach curves as "jagged zones." The zones are an indicator of nerve fiber vulnerability to compression or impaired mechanical resilience (). AUTHOR CONTRIBUTIONS VS and GR designed the experiments, analyzed data, and wrote up the manuscript paper. GR carried out all the experiments, analyzed data, and prepared the figures. PY and IL contributed to the design of the experiments and the paper, and were actively involved in the analysis of the data and provided essential inputs.
/* $NetBSD: disklabel_scan.c,v 1.3 2009/01/18 12:13:03 lukem Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation * by <NAME>. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> #ifndef lint __COPYRIGHT( "@(#) Copyright (c) 2002\ The NetBSD Foundation, Inc. All rights reserved."); __RCSID("$NetBSD: disklabel_scan.c,v 1.3 2009/01/18 12:13:03 lukem Exp $"); #endif #include <string.h> #include <unistd.h> #include <util.h> #include <sys/disklabel.h> #define SCAN_INCR 4 int disklabel_scan(struct disklabel *lp, char *buf, size_t buflen) { size_t i; /* scan for the correct magic numbers. */ for (i=0; i <= buflen - sizeof(*lp); i += SCAN_INCR) { memcpy(lp, buf + i, sizeof(*lp)); if (lp->d_magic == DISKMAGIC && lp->d_magic2 == DISKMAGIC) goto sanity; } return 1; sanity: /* we've found something, let's sanity check it */ if (lp->d_npartitions > MAXPARTITIONS || disklabel_dkcksum(lp)) return 1; return 0; }
Progress toward the total synthesis of psymberin/irciniastatin A. In this paper, we describe our synthesis of four key building blocks for the total synthesis of psymberin and its C4 epimer. Despite early difficulties in processing material to the advanced intermediate stage, we have been successful in developing high-yielding syntheses for the pyran core, natural side chain, 4-epi side chain, and aryl fragments of the molecule. Our findings from the optimization process are presented herein.
<gh_stars>0 // // BondiBlue.h // BondiBlue // // Created by <NAME> on 2018/12/02. // Copyright © 2018 <NAME>. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for BondiBlue. FOUNDATION_EXPORT double BondiBlueVersionNumber; //! Project version string for BondiBlue. FOUNDATION_EXPORT const unsigned char BondiBlueVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <BondiBlue/PublicHeader.h>
<filename>eventstore/store_forecast_events.go<gh_stars>10-100 package eventstore import ( "context" "database/sql" "github.com/alphagov/paas-billing/eventio" "github.com/lib/pq" ) var _ eventio.BillableEventForecaster = &EventStore{} const ( DummyOrgGUID = "00000001-0000-0000-0000-000000000000" DummyOrgName = "my-org" DummySpaceGUID = "00000001-0001-0000-0000-000000000000" DummySpaceName = "my-space" ) func (s *EventStore) ForecastBillableEventRows(ctx context.Context, events []eventio.UsageEvent, filter eventio.EventFilter) (eventio.BillableEventRows, error) { tx, err := s.db.BeginTx(ctx, nil) if err != nil { return nil, err } rows, err := s.forecastBillableEventRows(tx, events, filter) if err != nil { tx.Rollback() return nil, err } return rows, nil } func (s *EventStore) forecastBillableEventRows(tx *sql.Tx, events []eventio.UsageEvent, filter eventio.EventFilter) (eventio.BillableEventRows, error) { eventGUIDs := []string{} for _, ev := range events { _, err := tx.Exec(` insert into events ( event_guid, resource_guid, resource_name, resource_type, org_guid, org_name, space_guid, space_name, duration, plan_guid, plan_name, number_of_nodes, memory_in_mb, storage_in_mb ) values ( $1::uuid, $2::uuid, $3::text, $4::text, $5::uuid, $6::text, $7::uuid, $8::text, tstzrange($9::timestamptz, $10::timestamptz), $11::uuid, 'simulated', $12::numeric, $13::numeric, $14::numeric ) `, ev.EventGUID, ev.ResourceGUID, ev.ResourceName, ev.ResourceType, ev.OrgGUID, ev.OrgName, ev.SpaceGUID, ev.SpaceName, ev.EventStart, ev.EventStop, ev.PlanGUID, ev.NumberOfNodes, ev.MemoryInMB, ev.StorageInMB, ) if err != nil { return nil, err } eventGUIDs = append(eventGUIDs, ev.EventGUID) } _, err := tx.Exec(` insert into billable_event_components ( select * from generate_billable_event_components() where event_guid = any($1) ) `, pq.Array(eventGUIDs)) if err != nil { return nil, err } return s.getBillableEventRows(tx, filter) } func (s *EventStore) ForecastBillableEvents(input []eventio.UsageEvent, filter eventio.EventFilter) ([]eventio.BillableEvent, error) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() rows, err := s.ForecastBillableEventRows(ctx, input, filter) if err != nil { return nil, err } defer rows.Close() events := []eventio.BillableEvent{} for rows.Next() { ev, err := rows.Event() if err != nil { return nil, err } events = append(events, *ev) } if err := rows.Err(); err != nil { return nil, err } return events, nil }
/** * Fill in a service description by introspecting the implementation * class. */ public void loadServiceDescByIntrospection(Class implClass) { if (introspectionComplete || implClass == null) { return; } this.implClass = implClass; if (Skeleton.class.isAssignableFrom(implClass)) { isSkeletonClass = true; loadSkeletonOperations(); } /** If the class knows what it should be exporting, * respect its wishes. */ AxisServiceConfig axisConfig = null; try { Method method = implClass.getDeclaredMethod( "getAxisServiceConfig", new Class [] {}); if (method != null && Modifier.isStatic(method.getModifiers())) { axisConfig = (AxisServiceConfig)method.invoke(null, null); } } catch (Exception e) { } if (axisConfig != null) { String allowedMethodsStr = axisConfig.getAllowedMethods(); if (allowedMethodsStr != null && !"*".equals(allowedMethodsStr)) { ArrayList methodList = new ArrayList(); StringTokenizer tokenizer = new StringTokenizer(allowedMethodsStr, " ,"); while (tokenizer.hasMoreTokens()) { methodList.add(tokenizer.nextToken()); } setAllowedMethods(methodList); } } loadServiceDescByIntrospectionRecursive(implClass); for (Iterator iterator = operations.iterator(); iterator.hasNext();) { OperationDesc operation = (OperationDesc) iterator.next(); if (operation.getMethod() == null) { throw new InternalException( Messages.getMessage("badWSDDOperation", operation.getName(), "" + operation.getNumParams())); } } if ((style == Style.MESSAGE) && operations.size() == 1) { messageServiceDefaultOp = (OperationDesc)operations.get(0); } introspectionComplete = true; }
<gh_stars>0 package de.othr.threads; public class TimerApp { public static void main(String[] args) { Timer t1 = new Timer("Spaghetti", 8); Timer t2 = new Timer("Sosse", 15); t1.start(); t2.start(); try { do { System.out.println(t1.getState()); Thread.sleep(1000); } while (t1.getState() != Thread.State.TERMINATED); } catch (InterruptedException e) { } main2(args); main3(args); } private static void main2(String[] args) { new Thread() { @Override public void run() { System.out.println("Hallo!"); } }.start(); } private static void main3(String[] args) { new Thread(() -> { System.out.println("Pizza-Timer gestartet."); try { Thread.sleep(15*1000); } catch (InterruptedException e) { System.out.println("Pizza-Timer unterbrochen."); } System.out.println("Pizza-Timer abgelaufen."); }).start(); } }
/* * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.cloud.servicebroker.autoconfigure.web.reactive; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.Objects; import com.jayway.jsonpath.JsonPath; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import reactor.core.publisher.Mono; import org.springframework.cloud.servicebroker.controller.CatalogController; import org.springframework.cloud.servicebroker.model.BrokerApiVersion; import org.springframework.cloud.servicebroker.model.catalog.Catalog; import org.springframework.cloud.servicebroker.service.CatalogService; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.web.reactive.server.WebTestClient; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.BDDMockito.given; @ExtendWith(MockitoExtension.class) class ApiVersionWebFilterIntegrationTest { private static final String CATALOG_PATH = "/v2/catalog"; private static final Charset UTF_8 = StandardCharsets.UTF_8; @InjectMocks private CatalogController controller; @Mock private CatalogService catalogService; @Test void noHeaderSent() { mockWithExpectedVersion().get().uri(CATALOG_PATH) .accept(MediaType.APPLICATION_JSON) .exchange() .expectStatus().isBadRequest() .expectBody() .consumeWith(result -> { String responseBody = new String(Objects.requireNonNull(result.getResponseBody()), UTF_8); String description = JsonPath.read(responseBody, "$.description"); assertThat(description).contains("expected-version"); }); } @Test void incorrectHeaderSent() { mockWithExpectedVersion().get().uri(CATALOG_PATH) .header(BrokerApiVersion.DEFAULT_API_VERSION_HEADER, "wrong-version") .accept(MediaType.APPLICATION_JSON) .exchange() .expectStatus().isEqualTo(HttpStatus.PRECONDITION_FAILED) .expectBody() .consumeWith(result -> { String responseBody = new String(Objects.requireNonNull(result.getResponseBody()), UTF_8); String description = JsonPath.read(responseBody, "$.description"); assertThat(description).contains("expected-version"); assertThat(description).contains("wrong-version"); }); } @Test void matchingHeaderSent() { given(catalogService.getCatalog()) .willReturn(Mono.just(Catalog.builder().build())); mockWithExpectedVersion().get().uri(CATALOG_PATH) .header(BrokerApiVersion.DEFAULT_API_VERSION_HEADER, "expected-version") .accept(MediaType.APPLICATION_JSON) .exchange() .expectStatus().isOk(); } @Test void anyHeaderNotSent() { given(catalogService.getCatalog()) .willReturn(Mono.just(Catalog.builder().build())); mockWithDefaultVersion().get().uri(CATALOG_PATH) .accept(MediaType.APPLICATION_JSON) .exchange() .expectStatus().isOk(); } @Test void anyHeaderSent() { given(catalogService.getCatalog()) .willReturn(Mono.just(Catalog.builder().build())); mockWithDefaultVersion().get().uri(CATALOG_PATH) .header(BrokerApiVersion.DEFAULT_API_VERSION_HEADER, "ignored-version") .accept(MediaType.APPLICATION_JSON) .exchange() .expectStatus().isOk(); } private WebTestClient mockWithDefaultVersion() { return WebTestClient.bindToController(controller) .webFilter(new ApiVersionWebFilter(new BrokerApiVersion())) .build(); } private WebTestClient mockWithExpectedVersion() { return WebTestClient.bindToController(controller) .webFilter(new ApiVersionWebFilter(new BrokerApiVersion("expected-version"))) .build(); } }
Peter Neil Temple Wells CBE. 19 May 193622 April 2017 Peter Wells will be remembered internationally for his many outstanding contributions in the field of medical ultrasound. He pioneered the development of non-invasive imaging techniques in the development of ultrasonics as a diagnostic and surgical tool. He was the originator and developer of instruments for ultrasonic surgery and ultrasonic power measurement, as well as the two-dimensional, articulated-arm ultrasonic general purpose scanner and the water-immersion ultrasonic breast scanner. He demonstrated ultrasonic-pulsed Doppler range-gating, and was the discoverer of the ultrasonic Doppler signal characteristic of malignant tumour neovascularization. He investigated ultrasonic bioeffects and formulated ultrasonic safety guidelines and conditions for prudent use of ultrasonic diagnosis. His outstanding and sustained achievements in the medical applications of ultrasound extend continuously from the 1960s until a few days before his death at the age of 80. Anyone who has ever benefited from an ultrasound procedure owes a debt of gratitude to Peter Wells.
Comparisons between the antianesthetic action of dibutyryl cyclic AMP and analeptic drugs on amobarbital-induced narcosis in the rat. The dose-related antianesthetic and antidotal property of dibutyryl cyclic AMP, devoid of toxic effects, imparts uniqueness to the nucleotide as an arousal agent. Of the analeptic drugs studied (d-amphetamine, picrotoxin, pentylenetetrazol, caffeine, theophylline, strychnine, ethamivan and doxapram), only picrotoxin demonstrated antianesthetic properties. However, picrotoxin was associated with severe toxicity at all dose levels tested. No analeptic drug is effective in reversing the central nervous system depression produced by sedative, hypnotic or tranquilizer drug overdosage.
/// appends absop to a linked list of absops used to build the statement void append(absop **ops_list, absop *newop) { if(ops_list[0] == NULL) { ops_list[0] = newop; return; } absop *x = ops_list[0]; for(; x->next != NULL; x = x->next) {} x->next = newop; }
// Copyright (c) 2021 <NAME> #ifndef GRAPHVISUALISATION_PROGRESSBAR_H_ #define GRAPHVISUALISATION_PROGRESSBAR_H_ #include <atomic> #include <mutex> #include <iostream> class ProgressBar { public: void set_progress(float value) { progress_ = value; } void set_bar_width(size_t width) { bar_width_ = width; } void fill_bar_progress_with(const std::string& chars) { fill_ = chars; } void fill_bar_remainder_with(const std::string& chars) { remainder_ = chars; } void set_status_text(const std::string& status) { status_text_ = status; } void update(float value, std::ostream &os = std::cout) { set_progress(value); write_progress(os); } void write_progress(std::ostream &os = std::cout) { // No need to write once progress is 100% if (progress_ > 100.0f) return; // Move cursor to the first position on the same line and flush os << "\r" << std::flush; // Start bar os << "["; const auto completed = static_cast<size_t>(progress_ * static_cast<float>(bar_width_) / 100.0); for (size_t i = 0; i < bar_width_; ++i) { if (i <= completed) os << fill_; else os << remainder_; } // End bar os << "]"; // Write progress percentage os << " " << std::min(static_cast<size_t>(progress_), size_t(100)) << "%"; // Write status text os << " " << status_text_; } private: std::atomic<float> progress_{0.0f}; size_t bar_width_{60}; std::string fill_{"#"}, remainder_{" "}, status_text_{""}; }; #endif // GRAPHVISUALISATION_PROGRESSBAR_H
The mayor's race in St. John's just got some more bite — and bark — as Finn begins his campaign to be the city's top dog. Campaign manager Glenn Redmond says running for mayor is something Finn has been thinking about for sometime, and he's been busy putting his paws to the pavement and marking his territory with his campaign strategy. He will work day and night to get things done. - Glenn Redmond "Finn being an Australian cattle dog, he's a tireless worker, he doesn't know when to stop. He will work day and night to get things done," Redmond said. "Potholes [are] a big issue for Finn, as well as snow clearing and stuff in the wintertime. He's an avid walker, and these are certainly things that [would be] concerns for him." See more of Finn in the player above.
// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ #define PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_ #include "base/basictypes.h" #include "ppapi/c/pp_module.h" #include "ppapi/c/pp_resource.h" #include "ppapi/proxy/interface_proxy.h" struct PPB_CharSet_Dev; struct PPB_Core; namespace pp { namespace proxy { class SerializedVarReturnValue; class PPB_CharSet_Proxy : public InterfaceProxy { public: PPB_CharSet_Proxy(Dispatcher* dispatcher, const void* target_interface); virtual ~PPB_CharSet_Proxy(); const PPB_CharSet_Dev* ppb_char_set_target() const { return static_cast<const PPB_CharSet_Dev*>(target_interface()); } // InterfaceProxy implementation. virtual const void* GetSourceInterface() const; virtual InterfaceID GetInterfaceId() const; virtual void OnMessageReceived(const IPC::Message& msg); private: // Message handlers. void OnMsgUTF16ToCharSet(const string16& utf16, const std::string& char_set, int32_t on_error, std::string* output, bool* output_is_success); void OnMsgCharSetToUTF16(const std::string& input, const std::string& char_set, int32_t on_error, string16* output, bool* output_is_success); void OnMsgGetDefaultCharSet(PP_Module module, SerializedVarReturnValue result); // Returns the local PPB_Core interface for freeing strings. const PPB_Core* GetCoreInterface(); // Possibly NULL, lazily initialized by GetCoreInterface. const PPB_Core* core_interface_; DISALLOW_COPY_AND_ASSIGN(PPB_CharSet_Proxy); }; } // namespace proxy } // namespace pp #endif // PPAPI_PROXY_PPB_CHAR_SET_PROXY_H_
package edu.nwpu.store.web.servlet; import java.io.IOException; import java.sql.SQLException; import java.util.List; import javax.servlet.annotation.WebServlet; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import edu.nwpu.store.domain.Category; import edu.nwpu.store.domain.User; import edu.nwpu.store.service.CategoryService; import edu.nwpu.store.service.UserService; import edu.nwpu.store.service.serviceIml.CategoryServiceImp; import edu.nwpu.store.service.serviceIml.UserServiceIml; import edu.nwpu.store.utils.MailUtils; import edu.nwpu.store.utils.MyBeanUtils; import edu.nwpu.store.utils.UUIDUtils; import edu.nwpu.store.web.base.BaseServlet; @WebServlet("/UserServlet") public class UserServlet extends BaseServlet { private static final long serialVersionUID = 1L; // registerUI:跳转到注册页面 public String registerUI(HttpServletRequest request, HttpServletResponse response) { // 调用业务层功能:获取全部分类信息,返回集合 CategoryService cs = new CategoryServiceImp(); List<Category> categoryList = null; try { categoryList = cs.getAllCategories(); } catch (SQLException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } // 将返回的集合放入request request.setAttribute("allCategories", categoryList); return "/jsp/register.jsp"; } // userRegister:真正的注册实现 public String userRegister(HttpServletRequest request, HttpServletResponse response) { try { User user = new User(); // 接收表单参数 MyBeanUtils.populate(user, request.getParameterMap()); // 为用户的其他属性赋值:uid,state,code user.setUid(UUIDUtils.getId()); user.setState(0); user.setCode(user.getUid() + user.getUid()); // 调用业务层注册功能 UserService us = new UserServiceIml(); us.userRegister(user); // 注册成功就返回注册成功的信息,失败则捕捉异常返回注册失败的信息 request.setAttribute("msg", "用户注册成功,请激活!"); // 注册成功,向用户邮箱发送激活信息 MailUtils.sendMail(user.getEmail(), user.getCode()); } catch (Exception e) { e.printStackTrace(); // 失败则捕捉异常返回注册失败的信息 request.setAttribute("msg", "用户注册失败,请重新注册!"); } return "/jsp/info.jsp"; } // activeAccount:激活账号 public String activeAccount(HttpServletRequest request, HttpServletResponse response) { // 获取激活码 String code = request.getParameter("code"); // 调用业务层激活功能 UserService us = new UserServiceIml(); boolean flag = false; try { flag = us.activeAccount(code); } catch (SQLException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } // 进行激活的信息提示 if (flag == true) { // 用户激活成功,向request放入提示信息,转发到登录界面 request.setAttribute("msg", "您已经成功激活账号,请登录!"); return "/jsp/login.jsp"; } else { // 用户激活成功,向request放入提示信息,转发到失败信息提示页面 request.setAttribute("msg", "激活码无效,激活失败!"); return "/jsp/info.jsp"; } } // loginUI:跳转到登录页面 public String loginUI(HttpServletRequest request, HttpServletResponse response) { return "/jsp/login.jsp"; } // userLogin:用户登录的实际实现(包括用户登录、自动登录、记住用户名的业务逻辑) public String userLogin(HttpServletRequest request, HttpServletResponse response) { // 获取用户数据(账户 + 密码)并封装 User user = MyBeanUtils.populate(User.class, request.getParameterMap()); // 调用业务层登录功能 UserService us = new UserServiceIml(); try { // user的判null在serviceiml中做了 user = us.userLogin(user); // 用户登录成功,将用户信息放入session中 request.getSession().setAttribute("loginUser", user); // 处理自动登录的业务 String autoLogin = request.getParameter("autoLogin"); // 如果勾选,用cookie记录用户信息 if ("1".equals(autoLogin)) { Cookie autoLoginCookie = new Cookie("autoLoginCookie", user.getUsername() + "@" + user.getPassword()); autoLoginCookie.setPath("/"); // cookie保存路径 autoLoginCookie.setMaxAge(60 * 60 * 24 * 7); // 保存cookie的时间 response.addCookie(autoLoginCookie); } else { // 如果没勾选,删除cookie Cookie autoLoginCookie = new Cookie("autoLoginCookie", ""); autoLoginCookie.setPath("/"); autoLoginCookie.setMaxAge(0); response.addCookie(autoLoginCookie); } // 处理记住用户名的业务 String rememberUN = request.getParameter("rememberUserName"); // 勾选了记住用户名的选项 if ("1".equals(rememberUN)) { Cookie rememberUNCookie = new Cookie("rememberUNCookie", user.getUsername()); rememberUNCookie.setPath("/"); rememberUNCookie.setMaxAge(60*60*24*7); response.addCookie(rememberUNCookie); } else { // 没有勾选记住用户名的选项 Cookie rememberUNCookie = new Cookie("rememberUNCookie", ""); rememberUNCookie.setPath("/"); rememberUNCookie.setMaxAge(0); response.addCookie(rememberUNCookie); } // 重定向到首页 response.sendRedirect("/store_nwpu_v1/index.jsp"); return null; } catch (Exception e) { // 用户登录失败 String msg = e.getMessage(); // System.out.println(msg); // 向request中放入登录失败的信息 request.setAttribute("msg", msg); // 转发到登录界面 return "/jsp/login.jsp"; } } // logout::用户退出 public String logout(HttpServletRequest request, HttpServletResponse response) { // 清除session request.getSession().invalidate(); // 清除cookie:否则会无法退出 Cookie autoLoginCookie = new Cookie("autoLoginCookie", ""); autoLoginCookie.setPath("/"); autoLoginCookie.setMaxAge(0); response.addCookie(autoLoginCookie); try { // 重定向到首页 response.sendRedirect("/store_nwpu_v1/index.jsp"); } catch (IOException e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } return null; } // Ajax检查用户名 public void checkUserName(HttpServletRequest request, HttpServletResponse response) { // System.out.println("******checkusername*****************"); // 接收文本框的值 User user = MyBeanUtils.populate(User.class, request.getParameterMap()); // 业务层进行查询 UserService us = new UserServiceIml(); try { user = us.checkUserName(user); // 判断业务层返回的结果,向前端发送消息:0没有,1有 if (user == null) { // 用户名没有被使用 response.getWriter().print(0); } else { // 用户名已经被使用 response.getWriter().print(1); } } catch (Exception e) { // TODO 自动生成的 catch 块 e.printStackTrace(); } } }
A South Korean intelligence officer who used a controversial surveillance system from Italy’s Hacking Team was found dead over the weekend in an apparent suicide as controversy swirls in the country over use of the software. The officer, identified by local media only as Lim, was a 20-year cyber-security veteran of the country’s National Intelligence Service (NIS) and ran the department that used the software, according to reports. Dealings between Hacking Team and the NIS were made public when a cache of the company’s emails was recently published on the Internet. The software, called “Remote Control System,” allows users to target the computer or cellphones of people and install a spyware application that gives the user access to the target’s communications. It is said to be resistant to attempts at removal and the leaked emails show Hacking Team sold and demonstrated the system to law enforcement agencies across the world. As part of the Hacking Team leak, a log file of IP addresses was published that is said to include some at Korea Telecom, national broadcaster KBS, Seoul National University and major portal and instant messaging service Daum Kakao. One of the leaked emails notes that Hacking Team’s South Korean customers are interested in gaining access to Kakao chat. “There was no spying on locals in relation to elections at all,” the note said, according to Yonhap News. The NIS had previously told South Korea’s parliament that its use of the Hacking Team software was for external surveillance purposes.
<gh_stars>0 package nextstep.subway.path.domain; import nextstep.subway.line.domain.Section; import nextstep.subway.station.domain.Station; import org.jgrapht.graph.DefaultWeightedEdge; import java.util.List; import java.util.stream.Collectors; public class SectionEdge extends DefaultWeightedEdge { private Section section; private SectionEdge() { } public static SectionEdge from(Section section) { SectionEdge sectionEdge = new SectionEdge(); sectionEdge.section = section; return sectionEdge; } public static List<Section> toSections(List<SectionEdge> sectionEdges) { return sectionEdges.stream() .map(SectionEdge::getSection) .collect(Collectors.toList()); } private Section getSection() { return section; } @Override protected double getWeight() { return section.getDistance(); } @Override protected Station getSource() { return section.getUpStation(); } @Override protected Station getTarget() { return section.getDownStation(); } }
<gh_stars>1-10 class Solution: def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float: tempArr = [] i = 0 j = 0 m = len(nums1) n = len(nums2) while i < m and j < n: if nums1[i] < nums2[j]: tempArr.append(nums1[i]) i += 1 else: tempArr.append(nums2[j]) j += 1 while i < m: tempArr.append(nums1[i]) i += 1 while j < n: tempArr.append(nums2[j]) j += 1 mid = (m + n) // 2 if (m + n) % 2 == 0: return (tempArr[mid - 1] + tempArr[mid]) / 2 return float(tempArr[mid])
<gh_stars>10-100 /* * s390-tools/zipl/include/error.h * Functions to handle error messages. * * Copyright IBM Corp. 2001, 2017 * * s390-tools is free software; you can redistribute it and/or modify * it under the terms of the MIT license. See LICENSE for details. * */ #ifndef ERROR_H #define ERROR_H #include "zipl.h" void error_reason(const char* fmt, ...); void error_text(const char* fmt, ...); void error_clear_reason(void); void error_clear_text(void); void error_print(void); #endif /* not ERROR_H */
Economic and social consequences of COVID-19 and mental health burden among Latinx young adults during the 2020 pandemic. Latinx young adults 18-25 years old face unique challenges that disproportionately put them at high risk of experiencing health as well as economic and social burden due to the Coronavirus disease (COVID-19) pandemic. The present study examined how economic and psychosocial consequences as a result of the pandemic were associated with mental health issues among a community sample of Latinx young adults (N = 83) from Central Texas. Participants completed an online survey of COVID-related experiences and mental health needs. The survey asked about personal and family experiences of COVID-19 in two significant areas: (a) economic strain (e.g., economic hardship, food insecurity) and (b) psychosocial burden (e.g., losing relationships, substance use). Regression analyses examined the association of COVID-19 consequences on level of mental health symptoms and clinically significant outcomes. Relative to economic consequences, psychosocial consequences due to the COVID-19 pandemic were associated with higher levels of mental health symptoms. In contrast, in few cases, economic strain resultant from the pandemic was correlated with clinically significant outcomes among this sample. Collectively, findings suggest that the costs of the pandemic do not only pertain to mortality from illness but also to morbidity as it relates to deteriorating social circumstances and mental health. Findings from this study call for immediate attention to implement policies and programs to help mitigate the economic and social-emotional consequences of COVID-19 such as easy access to low-cost virtual mental health resources to Latinx young adults. (PsycInfo Database Record (c) 2021 APA, all rights reserved) Abstract (Spanish) Los adultos jovenes latinos de 18 a 25 anos enfrentan desafios unicos que los ponen de manera desproporcionada en un alto riesgo de sufrir consecuencias de salud, economicas y sociales debido a la pandemia del COVID-19. El estudio presente examino como las consecuencias economicas y psicosociales a raiz de la pandemia se asociaron con problemas de salud mental en una muestra comunitaria de adultos jovenes latinos (N = 83) del centro de Texas. Los participantes completaron una encuesta en linea sobre experiencias relacionadas con el COVID-19 y necesidades de salud mental. La encuesta incluyo preguntas sobre las experiencias personales y familiares del COVID-19 en dos areas importantes: (a) tension economica (por ejemplo, dificultades economicas, inseguridad alimentaria) y (b) carga psicosocial (por ejemplo, perdida de relaciones, consumo de sustancias). Los analisis de regresion examinaron la asociacion de las consecuencias del COVID-19 en el nivel de los sintomas de salud mental y los resultados clinicamente significativos. En comparacion a las consecuencias economicas, las consecuencias psicosociales debido a la pandemia de COVID-19 se asociaron con niveles mas altos de sintomas de salud mental. Por el contrario, en unos pocos casos, la tension economica resultante de la pandemia se correlaciono con resultados clinicamente significativos en esta muestra. En conjunto, los hallazgos sugieren que los costos de la pandemia no solo se refieren a la mortalidad por enfermedad, sino tambien a la al deterioro de las circunstancias sociales y la salud mental. Los hallazgos de este estudio exigen atencion inmediata para implementar politicas y programas que ayuden a mitigar las consecuencias economicas y socioemocionales del COVID-19, como el facil acceso a recursos virtuales de salud mental de bajo costo para adultos jovenes latinos. (PsycInfo Database Record (c) 2021 APA, all rights reserved) Impact Statement Young adults are often underrepresented in research and practice, which is concerning because they face unique mental health risks. Our study found that Coronavirus disease (COVID-19) and shelter-in-place measures during the first 6 months of the pandemic burdened Latinx young adults economically and interpersonally, which was associated with poor mental health outcomes. Findings from this study call for immediate action to implement policies that help reduce the social and economic impact of COVID-19 on Latinx young adults. (PsycInfo Database Record (c) 2021 APA, all rights reserved)
<filename>src/test/java/com/sumologic/log4j/BufferedSumoLogicAppenderTest.java /** * _____ _____ _____ _____ __ _____ _____ _____ _____ * | __| | | | | | | | | __| | | * |__ | | | | | | | | | |__| | | | |- -| --| * |_____|_____|_|_|_|_____| |_____|_____|_____|_____|_____| * * UNICORNS AT WARP SPEED SINCE 2010 * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package com.sumologic.log4j; import com.sumologic.log4j.server.AggregatingHttpHandler; import com.sumologic.log4j.server.MaterializedHttpRequest; import com.sumologic.log4j.server.MockHttpServer; import org.apache.log4j.Logger; import org.apache.log4j.PatternLayout; import org.apache.log4j.helpers.LogLog; import org.junit.After; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; /** * @author: <NAME> (<EMAIL>) */ public class BufferedSumoLogicAppenderTest { private static final int PORT = 10010; private static final String ENDPOINT_URL = "http://localhost:" + PORT; private MockHttpServer server; private AggregatingHttpHandler handler; private Logger loggerInTest; private BufferedSumoLogicAppender appender; private void setUpLogger(BufferedSumoLogicAppender appender) { loggerInTest = Logger.getLogger("BufferedSumoLogicAppenderTest"); loggerInTest.setAdditivity(false); loggerInTest.addAppender(appender); } private void setUpLogger(int batchSize, int windowSize, int precision) { LogLog.setInternalDebugging(true); appender = new BufferedSumoLogicAppender(); appender.setUrl(ENDPOINT_URL); appender.setMessagesPerRequest(batchSize); appender.setMaxFlushInterval(windowSize); appender.setFlushingAccuracy(precision); // TODO: Shouldn't there be a default layout? appender.setLayout(new PatternLayout("%m%n")); setUpLogger(appender); appender.activateOptions(); } @Before public void setUp() throws Exception { handler = new AggregatingHttpHandler(); server = new MockHttpServer(PORT, handler); server.start(); } @After public void tearDown() throws Exception { if (loggerInTest != null) loggerInTest.removeAllAppenders(); if (server != null) server.stop(); } @Test public void testSingleMessage() throws Exception { setUpLogger(1, 10000, 10); loggerInTest.info("This is a message"); Thread.sleep(100); assertEquals(handler.getExchanges().size(), 1); assertEquals(handler.getExchanges().get(0).getBody(), "This is a message\n"); } @Test public void testMultipleMessages() throws Exception { setUpLogger(1, 10000, 1); int numMessages = 5; for (int i = 0; i < numMessages; i ++) { loggerInTest.info("info " + i); Thread.sleep(1500); } assertEquals(numMessages, handler.getExchanges().size()); } @Test public void testBatchingBySize() throws Exception { // Huge window, ensure all messages get batched into one setUpLogger(100, 10000, 1); int numMessages = 100; for (int i = 0; i < numMessages; i ++) { loggerInTest.info("info " + i); } Thread.sleep(2000); assertEquals(handler.getExchanges().size(), 1); } @Test public void testBatchingByWindow() throws Exception { // Small window, ensure all messages get batched by time setUpLogger(10000, 500, 1); loggerInTest.info("message1"); loggerInTest.info("message2"); loggerInTest.info("message3"); loggerInTest.info("message4"); loggerInTest.info("message5"); Thread.sleep(1520); loggerInTest.info("message1"); loggerInTest.info("message2"); loggerInTest.info("message3"); loggerInTest.info("message4"); loggerInTest.info("message5"); Thread.sleep(520); assertEquals(2, handler.getExchanges().size()); MaterializedHttpRequest request1 = handler.getExchanges().get(0); MaterializedHttpRequest request2 = handler.getExchanges().get(1); System.out.println(request1.getBody()); } @Test // Start with an appender without its URL set. THEN set the property and // make sure everything's still there. public void testNoUrlSetInitially() throws Exception { LogLog.setInternalDebugging(true); appender = new BufferedSumoLogicAppender(); appender.setMessagesPerRequest(1000); appender.setMaxFlushInterval(100); appender.setFlushingAccuracy(1); appender.setRetryInterval(1); // TODO: Shouldn't there be a default layout? appender.setLayout(new PatternLayout("%m%n")); appender.activateOptions(); setUpLogger(appender); for (int i = 0; i < 100; i++) { loggerInTest.info("message " + i); } appender.setUrl(ENDPOINT_URL); appender.activateOptions(); Thread.sleep(1000); assertEquals(1, handler.getExchanges().size()); } }
<reponame>fittner/SiMA<filename>ARSDecisionUnit/src/modules/interfaces/I3_3_send.java<gh_stars>0 /** * I2_17_send.java: DecisionUnits - pa.interfaces.send._v38 * * @author deutsch * 03.03.2011, 15:37:55 */ package modules.interfaces; import java.util.ArrayList; import base.datatypes.clsDriveMesh; /** * The eight drives - the four partial sexual drives divided into libidinous and aggressive components are transfered to F48. * * @author deutsch * 03.03.2011, 15:37:55 * */ public interface I3_3_send { public void send_I3_3(ArrayList<clsDriveMesh> poSexualDriveRepresentations); }
from MyFeistel import MyFeistel, LengthPreservingCipher import binascii import pytest import base64 import os class TestMyFeistel: def test_Functionality(self): key = base64.urlsafe_b64encode(os.urandom(16)) feistel = MyFeistel(key, 10) for i in xrange(20): msg = os.urandom(40) assert feistel.decrypt(feistel.encrypt(msg)) == msg def test_AllLengthMessages(self): key = base64.urlsafe_b64encode(os.urandom(16)) fstl = MyFeistel(key, 10) for i in xrange(101): txt = os.urandom(i+1) dtxt = fstl.decrypt(fstl.encrypt(txt)) assert dtxt == txt def test_zeroLengthMessage(self): key = base64.urlsafe_b64encode(os.urandom(16)) feistel = MyFeistel(key, 10) msg = os.urandom(0) assert feistel.decrypt(feistel.encrypt(msg)) == msg def test_varyingRoundsFeistel(self): key = base64.urlsafe_b64encode(os.urandom(16)) for i in xrange(4, 14): feistel = MyFeistel(key, i) msg = os.urandom(40) assert feistel.decrypt(feistel.encrypt(msg)) == msg # this test is expected to "fail" except for when the key length = 16 def test_varyingLengthKey(self): for i in xrange(10, 20): key = base64.urlsafe_b64encode(os.urandom(i)) try: feistel = MyFeistel(key, 10) # expected to raise ValueError, if so, pass and return except ValueError: pass return # otherwise fail the test pytest.fail("Did not raise key length error.") def test_msgNotEqualCtx(self): key = base64.urlsafe_b64encode(os.urandom(16)) feistel = MyFeistel(key, 10) for i in xrange(20): msg = os.urandom(40) assert feistel.encrypt(msg) != msg def test_randomnessOfCtx(self): ctxs = [] for i in xrange(100): key = base64.urlsafe_b64encode(os.urandom(16)) feistel = MyFeistel(key, 10) msg = os.urandom(40) ctx = feistel.encrypt(msg) assert ctx not in ctxs ctxs.append(ctx) class TestLengthPreservingCipher: def test_Functionality(self): key = base64.urlsafe_b64encode(os.urandom(16)) lpc = LengthPreservingCipher(key, length=5) for i in xrange(20): msg = os.urandom(5) assert lpc.decrypt(lpc.encrypt(msg)) == msg # this test is expected to "fail" except for when the data length = 5 def test_EnsureConsistentLength(self): key = base64.urlsafe_b64encode(os.urandom(16)) lpc = LengthPreservingCipher(key, length = 5) for i in xrange(1,20): msg = os.urandom(i) assert pytest.raises(Exception)
PRINCETON, N.J. and REHOVOT, Israel, Sept. 30, 2015 (GLOBE NEWSWIRE) -- Rosetta Genomics Ltd. (NASDAQ:ROSG), a leading developer and provider of microRNA-based and other molecular diagnostics, announces that the Company has reached an agreement-in-principle with FNApath of Little Rock, Arkansas, under which Rosetta Genomics will provide endocrinologists initially testing their patients for thyroid cancer with the option of using a pathologist or laboratory of their own choosing, or FNApath, a centralized laboratory with an expertise in diagnosing thyroid cancer. In the event of an indeterminate result, the sample would then be tested with RosettaGx Thyroid Reveal™, the Company's thyroid neoplasia assay for the differential diagnosis of indeterminate fine needle aspirates (FNAs). Currently, the market-leading test for indeterminate thyroid cancer FNAs in most cases requires physicians to send their patients' FNA samples to that company's designated centralized laboratory, thereby preventing physicians from working with the local pathologist of their choice, and in the case of an indeterminate result, requiring two additional FNA samples be drawn in order to run their test. "Interpretation of FNA samples from thyroid nodules is not always straightforward, which leads to an indeterminate result in up to 30% of the samples. Many patients with indeterminate results are sent to surgery as a precaution, despite the fact the majority of these cases are benign. This exposes patients to unnecessary surgical risk and costs the system hundreds of millions of dollars," stated Kenneth A. Berlin, President and Chief Executive Officer of Rosetta Genomics. "Our goal with this partnership is to give endocrinologists the option of working with the pathologists they know and trust for the initial interpretation of the sample, or to use our designated experts. This open platform eliminates the penalty of having to secure another FNA from the patient in order to further examine the sample for a more accurate diagnosis and classification. In addition, the RosettaGx Thyroid Reveal test can be run on very small samples and smears. This flexibility, coupled with other features and benefits of this assay, should provide considerable competitive advantage for RosettaGx Thyroid Reveal," said Douglas Sites, Executive Vice President, Sales and Marketing for Rosetta Genomics. Commenting on the partnership, Nicole Massoll, M.D., medical director for FNAPath Laboratories, said, "We are especially pleased to be working with Rosetta Genomics' cutting-edge diagnostic assay, RosettaGx Thyroid Reveal, as we believe it has the potential to be the most effective and efficient assay for the accurate diagnosis and classification of indeterminate thyroid FNAs. One of the advantages of using RosettaGx Thyroid Reveal is that we can work off the same cytology slides that are initially created to perform the upfront diagnosis, thus eliminating the risks, morbidity and unnecessary pain associated with a second fine needle passage into the patient's neck and also allowing Rosetta's test to be run on the very cells that the cytopathologist has already examined. We believe this partnership will give physicians the optionality they want with the superior test results they need for their patients with an indeterminate thyroid cancer diagnosis." Rosetta Genomics expects to introduce its RosettaGx Thyroid Reveal assay and to report on its clinical performance at the upcoming 15th International Thyroid Congress (ITC) and 85th Annual Meeting of the American Thyroid Association (ATA) taking place October 18-23, 2015 in Lake Buena Vista, Florida. The ITC is a collaborative meeting held every fifth year by the four world thyroid associations: ATA, Asia-Oceania Thyroid Association (AOTA), European Thyroid Association (ETA) and Latin American Thyroid Society (LATS). The ITC will bring together the international community of endocrine specialists, surgeons and other health professionals to present and discuss the latest research and developments in thyroidology. The four international thyroid associations combine their efforts to contribute to this one-of-a-kind, state-of-the-science experience. "We look forward to introducing RosettaGx Thyroid Reveal at the ITC, as it is the largest meeting of endocrinologists and others dedicated to making advances for patients with thyroid disease. It is particularly fortuitous for Rosetta that this Congress, which takes place once every five years, coincides with our expected market introduction and presentation of results from our validation testing for RosettaGx Thyroid Reveal. We believe that RosettaGx Thyroid Reveal's clinical benefits and competitive advantages will be of interest to this audience of thyroid specialists," added Mr. Berlin. Rosetta develops and commercializes a broad range of microRNA-based and other high-value molecular diagnostics. Rosetta's integrative research platform combining bioinformatics and state-of-the-art laboratory processes has led to the discovery of hundreds of biologically validated novel human microRNAs. Building on its strong patent position and proprietary platform technologies, Rosetta is working on the application of these technologies in the development and commercialization of a full range of microRNA-based diagnostic tools. Through the acquisition of PersonalizeDx, the Company also offers core FISH, IHC and PCR-based testing capabilities and partnerships in oncology and urology that provide additional content and platforms that complement the Rosetta offerings. Rosetta's cancer testing services are commercially available through the Philadelphia, PA- and Lake Forest, CA-based CAP-accredited, CLIA-certified labs. For more information visit www.rosettagenomics.com. Various statements in this release concerning Rosetta's future expectations, plans and prospects including, but not limited to statements relating to the expected timing of the launch of Rosetta Genomics' thyroid assay, Rosetta Genomics executing a definitive agreement with FNApath, Rosetta Genomics' thyroid assay providing a more accurate diagnosis and classification for Thyroid tumors, Rosetta Genomics' thyroid assay reducing the amount of FNA 'passes' into a patients neck and Rosetta Genomics' thyroid assay being the most effective and efficient assay for the accurate diagnosis and classification of indeterminate thyroid FNAs, constitute forward-looking statements for the purposes of the safe harbor provisions under The Private Securities Litigation Reform Act of 1995. Actual results may differ materially from those indicated by these forward-looking statements as a result of various important factors, including those risks more fully discussed in the "Risk Factors" section of Rosetta's Annual Report on Form 20-F for the year ended December 31, 2014 as filed with the SEC. In addition, any forward-looking statements represent Rosetta's views only as of the date of this release and should not be relied upon as representing its views as of any subsequent date. Rosetta does not assume any obligation to update any forward-looking statements unless required by law.
The Use of H2 Mutants as Models for the Study of T Cell Activation Studies of the role of the H-2 histocompatibility complex in the mouse have progressed rapidly over the last few years for several reasons. Firstly, there has been the ready availability of H-2 congenic lines and more recently of intra-H-2 recombinant strains. These latter have served, by using various parameters, to divide the H-2 complex into various regions and subregions, which, currently are K, I A, IB, U, IE, IC, S, G and D. Each region or subregion is identified by a marker locus, which effects transplantation phenomena (H-2K and H-2D), Ir genes or Ia specificities (IA, IB, IJ, IE, IC) serum lipoprotein levels (S) or a specificity (H-2.7) detected predominantly by hemagglutination (G). Secondly, the H-2 complex has been shown to effect not only transplantation (graft rejection) and the related phenomena of MLR, CML and the GVHR, but also many other phenomena, which are apparently not related to transplantation: the Ir genes; the susceptibility to various leukemic agents; serum lipoprotein and complement levels; specificities present selectively on B cells, and on some T cell subpopulations; size and weight of seminal vesicles and other sexual characteristics; cAMP levels in the liver and so on. This list, incomplete as it is, illustrates the
<reponame>chainblocks/JoltPhysics<filename>Samples/Tests/General/SensorTest.cpp // SPDX-FileCopyrightText: 2021 <NAME> // SPDX-License-Identifier: MIT #include <TestFramework.h> #include <Tests/General/SensorTest.h> #include <Physics/Collision/Shape/BoxShape.h> #include <Physics/Collision/Shape/SphereShape.h> #include <Physics/Body/BodyCreationSettings.h> #include <Utils/RagdollLoader.h> #include <Utils/Log.h> #include <Layers.h> #include <Renderer/DebugRendererImp.h> JPH_IMPLEMENT_RTTI_VIRTUAL(SensorTest) { JPH_ADD_BASE_CLASS(SensorTest, Test) } SensorTest::~SensorTest() { // Destroy the ragdoll mRagdoll->RemoveFromPhysicsSystem(); mRagdoll = nullptr; } void SensorTest::Initialize() { // Floor CreateFloor(); // Sensor BodyCreationSettings sensor_settings(new SphereShape(10.0f), Vec3(0, 10, 0), Quat::sIdentity(), EMotionType::Static, Layers::NON_MOVING); sensor_settings.mIsSensor = true; Body &sensor = *mBodyInterface->CreateBody(sensor_settings); JPH_IF_DEBUG(sensor.SetDebugName("Sensor");) mSensorID = sensor.GetID(); mBodyInterface->AddBody(mSensorID, EActivation::DontActivate); // Dynamic bodies for (int i = 0; i < 10; ++i) { Body &body = *mBodyInterface->CreateBody(BodyCreationSettings(new BoxShape(Vec3(0.1f, 0.5f, 0.2f)), Vec3(-15.0f + i * 3.0f, 25, 0), Quat::sIdentity(), EMotionType::Dynamic, Layers::MOVING)); JPH_IF_DEBUG(body.SetDebugName("Body " + ConvertToString(i))); mBodyInterface->AddBody(body.GetID(), EActivation::Activate); } // Load ragdoll Ref<RagdollSettings> ragdoll_settings = RagdollLoader::sLoad("Assets/Human.tof", EMotionType::Dynamic); if (ragdoll_settings == nullptr) FatalError("Could not load ragdoll"); // Load animation Ref<SkeletalAnimation> animation; if (!ObjectStreamIn::sReadObject("Assets/Human/Dead_Pose1.tof", animation)) FatalError("Could not open animation"); // Create pose SkeletonPose ragdoll_pose; ragdoll_pose.SetSkeleton(ragdoll_settings->GetSkeleton()); animation->Sample(0.0f, ragdoll_pose); SkeletonPose::JointState &root = ragdoll_pose.GetJoint(0); root.mTranslation = Vec3(0, 30, 0); ragdoll_pose.CalculateJointMatrices(); // Create ragdoll mRagdoll = ragdoll_settings->CreateRagdoll(1, nullptr, mPhysicsSystem); mRagdoll->SetPose(ragdoll_pose); mRagdoll->AddToPhysicsSystem(EActivation::Activate); // Create kinematic body BodyCreationSettings kinematic_settings(new BoxShape(Vec3(0.25f, 0.5f, 1.0f)), Vec3(-15, 10, 0), Quat::sIdentity(), EMotionType::Kinematic, Layers::MOVING); Body &kinematic = *mBodyInterface->CreateBody(kinematic_settings); mKinematicBodyID = kinematic.GetID(); mBodyInterface->AddBody(kinematic.GetID(), EActivation::Activate); } void SensorTest::PrePhysicsUpdate(const PreUpdateParams &inParams) { // Update time mTime += inParams.mDeltaTime; // Move kinematic body Vec3 kinematic_pos = Vec3(-15.0f * cos(mTime), 10, 0); mBodyInterface->MoveKinematic(mKinematicBodyID, kinematic_pos, Quat::sIdentity(), inParams.mDeltaTime); // Draw if the kinematic body is in the sensor if (mKinematicBodyInSensor) mDebugRenderer->DrawWireBox(mBodyInterface->GetTransformedShape(mKinematicBodyID).GetWorldSpaceBounds(), Color::sRed); // Apply forces to dynamic bodies in sensor lock_guard lock(mMutex); Vec3 center(0, 10, 0); float centrifugal_force = 10.0f; Vec3 gravity = mPhysicsSystem->GetGravity(); for (const BodyAndCount &body_and_count : mBodiesInSensor) { BodyLockWrite body_lock(mPhysicsSystem->GetBodyLockInterface(), body_and_count.mBodyID); if (body_lock.Succeeded()) { Body &body = body_lock.GetBody(); // Calculate centrifugal acceleration Vec3 acceleration = center - body.GetPosition(); float length = acceleration.Length(); if (length > 0.0f) acceleration *= centrifugal_force / length; else acceleration = Vec3::sZero(); // Draw acceleration mDebugRenderer->DrawArrow(body.GetPosition(), body.GetPosition() + acceleration, Color::sGreen, 0.1f); // Cancel gravity acceleration -= gravity; // Apply as force body.AddForce(acceleration / body.GetMotionProperties()->GetInverseMass()); } } } void SensorTest::OnContactAdded(const Body &inBody1, const Body &inBody2, const ContactManifold &inManifold, ContactSettings &ioSettings) { // Check which body is the sensor BodyID body_id; if (inBody1.GetID() == mSensorID) body_id = inBody2.GetID(); else if (inBody2.GetID() == mSensorID) body_id = inBody1.GetID(); else return; lock_guard lock(mMutex); if (body_id == mKinematicBodyID) { JPH_ASSERT(!mKinematicBodyInSensor); mKinematicBodyInSensor = true; } else { // Add to list and make sure that the list remains sorted for determinism (contacts can be added from multiple threads) BodyAndCount body_and_count { body_id, 1 }; BodiesInSensor::iterator b = lower_bound(mBodiesInSensor.begin(), mBodiesInSensor.end(), body_and_count); if (b != mBodiesInSensor.end() && b->mBodyID == body_id) { // This is the right body, increment reference b->mCount++; return; } mBodiesInSensor.insert(b, body_and_count); } } void SensorTest::OnContactRemoved(const SubShapeIDPair &inSubShapePair) { // Check which body is the sensor BodyID body_id; if (inSubShapePair.GetBody1ID() == mSensorID) body_id = inSubShapePair.GetBody2ID(); else if (inSubShapePair.GetBody2ID() == mSensorID) body_id = inSubShapePair.GetBody1ID(); else return; lock_guard lock(mMutex); if (body_id == mKinematicBodyID) { JPH_ASSERT(mKinematicBodyInSensor); mKinematicBodyInSensor = false; } else { // Remove from list BodyAndCount body_and_count { body_id, 1 }; BodiesInSensor::iterator b = lower_bound(mBodiesInSensor.begin(), mBodiesInSensor.end(), body_and_count); if (b != mBodiesInSensor.end() && b->mBodyID == body_id) { // This is the right body, increment reference JPH_ASSERT(b->mCount > 0); b->mCount--; // When last reference remove from the list if (b->mCount == 0) mBodiesInSensor.erase(b); return; } JPH_ASSERT(false, "Body pair not found"); } } void SensorTest::SaveState(StateRecorder &inStream) const { inStream.Write(mTime); inStream.Write(mBodiesInSensor); inStream.Write(mKinematicBodyInSensor); } void SensorTest::RestoreState(StateRecorder &inStream) { inStream.Read(mTime); inStream.Read(mBodiesInSensor); inStream.Read(mKinematicBodyInSensor); }
# Copyright DST Group. Licensed under the MIT license. from CybORG.Shared.Actions.MSFActionsFolder.MeterpreterActionsFolder.MeterpreterAction import MeterpreterAction from CybORG.Shared.Enums import SessionType from CybORG.Shared.Observation import Observation from CybORG.Simulator.State import State # Call localtime from a meterpreter session - gives the current local time of the dict class LocalTime(MeterpreterAction): def __init__(self, session: int, agent: str): super().__init__(session=session, agent=agent) def sim_execute(self, state: State): obs = Observation() obs.set_success(False) if self.session not in state.sessions[self.agent]: return obs session = state.sessions[self.agent][self.session] if session.session_type != SessionType.METERPRETER or not session.active: return obs obs.set_success(True) obs.add_system_info(local_time=session.host.time) return obs
The race for the Democratic Party's presidential nomination remained wide open Wednesday after senators Hillary Clinton and Barack Obama split voters and delegates in the Super Tuesday primaries. Although CNN projections showed Obama winning more states, Clinton claimed victory in several key states with higher delegate counts, including New York, which she represents in the Senate, and California. Latest estimates suggest Clinton may have picked up only about 20 more delegates than Obama in the Super Tuesday states -- and that the pair could be separated by less than 100 delegates in all voting so far. But it will take time to determine the final distribution of delegates because of complicated formulae, and because New Mexico's count is not yet final. CNN's Candy Crowley, Suzanne Malveaux and Mark Preston contributed to this report. Explainer: Who won which state?
Mass population displacement. A global public health challenge. Since the end of the Cold War, there has been a dramatic increase in civil conflicts resulting in approximately 50 million refugees and internally displaced civilians. The public health impact of these situations has been immense, comprising high rates of communicable diseases, elevated prevalence of acute malnutrition, and high excess mortality rates. The prevention of these adverse public health effects includes early warning and intervention; prompt supply of adequate food, water, and sanitation; measles immunization; effective management of epidemic communicable diseases; and simple and timely information systems.
Intracerebroventricularly and systemically delivered inhibitor of brain CYP2B (C8-Xanthate), even following chlorpyrifos exposure, reduces chlorpyrifos activation and toxicity in male rats. Chlorpyrifos is a pesticide that is metabolically activated to chlorpyrifos oxon (acetylcholinesterase inhibitor) primarily by the cytochrome P450 2B (CYP2B) enzyme subfamily in the liver and brain. We have previously shown that intracerebroventricular pretreatment with a CYP2B inhibitor, C8-Xanthate, can block chlorpyrifos toxicity. Here, we assessed whether delayed introduction of C8-Xanthate would still reduce toxicity and whether peripheral administration of C8-Xanthate could also inhibit chlorpyrifos activation in the brain and block toxicity. Male rats (N = 4-5/group) were either pretreated with C8-Xanthate (40 g intracerebroventricular or 5 mg/kg intraperitoneal), or vehicle (ACSF or saline, respectively), 24 h before chlorpyrifos treatment (125 mg/kg subcutaneous) and then treated daily with inhibitor or vehicle until 7 days post-chlorpyrifos treatment. Additional groups received vehicle pretreatment, switching to C8-Xanthate 1, 2, 3, or 4 days after chlorpyrifos and then continuing with daily C8-Xanthate treatment until 7 days post-chlorpyrifos treatment. Neurotoxicity was assessed at baseline (before chlorpyrifos) and then daily after chlorpyrifos, using behavioral assessments (e.g., gait score). Neurochemical assays (e.g., serum and brain chlorpyrifos) were performed at the end of study. Pretreatment with C8-Xanthate completely prevented chlorpyrifos toxicity, and delayed introduction of C8-Xanthate reduced toxicity, even when started up to 4 days after chlorpyrifos treatment. Discontinuation of C8-Xanthate treatment 7 days post-chlorpyrifos treatment did not result in the reappearance of toxicity, tested through 10 days after chlorpyrifos treatment. These findings suggest that CYP2B inhibitor treatment, even days after chlorpyrifos exposure, and using a peripheral delivery route, may be useful as a therapeutic approach to reduce chlorpyrifos toxicity.
Cal reserve center Shahar Gordon accompanied the team to North Carolina yesterday, but he will not be available if the Bears reach the NIT Final Four. Gordon, 19, will leave for his native Israel on Saturday to begin a three-year obligation to the Israeli army. He previously received two one-year exemptions from military service. Gordon will be available for tomorrow's NIT quarterfinal game against Wake Forest at the Greensboro Coliseum. Cal might need him, because the Demon Deacons are especially big. They outrebounded New Mexico 50-35 in a second-round win over the Lobos. The Bears leaned on Gordon, a 6-foot-10 sophomore, in Tuesday night's 60-49 victory over Georgetown. He played 14 minutes -- in part because of Sean Lampley's first- half foul trouble -- and contributed five points and five rebounds. "Shahar played very inspired and very well against Georgetown," coach Ben Braun said. "He really helped us." The Cal-Wake Forest game will tip off at 4:30 p.m. (PST) tomorrow; the game will not be televised. The winner meets the winner of Mississippi-North Carolina State in Tuesday night's NIT semifinals at Madison Square Garden in New York.
La ilegalidad del muro de Donald Trump This paper analyzes, from the perspective of international law, the impact of the construction of a wall by the United States government on the border with Mexico. Based on studies of experts in ecology, the impact on the ecosystem of the introduction of an aggressive and intrusive element such as the construction of a wall in the border region is analyzed. The border is regulated by a large number of international legal norms, which, with the construct nion of a wall, the United States violates by irreversibly damaging the ecosystem of the region. Precisely, contemporary international environmental law limits the internal sovereignty of States, in relation to acts that may harm neighbours.
Sometimes described as a cross between Trader Joe's and Whole Foods, Le Beau Market has a rooftop garden. “The bees have been pretty successful,” says Alex Omran, a co-owner of Le Beau Market on the corner of Leavenworth and Clay streets. He ticks off the fruits, herbs, and vegetables the 33-year-old, family-owned grocery store grows on its roof: tomatoes, rosemary, lemons, lavender, and adds, “Some of the stuff we sell in the store. We use the rest in the deli.” A resident of the Mission, Omran runs Le Beau with his father, having inherited it from two uncles. It’s full but not cramped, with a LaCroix display for Halloween that looks as though a skeleton died of thirst just before reaching its favorite zero-carb pamplemousse water. A sign at the grill includes this maxim: “Your stomach is important to us.” Sally Kuchar, Cities Director for Curbed SF and a former Nob Hill resident, says that Le Beau is a “huge part of the community.” “I don’t even have a word to describe them,” she says. “They’re the only real grocery store in the neighborhood. Trader Joe’s is past California, so it’s not Nob Hill.” Small and somewhat upscale, Le Beau is basically a cross between Trader’s and Whole Foods, but it has the same independent spirit you find at Bi-Rite Market. Murals on the north- and east-facing exterior walls vary considerably. The Clay Street side depicts a motley crew that could be the cast to the early Tales of the City books, while the Leavenworth facade has slightly anthropomorphic bees that have barcodes on them. (Indonesian artists affiliated with the Clarion Alley Mural Project painted it around 2003, Omran says.) Because Le Beau has an older clientele, and because mobility on the neighborhood’s steep streets is challenging, the store does deliveries and allows people run up tabs — just like an old-school market. And even if Amazon Whole Foods came a-knockin’, Omran says he’s not inclined to sell. “We would never,” he says. “I love what we do, and I don’t know what else I would do. I would like, one day, to open another location — if I could ever peel myself away from here. I feel like this is my first home, and I live somewhere else.” Le Beau Market, 1263 Leavenworth St., 415-885-3030 or lebeaumarket.com Check out more stories in our feature on Nob Hill here: Lights, Camera, Action at the Fairmont Hotel With more than 10 major films shot at the Nob Hill site, Hollywood has designated it San Francisco’s reigning cinematic hotel. A Slow But Steady Thieving Four bronze tortoises regularly disappear from Huntington Park’s fountain. The Ascent to Jones Scaling Nob Hill in pursuit of its flattest blocks. The Gardens of Fairmont The Nob Hill hotel has a picturesque rooftop park open to locals. Don’t Miss the AIDS Memorial Quilt Exhibit at Grace Cathedral By bathing 15 panels of the quilt in light, the stained glass windows sanctify the 20,000 San Franciscans who died in the modern plague. Infinite Appetite, Finite Budget: Nob Hill From the House of Prime Rib to Buffalo Theory, Nob Hill’s food scene might be more diverse than you think.
NEW ORLEANS (AP) - Don’t give up. Do get counseling. Don’t look back. Survivors coped with problems for years after Hurricane Katrina decimated coastal Mississippi and Louisiana and flooded New Orleans. Now they have hard memories and hopeful experiences to share as southeast Texas, Florida and Puerto Rico begin to recover from this year’s hurricanes. “There were so many questions,” recalls pharmacist Ruston Henry, who lost his business in the Lower 9th Ward as his home flooded in the Gentilly neighborhood. “Can it be rebuilt? Can it not be rebuilt? One thing they learned: Don’t go it alone. “The way to survive these traumas is in community,” says law professor Bill Quigley, who relocated to Houston for months after Loyola University’s law school temporarily moved its classes there. He saw solidarity in New Orleans‘ Vietnamese community and with his neighbors in the flooded Broadmoor neighborhood. “People strengthened their ties with each other and their families, and that’s how people survived,” Quigley said. Some symptoms didn’t emerge right away. Several months after Katrina’s floods subsided, many survivors developed signs of post-traumatic stress disorder — flashbacks, rapid heartbeat, feeling jumpy, sleeplessness — that lasted more than a year, according to research by Katie McLaughlin, an associate professor of psychology at the University of Washington in Seattle. McLaughlin has seen reports of communities banding together in Puerto Rico since Maria struck, even as calls continue for more outside help. Strengthening support networks can make debilitating stress and anxiety less likely, she said. After Katrina, depression was a new and stark reality for Tebo. She’s ebullient by nature — “A psychiatrist told me that I clearly have the happy gene,” she said — but with the flood damage that followed New Orleans‘ levee failures, she didn’t know where she and her husband and their children would live, or whether their neighborhood would revive. They struggled over insurance, and with the Federal Emergency Management Agency. A family friend killed himself. And then there was her work at the police crisis unit. “The majority were calls involving people who were back here trying to rebuild, who’d never really had a mental health history but were starting to feel very helpless and hopeless and very suicidal,” she recalled. It wore her down. At one point, months after the storm, “I couldn’t get out of bed for five days,” she said. Then, she decided to take action: She wrote an open letter to the media. That drew national attention to her city’s plight, and helped her recover as well. Her work now involves getting mental health support for police officers and their families through the department’s Officer Assistance Program. She put off getting counseling until about two years ago. “I should have done it earlier, probably,” she said. Mental health professionals can be scarce after a disaster, but community organizations and church groups can help. It also helps to help others, Katrina’s survivors say. Areas of Texas and Florida hit hard by Harvey and Irma need attention, but long-term assistance is crucial in Puerto Rico, where Maria ravaged already poor communities, said Dr. Sandro Galea, dean of Boston University’s public health school. “The people who are affected by these events disproportionately are always people who are marginalized, who are under social and economic strain to begin with,” Galea said. Even people with resources need to be determined, said Henry, who took a Walmart pharmacy job to provide for his wife and kids while restoring his home. “It was catastrophic, it was traumatic. But, these are the challenges that have been put before you. You’ve got to man up and make it happen,” Henry said. Some have had learned all this not just the hard way, but repeatedly. Ashley Aples lost his home and possessions when New Orleans flooded 12 years ago - “You can imagine what it feels like, but you don’t know until you get your heart broken,” he recalls - and then he moved to Houston, where he found higher-paying work and less crime. Flooded again by Harvey, he’s preparing to take his family to Dallas. His advice? Consider the Old Testament story of Lot’s wife, turning into a pillar of salt because she failed to heed a divine warning while escaping the doomed Sodom and Gomorrah. Associated Press Medical Writer Lindsey Tanner in Chicago contributed to this story.
Management of Complicated Nasal Defects. The nose is the most common site for nonmelanoma skin cancer. Fortunately, most skin cancer lesions on the nose are discovered early and their timely diagnosis and excision result in superficial defects that can be reconstructed with minimal impact on the aesthetics and function. Reconstruction of full-thickness defects of the nose remains a challenging endeavor for reconstructive surgeons. An organized and systematic approach is necessary to streamline the analysis, planning, and reconstruction complex nasal defects to consistently achieve optimal results. This article reviews options for reconstructing full-thickness nasal defects and highlights current advances in established techniques.
On July 3, 1776, following the signing of the Declaration of Independence, John Adams reflected on that important day. The second day of July 1776 will be the most memorable epoch in the history of America. I am apt to believe that it will be celebrated by succeeding generations as the great anniversary festival. It ought to be commemorated as the day of deliverance, by solemn acts of devotion to God Almighty. It ought to be solemnized with pomp and parade, with shows, games, sports, guns, bells, bonfires, and illuminations, from one end of this continent to the other, from this time forward forever. You will think me transported with enthusiasm, but I am not. I am well aware of the toil and blood and treasure that it will cost to maintain this Declaration and support and defend these States. Yet through all the gloom I can see the rays of ravishing light and glory. I can see that the end is worth more than all the means; that posterity will triumph in that day’s transaction, even though we [may regret] it, which I trust in God we shall not. Thank You, Lord, for the men and women who gave their lives for the freedom of the republic in which we live today. Help me to be as bold and brave as they were when it is my turn to protect this land. “The righteous cry out, and the Lord hears, and delivers them out of all their troubles” (Psalm 34:17).
/** * multiOTP Credential Provider, extends privacyIdea * * @author <NAME>, SysCo systemes de communication sa, <<EMAIL>> * @version 5.8.4.0 * @date 2021-11-18 * @since 2021 * @copyright (c) 2016-2021 SysCo systemes de communication sa * @copyright (c) 2015-2016 ArcadeJust ("RDP only" enhancement) * @copyright (c) 2013-2015 Last Squirrel IT * @copyright Apache License, Version 2.0 * * * Change Log * * 2021-03-24 1.0.0.0 SysCo/yj New implementation from scratch * *********************************************************************/ #pragma once #include "OfflineHandler.h" #include "Logger.h" #include "Endpoint.h" #include "PIConf.h" #include "Codes.h" #include "SecureString.h" #include <Windows.h> #include <string> #include <map> #include <functional> #include <atomic> #include "PrivacyIDEA.h" class MultiOTP : public PrivacyIDEA { public: MultiOTP(PICONFIG conf); // Tries to verify with offline otp first. If there is none, // sends the parameters to privacyIDEA and checks the response for // 1. Offline otp data, 2. Triggered challenges, 3. Authentication success // <returns> PI_AUTH_SUCCESS, PI_TRIGGERED_CHALLENGE, PI_AUTH_FAILURE, PI_AUTH_ERROR, PI_ENDPOINT_SETUP_ERROR, PI_WRONG_OFFLINE_SERVER_UNAVAILABLE </returns> HRESULT validateCheck(const std::wstring& username, const std::wstring& domain, const SecureWString& otp, const std::string& transaction_id = std::string()); private: };
// Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.25.0 // protoc v3.13.0 // source: src/main/protobuf/command_line.proto package command_line import ( proto "github.com/golang/protobuf/proto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" option_filters_go_proto "kythe.io/third_party/bazel/option_filters_go_proto" reflect "reflect" sync "sync" ) const ( // Verify that this generated code is sufficiently up-to-date. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) // Verify that runtime/protoimpl is sufficiently up-to-date. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) // This is a compile-time assertion that a sufficiently up-to-date version // of the legacy proto package is being used. const _ = proto.ProtoPackageIsVersion4 type CommandLine struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields CommandLineLabel string `protobuf:"bytes,1,opt,name=command_line_label,json=commandLineLabel,proto3" json:"command_line_label,omitempty"` Sections []*CommandLineSection `protobuf:"bytes,2,rep,name=sections,proto3" json:"sections,omitempty"` } func (x *CommandLine) Reset() { *x = CommandLine{} if protoimpl.UnsafeEnabled { mi := &file_src_main_protobuf_command_line_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CommandLine) String() string { return protoimpl.X.MessageStringOf(x) } func (*CommandLine) ProtoMessage() {} func (x *CommandLine) ProtoReflect() protoreflect.Message { mi := &file_src_main_protobuf_command_line_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CommandLine.ProtoReflect.Descriptor instead. func (*CommandLine) Descriptor() ([]byte, []int) { return file_src_main_protobuf_command_line_proto_rawDescGZIP(), []int{0} } func (x *CommandLine) GetCommandLineLabel() string { if x != nil { return x.CommandLineLabel } return "" } func (x *CommandLine) GetSections() []*CommandLineSection { if x != nil { return x.Sections } return nil } type CommandLineSection struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields SectionLabel string `protobuf:"bytes,1,opt,name=section_label,json=sectionLabel,proto3" json:"section_label,omitempty"` // Types that are assignable to SectionType: // *CommandLineSection_ChunkList // *CommandLineSection_OptionList SectionType isCommandLineSection_SectionType `protobuf_oneof:"section_type"` } func (x *CommandLineSection) Reset() { *x = CommandLineSection{} if protoimpl.UnsafeEnabled { mi := &file_src_main_protobuf_command_line_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *CommandLineSection) String() string { return protoimpl.X.MessageStringOf(x) } func (*CommandLineSection) ProtoMessage() {} func (x *CommandLineSection) ProtoReflect() protoreflect.Message { mi := &file_src_main_protobuf_command_line_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use CommandLineSection.ProtoReflect.Descriptor instead. func (*CommandLineSection) Descriptor() ([]byte, []int) { return file_src_main_protobuf_command_line_proto_rawDescGZIP(), []int{1} } func (x *CommandLineSection) GetSectionLabel() string { if x != nil { return x.SectionLabel } return "" } func (m *CommandLineSection) GetSectionType() isCommandLineSection_SectionType { if m != nil { return m.SectionType } return nil } func (x *CommandLineSection) GetChunkList() *ChunkList { if x, ok := x.GetSectionType().(*CommandLineSection_ChunkList); ok { return x.ChunkList } return nil } func (x *CommandLineSection) GetOptionList() *OptionList { if x, ok := x.GetSectionType().(*CommandLineSection_OptionList); ok { return x.OptionList } return nil } type isCommandLineSection_SectionType interface { isCommandLineSection_SectionType() } type CommandLineSection_ChunkList struct { ChunkList *ChunkList `protobuf:"bytes,2,opt,name=chunk_list,json=chunkList,proto3,oneof"` } type CommandLineSection_OptionList struct { OptionList *OptionList `protobuf:"bytes,3,opt,name=option_list,json=optionList,proto3,oneof"` } func (*CommandLineSection_ChunkList) isCommandLineSection_SectionType() {} func (*CommandLineSection_OptionList) isCommandLineSection_SectionType() {} type ChunkList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Chunk []string `protobuf:"bytes,1,rep,name=chunk,proto3" json:"chunk,omitempty"` } func (x *ChunkList) Reset() { *x = ChunkList{} if protoimpl.UnsafeEnabled { mi := &file_src_main_protobuf_command_line_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *ChunkList) String() string { return protoimpl.X.MessageStringOf(x) } func (*ChunkList) ProtoMessage() {} func (x *ChunkList) ProtoReflect() protoreflect.Message { mi := &file_src_main_protobuf_command_line_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use ChunkList.ProtoReflect.Descriptor instead. func (*ChunkList) Descriptor() ([]byte, []int) { return file_src_main_protobuf_command_line_proto_rawDescGZIP(), []int{2} } func (x *ChunkList) GetChunk() []string { if x != nil { return x.Chunk } return nil } type OptionList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields Option []*Option `protobuf:"bytes,1,rep,name=option,proto3" json:"option,omitempty"` } func (x *OptionList) Reset() { *x = OptionList{} if protoimpl.UnsafeEnabled { mi := &file_src_main_protobuf_command_line_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *OptionList) String() string { return protoimpl.X.MessageStringOf(x) } func (*OptionList) ProtoMessage() {} func (x *OptionList) ProtoReflect() protoreflect.Message { mi := &file_src_main_protobuf_command_line_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use OptionList.ProtoReflect.Descriptor instead. func (*OptionList) Descriptor() ([]byte, []int) { return file_src_main_protobuf_command_line_proto_rawDescGZIP(), []int{3} } func (x *OptionList) GetOption() []*Option { if x != nil { return x.Option } return nil } type Option struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields CombinedForm string `protobuf:"bytes,1,opt,name=combined_form,json=combinedForm,proto3" json:"combined_form,omitempty"` OptionName string `protobuf:"bytes,2,opt,name=option_name,json=optionName,proto3" json:"option_name,omitempty"` OptionValue string `protobuf:"bytes,3,opt,name=option_value,json=optionValue,proto3" json:"option_value,omitempty"` EffectTags []option_filters_go_proto.OptionEffectTag `protobuf:"varint,4,rep,packed,name=effect_tags,json=effectTags,proto3,enum=options.OptionEffectTag" json:"effect_tags,omitempty"` MetadataTags []option_filters_go_proto.OptionMetadataTag `protobuf:"varint,5,rep,packed,name=metadata_tags,json=metadataTags,proto3,enum=options.OptionMetadataTag" json:"metadata_tags,omitempty"` } func (x *Option) Reset() { *x = Option{} if protoimpl.UnsafeEnabled { mi := &file_src_main_protobuf_command_line_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } func (x *Option) String() string { return protoimpl.X.MessageStringOf(x) } func (*Option) ProtoMessage() {} func (x *Option) ProtoReflect() protoreflect.Message { mi := &file_src_main_protobuf_command_line_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) } return ms } return mi.MessageOf(x) } // Deprecated: Use Option.ProtoReflect.Descriptor instead. func (*Option) Descriptor() ([]byte, []int) { return file_src_main_protobuf_command_line_proto_rawDescGZIP(), []int{4} } func (x *Option) GetCombinedForm() string { if x != nil { return x.CombinedForm } return "" } func (x *Option) GetOptionName() string { if x != nil { return x.OptionName } return "" } func (x *Option) GetOptionValue() string { if x != nil { return x.OptionValue } return "" } func (x *Option) GetEffectTags() []option_filters_go_proto.OptionEffectTag { if x != nil { return x.EffectTags } return nil } func (x *Option) GetMetadataTags() []option_filters_go_proto.OptionMetadataTag { if x != nil { return x.MetadataTags } return nil } var File_src_main_protobuf_command_line_proto protoreflect.FileDescriptor var file_src_main_protobuf_command_line_proto_rawDesc = []byte{ 0x0a, 0x24, 0x73, 0x72, 0x63, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x26, 0x73, 0x72, 0x63, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x79, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3c, 0x0a, 0x08, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xc0, 0x01, 0x0a, 0x12, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x38, 0x0a, 0x0a, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x09, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x21, 0x0a, 0x09, 0x43, 0x68, 0x75, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x22, 0x3a, 0x0a, 0x0a, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xed, 0x01, 0x0a, 0x06, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6f, 0x6d, 0x62, 0x69, 0x6e, 0x65, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x66, 0x66, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x52, 0x0a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x54, 0x61, 0x67, 0x73, 0x12, 0x3f, 0x0a, 0x0d, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x54, 0x61, 0x67, 0x52, 0x0c, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x54, 0x61, 0x67, 0x73, 0x42, 0x2d, 0x0a, 0x2b, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x64, 0x65, 0x76, 0x74, 0x6f, 0x6f, 0x6c, 0x73, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( file_src_main_protobuf_command_line_proto_rawDescOnce sync.Once file_src_main_protobuf_command_line_proto_rawDescData = file_src_main_protobuf_command_line_proto_rawDesc ) func file_src_main_protobuf_command_line_proto_rawDescGZIP() []byte { file_src_main_protobuf_command_line_proto_rawDescOnce.Do(func() { file_src_main_protobuf_command_line_proto_rawDescData = protoimpl.X.CompressGZIP(file_src_main_protobuf_command_line_proto_rawDescData) }) return file_src_main_protobuf_command_line_proto_rawDescData } var file_src_main_protobuf_command_line_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_src_main_protobuf_command_line_proto_goTypes = []interface{}{ (*CommandLine)(nil), // 0: command_line.CommandLine (*CommandLineSection)(nil), // 1: command_line.CommandLineSection (*ChunkList)(nil), // 2: command_line.ChunkList (*OptionList)(nil), // 3: command_line.OptionList (*Option)(nil), // 4: command_line.Option (option_filters_go_proto.OptionEffectTag)(0), // 5: options.OptionEffectTag (option_filters_go_proto.OptionMetadataTag)(0), // 6: options.OptionMetadataTag } var file_src_main_protobuf_command_line_proto_depIdxs = []int32{ 1, // 0: command_line.CommandLine.sections:type_name -> command_line.CommandLineSection 2, // 1: command_line.CommandLineSection.chunk_list:type_name -> command_line.ChunkList 3, // 2: command_line.CommandLineSection.option_list:type_name -> command_line.OptionList 4, // 3: command_line.OptionList.option:type_name -> command_line.Option 5, // 4: command_line.Option.effect_tags:type_name -> options.OptionEffectTag 6, // 5: command_line.Option.metadata_tags:type_name -> options.OptionMetadataTag 6, // [6:6] is the sub-list for method output_type 6, // [6:6] is the sub-list for method input_type 6, // [6:6] is the sub-list for extension type_name 6, // [6:6] is the sub-list for extension extendee 0, // [0:6] is the sub-list for field type_name } func init() { file_src_main_protobuf_command_line_proto_init() } func file_src_main_protobuf_command_line_proto_init() { if File_src_main_protobuf_command_line_proto != nil { return } if !protoimpl.UnsafeEnabled { file_src_main_protobuf_command_line_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CommandLine); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_src_main_protobuf_command_line_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CommandLineSection); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_src_main_protobuf_command_line_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChunkList); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_src_main_protobuf_command_line_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OptionList); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } file_src_main_protobuf_command_line_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Option); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields default: return nil } } } file_src_main_protobuf_command_line_proto_msgTypes[1].OneofWrappers = []interface{}{ (*CommandLineSection_ChunkList)(nil), (*CommandLineSection_OptionList)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_src_main_protobuf_command_line_proto_rawDesc, NumEnums: 0, NumMessages: 5, NumExtensions: 0, NumServices: 0, }, GoTypes: file_src_main_protobuf_command_line_proto_goTypes, DependencyIndexes: file_src_main_protobuf_command_line_proto_depIdxs, MessageInfos: file_src_main_protobuf_command_line_proto_msgTypes, }.Build() File_src_main_protobuf_command_line_proto = out.File file_src_main_protobuf_command_line_proto_rawDesc = nil file_src_main_protobuf_command_line_proto_goTypes = nil file_src_main_protobuf_command_line_proto_depIdxs = nil }
import { head, filter, map } from '@antv/util'; import { View, Geometry, Element, IShape, IGroup } from '../dependents'; export function getAllGeometryByType(view: View, type: string): Geometry[] { return filter(view.geometries, (geometry: Geometry) => geometry.type === type); } export function getGeometryByType(view: View, type: string): Geometry | undefined { return head(getAllGeometryByType(view, type)); } export function getGeometryShapes(geometry: Geometry): (IShape | IGroup)[] { return map(geometry.elements, (element: Element) => element.shape); }
Spacious first floor, one bedroom condo at Morgan Manor. Natural gas heat/hot water included in condo fee!. Nicely updated and ready for summer 2019!Great location, short walk to town, near Tanglewood, shops, restaurants, Community Center and bus line. Renovated Lennox Heights condo! Two bedroom, 1.5 bath with rear screened porch. The condo fee includes gas heat, hot water, basic cable TV and Internet! Light, bright unit is on middle level, located in middle row of complex. Enjoy pool and tennis and convenient access to all Berkshire attractions! First time offered, this charming 617 square foot commercial building is located in the heart of the village. Perfect spot for a professional office with inviting front porch and parking in the rear. Town water/sewer, natural gas heat and on the bus line. Adorable Lenox property on the seldom traveled quiet loop off East St.- ''old East''! Two bedrooms with two bonus rooms-den/office plus glassed-in year-round heated sunroom. Open living/kitchen. Spacious rear yard. Move-in ready condo at October Mountain Village. First floor features open plan, kitchen opens to great room with pristine wood floors, fireplace, skylights and sliders to large deck. Full bath and den/bedroom on the first floor too. Upper level with two additional bedrooms(master) and full bath. Finished walk-out lower level bonus space with lots of built-ins. Inviting front porch and on-site community amenities (pool and tennis).
Synthetic resins are known to form strong adhesive bonds with many materials. In fact, it is these strong adhesive properties which have made one such polymer system, the epoxies, generally a matrix material of choice for forming fiber reinforced composites. However, fiber reinforced epoxy resin composite materials lose their elevated temperature mechanical properties, and in some instances, their room temperature mechanical properties on exposure to natural conditions such as heat, sunlight, and moisture over time periods ranging from a few months to several years. This is true even for composites containing not only popular and well known commercially available epoxies, but even to some extent, for composites containing conventional polyesters, polysulfones and polyimides as well. And while there are many patents directed to polyimide resin materials, very little attention has been directed to their specific functionality and its effect on improving the properties for which these resin compositions have their most popular use. Note for example, U.S. Pat. Nos. 3,380,964; 3,406,148; 3,450,711; 3,678,073; 3,717,615; 3,759,779; 3,761,430; 4,011,386; and 4,043,986.
Acceptability of Artificial Intelligence in Poultry Processing and Classification Efficiencies of Different Classification Models in the Categorisation of Breast Fillet Myopathies Breast meat from modern fast-growing big birds is affected with myopathies such as woody breast (WB), white striping, and spaghetti meat (SM). The detection and separation of the myopathy-affected meat can be carried out at processing plants using technologies such as bioelectrical impedance analysis (BIA). However, BIA raw data from myopathy-affected breast meat are extremely complicated, especially because of the overlap of these myopathies in individual breast fillets and the human error associated with the assignment of fillet categories. Previous research has shown that traditional statistical techniques such as ANOVA and regression, among others, are insufficient in categorising fillets affected with myopathies by BIA. Therefore, more complex data analysis tools can be used, such as support vector machines (SVMs) and backpropagation neural networks (BPNNs), to classify raw poultry breast myopathies using their BIA patterns, such that the technology can be beneficial for the poultry industry in detecting myopathies. Freshly deboned (33.5 h post slaughter) breast fillets (n = 100 3 flocks) were analysed by hand palpation for WB (0-normal; 1-mild; 2-moderate; 3-Severe) and SM (presence and absence) categorisation. BIA data (resistance and reactance) were collected on each breast fillet; the algorithm of the equipment calculated protein and fat index. The data were analysed by linear discriminant analysis (LDA), and with SVM and BPNN with 70::30: training::test data set. Compared with the LDA analysis, SVM separated WB with a higher accuracy of 71.04% for normal (data for normal and mild merged), 59.99% for moderate, and 81.48% for severe WB. Compared with SVM, the BPNN training model accurately (100%) separated normal WB fillets with and without SM, demonstrating the ability of BIA to detect SM. Supervised learning algorithms, such as SVM and BPNN, can be combined with BIA and successfully implemented in poultry processing to detect breast fillet myopathies. INTRODUCTION Globally, consumers are choosing meat and meat products for their higher nutritional value, especially protein (Heinz and Hautzinger, 2009). There has been a drastic increase in the consumption of these products worldwide in the last couple of decades. In developing countries, the per capita consumption of poultry has increased from 1.2 in the 1960s to 10.5 kg in the 2000s and will reach up to 14 kg by 2030. In the United States, more than nine billion broilers were raised in 2018, with a total live weight of 27.1 billion kilogrammes; and in 2020, the per capita consumption of chicken was 44.23 kg (National Chicken Council, 2020). Chicken is a popular consumer choice because of various physicochemical and sensorial attributes such as texture, colour, and flavour (). To supply the increasing demand for breast meat, breeders have increased the growth rate of the birds through genetics, in turn increasing total carcass yield (Petracci and Cavani, 2012). Markets are continuously changing because of the preference and demands of consumers, which are presently driving the market toward cut-up chicken parts and further processed products. Fast-growing chickens with increased breast meat yield have developed breast muscle myopathies, leading to meat quality defects, such as woody breast (WB). In the past 10 years, WB has been more prominently found in heavier birds (). Woody breast-affected fillets are characterised by an intricate and dull appearance (;), and tough texture due to collagen deposition (). These breast myopathies also affect meat quality parameters such as pH, colour, water holding capacity (WHC), proximate composition, cook loss, and texture, which ultimately influence the quality of further processed products (). Because of lower meat quality, WB meat is sorted out in processing plants by manual hand-palpation (Figure 1) and different grading scales based on the level of severity (Table 1). However, this method is unreliable and subjective, leading to potential misclassification of the breast meat (). By setting specific standards to accurately separate WB fillets, poultry processors will be able to reduce fillet misclassification and, ultimately, losses related to it. We investigated bioelectrical impedance analysis as a potential objective method to detect woody breast-affected fillets. Under ideal conditions, the resistance of a conducting material is directly proportional to its length (R L) and inversely proportional to its cross-sectional area (R 1/A) but can be affected by the shape, size, thickness, and composition of different matrixes (). The electrical conductivity of a conductor depends on cell physiological and biochemical composition (the amount of water with dissolved electrolytes, intracellular fluid, extra-cellular fluid, moisture, and protein content) and on the applied signal frequency. BIA technology has been used in many species to measure physical composition and properties such as body water content and fat content. Nyboer et al. and Hoffer et al. introduced the four-electrode, whole body, and bioelectrical impedance methods in clinical studies for the measurement of bodily fluid from hand to foot. Since its inception, the use of BIA has expanded beyond clinical studies. In the food sector, BIA parameters can be calibrated to specific species and have been used in fish for the rapid detection of proximate composition and the pre-harvest condition of fish (). The ability of meat to conduct electricity can be potentially used to detect meat myopathies such as WB and SM. WB presents itself with increased proliferation of collagen (non-conducting material), affecting resistance, while changes in intra-and extracellular water (conducting material) in the meat matrix alter the reactance (;;Velleman, 2015;;). Morey et al. successfully demonstrated the ability of bioelectric impedance analysis to differentiate between varying levels of WB as well as SM. The researchers attributed the differences in the electrical properties to the accumulation of collagen and increase in extra-myofibrillar water (;). Contrary to WB, Morey et al. reported that loose muscle fibres acted as insulators and increased resistance readings. Morey et al. have successfully demonstrated the ability of BIA to differentiate WB and SM at different severity levels as an alternative to hand palpation to reduce human error. However, various classification algorithms should be used to further increase the accuracy of the BIA technology. Classification accuracies of bioelectrical impedance analysis data can be improved through the use of modern data analytics techniques such as machine learning (ML), which includes data mining, artificial neural networks (ANNs), deep learning (DL), and artificial intelligence (AI) (Tuffry, 2011). ML is a complex field with a wide range of frameworks, concepts, approaches, or a combination of these methods; it is commonly used in the manufacturing sector for process optimization, tracking, and management applications in production and predictive maintenance (Wiendahl and Scholtissek, 1994;Gardner and Bicker, 2000;Alpaydin, 2010). These techniques have been widely applied to enhance quality control in production processes (), particularly in complex production processes where (), 3-point scale (), and 4-point scale (). predicting causes of problems is challenging. Over the last few decades, automated product inspection systems incorporating ML have been used in a wide variety of food industries such as potato and apple (), oil palm fruit (), rice and grains (), beef fat (), and colour in bakery applications (). The use of machine learning models has increased in recent years because of circumstances such as the availability of complex data with little accountability (Smola and Vishwanathan, 2008) and will become more critical in the future. Although several ML algorithms are available, such as ANNs, support vector machines (SVMs), and distributed hierarchical decision trees, their ability to deal with large data sets varies significantly (Monostori, 2003;;). In the production sector, only specific ML algorithms are capable of handling high-dimensional datasets, and having the ability to deal with high dimensionality is considered a benefit of using ML in the processing industry. One of the main benefits of ML algorithms is finding previously unknown (hidden) information and recognising its associations in large datasets. The available information criteria can depend mainly on the characteristics of an ML algorithm (supervised/unsupervised or reinforcement learning, RL). Nevertheless, the general process of the ML method for producing outcomes in a production environment has been proven conclusively (Filipi and Junkar, 2000;;Alpaydin, 2010;Kala, 2012). The use of the BIA method in poultry processing provides complex data with high dimensionality, which can be used to train SVM algorithms for the classification of WB (based on severity) and SM fillets. Support vector machines (SVMs), with a kernel-based procedure, has emerged in machine learning as one strategy for sample classification (Pardo and Sberveglieri, 2005). The implication of SVMs in machine learning as a supervised learning technique provides good generalisation ability and more minor overfitting tendencies. Using kernel functions in SVMs makes original input values linearly separable in a higher dimensional space. Moreover, SVMs can simultaneously reduce estimation errors and model dimensions (). The main objective of this research was to determine the accuracy of linear discriminant analysis (LDA), SVMs, and backpropagation neural networks (BPNNs) to classify WB and SM using multi-dimensional BIA data. The LDA, SVM, and BPNN methods are discussed in detail, their accuracies were compared, and reasons for the differences in the classification accuracies are discussed. Poultry researchers and the industry collect enormous amounts of data on a regular basis but use simpler statistical methods to derive meaning from the data. Through the presented research, we envision to introduce the poultry research community to several data analytics techniques to analyze complex datasets. Data Collection Freshly deboned breast fillets from 56-day old broilers (Ross 708) were analysed in a federally inspected commercial poultry processing facility after deboning. The breast fillets (n = 300, 3 replications or flocks) were randomly selected from the processing line 3 to 3.5 h post slaughter. The deboned breast fillets were analysed for WB incidence through hand palpation by an experienced team member (Figure 1). The breast fillets were classified into normal, mild (for data analysis mild was grouped with normal), moderate, and severe WB fillets (), and SM presence was evaluated by observing the turgor in the cranial-ventral portion of the breast fillets, with a decrease in turgor indicating the presence of SM and increase in turgor representing the absence of SM. The collected chicken breast fillets from the processing line were subjected to BIA by utilising a hand-held CQ Reader (Figure 2; Seafood Analytics, Clinton Town, MI, United States) (), equipped with four spring-loaded electrodes (RJL Systems, Detroit, MI, United States). All the four electrodes were placed to make contact with the ventral surface of the breast fillets. Once the electrodes were in contact with the breast fillets, the circuit was complete and linked. Then, the device measured the data for resistance, reactance, fat index, and protein index, and the stored data were downloaded for analysis later (Seafood Analytics Certified Quality Reader, Version 3.0.0.3; Seafood Analytics, MI, United States). Individual weights of the fillets were also FIGURE 2 | Hand-held bioelectrical impedance device to measure the severity level of fillets. determined using a weighing balance (Ohaus Corporation, Pine Brook, NJ, United States) for the analysis and used to train the SVM and BPNN models. Linear Discriminant Analysis Linear discriminant analysis is one of the conventional data mining algorithms used in supervised and unsupervised learning contemplated by Fisher for resolving the issue related to flower classification (). The LDA model is used to project an imaginary hyper-plane that minimises the interclass variance and maximises the distance between class means. Additionally, it produces a transformation in the data that is discriminative in some data cases. LDA is more appropriate for data where unequal withinclass frequencies are given, and its classification performances have been randomly examined on generated test data. This approach maximises the ratio of between-class variance to within-class variance with maximum separability. Data sets used in LDA analysis can be transformed, and related test vectors can be classified in the imaginary hyper-plane by classdependent transformation and class independent transformation (Balakrishnama and Ganapathiraju, 1998). The class-dependent transformation approach maximises the ratio of betweenclass variance to within-class variance. This kind of class transformation helps in maximising class separability (). The main objective for implementing LDA is to create a subspace of lower-dimensional data points compared with the sample data set, in which the original data points from the data set can be easily separable (Figure 3; Fisher, 1936). The use of LDA provides a solution that can be implemented in a generalised eigenvalue system, which provides huge and fast data optimization. The original LDA algorithm was used to solve binary classification taxonomic problems; however, Rao had also proposed multi-class generalisations. In this study, both class classification and multi-class case classification derivation were provided to better understand the concept from the simple two-class case (). Let "a1,..., a p ∈ R m " be a set of "q" data sets related to the two separate classes, A and B. For each class defined, sample means are (1.1) N A, N B is the total number of samples in data sets A and B. Scatter matrices for the data set by the equation Each of the matrices mentioned above is used for the imaginary hyper-plane, which is defined by the vector (), and the variance for the calculation is minimal and can be explained by the equation where S = S A + S B by definition and from equations 1.2, the scatter matrix for supposed two matrixes for the two classes are LDA is based on Fisher's projection hyper-plane, i.e., maximizing the distance between the means and minimizing the variance of each considered class that can be mathematically described by Fisher's criterion equation as: There could be several solutions for the optimization-related problem with the same function value. For a solution, * all the vectors c * will give the same value, and considering no loss in generality, we select only one best possible solution by substituting the denominator with an equality constraint. Then, the problem becomes The Lagrangian mechanism associated with this problem is where is the LaGrange multiplier associated with the equation 1.6b. Since S AB is positive and the nature of the problem is convex, the global minimum will be at the point for which The optimal obtained as the eigenvector that corresponds to the smallest value for the generalised eigensystem: Multi-class LDA is only the extension of the two-class classification problem. Given x classes, the matrices will be redefined, and the intra-class matrix becomes while the inter-class scatter matrix is annotated by where the number of samples (p i ) in the ith class, a i is the mean, and a is mean vector given in equation The linear transformation can be achieved by solving the above equation: S1,..., n = S to achieve a better classification by projection of the hyper-plane. Once the transformation is achieved, the class of a new point "y" is determined by where a n is the centroid of nth class. The calculation reflects that all the centroids of the classes were defined first and that the unknown points on the subspace were defined by and the closest class concerning D. Support Vector Machines Vapnik first contemplated the support vector machine method in 1995, and recently it has enticed an enormous level of endeavour in the machine learning applications community. Several studies have mentioned that the SVM method has immense performance in classification accuracy compared with other data classification algorithm methods (;Shao and Lunetta, 2012;). SVM generates a line between two or more classes known as hyper-planes for data set classification. Input data Q that can fall on either side of the hyper-plane (QTW-b) > 0 are labelled as +1, and those that fall on the other side, (QTW-b) < 0, are labelled as −1 (Figure 4A; Lee and To, 2010); let {Qi, yi} ∈ R n be training data set, y i ∈{1, −1}, i = 1, 2,...,n. There exits hyper-plane, The equation for the training data set can be written as The above-mentioned equations can be written as Another definition for the hyper-plane considering P − and P +, let {Qi, yi} ∈ R n be training data set, y i {1, −1}, i = 1,2,...,n, The optimization mentioned above is a form non-convex optimization problem that relies on the absolute value of |W| and is difficult to solve than convex optimization problems. The equation for the absolute value W can be replaced using 1/ 2 | |W| | 2 without having any change in the final solution; so, the representation of the SVM-related problem in quadratic programming (QP) form is as follows (): After solving the SVM optimization problem using Lagrange multipliers (a i ), the Wolfe dual of the optimization problem was achieved : After solving for the value for W and b, the solution in Equation (2.5) is the following condition: putting the value of 2.6 into equation 2.4, we get the dual form of SVM, The number of variables in the Equation derived is equivalent to the total number of data cases (n). The training set data with a i > 0 represents the position of support vectors for the classification, and Qi p+ or Q i p-. The equation for hyper-plane decision can be written as Pontil and Verri where q is the unknown input data that need to be classified. The SVM method has been employed in a considerable range of realworld problems associated with different fields of automation, forensics, biotechnology, agriculture statistics, and is now being used in food sciences for the classification of bakery products, fresh produce, and meat product classifications (;Chen and Zhang, 2014;;;). It has been proven that SVMs are persistently most appropriate for diverse supervised learning methods. Despite this, the performance of SVMs is very receptive to the cost parameter, and kernel frameworks are set. As a result, research industries want to conduct ample cross-validation to determine the most influential parameter setting (Durgesh and Lekha, 2010). Backpropagation Neural Networking According to Lippmann, there were no practical algorithms available for interconnecting weight values to achieve an overall minimum training error in multilayer networks. Rumelhart et al. proposed a generalised rule for backpropagation neural networking, an iterative, gradient descent training procedure. The input data, in the form of vector, are a pattern to be learned, and the desired output is in the form of a vector produced by the network upon recall of the input training pattern (Paola and Schowengerdt, 1995). The main goal of the training is to minimise the overall error between the test set data and training set data outputs of the network (Paola and Schowengerdt, 1995). BPNN is also recognized as multilayer perceptrons, one of the multiple layers forward neural networks. A BPNN comprises one input layer, one or more hidden layers, and one output layer (Bharathi and Subashini, 2011;). Consideration of distinct factors plays a fundamental role when developing a BPNN that consists of the structure of network, initialisation, and switch functions in each hidden and output layer, the training way and algorithm, the learning rate, the error-goal (), and preprocessed input data. BPNN has some advantages, such as easy architecture, ease of assembling the mannequin, and fast calculation speed. However, BPNNs have some issues, such as (i) possible to contain in local extremum, (ii) poor generalisation ability, (iii) lack of strict format packages with a theoretical foundation, and (iv) challenging to manage the learning and training method. In spite of these problems, backpropagation neural networks have been successfully implemented in a range of fields. Users have applied their experiences and prior knowledge during the design of a BPNN to overcome these problems (). A supervised BPNN learning algorithm consists of an input layer, one or more hidden layers, an output layer, and the nodes of the hidden layers primarily affect the classification efficiency of the neural network ( Figure 5). Parameters that are required to be defined by the users are learning rate (0 < <1) and momentum (0 < <1). BPNN program training procedure (Lee and To, 2010;): 1. Design and input for network. 2. Normalise the initial input weights W and threshold values (). 3. Define the training and testing data set and input the training matrix X and output matrix Y. 4. Estimate the output vector of each neural synaptic unit. Statistical Analysis All the parameters (resistance, reactance, fat index, protein index, and fillet weights) were analysed by one-way analysis of variance with Tukey's honestly significant difference (HSD) (p < 0.05) to determine significant differences among the levels of myopathy severity. The data were further analysed using three classification methods, linear discriminant analysis (LDA) (SAS, Version 9.4), support vector machines (SVMs), and backpropagation neural networking (BPNN). For each method, the data were analysed using three different scenarios: all data (WB scores, fillet weight, resistance, reactance, protein index, and fat index); without fillet weights (WB scores, resistance, reactance, protein index, and fat index); and without fat and protein index (WB scores, fillet weight, resistance and reactance). For the SVM and BPNN analysis of collected data, R software (Version 4.0.0, Arbour Day) was used by using the caret package in the analysis to classify various chicken breast fillet myopathies. The data sets collected for the different conditions were divided into 70::30 training set and testing set. The caret package algorithm calculated the best-suited tuning parameter or value of cost (C) for both the training and testing data sets. A seed value was set for 3,000 for the SVM analysis. For BPNN the classification of fillets, the Neural net and BBmisc packages were used to classify the collected data sets (WB and SM), and the data sets were divided into 70::30 training and testing data sets. Low learning rate (0.01), the threshold value (0.01), number of maximum steps, and four hidden layers were used in the BPNN classification algorithm for the analysis. RESULTS The differences in various parameters among the levels of woody breast and spaghetti meat severity are shown in Tables 2, 3, respectively. As shown in Table 2, there are significant differences (p < 0.05) in the resistance, reactance, and fillet weights among the WB categories. There were no significant differences (p > 0.05) in the fat and protein index between WB severity levels ( Table 2). On the contrary, there are no significant differences in the parameters between breast fillets with and without SM ( Table 3). Classification efficiencies of the fillets are greatly affected by the analysis of all the data, without fillet weights and without fat and protein index, indicating the significance of variables in classification accuracy ( Table 2). The LDA, SVM, and BPNN analyses showed that when the fillet weights were removed from the dataset, classification accuracy (testing %) was reduced by as high as 20% ( Table 2). The LDA analysis without fillet weight data set showed less classification efficiency in the testing data set (normal = 43.8%, moderate = 17.2%, and severe = 50.0%) compared with the training data set (normal= 62.1%, moderate = 32.2%, and severe = 64%), indicating that the training model was not efficient in classification at the testing stage. Similarly, the SVM analysis showed low classification efficiency for the testing set (normal = 56.52%, moderate = 49.77%, and severe = 64.63%). The removal of fat and protein index data from the analysis showed that the LDA analysis for normal (training::testing = 61.7::75.6) and moderate fillets (training::testing = 31.3::33.33) improved as compared with the analysis without the fillet weight data set and all the data sets (including resistance, reactance, protein index, fat index, and fillet weights). The lower efficiency may be due to the misclassification of fillets due to fat and protein index value overlapping. The SVM analysis showed a higher classification pattern for normal (training::testing = 65.75::73.28) and severe breast fillets (training::testing = 72.49::81.48), similar to the overall data set. For the classification of SM fillets from the normal fillets, the SVM analysis performed better in the classification of normal fillets (training::testing = 57.06::60.00) from spaghetti meat-conditioned fillets (training::testing = 45.5::22.2) ( Table 2). On the other hand, the SVM analysis for the resistance, reactance, and weight data set showed slightly DISCUSSION Using only visual and hand palpation characteristics to identify woody breast and spaghetti meat muscle myopathies poses various challenges, such as misclassifications, processing inefficiencies, and increase in labour costs, when classification is performed on a processing line. WB is found primarily in the superficial area of breast fillets and, many times, includes the visual presence of surface haemorrhages, appearance of lightyellow surface, rigid bulged fillet, and by mechanical palpability of the muscle (Figure 6; ;). Additionally, normal breast fillets have smaller crosssectional areas as compared with woody breast fillets (Huang and Ahn, 2018), with higher collagen content and elevated post processing pH ;Clark and Velleman, 2016;). SM, on the other hand, is related to immature intramuscular connective tissues in the breast meat, and it has lower muscular cohesion than the breast meat from unaffected fillets (Figure 7; Bowker and Zhuang, 2016;;). The thickness of connective tissues in the breast fillets showing SM decreases gradually in the endomysium and perimysium, causing different muscle fibres to deteriorate or have a mushy texture (). Therefore, using an assortment of already available complex data, we were able to make improvements to the classification of fillets among the WB and SM myopathies. Significant differences were observed in the resistance and reactance among the normal, moderate, and severe woody breast fillets ( Table 2), indicating changes in the muscle architecture and the intra-and extra-cellular water contents of the meat (). It was expected to find significant differences in the fillet weights among the levels of WB severity, with severe WB fillets weighing significantly heavier than the normal fillets (p < 0.05). However, contrary to Morey et al., this research reports an inverse trend in resistance and reactance of normal and severe woody breast. Morey et al. reported that resistance and reactance were lower in normal meat (72.18 and 28.04, respectively), and higher in severe WB meat (78.27 and 37.54 ). In this study, resistance and reactance were higher in normal meat (71.89 and 36.93 ) and lower in severe WB meat (67.9 and 30.72 ). As for the normal meat with and without SM (Table 3), the observations were contrary to Morey et al.. This study ( Table 3) did not find significant differences in the resistance, reactance, fat index, protein index and weight of the normal fillets with and without SM. In this study, the breast fillets were taken from water-chilled birds, which were immediately deboned on a deboning line and analysed in a plant, while in the study by Morey et al., the fillets were transported to a lab and analysed within 6 h of procurement. It would be of interest to investigate if the differences in bioelectrical properties are water-retention in the normal breast fillets due to immersion chilling and post deboning holding time. The findings emphasise the fact that the bioelectrical parameters were standardised by the processors prior to use. The results obtained with training accuracy for linear discriminant analysis (70::30) classification were 72.31, 43.75, and 75% for the normal, moderate, and severe woody breast (Table 4) fillet classifications, respectively, using the bioelectrical impedance analysis and fillet weight data set (n = 300). The testing set was lower in accuracy than the training set, with only 52.63% normal classified, 29.41% moderate classified, and 59.09% severe WB classified (n = 300; Table 4). The testing data set was lower in accuracy compared with the training set data, possibly because of the low sample size and non-linearity of the data set. The non-linear data set is likely due to human error during the manual hand-palpation of the breast fillets; however, in future studies, larger data sets could be implemented to increase the accuracy of the BIA method combined with conventional algorithms. Morey et al. also performed LDA (60::40) with a BIA data set (n = 120) and reported 68.69-70.55% accuracy for the classification of normal fillets and 54.42-57.75% accuracy for severe WB fillets in the testing set. Wold et al. analysed a near infrared spectroscopy (NIR) data set (n = 102) using an LDA (50::50) classification algorithm with 100% accuracy for fillet classification in the training set and 96% accuracy in the testing set, for a rapid on-line detection method for WB myopathy in processing plants. LDA is a wellrecognised technique for reducing the dimensionality of data in a dataset. However, LDA can only be used for single-label multi-class categorizations and cannot explicitly be extended to multi-label multi-class classification systems. The LDA technique is used to convert high-dimensional data into a low-dimensional data space, maximising the ratio of between-class variation to within-class variance, thereby ensuring optimal class separation (). The LDA technique works by projecting the initial data matrix onto a lower-dimensional region. For the reduction of dimensionality, three steps are required: (i) the inter-class difference or between-class matrix is used to measure the separability across multiple categories (i.e., the distance between the means of different classes), (ii) the within-class variance, also known as the within-class matrix, is calculated as the difference between the mean and the class samples, and (iii) the creation of a lower-dimensional space that maximises between-class variance while minimising within-class variance (). In this research and that of Morey et al., the low performance of data collected and analysed by LDA compared with the data collected may have two key factors: small sample size and data linearity issues. Su et al. also found low performance in data sets with small sample size and non-linear data. The linear discriminant analysis technique is used to find a linear transformation that discriminates between various groups. However, LDA cannot find a lower-dimensional space if the groups are non-linearly separable. In other words, where discriminatory knowledge is not in the means of classes, LDA fails to locate the LDA space. One of the significant issues with the LDA methodology is singularity, also known as small sample size or under-sampling. This issue arises because of high-dimensional trend classification problems or a low number of training samples available for each class compared with the dimensionality of the sample space (;;Zhuang and Dai, 2005;;). The machine learning theory lays the groundwork for support vector machine, and this algorithm has gained widespread attention because of its unique performance efficiency, and ability to accomplish pinpoint accuracy and manage highdimensional, multi-variate data sources. Cortes and Vapnik implemented SVMs as a new ML technique for twogroup classification problems. Researchers have reported that SVMs are an economical, sensitive, and easy to use classifier that can be implemented in organised evaluation assignments. The inspection of large collected data sets during production is a significant application of SVM (;Chinnam, 2002). SVM is frequently used in various food production environments, including product monitoring systems, mechanical fault detection, and dimensional accuracy (Ribeiro, 2005;;ayda and Ekici, 2012;). SVMs are used in different processing areas, such as drug designing and discovery, surgery, and cancer treatment, in addition to the food product processing industry. Product quality control (), polymer recognition, and other applications are also possible () areas in which SVM can be incorporated. These examples from different industries demonstrate that SVM algorithms have a broad range of applicability and 4 | Percentage classification efficiency for various supervised machine-learning algorithms (linear discriminant analysis, support vector machines, and back propagation neural networking) for breast fillets with woody breast a and spaghetti meat b in three different scenarios (all data, without fillet weights, and without fat and protein index value). Woody breast a n = 300 (normal = 148, moderate = 82, severe = 70); spaghetti meat b n = 84; All data c -WB scores, fillet weight, resistance, reactance, protein index, and fat index; without fillet weights d -woody breast (WB) scores, resistance, reactance, protein index, and fat index; and Data without fat and protein index e -WB scores, fillet weight, resistance, and reactance. versatility (). This research demonstrates the ability for the implementation of SVM and BPNN in combination with BIA and fillet weight data to classify WB and SM fillets. Statistical learning theory (SLT) is a robust and appropriate supervised learning algorithm for production research problems. Under SLT, algorithmic learning allows it to use an achieving function, representing the relationship between different components without being directly connected (). The algorithm enquires about the problem concerning how well the selected method resolves the problem, and accuracy prediction performance for previously unknown inputs is the subject of SLT (). A few more realistic techniques, such as autoencoders, SVM, and Bayesian optimization, are based on the theories of SLT (). SVM is considered a mathematical expression in its most basic form, a method (or algorithm) for optimising alphanumeric equations, with a given set of data. The fundamental idea of support vector machine algorithmic expression can be easily understood by four fundamental concepts: (i) the imaginary hyper-plane, (ii) the margin of hyper-plane, (iii) the soft margin, and (iv) the kernel function. A solid line splits the region in half in two dimensions ( Figure 4A), but we require a hypothetical plane to split the area into three dimensions. A hyper-plane is a collective term for a straight line in a high-dimensional region, and the dividing hyper-plane is the line that separates the pieces of data. SVM, on the other hand, differs from other hyper-plane-based classifiers based on how the hyper-plane is chosen. Consider the grouping shown in Figure 4. By implementing SLT, it is easier to find the best possible plane to create the hyper-plane that will be used in the classification of data. The capability of SVM to classify the correct data points between given classes can be improved by using an imaginary hyper-plane in the space. The SLT theorem implies that the data used to train SVM originates from the same dataset as the data used to test it. For example, if an SVM algorithm is trained on the sensory property of a product, it cannot be used to train the data collected for the subjective response of consumers. Furthermore, we cannot expect SVM to work well if training is conducted with an SM breast fillet data set, so a WB data set is used for testing. At the same time, the SLT principle does not assume that two data sets come from the same class of distributions. For example, an SVM algorithm does not assume that training data values follow a normal distribution. For a better understanding of support vector machine and its function, we have concluded an imaginary data set for classes A and B, which can be divided using a straight line. When the values in a data set are closer together or intersected (Figure 4B), SVM will manage this overlapping of data by inserting a soft margin. In essence, this causes specific data points to pass across the margin of the dividing hyper-plane, without influencing the outcome. The use of the soft margin provides the solution to the problem of misclassification (shown in Figure 4B) by considering the data point as an outlier (shown in Figure 4C). Another essential function for SVM classification is the kernel function (shown in Figures 4D,E), a mathematical trick that allows SVM to perform a two-dimensional classification of a one-dimensional data set. In general, a kernel function projects data from a low-dimensional space to a space of higher dimension. Support vector machine classification efficiency (Table 4) for the separation of high dimensionality data showed better classification efficiency for normal (training efficiency 63.86%, testing efficiency 71.04%), moderate (training efficiency 49.88%, testing efficiency 59.99%), and severe WB (training efficiency 71.78%, testing efficiency 81.48%) compared with the LDA algorithm used by Morey et al.. The BIA and fillet weight data set used in training the SVM performed well because of the higher dimensionality of the data set. When data are highly dimensional and the sample sets are relatively small, SVM analysis is more accurate to classify data, and has been used by other authors to help classify multi-dimensional data. Barbon et al. used a relatively small data set (n = 158) of NIR results combined with SVM (75::25) to classify normal and pale meat, as it relates to pale, soft, and exudative poultry breast meat. They demonstrated the use of SVM as a classification tool for breast fillets with muscle myopathies where the classification accuracy for normal fillets was 53.4 and 72. % for pale fillets. Geronimo et al., using an NIR system equipped with an image acquisition system, found 91.83% classification efficiencies (fillet images) using SVM to analyze a WB fillet sample set (sample size is unclear) with a 70::30 model. These researchers also used multilayer perceptron (a feedforward network differing from the backpropagation network in BPNN) to classify the data set, and classification accuracy was 90.67% for WB. Yang et al. analysed images derived from the expressible fluid of breast meat to classify WB using SVM (training and testing ratio is unreported) and DL (training to testing is 2 to 1). These researchers found fewer classification efficiencies for SVM algorithms in the testing set (38.25-63.89%), compared with the training set (40.41-81.94%) in three out of the four SVM classification methods used. In their DL classification (a type of ANN) to classify WB, they reported 100% accuracy in the training set and 93.3% accuracy in the testing set. Connexions of random different nodes or units in a computing system to solve problems that are impossible to solve by conventional statistical methods are known as artificial neural networks and are based on the circuitry of the human brain. When applied to a processor framework, the subconscious network can execute unique functions (perception, speech synthesis, image recognition), which have proven to be useful in industrial applications. Neural networks allow an automated artificial skill to operate unsupervised reinforcement and classification algorithm functions (neural networks) by simulating the decentralised "data analysis" capabilities of the central nervous platform through neural networks (Pham and Afify, 2005;). Decentralisation employs many necessary interconnected neurons or nodes and the capacity to process data through the complex response of these endpoints and their links to exogenous variables. These algorithms are crucial in the modern machine learning development of today and can be classified into two categories: interpretation and algorithm. Neural networks are used in a variety of industrial sectors for a range of problems () e.g., process control, emphasising their key benefit and overall predictive validity (Pham and Afify, 2005). However, ANN (similar to SVM) requires a large sample size to attain maximum precision (). Overfitting, which is linked to high-variance implementations, is universally acknowledged as a disadvantage of the ANN algorithm (). Other difficulties with using neural networks include the sophistication of generated models, aversion for missing values, and, often, lengthy dataset training method (Pham and Afify, 2005;). For backpropagation neural networks, the data were preprocessed and consisted of just two dimensions with a lower level of classification complexity. Classification efficiencies for the WB fillets using BPNN ( Table 4) show that the testing data set for the normal (47.77%) and moderate fillets (23.33%) did not perform well, compared with the classification efficiency for the severe WB fillets (28.88%). The BPNN classification algorithm for the WB fillets did not perform wellbecause of the complexity of the data after pre-processing, and overfitting of the learning model due to the uneven distribution of weight on the input neuron layer. The BPNN classification algorithm for the SM data set ( Table 4) performed well for the training data set for normal (training 100%, testing 52.95%) and SM fillets (training 100%, testing 75%). However, due to the complexity of pre-processed data, overfitting of BPNN and small data set, the classification efficiency of the testing set was lower than that of the training set. These studies all use SVM and ANN algorithms to classify small sample data sets, where the results always show that the accuracy in the training set data was higher than that in the testing set data, indicating that the training of the model is not performing well. Collection of larger data set for the supervised learning methods of classification provides the chances for getting lower error rates and better learning ability for the machine learning algorithms. In a backpropagation neural network, the input data vector represents the pattern to be trained, and the output data vector represents the optimal set of output values that the network can generate when the training pattern is recalled. The aim of BPNN training is to reduce the total error between the expected and real outputs of the network. To generate a reduction in error, the residual differences in the weights at each iteration must be unmeasurable. A learning rate metric, which reflects the rate of the move taken toward minimal error, must be defined to accomplish a reasonable training period. Learning will take too much time if this amount is too small, and if it is too high, the loss function will degenerate and errors will rise. When using neural networks to analyze WB data, overlearning or overfitting happens when the algorithm takes too long to run, and the network is too complicated for the problem or the amount of data available, whereas, to classify SM in a group of fillets, BPNN was used, and data are processed differently. Additional analysis of the data was conducted to determine if the parameters used in data classification would make a difference in classification accuracies using the three methods (linear discriminant analysis, support vector machine, and backpropagation neural network) for both woody breast and spaghetti meat. Irrespective of the methodologies used, removing fillet weight reduced the classification accuracies of WB classification by up to 20%, indicating the importance of using fillet weights (for classification), which were significantly different among the WB categories (p < 0.05; Table 2). Removing the fat and protein indexes, which were not significantly different among the WB categories (p > 0.05; Table 3) increased the classification accuracy (Testing %) of the LDA models, while it was similar for the SVM and BPNN models. The finding indicates the significance of using fillet weight in the models and that the SVM and BPNN models analyze the significance of each parameter in the classification models. It was interesting to note that the bioelectrical impedance analysis parameters, such as weight, were not significantly different between normal meat with and without spaghetti meat (Table 3). However, those parameters could be used collectively to develop classification models using LDA, SVM and BPNN models. Most importantly, removing weights did make a difference in the classification accuracies, but retaining the fillet weights and removing the fat and protein indexes did not necessarily increase the accuracy of the model. In the case of SM, more data are needed to build more accurate and stronger models. CONCLUSION This project demonstrates the application of machine learning in poultry production processes to categorise chicken breast fillets into groups based on the severity of myopathy. The use of SVM and BPNN can be combined with BIA and fillet weight data to more accurately classify breast fillet myopathies, such as WB and SM, from normal breast fillets in realtime online, compared with the subjective hand palpation method. With the implementation of other meat quality parameters, such as water content, the classification accuracy of SVM and BPNN could be improved. To obtain a welltrained model for classification efficiency and to reduce overfitting and underfitting problems related to classification, future research should include larger data sets for breast fillet myopathies to avoid the overlapping of conditions caused by human error in the sorting of fillets. The innovative combination of these tools has the potential to improve poultry processing efficiencies and downgrades of breast fillets affected by undesirable myopathies while reducing customer complaints. DATA AVAILABILITY STATEMENT The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation. ETHICS STATEMENT Ethics approval was not required for this study in line with national/local guidelines. AUTHOR CONTRIBUTIONS AM is the lead investigator who conceptualised the idea, secured funding, and conducted the research. AM, AS, and JV conducted the bioelectrical impedance analysis data collection. AS performed the SVM, BPNN analysis, and manuscript preparation. AES and SS have helped in the cross-validation of analysis results and review of the manuscript. AM and LG assisted in writing-review and editing. All authors contributed to the article and approved the submitted version.
Analysis of the Promoter of the Rh 2 Opsin Gene in Drosophila melanogaster We have analyzed the cis-acting regulatory sequences of the Drosophila melanogaster Rh2 gene that encodes the protein component of a rhodopsin which is expressed in ocellar photoreceptor cells. DNA fragments containing the start point of transcription of the Rh2 gene were fused to either the Escherichia coli chloramphenicol acetyltransferase (CAT) or lacZ (B-galactosidase) genes and introduced into the Drosophila germline by P-element-mediated transformation. Expression of the E. coli genes was then used to assay the ability of various sequences from the Rh2 gene to confer upon the indicator genes the Rh2 pattern of expression. Fragments containing between 4.3 kb and 183 bp upstream of the start of transcription plus the first 32 bp of the 5untranslated leader were found to result in nearly identical levels of head-specific CAT expression. Deletion of Rh2 sequences distal to position -1 12 bp resulted in loss of detectable CAT expression from these Rh2ICAT fusion constructs. We have, therefore, defined a region essential for head-specific expression of the Rh2 gene to a region extending from -183 to -1 12. We have determined the DNA sequence of the Rh2 promoter from -448 to +32 and have found an 1 l-bp sequence which is also present in the upstream flanking sequences of two other photoreceptor-specific genes (ninaE and ninaC). By histochemical staining of @-galactosidase expressed under the control of the Rh2 promoter and by analyzing the effect of the ocelliless mutation on the expression of an Rh2/CAT fusion gene, we have been able to demonstrate that this promoter is active in ocelli. R HODOPSIN is the major photoreceptor molecule of both vertebrate and invertebrate visual organs. It consists of a protein, opsin, covalently linked to a chromophore, usually 1 l-cis retinal (reviewed in HARCRAVE 1982). Four different opsin genes have been identified in the Drosophila melanogaster genome (ZUKER, COWMAN and RUBIN 1985; ; COWMAN, ZUKER and RUBIN 1986; ; ; FRYXELL and MEYEROCompound eyes and ocelli are two types of lightsensing organs found in the head of most insects. T h e compound eye of Drosophila contains, in addition to other cell types, three physiologically distinct classes of photoreceptor cells: Rl-R6, R7 and R8 (for review of the physiological differences between the photoreceptor classes see PAK 1979). Each of the isolated opsin genes is expressed in only a subpopulation of photoreceptor cells. Three ocelli are arranged triangularly on the vertex of the head (for review of the structure of insect ocelli see CHAPMAN 1982). T h e function of the ocelli is poorly understood, but it seems that they are capable of perceiving low-intensity light as well as influencing the orientation f the insect with respect to a light source, a function necessary for visual guidance (GOODMAN 1970; Hu, REICHART and STARK 1978; Hu and STARK 1980). WITZ 1987).
Demi Lovato is deleting reminders of her troubled past from her social media account. As fans of the singer know, Lovato recently completed 90 days of sobriety and is now back in the Los Angeles area, where she continues to seek treatment as she adjusts to life back in the public eye. Since completing the rehab stint, Lovato is looking to move forward in her life, and to do so, she feels that she needs to delete some reminders from her past, according to Hollywood Life. After an extended stay in the hospital from the overdose that nearly took her life, Lovato shared a message with fans on her Instagram account, thanking them for their overwhelming love and support. The message came just before Lovato entered rehab and it was lengthy and emotional. But today, the singer deleted the message and a source close to Lovato claims it’s because she is looking for a fresh start. The source shares that Demi is currently happy and trying to move on from the “horrible tragedy” that happened to her over the summer. The source also states that Demi does not regret the post as she felt the need to thank fans for their love at the time. However, now she wants to move forward in a “positive direction” and her No. 1 focus is staying healthy and remaining sober. That post was a reminder of the past and Demi doesn’t think that she should waste any more time dwelling on it as she continues in her recovery. And since she left rehab, Lovato has also been trying to surround herself with positive people in her life, including her ex Wilmer Valderrama. As the Inquisitr shared, Lovato reportedly reaches out to her ex quite frequently, even several times a week, as she tries to stay sober. According to sources, the former couple sometimes meet up though they have yet to be spotted together in public. Hopefully between erasing the past memories and surrounding herself with positive people, Demi can remain on the right path.
/* * $RCSfile: modemt30.c,v $ * $Revision: 1.37 $ * $Author: miurat $ * $Date: 2012/02/29 02:35:30 $ */ /************************************************************************ * * modemt30.c * * Modem T30 driver. * * Copyright 2004 - 2012 Conexant Systems, Inc. * 4000 MacArthur Blvd., Newport Beach, CA 92660 USA. * All Rights Reserved Worldwide. * Information Contained Herein is Proprietary to Conexant Systems, Inc. * ************************************************************************/ #include "dc_common_includes.h" #include "cxshell.h" #include "ATTRIB.H" #include "BUFFERS.H" #include "ERROR.H" #include "MODEMX.H" #include "T30X.H" #include "ECMX.H" #include "ECM.H" #include "HDLC.H" #include "modem336.h" #include "SDHFaxCommonHeader.h" #include "fax_memAPI.h" #include "faxapp_notify.h" #include "../../image_backup/include/image_backup.h" UINT16 cdbcount = 0; UINT32 last_EOL_time; #define MODEM_CED_TONE_MASK 0x40 /* TONEB for CED tone */ extern void prepare_rx_buffers(UINT16 buffers, BOOL ecm_mode); extern JOBNODE_BUFFER *pBuffer_front[NUM_OF_BUFF]; extern CDB_BUFFER cdb_buffer[MAX_ECM_BLOCKS][MAX_ECM_FRAMES]; extern UINT16 frame_num, tx_blk_num; #ifdef HAVE_IMAGELOG extern BOOLEAN IsImageLogEnabled(char jobtype, int subJobType); extern UINT32 create_unique_job_id( void ); extern void fsu_update_unique_job_id (UINT16 jnum, UINT32 jobId); #endif extern int T4_Decoding(UINT16 jnum, char *FileName, char *out_FileName, int codingtype, int width_type, int rx_resolution, UINT8 Direction); extern UINT8 fsu_get_fax_forward (UINT16 jnum); extern UINT8 T30RxCheckErrors(void); extern UINT8 fsu_get_poll_receive (UINT16 jnum); extern UINT8 fsu_get_resolution (UINT16 jnum); extern UINT8 fsu_get_width(UINT16 jnum); extern UINT16 fsu_get_doc_id(UINT16 jnum); extern int sw_jbig_encode_tx (int Page, char *FileName, UINT16 jnum, UINT8 Direction); extern int sw_jbig_decode_tx(int Page, UINT16 jnum, char *FileName, UINT8 Direction); extern int T4_encoding(int Page, char *FileName, int codingtype, int faxRes, int job_num_send, UINT8 Direction, int photo_image_resolution); extern void fsu_set_prn_job_ready(UINT16 jnum); extern void fsu_set_next_prn_num(UINT16 next_prn_num); extern void Create_Job_Queue_File(UINT16 jnum, FAX_APP_JOB_TYPE_t FaxAppJobType, UINT16 DocId); extern void faxapp_make_pdf_start (const char *Path, int jnum, int StartPageNo, int TotalPageNo, int image_width, int PageType, int Request, int Reason); #ifdef HAVE_IMAGELOG extern void fsu_update_remote_no_for_image_log (UINT8 type, UINT16 jnum); #endif extern int getSaveFaxFile(void); extern int getgFaxPrintMode(void); extern int fsu_image_validation_check (int res, int jnum); extern int gFaxRxTotalPages; extern UINT16 fsu_job_num_rcv; extern int gFaxRxCurrentPage; extern BOOLEAN isReadyToFaxPrint; extern char *pRootFolderName; extern char *pRootFolderNameRAM; extern BOOLEAN T4_end_of_page; extern UINT8 *gpRxPageMemory; extern UINT8 isFSURxImageProgessBegin; UINT32 NonECM_total_size = 0; UINT8 too_many_error = 0; extern OSC_MUTEX modem_dsp_mutex; /*=========================================================================== * * ModemCDBDone * * Wakes up the cdb task to finish processing the cdb for non-ECM * * Input: none * Output: none * *===========================================================================*/ void ModemCDBDone(UINT8 last_buffer) { JOBNODE_BUFFER *cdb = (JOBNODE_BUFFER *)NULL; int i = 0; FILE *pFile = (FILE *)NULL; char PathName[MAX_LEN_FILE_PATH_NAME] = {0, }; char TiffName[MAX_LEN_FILE_PATH_NAME] = {0, }; int result = 0; UINT8 coding_type = 0; UINT8 rx_res = 0; UINT16 DocId = 0; UINT16 jnum = fsu_job_num_rcv; UINT8 *pBuff = (UINT8 *)NULL; // in non-ECM lastbuffer will be always 0 and container->production_state will be updated by t4 when it detects RTC cdb = pBuffer_front[ModemControl->BufferQueueProcess]; if (cdb == (JOBNODE_BUFFER *)NULL) { faxapp_notify_SendFaxSCStatus(FAXAPP_SC_CODE_FAIL_TO_CDB_DONE); } cdb->lastBuffer = last_buffer; TRACE_FAX("rx_data size %d(%d)\n", (int)cdb->used, ModemControl->BufferQueueProcess); if( (last_buffer == JOBNODE_BUFFER_LAST) && (T30RxCheckErrors() == 0) ) { //remained buffer write isFSURxImageProgessBegin = 0; gFaxRxTotalPages++; too_many_error = 0; DocId = fsu_get_doc_id(jnum); snprintf(PathName, sizeof(PathName), "%s%cDoc%02X%02X%cfax%02X.jbg", pRootFolderName, PATH_SEPARATOR, 0, DocId, PATH_SEPARATOR, gFaxRxTotalPages); snprintf(TiffName, sizeof(TiffName), "%s%cDoc%02X%02X%cfax%02X.pbm", pRootFolderNameRAM, PATH_SEPARATOR, 0, DocId, PATH_SEPARATOR, gFaxRxTotalPages); printf("\n(YHCHO) %s() - PathName: %s , NonECM_total_size = %ld\n", __FUNCTION__, PathName, NonECM_total_size); pFile = fopen(PathName, "wb"); if (pFile == (FILE *)NULL) { printf("\n(YHCHO) %s() - Check Point [1]\n", __FUNCTION__); XASSERT(0,0); } else { //printf("\n(YHCHO) %s() - total_size: %d\n", __FUNCTION__, total_size); for(i = 0; i <= ModemControl->BufferQueueProcess; i++) { pBuff = (UINT8 *)pBuffer_front[i]->data; memcpy(gpRxPageMemory+NonECM_total_size, pBuff, pBuffer_front[i]->used); NonECM_total_size += pBuffer_front[i]->used; } result = fwrite(gpRxPageMemory, sizeof(UINT8), NonECM_total_size, pFile); printf("\n(YHCHO) %s() -(%d/%d) result = (%d/%ld)\n", __FUNCTION__,i,ModemControl->BufferQueueProcess,result,NonECM_total_size); if (result <= 0) { printf("\n(YHCHO) %s() - Check Point [2]\n", __FUNCTION__); XASSERT(0,0); } if (fflush(pFile) != 0) { XASSERT(0,0); } if (fsync(pFile->_fileno) == -1) { XASSERT(0,0); } if (fclose(pFile) != 0) { XASSERT(0,0); } } NonECM_total_size = 0; T30Query( IOCTL_RX_CODING_TYPE, &coding_type, sizeof( coding_type ) ); T30Query( IOCTL_GET_COMM_RES_RX, &rx_res, sizeof( rx_res ) ); printf("\n(YHCHO) %s() - coding: %d\n", __FUNCTION__, coding_type); if(coding_type != CODING_JBIG) { if(T4_Decoding(jnum, PathName, TiffName, coding_type, 0, rx_res, FAX_APP_JOB_DIRECTION_RECEIVE)) { ++ModemControl->BufferQueueProcess; pBuffer_front[ModemControl->BufferQueueProcess]->used = 0; too_many_error = 1; gFaxRxTotalPages--; unlink(PathName); isFSURxImageProgessBegin = 1; return; } if(!fsu_image_validation_check(rx_res, jnum)) { ++ModemControl->BufferQueueProcess; pBuffer_front[ModemControl->BufferQueueProcess]->used = 0; too_many_error = 2; gFaxRxTotalPages--; unlink(PathName); unlink(TiffName); isFSURxImageProgessBegin = 1; return; } printf("\n(YHCHO) %s() - T4 Decoding Complete: %s\n", __FUNCTION__, TiffName); T4_encoding(gFaxRxTotalPages, TiffName, CODING_MMR , rx_res, jnum, FAX_APP_JOB_DIRECTION_RECEIVE, FAX_APP_PHOTO_MODE_IMAGE_RES_300DPI); printf("\n(YHCHO) %s() - T4 Encode End\n",__FUNCTION__); T4_end_of_page = TRUE; } else { if(sw_jbig_decode_tx(gFaxRxTotalPages, jnum, PathName, FAX_APP_JOB_DIRECTION_RECEIVE)) { ++ModemControl->BufferQueueProcess; pBuffer_front[ModemControl->BufferQueueProcess]->used = 0; too_many_error = 3; gFaxRxTotalPages--; unlink(PathName); isFSURxImageProgessBegin = 1; return; } if(!fsu_image_validation_check(rx_res, jnum)) { ++ModemControl->BufferQueueProcess; pBuffer_front[ModemControl->BufferQueueProcess]->used = 0; too_many_error = 2; gFaxRxTotalPages--; unlink(PathName); unlink(TiffName); isFSURxImageProgessBegin = 1; return; } T4_encoding(gFaxRxTotalPages, TiffName, CODING_MMR , rx_res, jnum, FAX_APP_JOB_DIRECTION_RECEIVE, FAX_APP_PHOTO_MODE_IMAGE_RES_300DPI); printf("\n(YHCHO) %s() - T4 Encode End\n",__FUNCTION__); T4_end_of_page = TRUE; } #ifdef HAVE_IMAGELOG // Save the remote no. once and make .pdf file for image log if ( ( (IsImageLogEnabled('F', IMAGE_LOG_JOB_TYPE_TX) == TRUE) && (fsu_get_fax_forward(fsu_job_num_rcv) == 1) ) || ( (IsImageLogEnabled('F', IMAGE_LOG_JOB_TYPE_RX) == TRUE) && (getSaveFaxFile() == 1) ) ) { if (gFaxRxTotalPages == 1) { UINT32 jobId = create_unique_job_id(); fsu_update_unique_job_id(fsu_job_num_rcv, jobId); if ( (IsImageLogEnabled('F', IMAGE_LOG_JOB_TYPE_TX) == TRUE) && (fsu_get_fax_forward(fsu_job_num_rcv) == 1) ) { fsu_update_remote_no_for_image_log(IMAGE_LOG_JOB_TYPE_TX, fsu_job_num_rcv); } else { fsu_update_remote_no_for_image_log(IMAGE_LOG_JOB_TYPE_RX, fsu_job_num_rcv); } } faxapp_make_pdf_start(NULL, fsu_job_num_rcv, gFaxRxTotalPages, 1, fsu_get_width(fsu_job_num_rcv), SAVE_FILE_PAGE_TYPE_MULTI_PAGE, REQUEST_SOURCE_FAX, FAXAPP_MAKE_PDF_REASON_IMAGE_LOG); } #endif if (gFaxRxTotalPages == 1) { if (fsu_get_poll_receive(jnum) == 0) { Create_Job_Queue_File(jnum, FAX_APP_JOB_TYPE_RECEIVE, DocId); } else { Update_Job_Queue_File(jnum, IMAGE_BACKUP_REASON_UPDATE_RESOLUTION, fsu_get_resolution(jnum)); } } gFaxRxCurrentPage++; if(fsu_get_fax_forward(jnum) == DISABLE) { if ( (getgFaxPrintMode() == FAX_PRINT_MODE_PRINT_EVERY_PAGE) && (getSaveFaxFile() == DISABLE) ) { if(gFaxRxCurrentPage == 1) { fsu_set_prn_job_ready(jnum); fsu_set_next_prn_num(jnum); } } } isFSURxImageProgessBegin = 1; } // if(last_buffer == JOBNODE_BUFFER_LAST) // when all allocated dmbs are consumed if(++ModemControl->BufferQueueProcess >= NUM_OF_BUFF) { TRACE_FAX("Non-ECM buffer full NonECM_total_size = %ld!!\n",NonECM_total_size); if( !cdb->lastBuffer ) { for(i = 0; i < NUM_OF_BUFF; i++) { pBuff = (UINT8 *)pBuffer_front[i]->data; memcpy(gpRxPageMemory+NonECM_total_size, pBuff, pBuffer_front[i]->used); NonECM_total_size += pBuffer_front[i]->used; } ModemControl->BufferQueueProcess = 0; prepare_rx_buffers(NUM_OF_BUFF, FALSE); } else { ModemControl->BufferQueueProcess = 0; } } pBuffer_front[ModemControl->BufferQueueProcess]->used = 0; } //This will be called at the end of Rx Phase C when there is no data or error to fill RTC /*=========================================================================== * * ModemRxForceEndOfPage * * Called at the end of Rx Phase C * * Input: none * Output: none * *===========================================================================*/ void ModemRxForceEndOfPage( UINT8 RTC_Detected ) { JOBNODE_BUFFER *cdb = (JOBNODE_BUFFER *)NULL; UINT8 coding_type = 0; UINT8 rtc_MH[ 9 ] = { 0x00, 0x08, 0x80, 0x00, 0x08, 0x80, 0x00, 0x08, 0x80 }; UINT8 rtc_MR[ 10 ] = { 0x00, 0x18, 0x00, 0x03, 0x60, 0x00, 0x0C, 0x80, 0x01, 0x30 }; UINT8 rtc_cnt = 0, i = 0; UINT8 *p_rtc_data = (UINT8 *)NULL; if ( !RTC_Detected ) // case is fax error { cdb = pBuffer_front[ ModemControl->BufferQueueProcess ]; if ( cdb == 0 ) { TRACE_ERROR( "### ModemRxForceEndOfPage: Error no cdb ###\n" ); faxapp_notify_SendFaxSCStatus(FAXAPP_SC_CODE_FAIL_TO_RX_PHASE_C_ENDOFPAGE); } TRACE_FAX("ModemRxForceEndOfPage: Insert RTC\n"); T30Query( IOCTL_RX_CODING_TYPE, &coding_type, sizeof( coding_type ) ); // Insert RTC if(coding_type == CODING_MH) { rtc_cnt = 9; p_rtc_data = rtc_MH; } else if(coding_type == CODING_MR) { rtc_cnt = 10; p_rtc_data = rtc_MR; } else /* For MMR, the EOFB is always inserted. Therefore any separate RTCs are not needed. */ return; for(i = 0; i< rtc_cnt; i++) { if(cdb->used == cdb->userData) { ModemCDBDone(JOBNODE_BUFFER_NOT_LAST); cdb = pBuffer_front[ ModemControl->BufferQueueProcess ]; } *(cdb->data + cdb->used++) = *(p_rtc_data + i); } } else // RTC is detected, then we don't need the data { // wait until no signal while ( ModemControl->State != MODEM_IDLE ) { if ( ModemControl->Status ) break; OSC_Sleep( MODEM_DELAY_TIME ); } // if RTC is detected then send blank buffer with setting lastBuffer to finish JobModem // get current buffer cdb = pBuffer_front[ ModemControl->BufferQueueProcess ]; cdb->used = 0; // no need the received data to have Modem Job release this buffer } // send buffer having RTC to T4 Jobnode ModemCDBDone(JOBNODE_BUFFER_LAST); } /*=========================================================================== * * ModemShutdownJob * * Deallocates the Modem and HDLC control structures previously allocated * by ModemInitJob. * * Input: none * Output: 0 if successful, 1 if error detected * *===========================================================================*/ UINT8 ModemShutdownJob( void ) { UINT8 status; status = 1; /* Deallocate the Modem control structure */ if ( ModemControl ) { OSC_Deallocate_Memory( ModemControl ); ModemControl = 0; } return ( status ); } /*=========================================================================== * * ModemCheckRTC * * Check RTC * * Input: data * Output: none * *===========================================================================*/ void ModemCheckRTC( UINT8 in_data ) { UINT8 i, data; data = in_data; if ( data == 0 ) { ModemControl->ZeroCount += 8; } else { for ( i = 0; i < 8; i++ ) { if ( data & 0x01 ) { if ( ModemControl->ZeroCount >= 11 ) { last_EOL_time = ModemElapsedTime( 0 ); } if ( ( ( ModemControl->EOLType == CODING_MR ) && ( data == 0x03 ) ) || ( ( ModemControl->EOLType == CODING_MH ) && ( data == 0x01 ) ) ) { if ( ( ( ModemControl->EOLCount > 0 ) && ( ModemControl->ZeroCount == 11 ) ) || ( ( ModemControl->EOLCount == 0 ) && ( ModemControl->ZeroCount >= 11 ) ) ) { ModemControl->EOLCount++; //TRACE_IRQDEBUG( "EOL %d %d %d %d\n", ModemControl->EOLCount, ModemControl->ZeroCount, data, i ); if ( ModemControl->EOLCount == CONSECUTIVE_EOL ) { ModemControl->FoundRTC = TRUE; TRACE_IRQ( " ( RTC )\n" ); } } if ( ModemControl->EOLType == CODING_MR ) { data = data >> 1; i++; } } else if ( ModemControl->EOLCount < CONSECUTIVE_EOL ) { ModemControl->EOLCount = 0; } ModemControl->ZeroCount = 0; } else { ModemControl->ZeroCount++; } data = data >> 1; } } } /*=========================================================================== * * ModemCDBWriteByte * * Writes a byte of data to the next location in the empty CDB * If at the end of the CDB, make the notify callback * * Input: data * Output: none * *===========================================================================*/ void ModemCDBWriteByte( UINT8 data ) { JOBNODE_BUFFER *pCdb = (JOBNODE_BUFFER *)NULL; pCdb = pBuffer_front[ ModemControl->BufferQueueProcess ]; if (pCdb == (JOBNODE_BUFFER *)NULL) { faxapp_notify_SendFaxSCStatus(FAXAPP_SC_CODE_FAIL_TO_CDB_WRITE_1); } // non-ECM Rx mode // when it set lastBuffer, it will be one of three cases and don't need to get data. // 1. detect RTC 2. Error(line drop, printer/memory), 3. FSK detect without RTC if( pCdb->lastBuffer ) return; /* If there is no CDB available or no data buffer, return */ if ( !pCdb->data ) { faxapp_notify_SendFaxSCStatus(FAXAPP_SC_CODE_FAIL_TO_CDB_WRITE_2); } *( pCdb->data + pCdb->used++ ) = data; /* If this is the end of the CDB, make the notify callback */ //.. here only handle when buffer is full. // other case including lastBuffer will be handled in ModemCDBMarkEndOfPage() 8/18/06 THY if ( pCdb->used == pCdb->userData ) { //TRACE_FAX( "pModemCDBWriteByte: Cdb full(cdb = %p, size = 0x%x)\n", pCdb, pCdb->used ); //TRACE_FAX( "rxed data size = 0x%x \n", pCdb->used ); ModemCDBDone(JOBNODE_BUFFER_NOT_LAST); } } /*=========================================================================== * * ModemCDBReadByte * * Reads a byte of data from the next location in the full CDB * * Input: none * Output: returns data value read from CDB * *===========================================================================*/ UINT8 ModemCDBReadByte( void ) { CDB_BUFFER *cdb = (CDB_BUFFER *)NULL; UINT8 retval; cdb = &cdb_buffer[ModemControl->TxBlockCnt][ModemControl->TxFrameCnt]; // get a cdb pointer from cdb_buffer retval = *(UINT8 *)( cdb->data + ModemControl->CDBByteNum++ ); if ( ModemControl->CDBByteNum >= cdb->size ) { TRACE_IRQ("sent %d bytes (%d) (%d)\n", cdb->size, ModemControl->TxFrameCnt, ModemControl->TxBlockCnt); last_EOL_time = ModemElapsedTime( 0 ); ModemControl->CDBByteNum = 0; cdb->size = 0; if ( !cdb->end_of_page ) { // if it is end of cdb_buffer if ( ++ModemControl->TxFrameCnt >= MAX_NON_ECM_TXFRAME) { ModemControl->TxFrameCnt = 0; ModemControl->TxBlockCnt = (ModemControl->TxBlockCnt + 1) % MAX_ECM_BLOCKS; } } else { TRACE_IRQ( "ModemCDBReadByte End of page\n" ); ModemControl->State = MODEM_IDLE; ModemDisableTxInt(); } } return ( retval ); } /*=========================================================================== * * ModemCDBReadLength * * Reads the length of the current CDB * * Input: none * Output: returns length read from CDB * *===========================================================================*/ UINT16 ModemCDBReadLength( void ) { register CDB_BUFFER *cdb; cdb = &cdb_buffer[ModemControl->TxBlockCnt][ModemControl->TxFrameCnt]; // get a cdb pointer from cdb_buffer if ( !cdb->size ) { if ( cdb->end_of_page ) return ( 0xFFFF ); } return ( cdb->size ); } /*=========================================================================== * * ModemCDBMarkEndOfPage * * Marks the current CDB in the modem CDB queue as an end-of-page CDB. * Used by the modem receive ISR when an abort condition is encountered * * Input: none * Output: none * *===========================================================================*/ void ModemCDBMarkEndOfPage( void ) { if ( !pBuffer_front[ ModemControl->BufferQueueProcess ] ) return; pBuffer_front[ ModemControl->BufferQueueProcess ]->lastBuffer = 1; } /*=========================================================================== * * ModemCDBWriteErrorData * * Write error line data * * Input: none * Output: none * *===========================================================================*/ void ModemCDBWriteErrorData( void ) { if ( !ModemControl->FoundRTC ) { TRACE_FAX( " put error line data\n" ); ModemCDBWriteByte( 0x0F ); ModemCDBWriteByte( 0x07 ); ModemCDBWriteByte( 0x40 ); } } /*============================================================================= * * ModemRxInitPage * * Initializes non-HDLC data reception per page. Configures the modem * to the indicated speed (if necessary), initializes pointers, waits for * the training sequence to be received, enables Rx data mode * interrupts, and returns. If carrier is not detected within 5 seconds, * it returns without enabling interrupts * * Input: speed = desired data mode (index into modem speed table) * training = short or long train * * Index Speed * 0 V.21, 300 * 1 V.27, 2400 * 2 V.27, 4800 * 3 V.29, 7200 * 4 V.29, 9600 * 5 V.17, 7200 * 6 V.17, 9600 * 7 V.17, 12000 * 8 V.17, 14400 * * Output: ModemControl->State = T4_RX_MODE * RDBIE = 1 *============================================================================*/ void ModemRxInitPage( UINT8 speed, UINT8 training ) { TRACE_FAX( "ModemRxInitPage() speed %d, training %d\n", speed, training ); ModemControl->State = T4_RX_MODE; ModemControl->Status = NO_ERROR; /* Reconfigure and check for short train if code is different or HDLC flag is on */ if ( ( MDM_READ( MODEM_CONF ) != ModemConfigTbl[ speed ] ) || MDM_BITSET( MODEM_06, HDLC ) ) { TRACE_FAX( "ModemRxInitPage() Reconfigure\n" ); ModemRxConfigHiSpeed( speed ); } /* Start a 5 second timer */ MODEM_TIMER_START( TimerA, 5000 ); while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); if ( MODEM_TIMER_EXPIRE( TimerA ) ) /* Timed out ? */ { TRACE_FAX( "ModemRxInitPage() Eerror! Timed out.\n" ); /* Indicate carrier not found */ ModemControl->Status = TIME_OUT; ModemControl->State = MODEM_IDLE; break; } if ( MDM_BITSET( MODEM_0A, PNSUC ) && MDM_BITSET( MODEM_0F, RLSD ) ) { TRACE_FAX( "ModemRxInitPage() Succeeded training\n" ); MDM_SETBIT( MODEM_06, RTDIS ); MDM_CLEARBIT( MODEM_0A, FLAGDT ); TRACE_FAX( "ModemRxInitPage: Start IRQ\n" ); /* Enable Rx Data interrupts */ ModemEnableRxInt(); break; } else { if ( MDM_BITSET( MODEM_0F, FED ) ) { OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); ModemDSPWrite3( 0xABC, 0x4600 ); ModemDSPWrite3( 0xABE, 0x1755 ); OSC_Release_Mutex( &modem_dsp_mutex ); } } } } /*============================================================================ * * ModemTxInitPage * * Initializes non-HDLC data transmission per page. Configures the modem * to the indicated speed, init's sending dummy data if necessary, sends * the training sequence, enables parallel data mode interrupts, and returns. * * Input: speed = desired data mode (index into modem speed table) * training = long or short train * * Index Speed * 0 V.21, 300 * 1 V.27, 2400 * 2 V.27, 4800 * 3 V.29, 7200 * 4 V.29, 9600 * 5 V.17, 7200 * 6 V.17, 9600 * 7 V.17, 12000 * 8 V.17, 14400 * * Output: ModemControl->State = T4_TX_MODE * TDBIE = 1 *============================================================================*/ void ModemTxInitPage( UINT8 speed, UINT8 training ) { ModemControl->State = T4_TX_MODE; ModemControl->Status = NO_ERROR; ModemControl->TxFrameCnt = 0; // frame counter for non-ECM Tx ModemControl->TxBlockCnt = 0; ModemControl->CDBByteNum = 0; frame_num = tx_blk_num = 0; ModemSetTraining( training ); MODEM_TIMER_START( TimerEvent, 250 ); // adjust silence time ModemTxConfigHiSpeed( speed ); ModemControl->HighSpeed = TRUE; OSC_Sleep(1000); TRACE_FAX( "ModemTxInitPage: Start IRQ\n" ); /* Enable Tx data interrupts */ ModemEnableTxInt(); } /*============================================================================ * ModemTxFinishInitPage * Finish initializing the modem transmission now that the * first CDB data (not dummy data) to be sent is ready. *=============================================================================*/ void ModemTxFinishInitPage( void ) { TRACE_FAX( "ModemTxFinishInitPage: Start IRQ\n" ); /* Enable Tx data interrupts */ ModemEnableTxInt(); } /*============================================================================ * ModemTxDummyDataTimeOut * Called on a timeout on wait for actual CDB data and hence * finish sending the dummy data and abort the modem. *=============================================================================*/ void ModemTxDataStop( void ) { /* Disable interrupts and abort */ MDM_CLEARBIT( MODEM_08, RTS ); ModemControl->State = MODEM_IDLE; } /*============================================================================ * * ModemRxTCFDone * * Completes the training check sequence(TCF) * * Input: none * * Output: Returns with 0 if no error, 1 if there is an error * TCFErrorBytes = number of errors. $7FFF means no carrier. *============================================================================*/ UINT8 ModemRxTCFDone( void ) { UINT8 status = 1; extern const UINT16 EQM_limit_tbl[ 9 ]; ModemControl->State = MODEM_IDLE; if ( ( ModemControl->TCFErrorBytes != 0xFFFF ) && ( ( ModemControl->TCFOKBytes / ModemControl->TCFErrorBytes ) > ModemControl->TCFThreshold ) ) { if ( ModemControl->EQM < EQM_limit_tbl[ T30Control->ModemSpeed ] ) status = 0; } TRACE_FAX( "ModemRxTCFDone: OK %d, Error %d\n", ModemControl->TCFOKBytes, ModemControl->TCFErrorBytes ); if ( status ) TRACE_FAX( " TCF error\n" ); ModemDisableRxInt(); ModemControl->State = MODEM_IDLE; MODEM_TIMER_START( TimerEvent, 50 ); OSC_Sleep( MODEM_DELAY_TIME ); return ( status ); } static const UINT16 tcf_byte_tbl[ 9 ] = { 0, 300, 600, 900, 1200, 900, 1200, 1500, 1800 }; /*============================================================================ * * ModemRxTCF * * Receives the training check sequence (TCF) * * Input: speed = modem configuration code * ModemControl->TCFThreshold = FTT error threshold * Output: Returns with the 0 if no error, 1 if there is an * error. * TCFErrorBytes = number of errors. $7FFF means no carrier. *============================================================================*/ UINT8 ModemRxTCF( UINT8 speed ) { UINT8 data; UINT8 count = 0; /* Do not receive TCF in V.34 mode */ if ( ModemControl->V34Mode ) return ( 0 ); ModemClearIRQ(); ModemControl->State = T4_RX_MODE; ModemControl->Status = NO_ERROR; TRACE_FAX( "ModemRxTCF: Entered ModemRxTCF...\n" ); /* Turn off short train bit and configure as high speed receiver */ MDM_CLEARBIT( MODEM_04, EQFZ | STRN ); TRACE_FAX( "ModemRxTCF: speed = %d\n", speed ); ModemRxConfigHiSpeed( speed ); /* Wait up to 4 seconds for carrier detect */ MODEM_TIMER_START( TimerA, 4000 ); while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); /* Failed training */ if ( MODEM_TIMER_EXPIRE( TimerA ) ) { TRACE_FAX( "ModemRxTCF: Failed training. Timer expired\n" ); ModemControl->TCFErrorBytes = 0xFFFF; return ( ModemRxTCFDone() ); } /* Carrier detected, continue */ if ( MDM_BITSET( MODEM_0A, PNSUC ) && MDM_BITSET( MODEM_0F, RLSD ) ) { TRACE_FAX( "ModemRxTCF: Succeeded training\n" ); OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); ModemDSPWrite1( 0x270, 0x05, FALSE ); OSC_Release_Mutex( &modem_dsp_mutex ); ModemControl->TCFOKBytes = 0; ModemControl->TCFErrorBytes = 1; // for divide 0 error #ifdef OEM_FAX_REPORT ModemControl->Level = ModemReadRxLevel(); ModemControl->EQM = ModemReadEQM(); #endif break; } else { if ( MDM_BITSET( MODEM_0F, FED ) ) { OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); ModemDSPWrite3( 0xABC, 0x4A00 ); ModemDSPWrite3( 0xABE, 0x2000 ); OSC_Release_Mutex( &modem_dsp_mutex ); } } } /* Make sure to clear any garbage out of the data buffer */ while ( MDM_BITSET( MODEM_0C, RXFNE ) ) data = MDM_READ( MODEM_RBUFF ); /* Look at data for 1.3 sec */ MODEM_TIMER_START( TimerA, 1300 ); while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); /* Bad TCF data*/ if ( MODEM_TIMER_EXPIRE( TimerA ) ) { //TRACE_FAX( "ModemRxTCF: Bad TCF data %d. TimerA expired\n" ); ModemControl->TCFErrorBytes = 0xFFFF; return ( ModemRxTCFDone() ); } /* Bad TCF - Carrier Gone */ if ( MDM_BITCLEAR( MODEM_0F, RLSD ) ) { TRACE_FAX( "ModemRxTCF: Carrier gone.\n" ); ModemControl->TCFErrorBytes = 0xFFFF; return ( ModemRxTCFDone() ); } while ( MDM_BITSET( MODEM_0C, RXFNE ) ) { if ( MDM_READ( MODEM_RBUFF ) == 0 ) ModemControl->TCFOKBytes++; else ModemControl->TCFErrorBytes++; } if ( ModemControl->TCFOKBytes >= 10 ) { break; } } // THY for interrupt method to receive TCF data ModemControl->State = MODEM_RX_TCF; TRACE_FAX( "ModemRxTCF: Start IRQ\n" ); ModemEnableRxInt(); while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); /* Bad TCF - Carrier Gone */ if ( MODEM_TIMER_EXPIRE( TimerA ) || MDM_BITCLEAR( MODEM_0F, RLSD ) ) { if ( ( count == 0 ) || !MODEM_TIMER_EXPIRE( TimerA ) ) { TRACE_ERROR( "ModemRxTCF: ERROR carrier gone before valid TCF time\n" ); ModemControl->TCFErrorBytes = 0xFFFF; } return ( ModemRxTCFDone() ); } if ( ( count == 0 ) && ( ModemControl->TCFOKBytes > tcf_byte_tbl[ speed ] ) ) { count++; if ( speed >= T30_SPEED_V17_7200 ) { TRACE_FAX( "ModemRxTCF: Set short train\n" ); MDM_SETBIT( MODEM_04, STRN ); // Set short train } #ifdef OEM_FAX_REPORT ModemControl->Level = ModemReadRxLevel(); ModemControl->EQM = ModemReadEQM(); CxProtocolReport( TCF, NULL, 0, RX_LOG ); #endif } } } /*============================================================================= * * ModemRxHsSignalRec * * High speed signal recognition * * - Configures to high speed receiver * - Starts a 6.7 second T.30 T2 timer. * * - Waits for either the 'PN success' flag or 'FSK 7E' flag, or T2 time-out * * Input: T2_TIMEOUT = T2 time-out period * speed = desired data mode (index into modem speed table) * training = short or long train * timeout = Time to check for ONLY the PN success flag initially * index = Speed * 0 V.21, 300 * 1 V.27, 2400 * 2 V.27, 4800 * 3 V.29, 7200 * 4 V.29, 9600 * 5 V.17, 7200 * 6 V.17, 9600 * 7 V.17, 12000 * 8 V.17, 14400 * * Output: return value: * TIME_OUT if no signal within 6.7 seconds * FSK if no PNSUC detected within 220 msec of signal present * HIGH_SPEED if PNSUC detected * ModemControl->Status = retval if TIME_OUT *=============================================================================*/ UINT8 ModemRxHsSignalRec( UINT8 speed, UINT8 training, UINT32 timeout, UINT8 ecm ) { UINT8 retval, v34state; BOOL fsk = FALSE; /* Non V.34 mode */ if ( !ModemControl->V34Mode ) { TRACE_FAX( "Entering ModemRxHsSignalRec: V17\n" ); ModemControl->State = T4_RX_MODE; ModemControl->Status = NO_ERROR; ModemControl->BufferQueueProcess = 0; HDLCRxWriteInitAllFrames(); /* Configure the modem */ ModemSetTraining( training ); if ( ecm ) ModemRxConfigHDLC( speed ); else ModemRxConfigHiSpeed( speed ); /* Start T.30 T2 timer, waiting for either high speed training sequence (PNSUC) or */ /* FSK command (FLAGDT). Default time-out = 7.7 */ MODEM_TIMER_START( TimerA, timeout ); /* Wait until fast energy detected */ while ( MDM_BITCLEAR( MODEM_0F, FED ) ) { OSC_Sleep( MODEM_DELAY_TIME ); if ( MODEM_TIMER_EXPIRE( TimerA ) ) { TRACE_FAX( "ModemRxHsSignalRec(): FED Expired\n" ); ModemControl->Status = TIME_OUT; return ( TIME_OUT ); } } /* Continue checking for PNSUC bit unless the timer expires */ while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); /* High speed signal detected? */ if ( MDM_BITSET( MODEM_0A, PNSUC ) && MDM_BITSET( MODEM_0F, RLSD ) ) { TRACE_FAX( "ModemRxHsSignalRec: Succeeded training\n" ); MDM_SETBIT( MODEM_06, RTDIS ); MDM_CLEARBIT( MODEM_0A, FLAGDT ); /* Set back short train after CTC-CTR for V.17 */ if ( speed >= T30_SPEED_V17_7200 ) ModemSetTraining( 0 ); ModemControl->State = MODEM_IDLE; ModemControl->HighSpeed = TRUE; retval = HIGH_SPEED; break; } else { if ( MDM_BITSET( MODEM_0F, FED ) ) { OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); ModemDSPWrite3( 0xABC, 0x4600 ); ModemDSPWrite3( 0xABE, 0x1755 ); OSC_Release_Mutex( &modem_dsp_mutex ); } } /* FSK tone detected? */ if ( MDM_BITSET( MODEM_0A, FLAGDT ) ) { /* Is this the start of the detection ? */ if ( !fsk ) { fsk = TRUE; /* Verify FSK for 150ms */ MODEM_TIMER_START( TimerB, 150 ); } else if ( MODEM_TIMER_EXPIRE( TimerB ) ) /* Detected for long enough ? */ { retval = FSK; break; } } else if ( fsk ) /* FSK tone had been detected earlier but not on now */ { fsk = FALSE; } /* Timeout? */ if ( MODEM_TIMER_EXPIRE( TimerA ) ) { TRACE_FAX( "ModemRxHsSignalRec: V.17 TimerA expired\n" ); retval = TIME_OUT; break; } if ( ModemControl->Status & MODEM_ABORT ) { retval = MODEM_ABORT; break; } } // while(1) } /* V.34 mode */ else { TRACE_FAX( "Entering ModemRxHsSignalRec: V34\n" ); timeout = ECM_BLOCK_LIMIT_TIMEOUT; MODEM_TIMER_START( TimerA, timeout ); ModemRxWaitForPC( 0 ); /* Wait for transition to rx data mode */ while ( 1 ) { OSC_Sleep( MODEM_DELAY_TIME ); /* Check for primary channel */ v34state = ModemRxWaitForPC( 1 ); if ( v34state == PC_RX_DATA_MODE ) { TRACE_FAX( "ModemRxHsSignalRec: V.34 High speed\n" ); ModemControl->HighSpeed = TRUE; retval = HIGH_SPEED; break; } else if ( MODEM_TIMER_EXPIRE( TimerA ) ) /* Timeout means go back to phase B */ { TRACE_FAX( "ModemRxHsSignalRec: V.34 TimerA expired\n" ); retval = TIME_OUT; break; } else if ( v34state == CC_DATA_MODE ) /* Tx retransmit EOM or MPS ? */ { retval = FSK; break; } if ( ModemControl->Status & MODEM_ABORT ) { retval = MODEM_ABORT; break; } } } ModemControl->State = MODEM_IDLE; return ( retval ); } /*============================================================================ * * ModemTxTCF * * Sends the TCF. Configures the modem to high speed transmit mode * and sends 1.5 seconds of 0's. * * Input: speed = desired data mode (index into modem speed table) * * Index Speed * 0 V.21, 300 * 1 V.27, 2400 * 2 V.27, 4800 * 3 V.29, 7200 * 4 V.29, 9600 * 5 V.17, 7200 * 6 V.17, 9600 * 7 V.17, 12000 * 8 V.17, 14400 * * Output: (none) * *============================================================================*/ void ModemTxTCF( UINT8 speed ) { int i; /* Do not send TCF in V.34 mode */ if ( ModemControl->V34Mode ) return ; /* Turn off short train, reset RTS, clear HDLC, and configure modem */ ModemClearIRQ(); MDM_CLEARBIT( MODEM_04, STRN ); MDM_CLEARBIT( MODEM_08, RTS ); MDM_CLEARBIT( MODEM_06, HDLC ); MDM_SETBIT( MODEM_08, TPDM ); MDM_SETBIT( MODEM_09, DATA ); MDM_SETBIT( MODEM_04, FIFOEN ); if ( ModemControl->Options.ForceEPTOff || ( !ModemControl->Options.ForceEPTOn && ( ( speed == T30_SPEED_V29_9600 ) || ( speed == T30_SPEED_V29_7200 ) ) ) ) { /* OFF echo protect */ MDM_CLEARBIT( MODEM_03, EPT ); MODEM_TIMER_START( TimerEvent, 70 ); i = 80; } else { /* ON echo protect */ MDM_SETBIT( MODEM_03, EPT ); MODEM_TIMER_START( TimerEvent, 90 ); i = 100; } ModemConfig( ModemConfigTbl[ speed ] ); while ( !MODEM_TIMER_EXPIRE( TimerEvent ) ) { if ( --i == 0 ) break; OSC_Sleep( MODEM_DELAY_TIME ); } /* TCF Sending */ ModemControl->State = MODEM_TX_TCF; OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); /* Set up the modem DSP to automatically transmit 0's for 1.5 sec */ ModemDSPWrite1( MODEM_TCF_FXN_ENB, MODEM_TCF_FXN_ENB_BIT, TRUE ); OSC_Release_Mutex( &modem_dsp_mutex ); /* Turn on RTS */ MDM_SETBIT( MODEM_08, RTS ); TRACE_FAX( "ModemTxTCF: Sending ( TCF )\n" ); #ifdef OEM_FAX_REPORT ModemControl->Level = ModemReadTxLevel(); ModemControl->EQM = 0xffff; CxProtocolReport( TCF, NULL, 0, TX_LOG ); #endif /* Wait for modem to finish the TCF and reset the RTS bit */ OSC_Sleep( 1500 ); MODEM_TIMER_START( TimerEvent, 1700 ); while ( MDM_BITSET( MODEM_08, RTS ) ) { OSC_Sleep( MODEM_DELAY_TIME ); // Fail safe if ( MODEM_TIMER_EXPIRE( TimerEvent ) ) { UINT8 data; TRACE_FAX( " Timeout ( TCF )\n" ); OSC_Obtain_Mutex( &modem_dsp_mutex, OSC_SUSPEND ); data = ModemDSPRead1( 0x6cd ); ModemDSPWrite1( 0x6cd, data & 0x7F, FALSE ); data = ModemDSPRead1( 0x6D7 ); ModemDSPWrite1( 0x6D7, data & 0x7F, FALSE ); data = ModemDSPRead1( 0x89 ); ModemDSPWrite1( 0x89, data & 0xFB, FALSE ); OSC_Release_Mutex( &modem_dsp_mutex ); MDM_CLEARBIT( MODEM_08, RTS ); break; } } ModemControl->State = MODEM_IDLE; } /*============================================================================ * * ModemSetTraining * * Sets training mode (short or long) * * Input: 1 - long train * 0 - short train * * Output: Controls modem short train * *============================================================================*/ void ModemSetTraining( UINT8 mode ) { TRACE_FAX( "ModemSetTraining %s\n", mode ? "long" : "short" ); if ( mode ) MDM_CLEARBIT( MODEM_04, EQFZ | STRN ); else MDM_SETBIT( MODEM_04, STRN ); } /*============================================================================ * * ModemRxTrainingDisable * * Disable or enable the receiver training * * Input: 1 - Disable training * 0 - Enable training * * Output: Controls Rx training capability * *============================================================================*/ void ModemRxTrainingDisable( BOOL mode ) { if ( mode ) MDM_SETBIT( MODEM_06, RTDIS ); else MDM_CLEARBIT( MODEM_06, RTDIS ); } /*=========================================================================== * * ModemRxBillingDelay * * Waits for 2.15 seconds, and for CNG to go away * * Input: *speed = Initial speed to try connection at * poll = TRUE if initial polling is allowed * Output: Returns the following * << look at V8Answer in modemv8.c if initial speed is a V34 speed >> * 0 if CNG no longer detected, non-zero otherwise * *===========================================================================*/ UINT8 ModemRxBillingDelay( UINT8 *speed, BOOL poll, UINT16 timeout ) { UINT8 status; TRACE_FAX( "ModemRxBillingDelay speed %d, poll %d, timeout %d\n", *speed, poll, timeout ); ModemControl->V34Mode = FALSE; /* If V34 speeds are allowed try to do V8 */ if ( *speed > T30_SPEED_V17_14400 ) { return V8Answer( speed, poll, FALSE, timeout ); } /* Set tone detectors to detect CNG flags */ ModemSetupToneDet( MODEM_CNG_TONE ); /* Start a 1 second timer */ MODEM_TIMER_START( TimerB, 1000 ); /* Loop until either CNG no longer detected or timeout */ while ( ModemToneDetected( MODEM_CNG_TONE ) && !MODEM_TIMER_EXPIRE( TimerB ) ) { OSC_Sleep( 20 ); } status = ModemToneDetected( MODEM_CNG_TONE ); TRACE_FAX( "Tone detected: 0x%X.\n", status ); ModemDisableToneDet( MODEM_CNG_TONE ); /* Transmit answer tone */ ModemTxCED(); #ifdef OEM_FAX_REPORT ModemControl->Level = ModemReadTxLevel(); ModemControl->EQM = 0xffff; CxProtocolReport( CED, NULL, 0, TX_LOG ); #endif /* Wait 3 seconds */ OSC_Sleep( 3000 ); /* Stop Transmitting */ MDM_CLEARBIT( MODEM_08, RTS ); MODEM_TIMER_START( TimerEvent, 50 ); return status; } /*============================================================================ * ModemTxDetCalledStation * * Detects called fax station * * Input: timeout = carrier time-out period (msec) * abort_fn = Pointer to a function to call to check for aborts * *speed = Initial speed to try connection at * poll = TRUE if initial polling is to be attempted * Output: Returns the following: * << look at V8Originate in modemv8.c if initial speed is a V34 speed >> * FAX_PHASE_A_TIMEOUT * FAX_PHASE_A_BUSY * FAX_PHASE_A_CED * FAX_PHASE_A_ABORT *============================================================================*/ UINT8 ModemTxDetCalledStation( UINT16 timeout, UINT8 ( *abort_fn ) ( void ), UINT8 *speed, BOOL poll ) { TRACE_FAX( "ModemTxDetCalledStation speed %d, poll %d, timeout %d\n", *speed, poll, timeout ); ModemControl->V34Mode = FALSE; /* If V34 speeds are allowed try to do V8 */ if ( *speed > T30_SPEED_V17_14400 ) { return V8Originate( speed, poll, FALSE, timeout, abort_fn ); } else { ModemSetupToneDet( MODEM_ANS_TONE ); /* CED signal */ ModemSetupToneDet( MODEM_FSK_TONE ); /* V.21 signal */ } ModemControl->State = HDLC_RX_MODE; ModemControl->Status = NO_ERROR; ModemClearIRQ(); /* Set the carrier timeout timer */ MODEM_TIMER_START( TimerB, timeout ); /* Continue sending CNG tone until done */ while ( 1 ) { /* Need 100 msec interval to coordinate with phone */ /* so that busy tone can be detected properly */ OSC_Sleep( 100 ); /* Check for abort or for scanner pullin paper jam */ if ( abort_fn && abort_fn() ) { ModemControl->State = MODEM_IDLE; return ( MODEM_FAX_PHASE_A_ABORT ); } /* Check for carrier timeout */ if ( MODEM_TIMER_EXPIRE( TimerB ) ) { ModemControl->Status = NO_ERROR; ModemControl->State = MODEM_IDLE; return ( MODEM_FAX_PHASE_A_TIMEOUT ); } /* CED or HDLC flag found? */ if ( ModemToneDetected( MODEM_ANS_TONE ) || ModemToneDetected( MODEM_FSK_TONE ) ) { #ifdef OEM_FAX_REPORT ModemControl->Level = ModemReadRxLevel(); ModemControl->EQM = 0xffff; CxProtocolReport( CED, NULL, 0, RX_LOG ); #endif ModemControl->State = MODEM_IDLE; return ( MODEM_FAX_PHASE_A_CED ); } } /* while sending CNG tones */ }
Fall detection and walking estimation using floor vibration for solitary elderly people In this study, we propose a system that detects falls and estimates walking conditions for elderly people living alone. This system uses floor vibration measured by microphone sensors installed on the floor of an elderly person's home, and it detects falls and walking from the frequency characteristic of the floor vibration. Furthermore, it estimates the walking condition using a method of estimating the sound sources with multiple microphone sensors. To demonstrate the usefulness of the proposed system, an experiment of fall / walk detection with one healthy person and a walking condition estimation experiment were conducted in a model room in a facility for the elderly in Fukui Prefecture. As a result, all falls and walks under arbitrary conditions were able to be detected, and the estimation of the walking state was able to be partially achieved.
Parental Alienation Disorder: Why Label Children with a Mental Diagnosis? The proposal to include Parental Alienation Disorder (PAD) in the new proposed Diagnostic and Statistical Manual of Mental Disorders, Fifth Edition (DSM-V) creates a host of problems. The first major problem is the labeling of children with a mental disorder who may simply be reacting with anger to the changes in their lives from the separation and divorce of their parents by rejecting one parent and aligning with the other. Diagnosis may bring with it shame and have a chilling impact on parents report of domestic violence. Although proponents of PAD are aware that it is inappropriate to diagnose children who have been exposed to child abuse and/or domestic violence with PAD, they do not clarify how to make such differential diagnoses. It is suggested that there are insufficient empirical data to differentiate abused and traumatized children from those who are alienated or estranged from the rejected parent. Nor are there sufficient scientific data to account for other child vulnerabilities such as neurological immaturity, Attention-Deficit/Hyperactivity Disorder (ADHD), other anxiety and mood disorders, or oppositional defiant disorder. There are too few comparisons between the risks and benefits of adding a new diagnosis of childhood disorders to justify its inclusion in the DSM-V. Appropriate intervention strategies recommended for PAD children include contact with the rejected parent, which differ widely from trauma victim/survivors who need assurance of safety and healing before contact is re-established. Ethical standards that may be impacted by this new diagnosis and admissibility issues raised by its predecessor, Parental Alienation Syndrome (PAS), are also discussed by the authors.
ESTIMATION OF PHYTOTOXIC ALUMINUM IN SOIL SOLUTION USING THREE SPECTROPHOTOMETRIC METHODS Aluminum in soil solution exists in a variety of forms, some of which are toxic to plants. In the current investigation three spectrophotometric techniques-8-hy-droxyquinoline, aluminon, and ferronwere compared for their ability to estimate phytotoxic Al in soil solution. Soil solution Al reacting with 8-hydroxyquinoline in 15 s, ferron in 30 s, and aluminon in 30 min were related to root and shoot growth of subterranean clover (Trifolium subterraneum L. cv. Mt. Barket) and switchgrass (Panicum virgatum L. cv. Cave-in-Rock) in limed and unlimed treatments of 10 acidic subsoil horizons. Across all 10 soils the amount of Al reacting with 8-hydroxyquinoline was generally the lowest, and that reacting with ferron the highest, although overlap among methods did occur. Manganese interference in several of the soil solutions limited the utility of the ferron method. The amounts of Al reacting with 8-hydroxyquinoline and aluminon were significantly related (P < 0.05) to root and shoot growth limitations exhibited by subterranean clover and switch-grass. Activities of Al3+ (aAl3+) calculated from the GEOCHEM program using the Al reacting with 8-hydroxyquinoline and aluminon as the Al inputs were generally the best predictors of root and shoot growth. Especially for subterranean clover, including measures of soil or soil solution Ca and pH with aAl3+ greatly enhanced the predictive capability of regression equations describing root and shoot growth. The concentrations of organic acids and dissolved organic C were low in the soil solutions from this experiment, and both 8-hydroxyquinoline and aluminon gave reasonable estimates of phytotoxic Al. However, the extent of reaction between these reagents and organically complexed forms of Al should be investigated before these techniques are applied to soil solutions in which a significant fraction of soil solution Al is in an organically complexed form.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ============================================================================= """Module Built to To Read ID3 Track Data.""" # File Name: track_meta_id3.py # ============================================================================= import time from os import path from eyed3 import id3 from eyed3 import load current_home = path.expanduser('~') search_dir = path.join(current_home + "/Music/iTunes/iTunes Media/Music/Rush/Chronicles (Disc 2)/2-03 Limelight.mp3") # noqa def track_info(filename): """Module Built To Read ID3 Track Data.""" tag = id3.Tag() tag.parse(filename) a = load(filename) print("# {}".format('=' * 78)) print("Track Name: {}".format(tag.title)) print("Track Artist: {}".format(tag.artist)) print("Track Album: {}".format(tag.album)) print("Track Duration: {}".format(duration_from_seconds(a.info.time_secs))) print("Track Number: {}".format(tag.track_num)) print("Track BitRate: {}".format(a.info.bit_rate)) print("Track BitRate: {}".format(a.info.bit_rate_str)) print("Sample Rate: {}".format(a.info.sample_freq)) print("Mode: {}".format(a.info.mode)) print("# {}".format('=' * 78)) print("Album Artist: {}".format(tag.album_artist)) print("Album Year: {}".format(tag.getBestDate())) print("Album Recording Date: {}".format(tag.recording_date)) print("Album Type: {}".format(tag.album_type)) print("Disc Num: {}".format(tag.disc_num)) print("Artist Origin: {}".format(tag.artist_origin)) print("# {}".format('=' * 78)) print("Artist URL: {}".format(tag.artist_url)) print("Audio File URL: {}".format(tag.audio_file_url)) print("Audio Source URL: {}".format(tag.audio_source_url)) print("Commercial URL: {}".format(tag.commercial_url)) print("Copyright URL: {}".format(tag.copyright_url)) print("Internet Radio URL: {}".format(tag.internet_radio_url)) print("Publisher URL: {}".format(tag.publisher_url)) print("Payment URL: {}".format(tag.payment_url)) print("# {}".format('=' * 78)) print("Publisher: {}".format(tag.publisher)) print("Original Release Date: {}".format(tag.original_release_date)) print("Play Count: {}".format(tag.play_count)) print("Tagging Date: {}".format(tag.tagging_date)) print("Release Date: {}".format(tag.release_date)) print("Terms Of Use: {}".format(tag.terms_of_use)) print("isV1: {}".format(tag.isV1())) print("isV2: {}".format(tag.isV2())) print("BPM: {}".format(tag.bpm)) print("Cd Id: {}".format(tag.cd_id)) print("Composer: {}".format(tag.composer)) print("Encoding date: {}".format(tag.encoding_date)) print("# {}".format('=' * 78)) print("Genre: {}".format(tag.genre.name)) print("Non Std Genre Name: {}".format(tag.non_std_genre.name)) print("Genre ID: {}".format(tag.genre.id)) print("Non Std Genre ID: {}".format(tag.non_std_genre.id)) print("LAME Tag: {}".format(a.info.lame_tag)) print("# {}".format('=' * 78)) print("Header Version: {}".format(tag.header.version)) print("Header Major Version: {}".format(tag.header.major_version)) print("Header Minor Version: {}".format(tag.header.minor_version)) print("Header Rev Version: {}".format(tag.header.rev_version)) print("Header Extended: {}".format(tag.header.extended)) print("Header Footer: {}".format(tag.header.footer)) print("Header Experimental: {}".format(tag.header.experimental)) print("Header SIZE: {}".format(tag.header.SIZE)) print("Header Tag Size: {}".format(tag.header.tag_size)) print("Extended Header Size: {}".format(tag.extended_header.size)) print("# {}".format('=' * 78)) print("File Name: {}".format(tag.file_info.name)) print("File Tag Size: {}".format(tag.file_info.tag_size)) print("File Tag Padding Size: {}".format(tag.file_info.tag_padding_size)) print("File Read Only: {}".format(tag.read_only)) print("File Size: {}".format(a.info.size_bytes)) print("Last Modified: {}".format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(tag.file_info.mtime)))) print("Last Accessed: {}".format(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(tag.file_info.atime)))) print("# {}".format('=' * 78)) def duration_from_seconds(s): """Module to get the convert Seconds to a time like format.""" s = s m, s = divmod(s, 60) h, m = divmod(m, 60) d, h = divmod(h, 24) timelapsed = "{:01d}:{:02d}:{:02d}:{:02d}".format(int(d), int(h), int(m), int(s)) return timelapsed track_info(search_dir)
// JOOS1:REACHABILITY,UNREACHABLE_STATEMENT // JOOS2:REACHABILITY,UNREACHABLE_STATEMENT // JAVAC:UNKNOWN // /** * Reachability: * - Check that all statements (including empty statements and empty * blocks) are reachable. */ public class Je_7_Reachability_AfterIfReturnElseReturn { public Je_7_Reachability_AfterIfReturnElseReturn () {} public static int test(int j) { if (j == 0) return 7; else return j; int i = 8; return 123; } }
James P. Rubin is a former assistant secretary of state in the Clinton administration and is a contributing editor for Politico Magazine. LONDON — Since the fall of communism in 1989, a year has not gone by without some high-level meeting or international conference wrestling with the question of whether the Western alliance, NATO, has passed its sell-by date. “Whither NATO?” is now a well-worn inside joke for the conference-attending global elites so despised by Donald Trump and his followers. However, with each passing week of chaos, confusion and amateurish public statements emanating from the modern day Tower of Babel, formerly known as the White House, the prospect of permanent damage to this revered institution is no longer an exaggerated fear. This time, many in Europe agree, the danger is real. Worse yet, we are rapidly approaching a point of no return—a decision point when European governments conclude that, despite its demonstrable success, the era of a U.S.-led NATO military alliance is ending and they must act accordingly. Story Continued Below We are not there yet. But for those who have worked over the past 70 years to establish and enhance American leadership of a stable, prosperous, democratic order, as well as for those who support and benefit from the policies and practices such a world order entails, it’s time to recognize the risk. In doing so, it is especially important to consider the context in which Trump’s damage is being done. The critique of Western allies, like Germany, for insufficient defense spending did not begin with Trump. NATO alliance stalwarts like former Senators Mike Mansfield and Sam Nunn as well as the ever-present Bob Gates, secretary of defense for George W. Bush and Barack Obama, have all made much the same point. And while Trump has taken his complaint to an extreme by casting doubt on America’s pledge of collective defense, something no other president has ever even contemplated, it was Obama after all who loudly complained about “free riders,” countries that benefit from U.S. military spending and action and have sufficient resources but still don’t contribute their fair share. Most assumed Saudi Arabia and Germany were prime examples. Beyond the question of NATO spending is the larger context of America’s willingness to act internationally and the extent to which it acts in concert with allies and partners. This part of the problem is too often ignored. The tragic truth is that it has been a long, long time since Washington has been both willing to lead internationally and willing to do so together with our Western allies. Much has been written about the damage done to the Western alliance by the Bush administration’s arrogance in the lead-up to both Afghanistan and Iraq. From the treatment of prisoners, to the abrogation of treaties, to the pre-Iraq War diplomatic blunders, to the disastrous prosecution of the war and its aftermath, as well as the absence of weapons of mass destruction, no doubt the two Bush terms profoundly scarred America’s international reputation here in Europe. If the Bush administration was marked by overreach, then the eight years of Obama could be described as underreach. The widespread perception among Europeans is that Obama never established the close working partnerships with leaders of Britain, France and Germany previously seen as a necessary component of American diplomacy. Nor, in the minds of most European governments, was the United States willing to act when crises erupted in Ukraine and Syria. And as much as anything, the refugees that flooded Europe as the Syria conflict went unaddressed for six long years were the final straw for British voters who chose to exit the European Union. As painful as it is to acknowledge, the Obama years were widely regarded as a typically American overreaction to Bush’s excesses. Which brings us to President Trump. No doubt Trump’s attacks on NATO as obsolete, his inexplicable refusal to criticize Moscow’s invasion of Ukraine, and his boorish treatment of Chancellor Angela Merkel of Germany are deeply damaging when taken in isolation. But coming as they do after 16 long years of European longing for a return to respected American leadership of the West, they are far more destructive. After four straight administrations marked by seesaw leadership and erratic diplomacy, each of which weakened, albeit in different ways, perceptions of U.S. reliability and leadership, it was always going to be hard for a new president to restore trust and confidence. But now, as a consequence of four weeks of Trump’s heresies and insult-driven diplomacy, it seems fair to say European confidence in America has reached a new low—a loss of confidence so profound that it may soon be extremely difficult to reverse. To see how low we have sunk, it’s worth remembering France’s response during the Cuban Missile Crisis. President John F. Kennedy was determined to secure the full support of his French counterpart, General Charles de Gaulle. So, he sent Dean Acheson, the respected former secretary of state who was “present at the creation” of the key Western Institutions, to meet the prickly French president in Paris along with a CIA representative who was carrying the photographic evidence of the Soviet missiles in Cuba. Remarkably, de Gaulle declined the CIA briefing Acheson offered, telling him he had full confidence in Kennedy and took him at his word on a matter so grave. After the Iraqi WMD fiasco, that kind of trust is hard to imagine. The solidarity of NATO has also been crucial to its success in deterring Soviet aggression and contributing to the emergence of a Europe whole, free and prosperous. Whether it was the invasion of Ukraine, the 9/11 attacks, the aggression of Slobodan Milosevic or Saddam Hussein’s attack on Kuwait, that solidarity was proven in crisis after crisis. If the Trump effect has indeed provoked a point of no return, we may not know it until a new crisis arises requiring NATO to take a stand. In the meantime, European governments may well be willing to provide greater resources for defense. In the case of Germany, defense spending has been growing, even before Trump raised the subject. If the pace were accelerated, that is all to the good. The dangers come when European governments develop an expectation that they can no longer rely on the United States. Will they make future decisions about sanctions on Russia based on a weakening NATO? What about the united European stance against Russia’s insistence on acceptance of its “sphere of influence” in former Soviet territories? Will a loss of confidence in American leadership change how France or Germany answer that crucial question? Or take the Balkans, where NATO and European institutions were so successful in stopping Serbian aggression in Kosovo and promoting democratic government in all the former Yugoslav republics. Reports indicate that Moscow is stirring up Serbian nationalism again. Without an expectation of American leadership, Europeans may not be willing to protect those hard-won victories for the rule of law and democratic values. At last week’s Munich Security Conference, Trump officials worked hard to reassure European leaders that U.S. support for NATO had not fundamentally changed. Vice President Mike Pence, in particular, sought to dispel doubts about America’s readiness to defend Europe and face down the growing Russian menace. While his statements, and similar comments by Defense Secretary James Mattis, hit all the proper notes, confidence has been so shaken that words alone are simply not enough. Europeans, too, will be watching the next crisis carefully. The right words are necessary but only actions will be sufficient. At the same event, foreign ministers from Russia, China and Iran were putting forward a more troubling premise. Each in their own way asserted that this year marked the end of the “West” and the onset of a new era for Europe and the wider world. Their analysis was surely premature and self-serving, inasmuch as those countries have been making similar points for many years now. Tragically though, unless something changes, this time they may be right.
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from recipe_engine.types import freeze DEPS = [ 'adb', 'depot_tools/bot_update', 'chromium', 'chromium_android', 'chromium_tests', 'depot_tools/gclient', 'recipe_engine/json', 'recipe_engine/path', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', 'test_utils', ] REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' def _ChromiumPerfTesters(): def _AddTestSpec(name, perf_id, num_device_shards=1, num_host_shards=1, target_bits=64): for shard_index in xrange(num_host_shards): builder_name = '%s (%d)' % (name, shard_index + 1) testers[builder_name] = _TestSpec( name, perf_id, num_device_shards, num_host_shards, shard_index, target_bits) def _TestSpec(name, perf_id, num_device_shards, num_host_shards, shard_index, target_bits): spec = { 'perf_id': perf_id, 'bucket': 'chrome-perf', 'num_device_shards': num_device_shards, 'num_host_shards': num_host_shards, 'shard_index': shard_index, 'test_spec_file': 'chromium.perf.json', 'max_battery_temp': 350, } if target_bits == 32: builder_name = 'android_perf_rel' elif target_bits == 64: builder_name = 'android_perf_rel_arm64' spec['recipe_config'] = 'tests_arm64' spec['path'] = lambda api: '%s/full-build-linux_%s.zip' % ( builder_name, api.properties['parent_revision']) return spec testers = {} _AddTestSpec('Android Galaxy S5 Perf', 'android-galaxy-s5', num_device_shards=7, num_host_shards=3, target_bits=32) _AddTestSpec('Android Nexus5 Perf', 'android-nexus5', num_device_shards=7, num_host_shards=3, target_bits=32) _AddTestSpec('Android Nexus6 Perf', 'android-nexus6', num_device_shards=7, num_host_shards=3, target_bits=32) _AddTestSpec('Android Nexus7v2 Perf', 'android-nexus7v2', num_device_shards=7, num_host_shards=3, target_bits=32) _AddTestSpec('Android Nexus9 Perf', 'android-nexus9', num_device_shards=7, num_host_shards=3) _AddTestSpec('Android One Perf', 'android-one', num_device_shards=7, num_host_shards=3, target_bits=32) return testers BUILDERS = freeze({ 'chromium.perf': _ChromiumPerfTesters(), 'chromium.perf.fyi': { 'android_nexus5_oilpan_perf': { 'perf_id': 'android-nexus5-oilpan', 'bucket': 'chromium-android', 'path': lambda api: ( '%s/build_product_%s.zip' % ( api.properties['parent_buildername'], api.properties['parent_revision'])), 'num_device_shards': 1, }, }, 'client.v8.fyi': { 'Android Nexus4 Perf': { 'gclient_apply_config': [ 'v8_bleeding_edge_git', 'chromium_lkcr', 'show_v8_revision', ], 'perf_id': 'v8-android-nexus4', 'bucket': 'v8-android', 'path': lambda api: ('v8_android_perf_rel/full-build-linux_%s.zip' % api.properties['parent_revision']), 'num_device_shards': 1, 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, }, }, }) def RunSteps(api): mastername = api.properties['mastername'] buildername = api.properties['buildername'] # TODO(akuegel): Move the configs in builders.py in chromium_tests to this # recipe, and get rid of duplications. builder = dict(BUILDERS[mastername][buildername]) builder_config = builder.get('recipe_config', 'base_config') kwargs = { 'REPO_NAME':'src', 'REPO_URL':REPO_URL, 'INTERNAL':False, 'BUILD_CONFIG':'Release', 'TARGET_PLATFORM':'android', } api.chromium_android.set_config(builder_config, **kwargs) api.chromium.set_config(builder_config, **kwargs) api.gclient.set_config('perf') api.gclient.apply_config('android') for c in builder.get('gclient_apply_config', []): api.gclient.apply_config(c) if builder.get('set_component_rev'): # If this is a component build and the main revision is e.g. blink, # webrtc, or v8, the custom deps revision of this component must be # dynamically set to either: # (1) the revision of the builder, # (2) 'revision' from the waterfall, or # (3) 'HEAD' for forced builds with unspecified 'revision'. # TODO(machenbach): Use parent_got_cr_revision on testers with component # builds to match also the chromium revision from the builder. component_rev = api.properties.get( 'parent_got_revision', api.properties.get('revision') or 'HEAD') dep = builder.get('set_component_rev') api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev bot_update_step = api.bot_update.ensure_checkout() test_spec_file = builder.get('test_spec_file') test_spec = {} if test_spec_file: test_spec = api.chromium_tests.read_test_spec(api, test_spec_file) scripts_compile_targets = \ api.chromium_tests.get_compile_targets_for_scripts().json.output builder['tests'] = api.chromium_tests.generate_tests_from_test_spec( api, test_spec, builder, buildername, mastername, False, None, scripts_compile_targets, [api.chromium_tests.steps.generate_script], bot_update_step) api.path['checkout'] = api.path['slave_build'].join('src') api.chromium_android.clean_local_files() api.chromium_android.download_build(bucket=builder['bucket'], path=builder['path'](api)) api.chromium_android.common_tests_setup_steps(perf_setup=True) api.chromium_android.adb_install_apk('ChromePublic.apk') test_runner = api.chromium_tests.create_test_runner( api, builder.get('tests', [])) try: failures = [] if test_runner: try: test_runner() except api.step.StepFailure as f: failures.append(f) dynamic_perf_tests = api.chromium_tests.steps.DynamicPerfTests( builder['perf_id'], 'android', None, max_battery_temp=builder.get('max_battery_temp'), num_device_shards=builder['num_device_shards'], num_host_shards=builder.get('num_host_shards', 1), shard_index=builder.get('shard_index', 0)) dynamic_perf_tests.run(api, None) if failures: raise api.step.StepFailure('src-side perf tests failed %s' % failures) finally: api.chromium_android.common_tests_final_steps( logcat_gs_bucket='chromium-android') def _sanitize_nonalpha(text): return ''.join(c if c.isalnum() else '_' for c in text) def GenTests(api): for mastername, builders in BUILDERS.iteritems(): for buildername in builders: yield ( api.test('full_%s_%s' % (_sanitize_nonalpha(mastername), _sanitize_nonalpha(buildername))) + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername=mastername, buildername=buildername, parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release')) yield (api.test('provision_devices') + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername='chromium.perf', buildername='Android Nexus5 Perf (1)', parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release') + api.step_data('provision_devices', retcode=1)) yield (api.test('get_perf_test_list_old_data') + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername='chromium.perf', buildername='Android Nexus5 Perf (1)', parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release') + api.override_step_data( 'get perf test list', api.json.output(['perf_test.foo', 'page_cycler.foo']))) yield (api.test('src_side_script_fails') + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername='chromium.perf', buildername='Android Nexus5 Perf (1)', parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release') + api.override_step_data( 'read test spec', api.json.output({ "Android Nexus5 Perf (1)": { "scripts": [ { "name": "host_info", "script": "host_info.py" }]}})) + api.step_data('host_info', retcode=1)) yield (api.test('test_failure') + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername='chromium.perf', buildername='Android Nexus5 Perf (1)', parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release') + api.override_step_data( 'perf_test.foo', retcode=1)) yield (api.test('missing_device') + api.properties.generic( repo_name='src', repo_url=REPO_URL, mastername='chromium.perf', buildername='Android Nexus5 Perf (1)', parent_buildername='parent_buildername', parent_buildnumber='1729', parent_revision='deadbeef', revision='deadbeef', slavename='slavename', target='Release') + api.override_step_data( 'perf_test.foo', retcode=87))
package mat.server.spreadsheet; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.Data; import lombok.NoArgsConstructor; import java.util.List; @Data @JsonIgnoreProperties(ignoreUnknown = true) @NoArgsConstructor public class MatAttribute { private String dataTypeDescription; private String matAttributeName; private String fhirQicoreMapping; private String fhirResource; private String fhirType; private String fhirElement; private String helpWording; private List<String> dropDown; }
<reponame>JoanAzpeitia/lp_sg<filename>install/app_store/tk-framework-qtwidgets/v2.6.5/python/playback_label/playback_label.py # Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the Shotgun Pipeline Toolkit Source Code License. All rights # not expressly granted therein are reserved by Shotgun Software Inc. from sgtk.platform.qt import QtCore, QtGui from .ui import resources_rc class ShotgunPlaybackLabel(QtGui.QLabel): """ Subclassed ``QLabel`` that displays a playback icon centered above its content. While it is technically possible to use this label with text based content, we strongly recommend using it with a pixmap. Typically this is a Shotgun thumbnail. By populating an instance with shotgun version data via the :meth:`set_shotgun_data()` method, the label will look at the data and determine whether a playback icon should be displayed or not. In the case an icon is displayed, a playback_clicked signal may be emitted. :signal playback_clicked(dict): The playback icon was clicked. This signal passes the shotgun version data specified in via the :meth:`set_shotgun_data()` method back to the caller. """ # signal fires when the play button was clicked playback_clicked = QtCore.Signal(dict) def __init__(self, parent): """ Constructor :param parent: QT parent object """ QtGui.QLabel.__init__(self, parent) self._play_icon = QtGui.QPixmap(":/tk_framework_qtwidgets.version_label/play_icon.png") self._play_icon_inactive = QtGui.QPixmap(":/tk_framework_qtwidgets.version_label/play_icon_inactive.png") self._sg_data = None self._hover = False self._playable = False self._interactive = True def set_shotgun_data(self, sg_data): """ Sets shotgun data associated with this label. This data will be used to drive the logic which is used to determine if the label should exhibit the playback icon or not. If you for example are passing a Shotgun data dictionary reprensenting a version, make sure to include the various quicktime and frame fields. :param sg_data: Shotgun data dictionary """ self._sg_data = sg_data # based on the data, figure out if the icon should be active or not self._playable = False if sg_data and sg_data.get("type") == "Version": # versions are supported if sg_data.get("sg_uploaded_movie"): self._playable = True if self.playable and self.interactive: self.setCursor(QtCore.Qt.PointingHandCursor) else: self.unsetCursor() @property def playable(self): """ Returns True if the label is playable given its current Shotgun data. """ return self._playable def _get_interactive(self): """ Whether a playable label is interactive. If it is not, then the play icon will not be overlayed on the thumbnail image, and the playback signal will not be emitted on click event. """ return self._interactive def _set_interactive(self, state): self._interactive = bool(state) if self.playable and self._interactive: self.setCursor(QtCore.Qt.PointingHandCursor) else: self.unsetCursor() interactive = QtCore.Property( bool, _get_interactive, _set_interactive, ) def enterEvent(self, event): """ Fires when the mouse enters the widget space """ QtGui.QLabel.enterEvent(self, event) if self.playable and self.interactive: self._hover = True self.repaint() def leaveEvent(self, event): """ Fires when the mouse leaves the widget space """ QtGui.QLabel.leaveEvent(self, event) if self.playable and self.interactive: self._hover = False self.repaint() def mousePressEvent(self, event): """ Fires when the mouse is pressed """ QtGui.QLabel.mousePressEvent(self, event) if self.playable and self._hover and self.interactive: self.playback_clicked.emit(self._sg_data) def paintEvent(self, event): """ Render the UI. """ # first render the label QtGui.QLabel.paintEvent(self, event) if self.playable and self.interactive: # now render a pixmap on top painter = QtGui.QPainter() painter.begin(self) try: # set up semi transparent backdrop painter.setRenderHint(QtGui.QPainter.Antialiasing) # draw image painter.translate((painter.device().width() / 2) - (self._play_icon.width()/2), (painter.device().height() / 2) - (self._play_icon.height()/2) ) if self._hover: painter.drawPixmap( QtCore.QPoint(0, 0), self._play_icon) else: painter.drawPixmap( QtCore.QPoint(0, 0), self._play_icon_inactive) finally: painter.end()
Inclusion of a program of instruction in care of the disabled in a dental school curriculum. Lack of practitioner training is considered a major reason for dental neglect of disabled persons. The feasibility of instruction in the care of the disabled for dental and dental hygiene students at the undergraduate level was demonstrated in a prototype program encompassing a continuum of didactic courses, clinical experiences in extramural and intramural settings, inservice training and continuing education, interdisciplinary activities, and evaluative research. Successful implementation of such a program required developing and using appropriate support systems, such as instructional materials, social services, public relations, and monitoring of care delivery. A format combining specific courses with inclusion of disability subject matter in existing courses appeared to be advantageous in intergrating the program into the dental curriculum. Evaluation data indicated the value of undergraduate training in improving access to dental care for the disabled patient.
MANCHESTER UNITED and Liverpool target Dani Alves is edging closer towards a move to Paris St-Germain. The Barcelona defender, 31, is out of contract next summer and has yet to be offered a new deal by the Spanish giants. United and Liverpool are both understood to be interested in Alves, who twice won the Champions League with Barca. But the Daily Star Sunday understands PSG have made the best offer.
Code Switching and Viewers Attitude Toward Interviews with President Susilo Bambang Yudhoyono (Sby) (An Analysis of Interview Transcript from Www.Presidenri.Go.Id) This study explores some important issues, namely the occurrences of code switching types, function, and the language attitudes of English and Indonesian students department toward the use of code switch in the interview with President Susilo Bambang Yudhoyono (SBY). The data were collected through distributing questionnaires to respondents of the English students (15 persons) and the Indonesian students (15 persons) of UPI and compiling the documents of interview transcripts taken from www.presidenri.go.id. Some theories were used to analyse the data, namely Poplack was used to identify types of code switching, Koziol was applied to investigate functions of Code Switching, while Lambert was implemented to find out the attitude of the viewers toward the use of Code Switch by President SBY. Based on the results of analysis, it shows that there were three types of code switching found in President SBYs interviews e.g. Intrasentential Switching, Intersentential Switching, and T ag Switching. In term of functions of code switching, nine functions were identified namely Reiteration, Personalization, Untranslatability, Substitution, Mitigating Message, Interjection, Emphasis, Clarification, and Quotation. Moreover, the findings from the questionnaires reveal that most respondents both from English and Indonesian Department perceived negatively to the use of Code Switching done by President SBY in the interview (17 persons). Some respondents who gave the negative attitude stated that the use of Code Switching did not provide the proper use of Indonesian according to EYD ( ejaan yang disempurnakan ), but it was considered to ruin Indonesian language structure. In contrast, the rest of respondents (13 persons) gave the positive attitude toward Code Switching since they claimed that Code Switching may increase the global vocabulary. Keywords : Code Switching, Interview with President SBY, Types of Code Switching, Function of Code Switching, Attitudes
Neuropeptides go the distance for circadian synchrony Synchronous activity is ubiquitous in natural systems and has fascinated the likes of engineers, mathematicians, and biologists. Although coordinated oscillations have been described among atoms, molecules, cells, and organisms on timescales from fractions of a second to years, our understanding of the mechanisms underlying synchrony is often limited. A study in PNAS provides insights into how diffusible signals organize the daily oscillations among cells in the brain. In this system, three neuropeptides released from distinct groups of neurons can coordinate cycles of gene expression across the larger population of cells (Fig. 1A).
Short Terms Safety of Chinese Origin Covid-19 Vaccine in Cardiac Patients Objective: To find out short terms safety of Chinese origin Covid-19 vaccines in cardiac patients. To identify frequency of major and minor cardiovascular events in Covid-19 vaccinated cardiac patients. Methodology: It was a cross sectional study conducted in Qazi Hussain Ahmad Medical Complex Nowshera and Kuwait Teaching Hospital Peshawar, Pakistan from February 2021 to April 2021 on a sample of 325 cardiac patients irrespective of their gender. Cardiac patients who received 2 doses of sinopharm vaccine were included in our study. The clinical characteristics of patients included age, gender, comorbids like diabetes and hypertension and those patient s who have undergone any cardiac procedures i-e post CABG and post PCI. The data was analyzed with SPSS version Results: Total 325 known cardiac patients who received 2 doses of sinopharm vaccine were enrolled in the study, among them 198 were male and 127 were female. Participants age range was 56.48±5.9 years and among them mean age of male was 56.59±6.55 years and of female was 57.64±4.27 years. Among the participants 76(23.3%) were hypertensive out of which 44(22.2%) were male. Total number of diabetics were 98(30.15%) among which 59(29.79%) were male. Post CABG patients were 56(17.23%) in number, and among these 34(17.17%) were male. Among them 176(54.15%) were post PCI and among these 102(51.51%) were male. Out of total 325 participants the frequency of major adverse cardiovascular events was 4(1.2%) which include major cardiovascular events, death of any cause, urgent repeat revascularization, MI (not revascularized) an ischemic stroke were 1.2%, 0.91%, 0.31%, 0.92%, 0% respectively. Frequency of minor adverse cardiovascular events in cardiac patients after sinopharm vaccination was 4(1.2%) out of total 325 participants. which include minor cardiovascular events(9.85%), atrial fibrillations(0.92%), complete heart block(0%), increase in angina functional class(2.46%), increase in NYHA functional class(2.53%), and palpitations(3.69%). Conclusion: Chinese origin covid-19 vaccine (sinophorm) is safe in cardiac patients and has minor side effects and rare major side effects in cardiac patients. Keywords: Sinopharm vaccine, Cardiac patients, Corona virus
GERIATRIC CONTINUING EDUCATION IN THE WORKPLACE: UTILIZING INTERACTIVE TELEVISION (ITV) TECHNOLOGY IN THEORY AND IN PRACTICE Interactive television (ITV) technology provides an excellent resource for offering continuing education programs for geriatrics service providers and faculty. During 2000-2002, the Ohio Valley Appalachia Regional Geriatric Education Center (OVAR/GEC) at the University of Kentucky provided two series of 40-hour geriatrics continuing education programs for professionals working in community mental health/mental retardation centers across Kentucky. This article describes the process for developing and conducting successful ITV distance learning courses and identifies the strengths and challenges of the interactive television medium, utilizing Moore's Theory of Transactional Distance as a conceptual framework in the analysis of this case example. Recommendations are offered for replication and future utilization involving ITV technology for delivering continuing education in the workplace.
package income import ( "context" "fmt" model "go-common/app/admin/main/growup/model/income" "go-common/library/database/sql" "go-common/library/log" ) const ( // count _upAccountCountSQL = "SELECT count(*) FROM up_account WHERE %s is_deleted = ?" // select _upAccountSQL = "SELECT mid,total_income,total_unwithdraw_income,total_withdraw_income,withdraw_date_version,last_withdraw_time,mtime FROM up_account WHERE %s is_deleted = ? LIMIT ?,?" _upAccountByMIDSQL = "SELECT mid,total_income,total_unwithdraw_income,withdraw_date_version,version FROM up_account WHERE mid = ? AND is_deleted = 0" // update _breachUpAccountSQL = "UPDATE up_account SET total_income = ?, total_unwithdraw_income = ?, version = ? WHERE mid = ? AND version = ? AND is_deleted = 0" ) // UpAccountCount get up_account count func (d *Dao) UpAccountCount(c context.Context, query string, isDeleted int) (total int64, err error) { err = d.db.QueryRow(c, fmt.Sprintf(_upAccountCountSQL, query), isDeleted).Scan(&total) if err == sql.ErrNoRows { err = nil } return } // ListUpAccount list up account bu query func (d *Dao) ListUpAccount(c context.Context, query string, isDeleted, from, limit int) (ups []*model.UpAccount, err error) { ups = make([]*model.UpAccount, 0) rows, err := d.db.Query(c, fmt.Sprintf(_upAccountSQL, query), isDeleted, from, limit) if err != nil { log.Error("ListUpAccount d.db.Query error(%v)", err) return } defer rows.Close() for rows.Next() { up := &model.UpAccount{} err = rows.Scan(&up.MID, &up.TotalIncome, &up.TotalUnwithdrawIncome, &up.TotalWithdrawIncome, &up.WithdrawDateVersion, &up.LastWithdrawTime, &up.MTime) if err != nil { log.Error("ListUpAccount rows scan error(%v)", err) return } ups = append(ups, up) } err = rows.Err() return } // GetUpAccount get up_account by mid func (d *Dao) GetUpAccount(c context.Context, mid int64) (up *model.UpAccount, err error) { up = &model.UpAccount{} err = d.db.QueryRow(c, _upAccountByMIDSQL, mid).Scan(&up.MID, &up.TotalIncome, &up.TotalUnwithdrawIncome, &up.WithdrawDateVersion, &up.Version) return } // TxBreachUpAccount breach up_account func (d *Dao) TxBreachUpAccount(tx *sql.Tx, total, unwithdraw, mid, newVersion, oldVersion int64) (rows int64, err error) { res, err := tx.Exec(_breachUpAccountSQL, total, unwithdraw, newVersion, mid, oldVersion) if err != nil { return } return res.RowsAffected() }
<reponame>antrad/If_Quake_2_Was_2D #include "..\..\Engine\Engine\Advanced2D.h" using namespace Advanced2D; #include "Clipboard.h" namespace Advanced2D { Clipboard::Clipboard() { this->grid = false; this->grid_size = 32; this->working_layer = 0; this->mouse_pressed = false; }//Clipboard() void Clipboard::Clear() { std::vector<Sprite*>::iterator iter = this->clipboard.begin(); while (iter != this->clipboard.end()) { delete (*iter); iter = this->clipboard.erase(iter); } this->clipboard.clear(); this->clipboard_relposx.clear(); this->clipboard_relposy.clear(); //ovo ne smi ovdje !!! /*this->clipboard_box_x1.clear(); this->clipboard_box_y1.clear(); this->clipboard_box_x2.clear(); this->clipboard_box_y2.clear();*/ }//Clear() ///////////////////// // SELECTION BOX // ///////////////////// void Clipboard::SelectionBox_position(int cursor_x, int cursor_y) { if(this->mouse_pressed) { this->clipboard_box_x2.clear(); this->clipboard_box_y2.clear();for(unsigned int i=0;i<g_engine->game_sprites.size();i++) { this->clipboard_box_x2.push_back(cursor_x - g_engine->getLayerOffsetX(i)); this->clipboard_box_y2.push_back(cursor_y - g_engine->getLayerOffsetY(i)); //g_engine->audio->Play("jump1"); } } else { this->clipboard_box_x1.clear(); this->clipboard_box_y1.clear(); this->clipboard_box_x2.clear(); this->clipboard_box_y2.clear(); for(unsigned int i=0;i<g_engine->game_sprites.size();i++) { this->clipboard_box_x1.push_back(cursor_x - g_engine->getLayerOffsetX(i)); this->clipboard_box_y1.push_back(cursor_y - g_engine->getLayerOffsetY(i)); this->clipboard_box_x2.push_back(cursor_x - g_engine->getLayerOffsetX(i)); this->clipboard_box_y2.push_back(cursor_y - g_engine->getLayerOffsetY(i)); } this->mouse_pressed = true; } }//SelectionBox_position() bool Clipboard::SelectionBox_inside(Sprite *a, int x1, int y1, int x2, int y2) { double x = a->getX() + g_engine->getLayerOffsetX(a->getLayer())*a->getOffsetMX(); double y = a->getY() + g_engine->getLayerOffsetY(a->getLayer())*a->getOffsetMY(); double w = a->w(); double h = a->h(); if ((g_engine->coll_manager->dot_dotrect( x,y, x1+g_engine->getLayerOffsetX(this->working_layer),y1+g_engine->getLayerOffsetY(this->working_layer), x2-x1,y2-y1)) && (g_engine->coll_manager->dot_dotrect( x+w,y, x1+g_engine->getLayerOffsetX(this->working_layer),y1+g_engine->getLayerOffsetY(this->working_layer), x2-x1,y2-y1)) && (g_engine->coll_manager->dot_dotrect( x+w,y+h, x1+g_engine->getLayerOffsetX(this->working_layer),y1+g_engine->getLayerOffsetY(this->working_layer), x2-x1,y2-y1)) && (g_engine->coll_manager->dot_dotrect( x,y+h, x1+g_engine->getLayerOffsetX(this->working_layer),y1+g_engine->getLayerOffsetY(this->working_layer), x2-x1,y2-y1))) return true; return false; }//SelectionBox_inside() void Clipboard::SelectionBox_draw() { //draw boxes of sprites inside selection box if(this->clipboard_box_x1.empty()) return; if(this->clipboard_box_y1.empty()) return; if(this->clipboard_box_x2.empty()) return; if(this->clipboard_box_y2.empty()) return; std::list<Sprite*>::iterator iter = g_engine->game_sprites[this->working_layer]->sprites.begin(); while (iter != g_engine->game_sprites[this->working_layer]->sprites.end()) { Sprite *a = *iter; if(this->SelectionBox_inside(a,this->getX1(this->working_layer),this->getY1(this->working_layer),this->getX2(this->working_layer),this->getY2(this->working_layer))) g_engine->ar_graphics->draw_box( a->getX(),a->getY(), a->w(),a->h(), g_engine->getLayerOffsetX(a->getLayer()), g_engine->getLayerOffsetY(a->getLayer()), 0xFFFF8800); iter++; } //draw texture box g_engine->ar_graphics->draw_texture( g_engine->gui->default_t, this->getX1(this->working_layer)+g_engine->getLayerOffsetX(this->working_layer), this->getY1(this->working_layer)+g_engine->getLayerOffsetY(this->working_layer), this->getX2(this->working_layer)-this->getX1(this->working_layer), this->getY2(this->working_layer)-this->getY1(this->working_layer), 0,0, this->getX2(this->working_layer)-this->getX1(this->working_layer), this->getY2(this->working_layer)-this->getY1(this->working_layer), 1,1, 0x33FFFF00); //draw line box g_engine->ar_graphics->draw_box( this->getX1(this->working_layer),this->getY1(this->working_layer), this->getX2(this->working_layer)-this->getX1(this->working_layer), this->getY2(this->working_layer)-this->getY1(this->working_layer), g_engine->getLayerOffsetX(this->working_layer),g_engine->getLayerOffsetY(this->working_layer), 0x66FFFF00); }//SelectionBox_draw() //////////// // COPY // //////////// void Clipboard::Copy_sprite(Sprite *a, std::string command) { this->Clear(); //skeleton se ne kopira, ali nosilac da Sprite *clone = NULL; clone = a->Copy(); if (clone==NULL) { g_engine->gui->messagebox_add("Error","Copy failed",10); g_engine->gui->setSelectedSprite(NULL); return; } else { this->clipboard.push_back(clone); this->clipboard_relposx.push_back(0); this->clipboard_relposy.push_back(0); g_engine->gui->setSelectedSprite(NULL); if(command=="cut") a->setAlive(false); } //g_engine->audio->Play("SOLDETH1"); } void Clipboard::Copy(std::string command, int layer, bool clear) { //no selection box if(this->clipboard_box_x1.empty()) return; if(clear) this->Clear(); std::list<Sprite*>::iterator iter = g_engine->game_sprites[layer]->sprites.begin(); while (iter != g_engine->game_sprites[layer]->sprites.end()) { Sprite *a = *iter; if (a->getClass()!=-999 || a->getType()!=-999 || a->getState()!=-999) { if (this->SelectionBox_inside(a,this->getX1(layer),this->getY1(layer),this->getX2(layer),this->getY2(layer))) { Sprite *temp_sprite = new Sprite(); temp_sprite = a->Copy(); this->clipboard.push_back(temp_sprite); int rel_x = a->getX() - this->clipboard_box_x1[layer]; this->clipboard_relposx.push_back(rel_x); int rel_y = a->getY() - this->clipboard_box_y1[layer]; this->clipboard_relposy.push_back(rel_y); if(command=="cut") { a->setAlive(false); for(int i=0;i<a->skeleton.size();i++) a->skeleton[i]->setAlive(false); for(int i=0;i<a->attachments.size();i++) a->attachments[i]->setAlive(false); } } } iter++; } if(clear) //moga bi kopirat vise puta isto, ne brise { this->clipboard_box_x1.clear(); this->clipboard_box_y1.clear(); this->clipboard_box_x2.clear(); this->clipboard_box_y2.clear(); } } void Clipboard::CopyAll(std::string command) { this->Clear(); for(unsigned int i=0;i<g_engine->game_sprites.size();i++) { this->Copy(command,i,false); } } void Clipboard::Paste() { int i=0; std::vector<Sprite*>::iterator iter=this->clipboard.begin(); while (iter!=this->clipboard.end()) { Sprite *a = *iter; Sprite *b = new Sprite(); b=a->Copy(); if (!grid) { b->setPosition( g_engine->gui->cursor->getX()-g_engine->getLayerOffsetX(b->getLayer())+this->clipboard_relposx[i], g_engine->gui->cursor->getY()-g_engine->getLayerOffsetY(b->getLayer())+this->clipboard_relposy[i]); } else { b->setPosition( this->getGridX(g_engine->gui->cursor->getX()+this->clipboard_relposx[i],b->getLayer()), this->getGridY(g_engine->gui->cursor->getY()+this->clipboard_relposy[i],b->getLayer()) ); } g_engine->addSprite(b,b->getLayer()); iter++; i++; } } void Clipboard::Delete(int layer) { std::list<Sprite*>::iterator iter = g_engine->game_sprites[layer]->sprites.begin(); while (iter!=g_engine->game_sprites[layer]->sprites.end()) { Sprite *a = *iter; if (a->skeleton.empty() && a->attachments.empty()) { if (this->SelectionBox_inside(a,this->getX1(layer),this->getY1(layer),this->getX2(layer),this->getY2(layer))) a->setAlive(false); } iter++; } //srusi se /*this->clipboard_box_x1.clear(); this->clipboard_box_y1.clear(); this->clipboard_box_x2.clear(); this->clipboard_box_y2.clear();*/ } void Clipboard::DeleteAll() { for(unsigned int i=0;i<g_engine->game_sprites.size();i++) this->Delete(i); } void Clipboard::Draw() { this->Grid_draw(); if(g_engine->p_input->GetKeyState(DIK_LCONTROL) & 0x80) { //draw transparent entities in clipboard while paste if(!this->clipboard.empty() && (g_engine->p_input->GetKeyState(DIK_V) & 0x80)) { int i=0; std::vector<Sprite*>::iterator iter = this->clipboard.begin(); while (iter!=this->clipboard.end()) { Sprite *a = *iter; if(!grid) { //stavio default_t dok ne napisem za teksture g_engine->ar_graphics->draw_texture( g_engine->gui->default_t, g_engine->gui->cursor->getX()+this->clipboard_relposx[i], g_engine->gui->cursor->getY()+this->clipboard_relposy[i], a->w(),a->h(), 0, 0, a->w(),a->h(), 1,1, 0x88FFFFFF); } else { g_engine->ar_graphics->draw_texture( g_engine->gui->default_t, this->getGridX(g_engine->gui->cursor->getX()+this->clipboard_relposx[i], a->getLayer())+g_engine->getLayerOffsetX(a->getLayer()), this->getGridY(g_engine->gui->cursor->getY()+this->clipboard_relposy[i], a->getLayer())+g_engine->getLayerOffsetY(a->getLayer()), a->w(),a->h(), 0, 0, a->w(),a->h(), 1,1, 0x88FFFFFF); } iter++; i++; } } else this->SelectionBox_draw();//just draw the selection box } if (g_engine->gui->getSelectedSprite()!=NULL) this->Draw_parent_child(g_engine->gui->getSelectedSprite()); } void Clipboard::Grid_draw() { //start screen g_engine->ar_graphics->draw_box( 0,0,g_engine->getScreenWidth(),g_engine->getScreenHeight(), g_engine->offset_X,g_engine->offset_Y, 0xFFFF0000); if (this->grid) { //vertical for(int i=0;i<g_engine->getScreenWidth()/this->grid_size+1;i++) { g_engine->ar_graphics->draw_line( (((int)-g_engine->getLayerOffsetX(this->working_layer)/this->grid_size)*this->grid_size)+i*this->grid_size, -g_engine->getLayerOffsetY(this->working_layer), (((int)-g_engine->getLayerOffsetX(this->working_layer)/this->grid_size)*this->grid_size)+i*this->grid_size, -g_engine->getLayerOffsetY(this->working_layer)+g_engine->getScreenHeight(), g_engine->getLayerOffsetX(this->working_layer), g_engine->getLayerOffsetY(this->working_layer), 0x44FF0000 ); } //horizontal for(int i=0;i<g_engine->getScreenHeight()/this->grid_size+1;i++) { g_engine->ar_graphics->draw_line( -g_engine->getLayerOffsetX(this->working_layer), (((int)-g_engine->getLayerOffsetY(this->working_layer)/this->grid_size)*this->grid_size)+i*this->grid_size, -g_engine->getLayerOffsetX(this->working_layer)+g_engine->getScreenWidth(), (((int)-g_engine->getLayerOffsetY(this->working_layer)/this->grid_size)*this->grid_size)+i*this->grid_size, g_engine->getLayerOffsetX(this->working_layer), g_engine->getLayerOffsetY(this->working_layer), 0x44FF0000 ); } D3DCOLOR color = 0xFFFFFFFF; //small grid-box if (this->dotcollision( this->getGridX(g_engine->gui->cursor->getX(),this->working_layer)+this->grid_size/2, this->getGridY(g_engine->gui->cursor->getY(),this->working_layer)+this->grid_size/2, this->working_layer)) color=0xFF00FF00; g_engine->ar_graphics->draw_box( this->getGridX(g_engine->gui->cursor->getX(),this->working_layer), this->getGridY(g_engine->gui->cursor->getY(),this->working_layer), this->grid_size,this->grid_size, g_engine->getLayerOffsetX(this->working_layer), g_engine->getLayerOffsetY(this->working_layer), color); } } void Clipboard::Draw_parent_child(Sprite *a) { std::stringstream stream; //draw selected sprites box g_engine->ar_graphics->draw_xbox( a->getX(),a->getY(), a->w(),a->h(), g_engine->getLayerOffsetX(a->getLayer()),g_engine->getLayerOffsetY(a->getLayer()), 0xFFFF0000); if (a->parent!=NULL) { std::string temp1 = "child: " + a->getName() + " " + g_engine->inttostring(a->parent_att_dot); g_engine->e_font->write_text(temp1.c_str(), a->getX()+g_engine->getLayerOffsetX(a->getLayer()), a->getY()+g_engine->getLayerOffsetY(a->getLayer())-20, g_engine->getScreenWidth(),g_engine->getScreenHeight(), 'L',0xFF0088FF);//i am a child std::string temp2 = "parent: " + a->parent->getName() + " " + g_engine->inttostring(a->parent->parent_att_dot); g_engine->e_font->write_text( temp2.c_str(), a->parent->getX()+g_engine->getLayerOffsetX(a->getLayer()), a->parent->getY()+g_engine->getLayerOffsetY(a->getLayer())-20, g_engine->getScreenWidth(),g_engine->getScreenHeight(), 'L',0xFF0088FF); g_engine->ar_graphics->draw_xbox( a->parent->getX(),a->parent->getY(), a->parent->w(),a->parent->h(), g_engine->getLayerOffsetX(a->getLayer()),g_engine->getLayerOffsetY(a->getLayer()), 0xFF0088FF);//parent return; } if (a->child!=NULL) { stream.str(""); stream<<"parent:"; g_engine->e_font->write_text(stream.str().c_str(), a->getX()+g_engine->getLayerOffsetX(a->getLayer()), a->getY()+g_engine->getLayerOffsetY(a->getLayer())-20, g_engine->getScreenWidth(),g_engine->getScreenHeight(), 'L',0xFF0088FF);//i am a parent stream.str(""); stream<<"child:"; g_engine->e_font->write_text( stream.str().c_str(), a->child->getX()+g_engine->getLayerOffsetX(a->getLayer()), a->child->getY()+g_engine->getLayerOffsetY(a->getLayer())-20, g_engine->getScreenWidth(),g_engine->getScreenHeight(), 'L',0xFF0088FF); g_engine->ar_graphics->draw_xbox( a->child->getX(),a->child->getY(), a->child->w(),a->child->h(), g_engine->getLayerOffsetX(a->getLayer()), g_engine->getLayerOffsetY(a->getLayer()), 0xFF0088FF);//child return; } } int Clipboard::getGridX(int x, int layer) { int pos_x = x - g_engine->getLayerOffsetX(layer); int add_neg = 0; if( pos_x < 0) add_neg = 1;//if (x<0) go one more block left return ((int)(pos_x)/this->grid_size)*this->grid_size - add_neg*this->grid_size; } int Clipboard::getGridY(int y, int layer) { int pos_y = y - g_engine->getLayerOffsetY(layer); int add_neg = 0; if( pos_y < 0) add_neg = 1;//if (x<0) go one more block up return ((int)(pos_y)/this->grid_size)*this->grid_size - add_neg*this->grid_size; } int Clipboard::getFrame(int x,int y,int w, int h, int column_num,int frame_offsetx,int frame_offsety) { int cx = g_engine->gui->cursor->getX(); int cy = g_engine->gui->cursor->getY(); int column = (cx-x)/(w+frame_offsetx); int row = (cy-y)/(h+frame_offsety); int frame = column_num*row+column; return frame; } int Clipboard::getFramePositionX(int x,int w,int frame_offsetx) { int cx = g_engine->gui->cursor->getX(); int column = (cx-x)/(w+frame_offsetx); return x+column*(w+frame_offsetx); } int Clipboard::getFramePositionY(int y,int h,int frame_offsety) { int cy = g_engine->gui->cursor->getY(); int row = (cy-y)/(h+frame_offsety); return y+row*(h+frame_offsety); } bool Clipboard::dotcollision(double x, double y, int entity_list) { std::list<Sprite*>::iterator iter = g_engine->game_sprites[entity_list]->sprites.begin(); while (iter != g_engine->game_sprites[entity_list]->sprites.end()) { Sprite *a = *iter; if (a->getAlive()) { if ( g_engine->coll_manager->DotInsideSprite(x,y,a) ) return true; } ++iter; } return false; } void Clipboard::movesprite(Sprite *a) { double oldx=a->getX(); double oldy=a->getY(); if (!this->grid) { a->setPosition( g_engine->gui->cursor->getX()-g_engine->getLayerOffsetX(a->getLayer())-g_engine->gui->cursor->rel_posx, g_engine->gui->cursor->getY()-g_engine->getLayerOffsetY(a->getLayer())-g_engine->gui->cursor->rel_posy ); } else { a->setPosition( this->getGridX(g_engine->gui->cursor->getX()-g_engine->gui->cursor->rel_posx,a->getLayer()), this->getGridY(g_engine->gui->cursor->getY()-g_engine->gui->cursor->rel_posy,a->getLayer())); } double movex=a->getX()-oldx; double movey=a->getY()-oldy; for (int i=0;i<a->skeleton.size();i++) a->skeleton[i]->setPosition( a->skeleton[i]->getX()+movex, a->skeleton[i]->getY()+movey ); for (int i=0;i<a->attachments.size();i++) a->attachments[i]->setPosition( a->attachments[i]->getX()+movex, a->attachments[i]->getY()+movey ); } void Clipboard::keyPress(int key){} void Clipboard::keyRelease(int key){} void Clipboard::mousePress(int button){} void Clipboard::mouseRelease(int button){} void Clipboard::mouseWheel(int wheel){} void Clipboard::buttonPress(Button *button, int mousebutton){} void Clipboard::buttonRelease(Button *button, int mousebutton){} }//namespace
<reponame>siloutil/openmpi<filename>ompi/mca/io/romio314/romio/mpi-io/fortran/fsyncf.c /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ /* * * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. */ #include "adio.h" #include "mpio.h" #if defined(MPIO_BUILD_PROFILING) || defined(HAVE_WEAK_SYMBOLS) #if defined(HAVE_WEAK_SYMBOLS) #if defined(HAVE_PRAGMA_WEAK) #if defined(FORTRANCAPS) extern FORTRAN_API void FORT_CALL MPI_FILE_SYNC( MPI_Fint *, MPI_Fint * ); #pragma weak MPI_FILE_SYNC = PMPI_FILE_SYNC #elif defined(FORTRANDOUBLEUNDERSCORE) extern FORTRAN_API void FORT_CALL mpi_file_sync__( MPI_Fint *, MPI_Fint * ); #pragma weak mpi_file_sync__ = pmpi_file_sync__ #elif !defined(FORTRANUNDERSCORE) extern FORTRAN_API void FORT_CALL mpi_file_sync( MPI_Fint *, MPI_Fint * ); #pragma weak mpi_file_sync = pmpi_file_sync #else extern FORTRAN_API void FORT_CALL mpi_file_sync_( MPI_Fint *, MPI_Fint * ); #pragma weak mpi_file_sync_ = pmpi_file_sync_ #endif #elif defined(HAVE_PRAGMA_HP_SEC_DEF) #if defined(FORTRANCAPS) #pragma _HP_SECONDARY_DEF PMPI_FILE_SYNC MPI_FILE_SYNC #elif defined(FORTRANDOUBLEUNDERSCORE) #pragma _HP_SECONDARY_DEF pmpi_file_sync__ mpi_file_sync__ #elif !defined(FORTRANUNDERSCORE) #pragma _HP_SECONDARY_DEF pmpi_file_sync mpi_file_sync #else #pragma _HP_SECONDARY_DEF pmpi_file_sync_ mpi_file_sync_ #endif #elif defined(HAVE_PRAGMA_CRI_DUP) #if defined(FORTRANCAPS) #pragma _CRI duplicate MPI_FILE_SYNC as PMPI_FILE_SYNC #elif defined(FORTRANDOUBLEUNDERSCORE) #pragma _CRI duplicate mpi_file_sync__ as pmpi_file_sync__ #elif !defined(FORTRANUNDERSCORE) #pragma _CRI duplicate mpi_file_sync as pmpi_file_sync #else #pragma _CRI duplicate mpi_file_sync_ as pmpi_file_sync_ #endif /* end of weak pragmas */ #endif /* Include mapping from MPI->PMPI */ #include "mpioprof.h" #endif #ifdef FORTRANCAPS #define mpi_file_sync_ PMPI_FILE_SYNC #elif defined(FORTRANDOUBLEUNDERSCORE) #define mpi_file_sync_ pmpi_file_sync__ #elif !defined(FORTRANUNDERSCORE) #if defined(HPUX) || defined(SPPUX) #pragma _HP_SECONDARY_DEF pmpi_file_sync pmpi_file_sync_ #endif #define mpi_file_sync_ pmpi_file_sync #else #if defined(HPUX) || defined(SPPUX) #pragma _HP_SECONDARY_DEF pmpi_file_sync_ pmpi_file_sync #endif #define mpi_file_sync_ pmpi_file_sync_ #endif #else #ifdef FORTRANCAPS #define mpi_file_sync_ MPI_FILE_SYNC #elif defined(FORTRANDOUBLEUNDERSCORE) #define mpi_file_sync_ mpi_file_sync__ #elif !defined(FORTRANUNDERSCORE) #if defined(HPUX) || defined(SPPUX) #pragma _HP_SECONDARY_DEF mpi_file_sync mpi_file_sync_ #endif #define mpi_file_sync_ mpi_file_sync #else #if defined(HPUX) || defined(SPPUX) #pragma _HP_SECONDARY_DEF mpi_file_sync_ mpi_file_sync #endif #endif #endif /* Prototype to keep compiler happy */ FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ); FORTRAN_API void FORT_CALL mpi_file_sync_(MPI_Fint *fh, MPI_Fint *ierr ) { MPI_File fh_c; fh_c = MPI_File_f2c(*fh); *ierr = MPI_File_sync(fh_c); }
Highly efficient allyl cross-coupling reactions of allylindiums with organic electrophiles. This paper describes highly efficient allyl cross-coupling reactions of allylindiums with organic electrophiles such as aryl and vinyl triflates, vinyl halides, dibromoolefin, and alkynyl iodide. The reactions were carried out using 4 mol % Pd(PPh3)4 in the presence of 3 equiv of LiCl in DMF at 100 degrees C under a nitrogen atmosphere. Allylindium, generated from the reaction of 1 equiv of indium with 1.5 equiv of allyl halide, gave the best result as a coupling partner. The present method is mild and simple to apply, and it produces a diverse range of allylic compounds in good to excellent yields.
<filename>src/main/java/com/hanwha/uboard/service/Partner.java /* * Copyright 2008-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.hanwha.uboard.service; public class Partner { private String userName; private String userCode; private String userEmail; private String userTel; public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserCode() { return userCode; } public void setUserCode(String userCode) { this.userCode = userCode; } public String getUserEmail() { return userEmail; } public void setUserEmail(String userEmail) { this.userEmail = userEmail; } public String getUserTel() { return userTel; } public void setUserTel(String userTel) { this.userTel = userTel; } }
Theoretical analysis of cascaded optical parametric oscillations generating tunable terahertz waves Abstract. Cascaded optical parametric oscillations generating a tunable terahertz (THz) wave are analyzed to solve the problem of low quantum conversion efficiency in a THz-wave parametric oscillator. The forward and backward optical parametric processes are theoretically analyzed based on periodically poled lithium niobate (PPLN) as an example. Tuning characteristics of the THz wave that relate to the parameters of the pump wavelength, the grating period of PPLN, and the working temperature are numerically simulated. The gain and absorption characteristics of the generating THz wave are deduced in the situation of quasiphase-matching configuration at different working temperatures.
// Numeric Conversion / Manipulation Functions {C++} // Copyright (c) 2000 by <NAME>. All rights reserved. #ifndef _MODULE_NUMEXT #define _MODULE_NUMEXT #include "bldenv.h" #include "numex.h" #ifdef __cplusplus template <typename T> inline int CenterInRange(T size, T lo, T hi) // Return the lower position of size centered in the range lo to hi. // Eg: CenterInRange(1, 4, 2) = 2 // Eg: CenterInRange(1, 5, 2) = 2 // Eg: CenterInRange(1, 6, 2) = 3 { return CenterIn(lo, hi, size); } template <typename T> inline T ForceInRange(T value, T lo, T hi) // Returns a value forced into the range lo to hi. A value // outside the range will be assigned the nearest limit. // Eg: ForceInRange(800, -100, 900) = 800 {no change} // Eg: ForceInRange(-900, 100, 900) = 100 {lo limit} // Eg: ForceInRange(900, -100, 800) = 800 {hi limit} { value = MIN(value, hi); value = MAX(value, lo); return value; } template <typename T> inline T PercentAdjust(T value, int aPercentage) // Returns value adjusted by an integer percentage amount. { #ifdef _WINDOWS return MulDiv(value, aPercentage, 100); #else return (long int) (value * aPercentage) / 100; #endif } template <typename T> class Circular // A circular indexing class that automatically increments and decrements a // value within predefined circular limits. { T m_val, m_min, m_max; int m_delta; public: Circular(T iniVal, T minVal = 0, T maxVal = 0, int delta = 1) : m_val(iniVal), m_min(minVal), m_max(maxVal), m_delta(delta) { } void SetValue(T value) { m_val = value; } // hack because operator=(T value) won't work? // derived classes can override these for dynamic ranging virtual T MinVal() { return m_min; } virtual T MaxVal() { return m_max; } virtual T Delta() { return m_delta; } // implicit casts operator T() const { return m_val; } operator T&() { return m_val; } Circular& operator=(const Circular& op) { m_val = op.m_val; return *this; } Circular& operator=(T value) { m_val = value; return *this; } // can not invoke this with "object = 123;"? T operator++() { m_val = CIRCULARINC(m_val, MinVal(), MaxVal(), Delta()); return m_val; } T operator--() { m_val = CIRCULARDEC(m_val, MinVal(), MaxVal(), Delta()); return m_val; } }; template <typename T> inline T CircularInc(T val, T minVal, T maxVal, int delta = 1) // Increments a value by delta in a circular sequence. { return CIRCULARINC(val, minVal, maxVal, delta); } template <typename T> inline T CircularDec(T val, T minVal, T maxVal, int delta = 1) // Decrements a value by delta in a circular sequence. { return CIRCULARDEC(val, minVal, maxVal, delta); } template <typename T> inline T CircularDelta(T val, T minVal, T maxVal, int delta = 1) // Adjusts a value by delta in a circular sequence. { return CircularInc(val, minVal, maxVal, delta); } // Legacy template <typename T> inline int CenterIn(T lo, T hi, T size) // Return the lower position of size centered in the range lo to hi. // Eg: CenterIn(1, 4, 2) = 2 // Eg: CenterIn(1, 5, 2) = 2 // Eg: CenterIn(1, 6, 2) = 3 { return lo + ((hi - lo + 1 - size) / 2); } #else __inline int CenterInRange(int size, int lo, int hi) { return CENTERIN(size, lo, hi); } #endif /* __cplusplus */ #endif
<reponame>BradleyWood/Triton-Lang package org.bw.tl.compiler.resolve; import org.bw.tl.antlr.ast.*; import org.bw.tl.compiler.Scope; import org.junit.Assert; import org.junit.Test; import org.junit.experimental.runners.Enclosed; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.objectweb.asm.Type; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.*; import static org.bw.tl.TestUtilities.getResolver; import static org.bw.tl.TestUtilities.parseExpression; import static org.bw.tl.util.TypeUtilities.getTypeFromName; import static org.bw.tl.util.TypeUtilities.isAssignableFrom; import static org.bw.tl.util.TypeUtilities.isAssignableWithImplicitCast; import static org.objectweb.asm.Type.*; @RunWith(Enclosed.class) public class ExpressionResolutionTest { public static class ModuleExpressionResolutionTest { @Test public void testResolveBinaryOpByte() { final ExpressionResolverImpl expressionResolver = new ExpressionResolverImpl(null, Collections.emptyList(), ModuleExpressionResolutionTest.class.getClassLoader(), new Scope()); final BinaryOp bop = new BinaryOp(new Literal<>(100), "*", new Literal<>(5)); final Type type = bop.resolveType(expressionResolver); Assert.assertEquals(BYTE_TYPE, type); Assert.assertTrue(isAssignableFrom(type, INT_TYPE)); Assert.assertTrue(isAssignableWithImplicitCast(type, Type.LONG_TYPE)); } @Test public void testResolveBinaryOpInt() { final ExpressionResolverImpl expressionResolver = new ExpressionResolverImpl(null, Collections.emptyList(), ExpressionResolutionTest.class.getClassLoader(), new Scope()); final BinaryOp bop = new BinaryOp(new Literal<>(100000), "*", new Literal<>(5)); final Type type = bop.resolveType(expressionResolver); Assert.assertEquals(INT_TYPE, type); Assert.assertTrue(isAssignableWithImplicitCast(type, Type.LONG_TYPE)); } @Test public void resolveExpression() { final ExpressionResolverImpl resolver = getResolver("package mod;" + "float abc = 100\n" + "java.lang.String str = \"a string lol\"\n" + "fun add(int a, float b): long {}"); final ExpressionResolverImpl expressionResolver = new ExpressionResolverImpl(resolver.getClazz(), Collections.singletonList(resolver.getClazz()), ModuleExpressionResolutionTest.class.getClassLoader(), new Scope()); // expr = abc * add(60000, abc) // F = F * L(INT, FLOAT) Expression expr = new BinaryOp(new QualifiedName("abc"), "*", new Call(null, "add", new Expression[]{new Literal<>(60000), new QualifiedName("abc")} )); Assert.assertEquals(Type.FLOAT_TYPE, expr.resolveType(expressionResolver)); } } @RunWith(Parameterized.class) public static class SimpleResolutionTest { private final String expectedType; private final String expr; private final boolean requireExactMatch; private final boolean shouldFail; public SimpleResolutionTest(final String expectedType, final String expr, final boolean requireExactMatch, final boolean shouldFail) { this.expectedType = expectedType; this.expr = expr; this.requireExactMatch = requireExactMatch; this.shouldFail = shouldFail; } @Test public void resolveTest() { final ExpressionResolverImpl resolver = new ExpressionResolverImpl(null, Collections.emptyList(), SimpleResolutionTest.class.getClassLoader(), new Scope()); final Expression expression = parseExpression(expr); final Type resolvedType = expression.resolveType(resolver); Assert.assertNotNull("Failed to parse expression", expression); if (shouldFail) { Assert.assertNull("Resolution should have failed", resolvedType); } else { final Type type = getTypeFromName(expectedType); Assert.assertNotNull(type); Assert.assertNotNull(expression); if (requireExactMatch) { Assert.assertEquals(type, resolvedType); } else { final boolean eq = type.equals(resolvedType); final boolean isAssignable = isAssignableFrom(resolvedType, type); final boolean isAssignableWithImplicitCast = isAssignableWithImplicitCast(resolvedType, type); Assert.assertTrue(eq || isAssignable || isAssignableWithImplicitCast); } } } @Parameterized.Parameters(name = "Resolution Test: {1} -> {0}") public static Collection<Object[]> parameters() throws IOException { final LinkedList<Object[]> parameters = new LinkedList<>(); final List<String> lines = Files.readAllLines(Paths.get("testData/resolution/expressions.resolve")); for (String line : lines) { line = line.trim(); if (line.isEmpty()) continue; boolean requireExact = true; try { String type = null; String expr = null; if (line.contains("~:")) { String[] sp = line.split("~:"); requireExact = false; type = sp[0].trim(); expr = sp[1].trim(); } else if (line.contains(":")) { String[] sp = line.split(":"); type = sp[0].trim(); expr = sp[1].trim(); } else if (line.startsWith("!!")) { expr = line.substring(line.indexOf("!!")).trim(); } parameters.add(new Object[]{type, expr, requireExact, false}); } catch (Throwable e) { parameters.add(new Object[]{"", line, requireExact, false}); } } return parameters; } } }
Acquired alteration in the expression of blood groups in a patient with sideroblastic anemia and chronic renal failure A patient with welldifferentiated lymphocytic lymphoma in remission presented with renal failure, sideroblastic anemia, and an acquired diminution in the expression of A antigen on his red cells. Other red cell antigens (H, M, i, and I) also were expressed weakly. Lewis antigen was expressed only in secretions. The diminished expression of the A antigen could not be accounted for by diminution in the specific glycosyl transferases responsible for its expression, since the activity in the serum of both the H enzyme (alpha 1 leads to 2 fucosyltransferase) and the A enzyme (alpha 1 leads to 3 N acetylgalactosaminyltransferase) was not diminished. When sialic acid was removed by enzymatic treatment, the expression of the A and i antigens was augmented markedly, suggesting that the sialic acid may have altered the expression or detection of the antigens. This abnormality was probably related to dysplasia of the bone marrow which was otherwise manifest by ringed sideroblasts, unsegmented megakaryocytes, and diminished growth in vitro.
<gh_stars>10-100 package com.notes.java.thread.pi; import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; /** * 在java的io包下,PipedOutputStream和PipedInputStream分别是管道输出流和管道输入流。 * 它们的作用是让多线程可以通过管道进行线程间的通讯。在使用管道通信时,必须将PipedOutputStream和PipedInputStream配套使用。 * 使用方法:先创建一个管道输入流和管道输出流,然后将输入流和输出流进行连接,用生产者线程往管道输出流中写入数据,消费者在管道输入流中读取数据,这样就可以实现了不同线程间的相互通讯,但是这种方式在生产者和生产者、消费者和消费者之间不能保证同步,也就是说在一个生产者和一个消费者的情况下是可以生产者和消费者之间交替运行的,多个生成者和多个消费者者之间则不行 */ public class PipedInputStreamModel { final PipedInputStream pis = new PipedInputStream(); final PipedOutputStream pos = new PipedOutputStream(); { try { pis.connect(pos); } catch (IOException e) { e.printStackTrace(); } } class Producer implements Runnable { @Override public void run() { try { while (true) { Thread.sleep(1000); int num = (int) (Math.random() * 255); System.out.println(Thread.currentThread().getName() + "生产者生产了一个数字,该数字为: " + num); pos.write(num); pos.flush(); } } catch (Exception e) { e.printStackTrace(); } finally { try { pos.close(); pis.close(); } catch (IOException e) { e.printStackTrace(); } } } } class Consumer implements Runnable { @Override public void run() { try { while (true) { Thread.sleep(1000); int num = pis.read(); System.out.println("消费者消费了一个数字,该数字为:" + num); } } catch (Exception e) { e.printStackTrace(); } finally { try { pos.close(); pis.close(); } catch (IOException e) { e.printStackTrace(); } } } } public static void main(String[] args) { PipedInputStreamModel pipedInputStreamModel = new PipedInputStreamModel(); new Thread(pipedInputStreamModel.new Producer()).start(); new Thread(pipedInputStreamModel.new Consumer()).start(); } }
A fire broke out on West Washington Avenue on Wednesday afternoon. The fire was reported on West Washington Avenue. ORANGETOWN - The sole resident of a Pearl River home and her Pomeranian escaped a Wednesday afternoon house fire unharmed. Neighbors of 174 W. Washington Ave. saw a large amount of smoke and fire raging from a detached garage around 12:30 p.m. and called 911, Orangetown police said. Flames quickly spread to the home and consumed the upper floors, prompting a multi-department response. Everyone got out safely, and the fire was knocked down without injuries to the resident, her pup or first responders, Orangetown police said. April 17, 2019, 1:11 p.m.
China and Sustainable Development in Latin America The English version of this paper can be found at: http://ssrn.com/abstract=2016680Chinas growing economic engagement with Latin America has sparked both popular and scholarly debate. Some scholars contend that China is a rising imperial power scouring the globe for natural resources, exploiting less powerful nations, and rejecting international environmental agreements that would curb its profligate consumption of the worlds natural resources. Others applaud Chinas unorthodox development strategies and portray China as a model worthy of emulation. This article interrogates both narratives and examines the environmental and developmental implications of Chinas rise for Latin America. The article discusses China's bilateral trade and investment agreements with Latin American nations and China's potential contributions to sustainable development law.
/* * Copyright (C) 2019 Intel Corporation * SPDX-License-Identifier: BSD-3-Clause */ package com.intel.mtwilson.flavor.controller; import com.fasterxml.jackson.databind.Module; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.PropertyNamingStrategy; import com.google.common.base.Charsets; import com.google.common.io.Resources; import com.intel.dcsg.cpg.extensions.Extensions; import com.intel.dcsg.cpg.io.UUID; import com.intel.dcsg.cpg.validation.Fault; import com.intel.mtwilson.flavor.data.MwHost; import com.intel.mtwilson.flavor.data.MwHostStatus; import com.intel.mtwilson.flavor.model.HostStatusInformation; import com.intel.mtwilson.i18n.HostState; import com.intel.mtwilson.jackson.bouncycastle.BouncyCastleModule; import com.intel.mtwilson.jackson.validation.ValidationModule; import com.intel.mtwilson.jaxrs2.provider.JacksonObjectMapperProvider; import com.intel.mtwilson.core.common.model.HostManifest; import static java.lang.Thread.sleep; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Properties; import javax.persistence.EntityManagerFactory; import javax.persistence.Persistence; import javax.persistence.spi.PersistenceUnitTransactionType; import org.apache.shiro.codec.Base64; import static org.eclipse.persistence.config.PersistenceUnitProperties.*; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * * @author rksavino */ public class MwHostStatusJpaControllerTest { private static final Logger log = LoggerFactory.getLogger(MwHostStatusJpaControllerTest.class); private static final String JAVAX_PERSISTENCE_JDBC_DRIVER = "org.postgresql.Driver"; private static final String JAVAX_PERSISTENCE_JDBC_URL = "jdbc:postgresql://192.168.0.1:5432/mw_as"; private static final String JAVAX_PERSISTENCE_JDBC_USER = "root"; private static final String JAVAX_PERSISTENCE_JDBC_PASSWORD = "<PASSWORD>Oy<PASSWORD>"; private static final String PERSISTENCE_UNIT_NAME = "FlavorDataPU"; private static EntityManagerFactory emf; private static MwHostStatusJpaController mwHostStatusJpaController; private final ObjectMapper mapper = JacksonObjectMapperProvider.createDefaultMapper(); public MwHostStatusJpaControllerTest() { } private static void registerJacksonModules() { Extensions.register(Module.class, BouncyCastleModule.class); Extensions.register(Module.class, ValidationModule.class); } @BeforeClass public static void setUpClass() throws Exception { registerJacksonModules(); Properties jpaProperties = new Properties(); jpaProperties.put(TRANSACTION_TYPE, PersistenceUnitTransactionType.RESOURCE_LOCAL.name()); jpaProperties.put(JDBC_DRIVER, JAVAX_PERSISTENCE_JDBC_DRIVER); jpaProperties.put(JDBC_URL, JAVAX_PERSISTENCE_JDBC_URL); jpaProperties.put(JDBC_USER, JAVAX_PERSISTENCE_JDBC_USER); jpaProperties.put(JDBC_PASSWORD, JAVAX_PERSISTENCE_JDBC_PASSWORD); log.debug("Loading database driver {} for persistence unit {}", jpaProperties.getProperty("javax.persistence.jdbc.driver"), PERSISTENCE_UNIT_NAME); emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, jpaProperties); mwHostStatusJpaController = new MwHostStatusJpaController(emf); } @AfterClass public static void tearDownClass() { emf.close(); } @Before public void setUp() { } @After public void tearDown() { } @Test public void createTestData() throws Exception { MwHostJpaController mwHostJpaController = new MwHostJpaController(emf); List<MwHost> mwHostList = mwHostJpaController.findMwHostEntities(); HostStatusInformation hostStatus = new HostStatusInformation(); for (MwHost mwHost : mwHostList) { for (int i = 1; i <= 5; i++) { String hostManifestAsJson = Resources.toString(Resources.getResource("rhel-host-manifest-test.json"), Charsets.UTF_8); HostManifest hostManifest = mapper.readValue(hostManifestAsJson, HostManifest.class); hostManifest.getHostInfo().setHostName(mwHost.getName()); hostManifest.getHostInfo().setHardwareUuid(mwHost.getHardwareUuid()); hostStatus.setHostState(HostState.QUEUE); hostStatus.setLastTimeConnected(Calendar.getInstance().getTime()); // hostStatus.setFaults(getFaults()); MwHostStatus mwHostStatus = new MwHostStatus(); mwHostStatus.setId(new UUID().toString()); mwHostStatus.setHostId(mwHost.getId()); mwHostStatus.setStatus(hostStatus); mwHostStatus.setCreated(Calendar.getInstance().getTime()); mwHostStatus.setHostManifest(hostManifest); mwHostStatusJpaController.create(mwHostStatus); System.out.println(String.format("Host status [%s] for host [%s] created with status: %s", mwHostStatus.getId(), mwHostStatus.getHostId(), mwHostStatus.getStatus())); sleep(2000); } } } @Test public void readTestData() throws Exception { List<MwHostStatus> mwHostStatusList = mwHostStatusJpaController.findMwHostStatusEntities(); for (MwHostStatus mwHostStatus : mwHostStatusList) { String hostStatusId = mwHostStatus.getId(); System.out.println(String.format("Found host status: %s", hostStatusId)); String hostId = mwHostStatus.getHostId(); System.out.println(String.format(" Host status [%s] has host ID: %s", hostStatusId, hostId)); HostStatusInformation hostStatus = mwHostStatus.getStatus(); ObjectMapper mapper = JacksonObjectMapperProvider.createDefaultMapper(); //System.out.println(String.format(" Host status [%s] has status: \n %s", hostStatusId, mapper.writeValueAsString(hostStatus))); Date createdTimeStamp = mwHostStatus.getCreated(); System.out.println(String.format(" Host status [%s] has created date: %s", hostStatusId, createdTimeStamp)); HostManifest hostManifest = mwHostStatus.getHostManifest(); mapper.setPropertyNamingStrategy(new PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy()); System.out.println(String.format(" Host status [%s] has host manifest:\n %s", hostStatusId, mapper.writeValueAsString(hostManifest))); } } @Test public void deleteAllData() throws Exception { List<MwHostStatus> mwHostStatusList = mwHostStatusJpaController.findMwHostStatusEntities(); for (MwHostStatus mwHostStatus : mwHostStatusList) { mwHostStatusJpaController.destroy(mwHostStatus.getId()); System.out.println(String.format("Host Status [%s] deleted", mwHostStatus.getId())); } } @Test public void retrieveHostStatusForAllHosts() throws Exception { MwHostJpaController mwHostJpaController = new MwHostJpaController(emf); List<MwHost> mwHostList = mwHostJpaController.findMwHostEntities(); for (MwHost mwHost : mwHostList) { MwHostStatus mwHostStatus = mwHostStatusJpaController.findMwHostStatusByHostId(mwHost.getId()); if (mwHostStatus == null) { System.out.println(String.format("No entry found for host [%s]", mwHost.getId())); return; } System.out.println(String.format( "Host [%s] created on [%s] has host status:", mwHost.getId(), mwHostStatus.getCreated())); } } @Test public void getHostsByKeyValue() throws Exception { List<String> mwHostEntries = mwHostStatusJpaController.findMwHostListByKeyValue("os_name", "RHEL"); if (mwHostEntries == null || mwHostEntries.isEmpty()) throw new Exception("No matching hosts found"); for (String hostId : mwHostEntries) { System.out.println(String.format("Host [%s] retrieved", hostId)); } } public List<Fault> getFaults() { ArrayList<Fault> faults = new ArrayList<>(); faults.add(new Fault("Test Description")); return faults; } @Test public void retrieveHostStatusByAikCertificate() throws Exception { String hostManifestAsJson = Resources.toString(Resources.getResource("rhel-host-manifest-test.json"), Charsets.UTF_8); HostManifest hostManifest = mapper.readValue(hostManifestAsJson, HostManifest.class); String aikCertificate = Base64.encodeToString(hostManifest.getAikCertificate().getEncoded()); System.out.println(String.format("AIK certificate:\n%s", aikCertificate)); MwHostStatus mwHostStatus = mwHostStatusJpaController.findMwHostStatusByAikCertificate(aikCertificate); if (mwHostStatus == null) { System.out.println(String.format("No entry found for aik certificate:\n%s", aikCertificate)); return; } System.out.println(String.format("Host [%s] created on [%s] has ID: %s", mwHostStatus.getHostId(), mwHostStatus.getCreated(), mwHostStatus.getId())); } }
Photobiomodulation induces antinociception, recovers structural aspects and regulates mitochondrial homeostasis in peripheral nerve of diabetic mice Diabetic peripheral neuropathy (DPN) is a nervous disorder caused by diabetes mellitus, affecting about 50% of patients in clinical medicine. Chronic pain is one of the major and most unpleasant symptoms developed by those patients, and conventional available treatments for the neuropathy, including the associated pain, are still unsatisfactory and benefit only a small number of patients. Photobiomodulation (PBM) has been gaining clinical acceptance once it is able to promote early nerve regeneration resulting in significant improvement in peripheral nerves disabilities. In this work, the effects of PBM (660nm, 30mW, 1.6 J/cm2, 0.28cm2, 15s in a continuous frequency) on treating DPNinduced pain and nerve damage were evaluated in an experimental model of diabeticneuropathy induced by streptozotocin in mice. PBMinduced antinociception in neuropathicpain mice was dependent on central opioids release. After 21 consecutive applications, PBM increased nerve growth factor levels and induced structural recovery increasing mitochondrial content and regulating Parkin in the sciatic nerve of DPNmice. Taking together, these data provide new insights into the mechanisms involved in the effects of PBMtherapy emphasizing its therapeutic potential in the treatment of DPN.
The Establishment of an On-Campus Neurotraining Center at a Small University: Internship Experience Using Neuropsychological Techniques. In 2015, Wilkes University's Neuroscience Program and Psychology Department established a unique training and learning center on a small liberal arts undergraduate campus - The NeuroTraining & Research Center. This paper shares the purpose of the Center, as a learning tool for Neuroscience majors who engage in internships and research opportunities, and as a means of promoting well-being on the campus by offering training in techniques such as Neurofeedback, Biofeedback and Audio-Visual Entrainment to the college community. The role that the center plays in connecting real world applications to concepts in Neuroscience, and the approach that the authors have taken to assess student learning is presented in this article.
def allDirectionalityRatios(ratioFunction): if not os.path.exists("savedHeatmaps"): os.mkdir("savedHeatmaps") wildRatio = np.log(ratioFunction("Wildtype_0min_BglII_rep1")) for j, dataset in enumerate(datasets): ax = plt.subplot(len(datasets), 1, j + 1) curRatio = (ratioFunction(dataset)) plt.title("{1}, r = {0:.2f}, p={2:.2e}".format(pearsonr(curRatio, wildRatio)[0], names[dataset], pearsonr(curRatio, wildRatio)[1]), fontsize=10) plt.tick_params(axis='both', which='major', labelsize=10) plt.tick_params(axis='both', which='minor', labelsize=8) plt.plot(curRatio) plt.ylim((0.25, 0.75)) plt.xlim((0, len(curRatio))) plt.yticks((0.25, 0.5, 0.75)) geneCoor = [1162773, 3509071, 1180887, 543099, 1953250, 2522439, 3328524, 1503879, 900483, 242693, 3677144, 3931680, 3677704, 3762707, 3480870, 3829656, 1424678, 901855, 1439056, 3678537] genePos = [i / 10000. for i in geneCoor] for lpos in genePos: plt.vlines(lpos , -.8, .8, alpha=0.2, linewidth=1, color="black") plt.xticks([0, 50, 100, 150, 200, 250, 300, 350, 400], ["" for i in xrange(9)], fontsize=98) removeAxes(ax=ax) plt.subplots_adjust(0.07, 0.05, 0.94, 0.95, 0.2, 0.5) plt.show() exit()
Live-cell imaging of small nucleolar RNA tagged with the broccoli aptamer in yeast. The development of the RNA 'vegetable' aptamers, Spinach and Broccoli, has simplified RNA imaging, especially in live cells. These RNA aptamers interact with a fluorophore (DFHBI or DFHBI-1T) to produce a green fluorescence signal. Although used in mammalian and Escherichia coli cells, the use of these aptamers in yeast has been limited. Here we describe how the Saccharomyces cerevisiae snoRNA, snR30, was tagged with the Spinach or the Broccoli aptamers and observed in live cells. The ability to observe aptamer fluorescence in polyacrylamide gels stained with a fluorophore or with a microplate reader can ease preliminary screening of the aptamers in different RNA scaffolds. In snR30 a tandem repeat of the Broccoli aptamer produced the best signal in vitro. Multiple factors in cell preparation were vital for obtaining a good fluorescence signal. These factors included the clearance of the native unmodified snR30, the amount and length of dye incubation and the rinsing of cells. In cells, the aptamers did not interfere with the structure or essential function of snR30, as the tagged RNA localized to the nucleolus and directed processing of ribosomal RNA in yeast. High-resolution images of the tagged snoRNA were obtained with live cells immobilized by a microcompressor.
Use of cytological samples of metastatic melanoma for ancillary studies Fine needle aspiration (FNA) is widely used in the diagnosis of metastatic melanoma, both at initial presentation and in the setting of recurrent disease. The purpose of this study was to evaluate the performance of confirmatory immunohistochemistry (IHC) and molecular analysis of the BRAF mutation in cytological preparations of metastatic melanoma.
def _get_solution_basis_svd(X, y, assume_diagonal=False): if y.ndim == 1: y = y[:, np.newaxis] b = np.dot(X.T, y) / len(X) if assume_diagonal: b2 = np.square(b) b /= b2 a = b2 / np.var(X, axis=0)[:, np.newaxis] return np.eye(len(b)), a, b else: _, s, U = linalg.svd(X, full_matrices=False) s = s**2 / len(X) idx = s > 1e-15 s_nnz = s[idx][:, np.newaxis] U = U[idx] UTb = np.dot(U, b) UTb2 = np.square(UTb) return U.T, UTb2 / s_nnz, UTb / UTb2
<reponame>Eae02/tank-game #pragma once #include "gl/texture1d.h" namespace TankGame { class NoiseTexture : public Texture1D { public: NoiseTexture(int size, float min, float max); }; }
// This class is used to collect all stub assignments during a // Manage() call. class StubAssignmentCollector { public: struct StubMemoryStat { GpuMemoryAllocation allocation; }; typedef base::hash_map<GpuCommandBufferStubBase*, StubMemoryStat> StubMemoryStatMap; static const StubMemoryStatMap& GetStubStatsForLastManage() { return stub_memory_stats_for_last_manage_; } static void ClearAllStats() { stub_memory_stats_for_last_manage_.clear(); } static void AddStubStat(GpuCommandBufferStubBase* stub, const GpuMemoryAllocation& allocation) { DCHECK(!stub_memory_stats_for_last_manage_.count(stub)); stub_memory_stats_for_last_manage_[stub].allocation = allocation; } private: static StubMemoryStatMap stub_memory_stats_for_last_manage_; }
The Cx43-like Connexin Protein Cx40.8 Is Differentially Localized during Fin Ontogeny and Fin Regeneration Connexins (Cx) are the subunits of gap junctions, membraneous protein channels that permit the exchange of small molecules between adjacent cells. Cx43 is required for cell proliferation in the zebrafish caudal fin. Previously, we found that a Cx43-like connexin, cx40.8, is co-expressed with cx43 in the population of proliferating cells during fin regeneration. Here we demonstrate that Cx40.8 exhibits novel differential subcellular localization in vivo, depending on the growth status of the fin. During fin ontogeny, Cx40.8 is found at the plasma membrane, but Cx40.8 is retained in the Golgi apparatus during regeneration. We next identified a 30 amino acid domain of Cx40.8 responsible for its dynamic localization. One possible explanation for the differential localization is that Cx40.8 contributes to the regulation of Cx43 in vivo, perhaps modifying channel activity during ontogenetic growth. However, we find that the voltage-gating properties of Cx40.8 are similar to Cx43. Together our findings reveal that Cx40.8 exhibits differential subcellular localization in vivo, dependent on a discrete domain in its carboxy terminus. We suggest that the dynamic localization of Cx40.8 differentially influences Cx43-dependent cell proliferation during ontogeny and regeneration. Introduction Connexins, the subunits of gap junction channels, are part of a large multigene family that includes about 20 genes in mammals. Connexins are integral membrane proteins that consist of four transmembrane domains, two extracellular loops, one cytoplasmic loop, and cytoplasmic amino-and carboxy-termini. Six connexin proteins oligomerize to form one connexon (or hemichannel), and the docking of two connexons at the plasma membranes of neighboring cells forms a single gap junction channel. Channels associate together at the plasma membrane to form gap junction plaques, permitting the passage of ions and small molecules (,1200 Da) between adjacent cells. Interestingly, most tissues express a unique complement of 2-7 connexin genes, suggesting that distinct homomeric and heteromeric gap junction channels contribute to cell-cell coupling and functional diversity (reviewed in ). Channel composition can determine metabolite selectivity and specificity. One possible role of this diversity in connexin expression is that regulated hetero-oligomerization of different isotypes may in turn regulate tissue function. Gap junctional intercellular communication (GJIC) is necessary for normal tissue development, evidenced by the identification of mutations in connexins that cause human disease. In particular, missense mutations in human CX43 cause the craniofacial and limb skeletal malformations associated with oculodentodigital dysplasia (ODDD). Importantly, the function of Cx43 appears to be conserved during skeletal morphogenesis. Mutations in zebrafish cx43 cause short bony fin ray segments associated with the short fin (sof) phenotype. In addition to the sof b123 allele that has reduced mRNA and protein levels, three non-complementing ENU-induced alleles were shown to cause missense mutations (sof j7e1 codes Cx43-F30V, sof j7e2 codes Cx43-P191S, and sof j7e3 codes Cx43-F209I). Each missense allele can form gap junction plaques, but channels exhibit aberrant ionic coupling properties. Recent studies revealed a positive correlation between segment length, level of cell proliferation, and level of GJIC. Therefore, the zebrafish fin represents a valuable system to understand how Cx43 function contributes to the development of the vertebrate skeleton, including cell proliferation and bone growth. The zebrafish caudal fin consists of 16-18 segmented bony rays, where fin length depends on the number and size of bony segments. In addition to ontogenetic growth, fins also have the capacity for regenerative growth, where lost tissue is replaced rapidly due to an accelerated growth rate. Amputation is immediately followed by wound healing and establishment of the regeneration blastema (reviewed in ). The blastema is a specialized structure composed primarily of proliferating cells, and is required for outgrowth. Interestingly, expression of cx43 is upregulated in the proliferating cells of the blastema, and all four sof alleles exhibit reduced levels of cell proliferation during regeneration. Moreover, cx43-gene knockdown also causes reduced levels of cell proliferation. Thus, Cx43 is required to promote cell proliferation during the rapid growth of fin regeneration. It remains unclear how Cx43 activity is regulated in this tissue. One possibility is that other connexins accomplish this role. The zebrafish genome includes a large connexin gene family (n = 37), almost twice the size of human (n = 21) and mouse (n = 20) families. Previously, we identified and characterized cx40.8, a cx43-like gene in the zebrafish genome. The cx40.8 gene shares 80% nucleotide identity with cx43, and is coexpressed with cx43 in the population of dividing cells during fin regeneration. Therefore Cx40.8 is a reasonable candidate for influencing Cx43 function. However, Cx40.8-EGFP localized to intracellular vesicles and not to gap junction plaques when expressed alone in HeLa cells, in contrast to typical connexins such as zebrafish Cx43-EGFP. Although, cotransfection with Cx43-mApple permits Cx40.8-EGFP to localize to the plasma membrane in gap junction plaques. Since cx43 and cx40.8 are both expressed in the proliferating cells of the regenerating fin, and since Cx43 and Cx40.8 can co-localize to common gap junction plaques in HeLa cells, one possibility is that Cx40.8 influences Cx43 function in dividing cells. Here, we test this hypothesis during zebrafish fin regeneration. Strikingly, we find that Cx40.8 exhibits differential subcellular localization either to the plasma membrane (during ontogeny) or to the Golgi apparatus (during regeneration). This dynamic localization is dependent on a 30 amino acid sequence immediately following the fourth transmembrane-spanning domain (TM4) of Cx40.8. We also show that that the channel properties of Cx40.8 are similar to Cx43, suggesting that Cx40.8 does not directly influence Cx43-based GJIC. Together, these findings reveal that Cx40.8-dependent subcellular localization is correlated with the growth rate of fins, perhaps by regulating a non-channel function of Cx43. Cx40.8 is differentially localized during ontogeny and regeneration Previous studies have shown that Cx40.8 is restricted to intracellular vesicles when expressed in HeLa cells. To evaluate Cx40.8 localization in vivo, an antibody was generated against an internal peptide located in the carboxy terminus (see Materials and Methods). First we evaluated antibody-specificity using lysates prepared from regenerating fins. A single band was identified at the expected size ( Figure 1A), demonstrating that the antibody recognizes Cx40.8 in fins. Peptide competition experiments confirmed the specificity of the antibody. Antibody recognition for its epitope was challenged by prior incubation with the peptide used to generate the antibody (i.e. ''competed''). We prepared lysates from bacteria expressing a GST-Cx40.8CT fusion protein, and loaded increasing amounts of lysate on two identical SDS gels, followed by immunoblotting. One blot was probed with the anti-Cx40.8 antibody and the other was probed with the ''competed'' antibody. As expected, the immunoblot treated with competed antibody showed reduced antibody binding to the GST-Cx40.8CT fusion protein compared to the non-competed antibody ( Figure 1B,C). Together, these results demonstrate that the anti-Cx40.8 antibody is specific and recognizes endogenous Cx40.8 protein by immunoblotting. Next, Cx40.8 localization in fins was evaluated during ontogenetic and regenerative growth by confocal microscopy ( Figure 2). During fin regeneration, Cx40.8 is found intracellularly in crescent-like structures adjacent to the nuclei, consistent with localization in the Golgi apparatus ( Figure 2B). These results were consistent with previous findings that Cx40.8-EGFP remains in intracellular vesicles in HeLa cells, and were therefore not unexpected. In contrast, during ontogeny, Cx40.8 is observed at the plasma membrane (Figure 2A), suggesting a dynamic localization of Cx40.8 that depends on growth status of the fin. Importantly, Cx43 was not found to exhibit differential localization, but is located at the plasma membrane during both ontogeny and regeneration. Thus, given that the Cx43 and Cx40.8 antibodies exhibit distinct immunolocalization patterns in regenerating fins, the newly developed Cx40.8 antibody does not crossreact with endogenous Cx43. Our findings described above reveal that during the relatively slow growth of ontogeny, Cx40.8 is located at the plasma membrane. During the relatively rapid growth of regeneration, Cx40.8 is located intracellularly. Together with our previous findings that cx43 and cx40.8 are co-expressed in Figure 1. The Cx40.8 antibody is specific. (A) An antibody raised against a Cx40.8 carboxy-terminal peptide detects a single major band from regenerating fin lysates (arrowhead). Non-competed (B) and competed (C) anti-Cx40.8 antibody was used to detect bacterially expressed GST-Cx40.8CT. Decreasing volumes of a concentrated lysate were loaded in each lane on two identical gels. When the antibody was pre-incubated with the Cx40.8 target sequence (i.e. competed), antibody binding was reduced in all lanes compared with noncompeted antibody. Arrowhead points to the full length product. Bands at molecular weights smaller than the full-length fusion protein represent degradation products. doi:10.1371/journal.pone.0031364.g001 the population of dividing cells, and that Cx43 is required for cell proliferation, it is possible that Cx40.8 localization to the plasma membrane attenuates Cx43-dependent cell proliferation during ontogeny. We next directly assessed whether Cx40.8 is localized to the Golgi apparatus during fin regeneration. To accomplish this, we utilized a novel zebrafish transgenic line that tags the aminoterminal domain of the Golgi-retained enzyme galactotransferase (GalT) with GFP (i.e. Tg(bact:galT-gfp)). In the transgenic line, GalT-GFP is expressed under the control of the zebrafish b-actin promoter (AV and KCS, in preparation), resulting in GFPlabeled Golgi apparatus in most cells of the fin. We found that Cx40.8 immunostaining co-localizes with GalT-GFP ( Figure 3 A-C). To further establish that the two labels co-reside in the Golgi apparatus, we treated regenerating fins with a drug that specifically disrupts the Golgi apparatus, Brefeldin A (BFA, ). BFA should cause dispersal of both Cx40.8 and GalT-GFP if they are in fact Golgi residents. In fin rays injected with the carrier DMSO, GalT-GFP and Cx40.8 co-localized as expected ( Figure 3 D-F). In contrast, fin rays injected with 10 mg/ml BFA exhibited disruption of both the Cx40.8 signal and the GalT-GFP ( Figure 3 G-I). Together, these data provide compelling evidence that newly synthesized Cx40.8 localizes to the Golgi apparatus during fin regeneration. We speculate that it is eventually mobilized to the plasma membrane following the transition from regenerative to ontogenetic fin growth. In order to reveal how Cx40.8 may be retained in the Golgi, we next attempted to define the region of Cx40.8 responsible for its intracellular location. A carboxy-terminal domain downstream of TM4 is responsible for the intracellular localization of Cx40.8 Since Cx40.8 is found in intracellular vesicles in HeLa cells but at the plasma membrane when co-transfected with Cx43, we reasoned that Cx40.8 may contain an intrinsic signal regulating its subcellular localization. To test this hypothesis, multiple chimeric forms of Cx43 and Cx40.8 were generated to identify the domain responsible for the intracellular localization of Cx40.8. These chimeras were generated as EGFP fusion proteins in order to directly visualize subcellular localization. Cx43 and Cx40.8 are about 80% identical at the amino acid levels, where the sequences of the carboxy-termini are the least conserved. Therefore, we subdivided the carboxy termini of Cx43 and Cx40.8 into three similarly sized regions, BCD for Cx43 and bcd for the analogous regions in Cx40.8 ( Figure 4). To test whether the carboxy terminus is indeed responsible for subcellular location, we first generated chimeras in which the carboxy termini of Cx43 and Cx40.8 were swapped (i.e. Cx43bcd-EGFP contains the N-terminus of Cx43 but the C-terminus of Cx40.8 and Cx40.8-BCD-EGFP contains the N-terminus of Cx40.8 but the C-terminus of Cx43). Results show that Cx40.8-BCD-EGFP forms gap junction plaques at the plasma membrane, resembling the behavior of Cx43, whereas Cx43-bcd-EGFP remains intracellular, resembling the behavior of Cx40.8 ( Figure 5C,D). Thus, the putative signal responsible for connexin localization appears to reside in the C-termini of these connexins. To determine more precisely the Cx40.8 localization domain, chimeras were generated between the three different sub-domains. Importantly, swapping the B/b domains had the same effect on connexin location as swapping the entire carboxy-termini suggesting that this domain is responsible for subcellular localization. Indeed, the effect was reciprocal, such that Cx43-bCD-EGFP was located in intracellular vesicles, while Cx40.8-Bcd-EGFP was found at the plasma membrane in gap junction plaques ( Figure 5E,F). In contrast, swapping the C/c or D/d domains did not coincidently reverse the location of the connexins ( Figure 5G-J). Together, these findings demonstrate that the carboxy-terminal domain closest to TM4 (i.e. juxta-TM4) determines the subcellular localization of both Cx43 and Cx40.8. A comparison of the sequences of these domains is included in Figure 4. To establish conclusively that the Cx40.8 ''b'' domain is responsible for the intracellular localization of Cx40.8 in HeLa cells, two additional constructs were tested. The first construct deletes the ''b'' region from Cx40.8 (i.e. Cx40.8-cd-EGFP) and results in localization of Cx40.8-cd-EGFP into gap junction plaques at the plasma membrane ( Figure 5L). Thus, ''b'' is necessary for the restriction of Cx40.8 to intracellular vesicles. The second construct, Cx43-bBCD-EGFP, inserts the ''b'' region of Cx40.8 ahead of the juxta-TM4 region of Cx43. As anticipated, this construct is retained in intracellular vesicles ( Figure 5K). However, an alternate ''b''-containing construct, Cx43-BbCD-EGFP, allows Cx43 to travel to the plasma membrane (not shown). We conclude from these experiments that the Cx40.8 ''b'' domain is required for intracellular localization of Cx40.8, and that the location of the ''b'' sequence in the carboxy terminus contributes to its effects on connexin localization. Indeed, the juxta-TM4 domains of both Cx43 and Cx40.8 appear to directly influence the subcellular localization of each protein (i.e. provided that the domains are located immediately downstream of TM4). Although EGFP fusions to connexins are widely utilized for following subcellular localization, it remained possible that such fusions could lead to aberrant localization. For example, Cx43-EGFP fusions fail to bind to the recycling factor ZO-1, leading to reduced turnover and expanded gap junctions. Other fluorescent proteins have been found to alter the typical trafficking of connexins (i.e. DsRed forms an obligate tetramer, causing connexins to be improperly retained, ). In order to rule out the possibility that the EGFP tag is confounding our results, we next evaluated untagged versions of selected constructs using connexinspecific antibodies. First, we find that untagged Cx43 and untagged Cx40.8 behave as their EGFP-tagged counterparts (Figure 6 A,B). More importantly, we find that the untagged Cx43-bBCD is retained intracellularly, confirming that ''b'' can impart the intracellular retention of Cx43 when inserted adjacent to TM4 ( Figure 6C). Further, we find that the untagged Cx40.8-cd is able to travel to the plasma membrane and establish gap junction plaques ( Figure 6D). These data indicate that the EGFP tag does not influence the trafficking of these proteins. More importantly, these data further confirm that the Cx40.8 ''b'' directs the intracellular retention of Cx40.8. Cx40.8 co-assembles with Cx43 in gap junction channels We previously found that Cx40.8 is capable of co-localizing to gap junction plaques in HeLa cells when co-transfected with Cx43, suggesting that Cx43 and Cx40.8 could associate in common gap junction channels. Increasing the primary magnification during fluorescence microscopy can be used to further investigate this hypothesis. For example, co-transfection of HeLa cells with human Cx26-EGFP and human Cx43-mApple demonstrates that these connexins occupy a common gap junction plaque ( Figure 7C,D and ). However, discrete domains of green and red are observed, revealing that Cx26-EGFP and Cx43-mApple do not hetero-oligomerize in common connexons, nor do they establish homomeric heterotypic gap junction channels (i.e. homomeric heterotypic channels would be comprised of one Cx26-EGFP connexon and one Cx43-mApple connexon). In contrast, co-transfection of human Cx43-EGFP and human Cx43-mApple results in plaques that are uniformly yellow, suggesting that the two connexins are located in common gap junction channels ( Figure 7A,B). Similarly, when zebrafish Cx43-mApple was co-expressed with zebrafish Cx40.8-EGFP, the resulting gap junction plaques were yellow ( Figure 7E,F). This finding suggests that Cx43 and Cx40.8 co-assemble into common gap junction channels when co-expressed in HeLa cells (see Figure S1 for single channel images). Co-association of Cx43 and Cx40.8 in common gap junction channels may cause novel functional properties, such as modulation of channel permeability or electrical-gating properties. We addressed this possibility by assessing the channel properties of Cx40.8-cd-EGFP alone, which is capable of trafficking to the plasma membrane and establishing gap junction plaques (compared to full length Cx40.8 which does not). We performed dual whole cell voltage clamp in N2a cells expressing either Cx43- Cx40.8-cd localizes to the plasma membrane. The Cx43 antibody was used to detect untagged Cx43 and untagged Cx43-bBCD. The Cx40.8 antibody was used to detect untagged Cx40.8 and untagged Cx40.8-cd. Flared arrows identify gap junction plaques located at the plasma membrane; Plain arrows identify the plasma membrane in the absence of gap junction plaques; n, nucleus. doi:10.1371/journal.pone.0031364.g006 EGFP or Cx40.8-cd-EGFP. Transjunctional current (I j ) was measured while transjunctional voltage (V j ) was varied up to 6180 mV in 30 mV steps. Voltage was stepped in one cell of the pair while the other cell remained clamped at 0 mV. Step duration was either 400 ms or 4 s. Representative current families from the 4 s protocol for cell pairs expressing Cx43-EGFP and Cx40.8-cd-EGFP constructs are shown (Figure 8 A,B). Cx43-EGFPexpressing pairs showed voltage dependent inactivation over the course of the 4 s voltage step, with transjunctional conductance (G j ) declining to 50.4621.5% at Vj of +180 mV (n = 4), confirming results obtained previously from paired oocyte recordings. Similarly, Cx40.8-cd-EGFP containing plaques inactivated to 44.665.6% (n = 6). Data for the 400 ms protocols followed this trend (Cx43: 74.1614.0%, n = 7; Cx40.8-cd: 78.5617.2%, n = 9). Steady state G j from the 4 s protocol was plotted as a function of V j, and normalized to the conductance at 630 mV ( Figure 8C). We find that the steady state G j was similar over most of the voltage range for both constructs. These results, taken together with the high sequence homology of the two connexins, reveal that voltage-dependent conductance properties of Cx43 and Cx40.8 are comparable. We cannot rule out the possibility that removal of the ''b'' domain influences the voltage-dependent conductance of Cx40.8. However, given that the domains predicted to regulate voltage-dependent channel activity (reviewed in ) are highly similar between Cx40.8 and Cx43, the finding that their voltage properties are also similar is not unexpected. We therefore conclude that it is unlikely that Cx40.8 dramatically modulates the electrical properties of Cx43 channels. Other possibilities for how Cx40.8 may regulate Cx43 function will be evaluated in future experiments. Discussion The four major findings of this study elucidate a novel mechanism that may regulate gap junction assembly and function. First, Cx40.8 exhibits dynamic subcellular localization in zebrafish fins, where it is retained in the Golgi apparatus during regeneration and is later mobilized to the plasma membrane during ontogeny. Thus, Cx40.8 retention is associated with the rapid growth during regeneration, and Cx40.8 at the plasma membrane is associated with the slower growth of ontogeny. Second, we identify a discrete 30 amino acid sequence near TM4 of the carboxy terminus of Cx40.8 that is required for its intracellular retention. Third, we provide evidence that Cx40.8 and Cx43 co-assemble in common gap junction channels when coexpressed in HeLa cells. Finally, we find that gap junctions composed of Cx40.8 exhibit similar voltage-dependent conductance properties as those composed of Cx43. This study is the first to document differential subcellular localization of a connexin protein based on growth status of a tissue. Thus, our findings provide the first evidence of growth-specific regulation of gap junctions. Previous studies have found that the juxta-TM4 domain is required for connexin trafficking to the plasma membrane. For example, the mammalian Cx32-TM4 sequence (amino acids 207-219 of mammalian Cx32) has been shown to be required for localization to the plasma membrane. Trafficking was suggested to involve binding of this domain to calmodulin. Interestingly, the zebrafish Cx43-juxta-TM4 region (amino acids 228-263) is predicted to bind calmodulin, but the Cx40.8-juxta-TM4 region is not (http://calcium.uhnres.utoronto.ca/ctdb/ no_flash.htm, data not shown). Also, the juxta-TM4 domain of mammalian Cx43 has been shown to bind microtubules, which may influence its localization to the plasma membrane. The juxta-TM4 domain of Cx40.8 does not bind microtubules (data not shown). Rather, we find that the juxta-TM4 domain of Cx40.8 is required for its intracellular localization, negatively regulating trafficking to the plasma membrane. Indeed, we also find that the juxta-TM4 domain of Cx40.8 can cause Cx43 to be retained intracellularly (i.e. Cx43-bBCD). However, recall that the proximity of the juxta-TM4 domain to TM4 is also significant, since adding the ''b'' domain to Cx43 following its native ''B'' domain (i.e.Cx43-BbCD) does not appear to alter Cx43 trafficking. Perhaps this domain is uniquely situated to influence the trafficking or retention of connexins. At least two other connexins have been found in intracellular compartments and not at the plasma membrane. For example, mouse Cx46 is retained in a compartment of the trans-Golgi network in ROS osteosarcoma cells, although the functional significance of this finding has not been revealed. A second example is mouse Cx33, found primarily in endocytic vesicles in the testes, and has been shown to regulate the activity of Cx43 during spermatogenesis. Cx33 appears to interact transiently with Cx43 at the plasma membrane, increasing the rate of Cx43 endocytosis and therefore reducing Cx43-based GJIC. Examination of Cx46 and Cx33 did not reveal sequence similarity with Cx40.8 in the juxta-TM4 domains. However, phylogenetic analyses show that mouse Cx33 is most closely related to the Cx43 connexins, as is Cx40.8. Thus, zebrafish Cx40.8 and mouse Cx33 are both most closely related to the Cx43 orthologs. Perhaps co-expression of highly related connexins favors regulatory mechanisms based upon physical interaction and not on direct modification of channel properties. Indeed, given that the highest degree of sequence diversity between Cx40.8 and Cx43 occurs in the carboxy terminus, Cx40.8 may bring distinct regulatory proteins to the plasma membrane that can modify Cx43 function in vivo. This and other possibilities will be explored in future experiments. Cx40.8 is a unique example of a connexin whose subcellular localization depends on the growth status of a tissue. Differential localization appears to be regulated by its juxta-TM4 domain. It is of interest to define the mechanism of this ''switch.'' For example, the Cx40.8 ''b'' sequence may interact with a hypothetical retention factor in the Golgi apparatus, preventing it from trafficking to the plasma membrane. Association between the retention factor and Cx40.8 may be reduced at the completion of regeneration, allowing the synthesized Cx40.8 to move to the plasma membrane. Once located at the plasma membrane, we suggest that Cx40.8 negatively influences Cx43 activity, contributing to reduced levels of cell proliferation associated with ontogenetic growth. It remains unclear if Cx40.8 forms homomeric heterotypic gap junction channels with Cx43 in vivo, and/ or if Cx40.8 and Cx43 also hetero-oligomerize in common connexons that are initially retained in the Golgi. Both newly translated Cx43 and Cx40.8 must travel through the Golgi apparatus during fin regeneration. We have not identified a large pool of Golgi-retained Cx43 by immunofluorescence, however this does not preclude the possibility that a small portion of Cx43 is retained with newly assembled Cx40.8 connexons. Biochemical analyses will be required to determine the composition of the connexons and gap junction channels in vivo. In conclusion, we find that Cx40.8 exhibits an unusual change in subcellular localization depending on the growth state of the zebrafish fin. Localization appears to depend on its juxta-TM4 domain, which may represent a common domain for the regulation of connexin trafficking (i.e. albeit via different mechanisms). Continued analyses will define the novel mechanisms of regulating both Cx40.8 protein location and Cx40.8dependent regulation of Cx43 activity. Statement on the ethical treatment of animals This study was carried out in strict accordance with the recommendations in the Guide for the Care and Use of Laboratory Animals of the National Institutes of Health. The protocols used for this manuscript were approved by Lehigh's Institutional Animal Care and Use Committee (IACUC) (identification #88, approved 6-3-2011). Lehigh University's Animal Welfare Assurance Number is A-3877-01. Fish maintenance The fish used in this study were derived from the C32 strain and were raised in a 14 light:10 dark photoperiod at 25uC. Tg(bact:galt-gfp) zebrafish were generated using Invitrogen Gateway technology to fuse amino acids 1-6 from human B4GALT1 with GFP under the control of the beta-actin promoter and inserted into the zebrafish genome using sites derived from the tol2 transposon. Lines were maintained on the TAB14 background. Immunoblots and Cx40.8 antibody Amino acids 269-285 (CSAPVPNLGYNLDTVDK) of zebrafish Cx40.8 were chosen as the antigen in conjunction with Quality Controlled Biochemicals (www.qcb.com). QCB completed peptide synthesis, immunization, rabbit maintenance, and affinity purifications of bleeds. Escherichia coli lysates expressing GST-Cx40.8CT fusion protein were grown to confluency before adding 0.3 mM IPTG to induce protein expression. Lysates were prepared using 50 mg/ml lysozyme in lysis buffer (100 mM Tris-HCl pH 7.5,50 mM NaCl, 10 mM EDTA pH 8.0, complete protease inhibitor cocktail, Roche). In addition, 2.2 N NaOH and 8% BME were added to the mixture. Total protein was precipitated using TCA and pellets were resuspended in SDS buffer. Samples were diluted in SDS buffer and decreasing volumes of sample were loaded in a total volume of 20 ml. For the antibody competition, identical gels were prepared. The anti-Cx40.8 antibody was either used directly (1:2000) or following preincubation with the peptide made as the Cx40.8 antigen. Wildtype fins (5 dpa regenerates) were homogenized in homogenization buffer (5 mM Tris-HCl, 5 mM EDTA, 5 mM EGTA pH 8.0, 0.1 mM PEFABLOC, 1 mM Na3VO4, 1 mM Na 3 VO 4, protease inhibitor cocktail) using a 5 mm generator (Pro 200 homogenizer, ProScientific, Rockford, IL). Protein samples were separated using 12% SDS-PAGE before transfer to nitrocellulose membranes. Following transfer, blots were rinsed in 40% isopropanol, rinsed in distilled water, and then blocked in 5% milk in SuperTBST for 30 min at room temperature. Blots were then incubated with anti-Cx40. 8 (1:2000) for 1 hr at room temperature, rinsed for 40 min in TBST, and then incubated with peroxidase-conjugated goat anti-rabbit IgG (1:250,000, pre-absorbed with fin tissue, Thermo Scientific, Rockford, IL) for 1 hr at room temperature. Following incubation, blots were rinsed in TBST for 40 min at room temperature. Using the Amersham ECL Plus Western Blotting Detection System (GE Healthcare, UK), blots were developed and exposed to X-ray film (CL-XPosure film, Thermo Scientific, Rockford, IL). Immunofluorescence and confocal microscopy Wildtype fins (9-12 months for ontogenetic fins, or 5 dpa regenerates) were harvested and fixed in 2% PFA in 0. In the experiments with Brefeldin A (BioLegend, San Diego, CA), 70 nl of a 10 mg/ml solution was injected into the dorsal fin rays of the regenerating caudal fin. After 2 hours, fins were harvested and processed as above. TO-PRO3 (Molecular probes) was added at 1:1000 with the secondary antibodies. Laser scanning confocal imaging was performed on whole fins. Images were acquired using a 40X N.A. 1.4 PlanApo DIC objective on an inverted microscope (Axiovert 200 M, Carl Zeiss, Jena, Germany) equipped with an LSM510META scan head. Argon ion, 543 HeNe, and 633 HeNe (far red) lasers were used to generate the excitation lines and multitrack sequential excitation was utilized to avoid bleedthrough between fluorophores. Files were exported as TIFF files. Plasmid construction and transient transfection The Cx43-EGFP, Cx43-mApple and Cx40.8-EGFP were previously described. The constructs in which internal domains were swapped (i.e. Cx43-bCD, Cx40.8Bcd, Cx43-BcD, Cx40.8-bCd, Cx43-BCd, Cx40.8-bcD) were generated by Genewiz (http://www.genewiz.com/). Cx43-bcd, Cx40.8-BCD, Cx40.8-cd, Cx43-bBCD, and Cx43BbCD were all generated by a common strategy using two sequential rounds of PCR. For example, Cx43-bcd was generated as follows. Two chimeric internal oligos were generated. The first internal oligo shared 20 bases of 39 complementarity to the Cx43-TM4 followed by 20 bases of complementarity to the start of the Cx40.8 carboxy tail. When paired with a 59 oligo specific to the first 20 bases of the Cx43 coding sequence (and using Cx43-EGFP plasmid as template), the first half of Cx43 was amplified through the end of TM4, with the first 20 bp of Cx40.8 as an overhang. The second internal oligo had a 59 overhang of the final 20 bases of Cx43-TM4 followed by the first 20 bases of the Cx40.8 carboxy tail. When paired with a 39 oligo specific to the final 20 bases of Cx40.8 (but not the stop codon), and using Cx40.8-EGFP plasmid as template, the carboxy tail of Cx40.8 with the last 20 bp of Cx43-TM4 as an overhang is amplified. Together, these two products (sharing 40 bases of overlap across TM4 and the start of the carboxy tail) served as template for the next PCR reaction. Using the 'outside' oligos for amplification (i.e. the 59 cx43 oligo and the 39 cx40.8 oligo), a chimeric connexin of Cx43 through TM4 and the carboxy tail of Cx40.8 was generated. This final product was subcloned into pN1-EGFP and sequenced. The same strategy was used to generate Cx40.8-BCD, Cx40.8-cd, Cx43-bBCD, and Cx43BbCD. All internal oligos were HPLC-purified to insure that they were the correct length. The untagged constructs were generated by isolating the EcoRI fragments from their pN1-EGFP backbones. The EcoRI fragments were subcloned into the pIRES2 vector. Orientation was determined using a BamHI digest. HeLa and N2a cells (ATCC) were stored at 5% CO 2 and 37uC and grown in tissue culture dishes with minimal essential media supplemented with 10% FBS, antibiotics, and antimycotics (Invitrogen). The cells were seeded onto poly-L-lysine coverglasses, incubated overnight, then transfected with Superfect (Qiagen) for 3 hours using 2 mg of plasmid DNA and imaged 21-24 hours later. Transfections were evaluated by standard immunofluorescence on a Nikon Eclipse E80 microscope. For double transfections, 1 mg of each plasmid was transfected. Analyses were completed on a Nikon Eclipse TE2000-U using the 1006 lens in combination with a 1.56 optivar to increase the primary magnification. Dual whole cell patch clamping For dual whole cell voltage clamp recording, the poly-L-lysine cover glass was placed into a chamber at room temperature perfused with oxygenated extracellular solution (containing in mM: 135 NaCl, 5 KCl, 2 CsCl, 2 CaCl2, 1 MgCl2, 1 BaCl2, 5 dextrose, 5 HEPES, and 2 pyruvate, pH 7.2-7.4). N2a cells were imaged on a Nikon (EF-4) Physiostation equipped with epifluorescence and infra red differential interference contrast optics. GFP positive cell pairs expressing connexin constructs were located by fluorescence and imaged using a Hammamatsu C5700 video camera (Hammamatsu City, Japan). Cells contacting multiple GFP positive neighbors were excluded. Patch pipettes were pulled from thick walled borosilicate glass capillary tubes (WPI 1B120F-4) using a two-stage puller (Narishige PC-10, Tokyo, Japan) to a resistance of 4-6 MV when back-filled with internal solution (containing in mM: 125 CsCl, 0.5 CaCl2, 10 EGTA, and 10 HEPES, pH 7.2). Patch pipettes were then brought into contact with cells using motorized micromanipulators (Model 7500, Siskiyou Instruments) and gigaohm seals were established. Whole cell configuration was achieved and cells were initially voltage clamped to 0 mV using a Multiclamp 700B amplifier (Molecular Devices, Sunnyvale, CA). Series resistance was compensated at 60-80%. The signal was filtered at 1-2 kHz and digitized at 10 kHz with a Digidata 1440 data acquisition board. Recording protocols were generated using Clampex 10.2 software (Molecular Devices, Sunnyvale, CA). Voltage clamp methods followed. Transjunctional potential (V j ) was varied up to 6180 mV in steps of 30 mV. Step duration was either 400 ms or 4 s. Recordings were analyzed using Clampex 10.2 software. Transjunctional conductance values were calculated from mean transjuctional current (I j ) amplitudes from a 15 ms window measured at 5 ms after pulse onset. Steady state G j was computed from I j measured at 5 ms before the termination of the pulse. G j was maximal and generally linear at voltages,60 mV so steady state G j was normalized to the conductance value calculated at 630 mV. Data in the results text are expressed as percent of maximum G j 6 SD. Error bars in figures represent SE. Figure S1 Cx43-mApple and Cx40.8-EGFP co-assemble in common gap junction channels. High resolution fluorescence microscopy was used to provide evidence for co-association of Cx43-mApple and Cx40.8-EGFP in common gap junction channels. Plane views are shown. Top: In HeLa cells cotransfected with Hs-Cx43-EGFP and Hs-Cx43-mApple, both green and red plaques completely overlap. Middle: In HeLa cells co-transfected with Hs-Cx26-GFP and Hs-Cx43-mApple, discrete domains of green and red plaques are observed. Bottom: In HeLa cells co-transfected with Dr-Cx40.8-EGFP and Dr-Cx43-mApple, both green and red plaques completely overlap. (TIF)
/** * Autogenerated Code. Changes here will be automatically overwritten. * * @author Andre Kutzleb */ public class TopicToString { public static String toString(int[] topic) { if (topic.length == 0) { return "*"; } StringBuilder builder = new StringBuilder(); int indexReached = 0; switch (topic[0]) { case 0x01: builder.append("TO"); indexReached = 0; if (topic.length == 1) { break; } switch (topic[1]) { case 0x00: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0x00: builder.append(".SWITCH_ADAPTER"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { default: builder.append(".[" + String.format("%02x", topic[3])); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { default: builder.append(":" + String.format("%02x", topic[4])); indexReached = 4; if (topic.length == 5) { break; } switch (topic[5]) { default: builder.append(":" + String.format("%02x", topic[5])); indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { default: builder.append(":" + String.format("%02x", topic[6])); indexReached = 6; if (topic.length == 7) { break; } switch (topic[7]) { default: builder.append(":" + String.format("%02x", topic[7])); indexReached = 7; if (topic.length == 8) { break; } switch (topic[8]) { default: builder.append(":" + String.format("%02x", topic[8])); indexReached = 8; if (topic.length == 9) { break; } switch (topic[9]) { default: builder.append(":" + String.format("%02x", topic[9])); indexReached = 9; if (topic.length == 10) { break; } switch (topic[10]) { default: builder.append(":" + String.format("%02x", topic[10])); builder.append("]->(SWITCH_INSTANCE)"); indexReached = 10; if (topic.length == 11) { break; } switch (topic[11]) { case 0x00: builder.append(".OPENFLOW"); indexReached = 11; if (topic.length == 12) { break; } switch (topic[12]) { case 0x00: builder.append(".HELLO"); indexReached = 12; break; case 0x20: builder.append(".REQUESTFORWARD"); indexReached = 12; break; case 0x01: builder.append(".ERROR"); indexReached = 12; break; case 0x21: builder.append(".BUNDLE_CONTROL"); indexReached = 12; break; case 0x02: builder.append(".ECHO_REQUEST"); indexReached = 12; break; case 0x22: builder.append(".BUNDLE_ADD_MESSAGE"); indexReached = 12; break; case 0x03: builder.append(".ECHO_REPLY"); indexReached = 12; break; case 0x04: builder.append(".EXPERIMENTER"); indexReached = 12; break; case 0x05: builder.append(".FEATURES_REQUEST"); indexReached = 12; break; case 0x07: builder.append(".GET_CONFIG_REQUEST"); indexReached = 12; break; case 0x09: builder.append(".SET_CONFIG"); indexReached = 12; break; case 0x0d: builder.append(".PACKET_OUT"); indexReached = 12; break; case 0x0e: builder.append(".FLOW_MOD"); indexReached = 12; break; case 0x0f: builder.append(".GROUP_MOD"); indexReached = 12; break; case 0x10: builder.append(".PORT_MOD"); indexReached = 12; break; case 0x11: builder.append(".TABLE_MOD"); indexReached = 12; break; case 0x12: builder.append(".MULTIPART_REQUEST"); indexReached = 12; break; case 0x14: builder.append(".BARRIER_REQUEST"); indexReached = 12; break; case 0x16: builder.append(".ROLE_REQUEST"); indexReached = 12; break; case 0x18: builder.append(".GET_ASYNC_REQUEST"); indexReached = 12; break; case 0x1a: builder.append(".SET_ASYNC"); indexReached = 12; break; case 0x1b: builder.append(".METER_MOD"); indexReached = 12; break; default: builder.append(".[" + String.format("%02x", topic[12])); builder.append("]->(CUSTOM_MESSAGETYPE)"); indexReached = 12; break; } break; } break; } break; } break; } break; } break; } break; } break; } break; } break; } break; case 0xff: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0xf2: builder.append(".EXAMPLE_MODULE_A"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".SOME_EVENT"); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { default: builder.append(".[" + String.format("%02x", topic[4])); indexReached = 4; if (topic.length == 5) { break; } switch (topic[5]) { default: builder.append(":" + String.format("%02x", topic[5])); indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { default: builder.append(":" + String.format("%02x", topic[6])); indexReached = 6; if (topic.length == 7) { break; } switch (topic[7]) { default: builder.append(":" + String.format("%02x", topic[7])); indexReached = 7; if (topic.length == 8) { break; } switch (topic[8]) { default: builder.append(":" + String.format("%02x", topic[8])); indexReached = 8; if (topic.length == 9) { break; } switch (topic[9]) { default: builder.append(":" + String.format("%02x", topic[9])); indexReached = 9; if (topic.length == 10) { break; } switch (topic[10]) { default: builder.append(":" + String.format("%02x", topic[10])); indexReached = 10; if (topic.length == 11) { break; } switch (topic[11]) { default: builder.append(":" + String.format("%02x", topic[11])); builder.append("]->(TO_INSTANCE_ID)"); indexReached = 11; break; } break; } break; } break; } break; } break; } break; } break; } break; case 0x01: builder.append(".ANOTHER_EVENT"); indexReached = 3; break; case 0x02: builder.append(".SOME_REQUEST"); indexReached = 3; break; } break; case 0xf3: builder.append(".EXAMPLE_MODULE_B"); indexReached = 2; break; } break; } break; case 0x02: builder.append("FROM"); indexReached = 0; if (topic.length == 1) { break; } switch (topic[1]) { case 0x00: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0x00: builder.append(".SWITCH_ADAPTER"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".OPENFLOW"); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { case 0x00: builder.append(".HELLO"); indexReached = 4; break; case 0x20: builder.append(".REQUESTFORWARD"); indexReached = 4; break; case 0x01: builder.append(".ERROR"); indexReached = 4; break; case 0x02: builder.append(".ECHO_REQUEST"); indexReached = 4; break; case 0x03: builder.append(".ECHO_REPLY"); indexReached = 4; break; case 0x23: builder.append(".CONTROLLER_STATUS"); indexReached = 4; break; case 0x04: builder.append(".EXPERIMENTER"); indexReached = 4; break; case 0x06: builder.append(".FEATURES_REPLY"); indexReached = 4; break; case 0x08: builder.append(".GET_CONFIG_REPLY"); indexReached = 4; break; case 0x0a: builder.append(".PACKET_IN"); indexReached = 4; if (topic.length == 5) { break; } switch (topic[5]) { case 0x60: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x03: builder.append(".DECNET_PHASE_IV"); indexReached = 6; break; } break; case 0x80: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0xf3: builder.append(".APPLETALK_ADDRESS_RESOLUTION_PROTOCOL_AARP"); indexReached = 6; break; case 0x35: builder.append(".REVERSE_ADDRESS_RESOLUTION_PROTOCOL"); indexReached = 6; break; case 0x9b: builder.append(".APPLETALK_ETHERTALK"); indexReached = 6; break; } break; case 0x90: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x00: builder.append(".ETHERNET_CONFIGURATION_TESTING_PROTOCOL"); indexReached = 6; break; } break; case 0x81: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x00: builder.append( ".VLAN_TAGGED_FRAME_IEEE_802_1Q_SHORTEST_PATH_BRIDGING_IEEE_802_1AQ"); indexReached = 6; break; case 0x37: builder.append(".IPX_1"); indexReached = 6; break; case 0x38: builder.append(".IPX_2"); indexReached = 6; break; } break; case 0x22: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0xf0: builder.append(".AUDIO_VIDEO_TRANSPORT_PROTOCOL_AS_DEFINED_IN_IEEE_STD_1722_2011"); indexReached = 6; break; case 0xf3: builder.append(".IETF_TRILL_PROTOCOL"); indexReached = 6; break; } break; case 0x82: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x04: builder.append(".QNX_QNET"); indexReached = 6; break; } break; case 0x86: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0xdd: builder.append(".IPV6"); indexReached = 6; if (topic.length == 7) { break; } switch (topic[7]) { case 0x00: builder.append(".HOPOPT"); indexReached = 7; break; case 0x01: builder.append(".ICMP"); indexReached = 7; break; case 0x02: builder.append(".IGMP"); indexReached = 7; break; case 0x03: builder.append(".GGP"); indexReached = 7; break; case 0x04: builder.append(".IP_IN_IP"); indexReached = 7; break; case 0x05: builder.append(".ST"); indexReached = 7; break; case 0x06: builder.append(".TCP"); indexReached = 7; break; case 0x07: builder.append(".CBT"); indexReached = 7; break; case 0x08: builder.append(".EGP"); indexReached = 7; break; case 0x09: builder.append(".IGP"); indexReached = 7; break; case 0x0a: builder.append(".BBN_RCC_MON"); indexReached = 7; break; case 0x0b: builder.append(".NVP_II"); indexReached = 7; break; case 0x0c: builder.append(".PUP"); indexReached = 7; break; case 0x0d: builder.append(".ARGUS"); indexReached = 7; break; case 0x0e: builder.append(".EMCON"); indexReached = 7; break; case 0x0f: builder.append(".XNET"); indexReached = 7; break; case 0x10: builder.append(".CHAOS"); indexReached = 7; break; case 0x11: builder.append(".UDP"); indexReached = 7; break; case 0x12: builder.append(".MUX"); indexReached = 7; break; case 0x13: builder.append(".DCN_MEAS"); indexReached = 7; break; case 0x14: builder.append(".HMP"); indexReached = 7; break; case 0x15: builder.append(".PRM"); indexReached = 7; break; case 0x16: builder.append(".XNS_IDP"); indexReached = 7; break; case 0x17: builder.append(".TRUNK_1"); indexReached = 7; break; case 0x18: builder.append(".TRUNK_2"); indexReached = 7; break; case 0x19: builder.append(".LEAF_1"); indexReached = 7; break; case 0x1a: builder.append(".LEAF_2"); indexReached = 7; break; case 0x1b: builder.append(".RDP"); indexReached = 7; break; case 0x1c: builder.append(".IRTP"); indexReached = 7; break; case 0x1d: builder.append(".ISO_TP4"); indexReached = 7; break; case 0x1e: builder.append(".NETBLT"); indexReached = 7; break; case 0x1f: builder.append(".MFE_NSP"); indexReached = 7; break; case 0x20: builder.append(".MERIT_INP"); indexReached = 7; break; case 0x21: builder.append(".DCCP"); indexReached = 7; break; case 0x22: builder.append("._3PC"); indexReached = 7; break; case 0x23: builder.append(".IDPR"); indexReached = 7; break; case 0x24: builder.append(".XTP"); indexReached = 7; break; case 0x25: builder.append(".DDP"); indexReached = 7; break; case 0x26: builder.append(".IDPR_CMTP"); indexReached = 7; break; case 0x27: builder.append(".TPPP"); indexReached = 7; break; case 0x28: builder.append(".IL"); indexReached = 7; break; case 0x29: builder.append(".IPV6_ENCAP"); indexReached = 7; break; case 0x2a: builder.append(".SDRP"); indexReached = 7; break; case 0x2b: builder.append(".IPV6_ROUTE"); indexReached = 7; break; case 0x2c: builder.append(".IPV6_FRAG"); indexReached = 7; break; case 0x2d: builder.append(".IDRP"); indexReached = 7; break; case 0x2e: builder.append(".RSVP"); indexReached = 7; break; case 0x2f: builder.append(".GRE"); indexReached = 7; break; case 0x30: builder.append(".MHRP"); indexReached = 7; break; case 0x31: builder.append(".BNA"); indexReached = 7; break; case 0x32: builder.append(".ESP"); indexReached = 7; break; case 0x33: builder.append(".AH"); indexReached = 7; break; case 0x34: builder.append(".I_NLSP"); indexReached = 7; break; case 0x35: builder.append(".SWIPE"); indexReached = 7; break; case 0x36: builder.append(".NARP"); indexReached = 7; break; case 0x37: builder.append(".MOBILE"); indexReached = 7; break; case 0x38: builder.append(".TLSP"); indexReached = 7; break; case 0x39: builder.append(".SKIP"); indexReached = 7; break; case 0x3a: builder.append(".IPV6_ICMP"); indexReached = 7; break; case 0x3b: builder.append(".IPV6_NONXT"); indexReached = 7; break; case 0x3c: builder.append(".IPV6_OPTS"); indexReached = 7; break; case 0x3d: builder.append(".ANY_HOST_INTERNAL_PROTOCOL"); indexReached = 7; break; case 0x3e: builder.append(".CFTP"); indexReached = 7; break; case 0x3f: builder.append(".ANY_LOCAL_NETWORK"); indexReached = 7; break; case 0x40: builder.append(".SAT_EXPAK"); indexReached = 7; break; case 0x41: builder.append(".KRYPTOLAN"); indexReached = 7; break; case 0x42: builder.append(".RVD"); indexReached = 7; break; case 0x43: builder.append(".IPPC"); indexReached = 7; break; case 0x44: builder.append(".ANY_DISTRIBUTED_FILE_SYSTEM"); indexReached = 7; break; case 0x45: builder.append(".SAT_MON"); indexReached = 7; break; case 0x46: builder.append(".VISA"); indexReached = 7; break; case 0x47: builder.append(".IPCU"); indexReached = 7; break; case 0x48: builder.append(".CPNX"); indexReached = 7; break; case 0x49: builder.append(".CPHB"); indexReached = 7; break; case 0x4a: builder.append(".WSN"); indexReached = 7; break; case 0x4b: builder.append(".PVP"); indexReached = 7; break; case 0x4c: builder.append(".BR_SAT_MON"); indexReached = 7; break; case 0x4d: builder.append(".SUN_ND"); indexReached = 7; break; case 0x4e: builder.append(".WB_MON"); indexReached = 7; break; case 0x4f: builder.append(".WB_EXPAK"); indexReached = 7; break; case 0x50: builder.append(".ISO_IP"); indexReached = 7; break; case 0x51: builder.append(".VMTP"); indexReached = 7; break; case 0x52: builder.append(".SECURE_VMTP"); indexReached = 7; break; case 0x53: builder.append(".VINES"); indexReached = 7; break; case 0x54: builder.append(".TTP"); indexReached = 7; break; case 0x55: builder.append(".NSFNET_IGP"); indexReached = 7; break; case 0x56: builder.append(".DGP"); indexReached = 7; break; case 0x57: builder.append(".TCF"); indexReached = 7; break; case 0x58: builder.append(".EIGRP"); indexReached = 7; break; case 0x59: builder.append(".OSPF"); indexReached = 7; break; case 0x5a: builder.append(".SPRITE_RPC"); indexReached = 7; break; case 0x5b: builder.append(".LARP"); indexReached = 7; break; case 0x5c: builder.append(".MTP"); indexReached = 7; break; case 0x5d: builder.append(".AX_25"); indexReached = 7; break; case 0x5e: builder.append(".IPIP"); indexReached = 7; break; case 0x5f: builder.append(".MICP"); indexReached = 7; break; case 0x60: builder.append(".SCC_SP"); indexReached = 7; break; case 0x61: builder.append(".ETHERIP"); indexReached = 7; break; case 0x62: builder.append(".ENCAP"); indexReached = 7; break; case 0x63: builder.append(".ANY_PRIVATE_ENCRYPTION_SCHEME"); indexReached = 7; break; case 0x64: builder.append(".GMTP"); indexReached = 7; break; case 0x65: builder.append(".IFMP"); indexReached = 7; break; case 0x66: builder.append(".PNNI"); indexReached = 7; break; case 0x67: builder.append(".PIM"); indexReached = 7; break; case 0x68: builder.append(".ARIS"); indexReached = 7; break; case 0x69: builder.append(".SCPS"); indexReached = 7; break; case 0x6a: builder.append(".QNX"); indexReached = 7; break; case 0x6b: builder.append(".A_N"); indexReached = 7; break; case 0x6c: builder.append(".IPCOMP"); indexReached = 7; break; case 0x6d: builder.append(".SNP"); indexReached = 7; break; case 0x6e: builder.append(".COMPAQ_PEER"); indexReached = 7; break; case 0x6f: builder.append(".IPX_IN_IP"); indexReached = 7; break; case 0x70: builder.append(".VRRP"); indexReached = 7; break; case 0x71: builder.append(".PGM"); indexReached = 7; break; case 0x72: builder.append(".ANY_0_HOP_PROTOCOL"); indexReached = 7; break; case 0x73: builder.append(".L2TP"); indexReached = 7; break; case 0x74: builder.append(".DDX"); indexReached = 7; break; case 0x75: builder.append(".IATP"); indexReached = 7; break; case 0x76: builder.append(".STP"); indexReached = 7; break; case 0x77: builder.append(".SRP"); indexReached = 7; break; case 0x78: builder.append(".UTI"); indexReached = 7; break; case 0x79: builder.append(".SMP"); indexReached = 7; break; case 0x7a: builder.append(".SM"); indexReached = 7; break; case 0x7b: builder.append(".PTP"); indexReached = 7; break; case 0x7c: builder.append(".IS_IS_OVER_IPV4"); indexReached = 7; break; case 0x7d: builder.append(".FIRE"); indexReached = 7; break; case 0x7e: builder.append(".CRTP"); indexReached = 7; break; case 0x7f: builder.append(".CRUDP"); indexReached = 7; break; case 0x80: builder.append(".SSCOPMCE"); indexReached = 7; break; case 0x81: builder.append(".IPLT"); indexReached = 7; break; case 0x82: builder.append(".SPS"); indexReached = 7; break; case 0x83: builder.append(".PIPE"); indexReached = 7; break; case 0x84: builder.append(".SCTP"); indexReached = 7; break; case 0x85: builder.append(".FC"); indexReached = 7; break; case 0x86: builder.append(".RSVP_E2E_IGNORE"); indexReached = 7; break; case 0x87: builder.append(".MOBILITY_HEADER"); indexReached = 7; break; case 0x88: builder.append(".UDPLITE"); indexReached = 7; break; case 0x89: builder.append(".MPLS_IN_IP"); indexReached = 7; break; case 0x8a: builder.append(".MANET"); indexReached = 7; break; case 0x8b: builder.append(".HIP"); indexReached = 7; break; case 0x8c: builder.append(".SHIM6"); indexReached = 7; break; case 0x8d: builder.append(".WESP"); indexReached = 7; break; case 0x8e: builder.append(".ROHC"); indexReached = 7; break; case 0xfd: builder.append(".USE_FOR_EXPERIMENTATION_AND_TESTING_0XFD"); indexReached = 7; break; case 0xfe: builder.append(".USE_FOR_EXPERIMENTATION_AND_TESTING_0XFE"); indexReached = 7; break; case 0xff: builder.append(".RESERVED"); indexReached = 7; break; default: builder.append(".[" + String.format("%02x", topic[7])); builder.append("]->(CUSTOM)"); indexReached = 7; break; } break; } break; case 0x08: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x00: builder.append(".IPV4"); indexReached = 6; if (topic.length == 7) { break; } switch (topic[7]) { case 0x00: builder.append(".HOPOPT"); indexReached = 7; break; case 0x01: builder.append(".ICMP"); indexReached = 7; break; case 0x02: builder.append(".IGMP"); indexReached = 7; break; case 0x03: builder.append(".GGP"); indexReached = 7; break; case 0x04: builder.append(".IP_IN_IP"); indexReached = 7; break; case 0x05: builder.append(".ST"); indexReached = 7; break; case 0x06: builder.append(".TCP"); indexReached = 7; break; case 0x07: builder.append(".CBT"); indexReached = 7; break; case 0x08: builder.append(".EGP"); indexReached = 7; break; case 0x09: builder.append(".IGP"); indexReached = 7; break; case 0x0a: builder.append(".BBN_RCC_MON"); indexReached = 7; break; case 0x0b: builder.append(".NVP_II"); indexReached = 7; break; case 0x0c: builder.append(".PUP"); indexReached = 7; break; case 0x0d: builder.append(".ARGUS"); indexReached = 7; break; case 0x0e: builder.append(".EMCON"); indexReached = 7; break; case 0x0f: builder.append(".XNET"); indexReached = 7; break; case 0x10: builder.append(".CHAOS"); indexReached = 7; break; case 0x11: builder.append(".UDP"); indexReached = 7; break; case 0x12: builder.append(".MUX"); indexReached = 7; break; case 0x13: builder.append(".DCN_MEAS"); indexReached = 7; break; case 0x14: builder.append(".HMP"); indexReached = 7; break; case 0x15: builder.append(".PRM"); indexReached = 7; break; case 0x16: builder.append(".XNS_IDP"); indexReached = 7; break; case 0x17: builder.append(".TRUNK_1"); indexReached = 7; break; case 0x18: builder.append(".TRUNK_2"); indexReached = 7; break; case 0x19: builder.append(".LEAF_1"); indexReached = 7; break; case 0x1a: builder.append(".LEAF_2"); indexReached = 7; break; case 0x1b: builder.append(".RDP"); indexReached = 7; break; case 0x1c: builder.append(".IRTP"); indexReached = 7; break; case 0x1d: builder.append(".ISO_TP4"); indexReached = 7; break; case 0x1e: builder.append(".NETBLT"); indexReached = 7; break; case 0x1f: builder.append(".MFE_NSP"); indexReached = 7; break; case 0x20: builder.append(".MERIT_INP"); indexReached = 7; break; case 0x21: builder.append(".DCCP"); indexReached = 7; break; case 0x22: builder.append("._3PC"); indexReached = 7; break; case 0x23: builder.append(".IDPR"); indexReached = 7; break; case 0x24: builder.append(".XTP"); indexReached = 7; break; case 0x25: builder.append(".DDP"); indexReached = 7; break; case 0x26: builder.append(".IDPR_CMTP"); indexReached = 7; break; case 0x27: builder.append(".TPPP"); indexReached = 7; break; case 0x28: builder.append(".IL"); indexReached = 7; break; case 0x29: builder.append(".IPV6_ENCAP"); indexReached = 7; break; case 0x2a: builder.append(".SDRP"); indexReached = 7; break; case 0x2b: builder.append(".IPV6_ROUTE"); indexReached = 7; break; case 0x2c: builder.append(".IPV6_FRAG"); indexReached = 7; break; case 0x2d: builder.append(".IDRP"); indexReached = 7; break; case 0x2e: builder.append(".RSVP"); indexReached = 7; break; case 0x2f: builder.append(".GRE"); indexReached = 7; break; case 0x30: builder.append(".MHRP"); indexReached = 7; break; case 0x31: builder.append(".BNA"); indexReached = 7; break; case 0x32: builder.append(".ESP"); indexReached = 7; break; case 0x33: builder.append(".AH"); indexReached = 7; break; case 0x34: builder.append(".I_NLSP"); indexReached = 7; break; case 0x35: builder.append(".SWIPE"); indexReached = 7; break; case 0x36: builder.append(".NARP"); indexReached = 7; break; case 0x37: builder.append(".MOBILE"); indexReached = 7; break; case 0x38: builder.append(".TLSP"); indexReached = 7; break; case 0x39: builder.append(".SKIP"); indexReached = 7; break; case 0x3a: builder.append(".IPV6_ICMP"); indexReached = 7; break; case 0x3b: builder.append(".IPV6_NONXT"); indexReached = 7; break; case 0x3c: builder.append(".IPV6_OPTS"); indexReached = 7; break; case 0x3d: builder.append(".ANY_HOST_INTERNAL_PROTOCOL"); indexReached = 7; break; case 0x3e: builder.append(".CFTP"); indexReached = 7; break; case 0x3f: builder.append(".ANY_LOCAL_NETWORK"); indexReached = 7; break; case 0x40: builder.append(".SAT_EXPAK"); indexReached = 7; break; case 0x41: builder.append(".KRYPTOLAN"); indexReached = 7; break; case 0x42: builder.append(".RVD"); indexReached = 7; break; case 0x43: builder.append(".IPPC"); indexReached = 7; break; case 0x44: builder.append(".ANY_DISTRIBUTED_FILE_SYSTEM"); indexReached = 7; break; case 0x45: builder.append(".SAT_MON"); indexReached = 7; break; case 0x46: builder.append(".VISA"); indexReached = 7; break; case 0x47: builder.append(".IPCU"); indexReached = 7; break; case 0x48: builder.append(".CPNX"); indexReached = 7; break; case 0x49: builder.append(".CPHB"); indexReached = 7; break; case 0x4a: builder.append(".WSN"); indexReached = 7; break; case 0x4b: builder.append(".PVP"); indexReached = 7; break; case 0x4c: builder.append(".BR_SAT_MON"); indexReached = 7; break; case 0x4d: builder.append(".SUN_ND"); indexReached = 7; break; case 0x4e: builder.append(".WB_MON"); indexReached = 7; break; case 0x4f: builder.append(".WB_EXPAK"); indexReached = 7; break; case 0x50: builder.append(".ISO_IP"); indexReached = 7; break; case 0x51: builder.append(".VMTP"); indexReached = 7; break; case 0x52: builder.append(".SECURE_VMTP"); indexReached = 7; break; case 0x53: builder.append(".VINES"); indexReached = 7; break; case 0x54: builder.append(".TTP"); indexReached = 7; break; case 0x55: builder.append(".NSFNET_IGP"); indexReached = 7; break; case 0x56: builder.append(".DGP"); indexReached = 7; break; case 0x57: builder.append(".TCF"); indexReached = 7; break; case 0x58: builder.append(".EIGRP"); indexReached = 7; break; case 0x59: builder.append(".OSPF"); indexReached = 7; break; case 0x5a: builder.append(".SPRITE_RPC"); indexReached = 7; break; case 0x5b: builder.append(".LARP"); indexReached = 7; break; case 0x5c: builder.append(".MTP"); indexReached = 7; break; case 0x5d: builder.append(".AX_25"); indexReached = 7; break; case 0x5e: builder.append(".IPIP"); indexReached = 7; break; case 0x5f: builder.append(".MICP"); indexReached = 7; break; case 0x60: builder.append(".SCC_SP"); indexReached = 7; break; case 0x61: builder.append(".ETHERIP"); indexReached = 7; break; case 0x62: builder.append(".ENCAP"); indexReached = 7; break; case 0x63: builder.append(".ANY_PRIVATE_ENCRYPTION_SCHEME"); indexReached = 7; break; case 0x64: builder.append(".GMTP"); indexReached = 7; break; case 0x65: builder.append(".IFMP"); indexReached = 7; break; case 0x66: builder.append(".PNNI"); indexReached = 7; break; case 0x67: builder.append(".PIM"); indexReached = 7; break; case 0x68: builder.append(".ARIS"); indexReached = 7; break; case 0x69: builder.append(".SCPS"); indexReached = 7; break; case 0x6a: builder.append(".QNX"); indexReached = 7; break; case 0x6b: builder.append(".A_N"); indexReached = 7; break; case 0x6c: builder.append(".IPCOMP"); indexReached = 7; break; case 0x6d: builder.append(".SNP"); indexReached = 7; break; case 0x6e: builder.append(".COMPAQ_PEER"); indexReached = 7; break; case 0x6f: builder.append(".IPX_IN_IP"); indexReached = 7; break; case 0x70: builder.append(".VRRP"); indexReached = 7; break; case 0x71: builder.append(".PGM"); indexReached = 7; break; case 0x72: builder.append(".ANY_0_HOP_PROTOCOL"); indexReached = 7; break; case 0x73: builder.append(".L2TP"); indexReached = 7; break; case 0x74: builder.append(".DDX"); indexReached = 7; break; case 0x75: builder.append(".IATP"); indexReached = 7; break; case 0x76: builder.append(".STP"); indexReached = 7; break; case 0x77: builder.append(".SRP"); indexReached = 7; break; case 0x78: builder.append(".UTI"); indexReached = 7; break; case 0x79: builder.append(".SMP"); indexReached = 7; break; case 0x7a: builder.append(".SM"); indexReached = 7; break; case 0x7b: builder.append(".PTP"); indexReached = 7; break; case 0x7c: builder.append(".IS_IS_OVER_IPV4"); indexReached = 7; break; case 0x7d: builder.append(".FIRE"); indexReached = 7; break; case 0x7e: builder.append(".CRTP"); indexReached = 7; break; case 0x7f: builder.append(".CRUDP"); indexReached = 7; break; case 0x80: builder.append(".SSCOPMCE"); indexReached = 7; break; case 0x81: builder.append(".IPLT"); indexReached = 7; break; case 0x82: builder.append(".SPS"); indexReached = 7; break; case 0x83: builder.append(".PIPE"); indexReached = 7; break; case 0x84: builder.append(".SCTP"); indexReached = 7; break; case 0x85: builder.append(".FC"); indexReached = 7; break; case 0x86: builder.append(".RSVP_E2E_IGNORE"); indexReached = 7; break; case 0x87: builder.append(".MOBILITY_HEADER"); indexReached = 7; break; case 0x88: builder.append(".UDPLITE"); indexReached = 7; break; case 0x89: builder.append(".MPLS_IN_IP"); indexReached = 7; break; case 0x8a: builder.append(".MANET"); indexReached = 7; break; case 0x8b: builder.append(".HIP"); indexReached = 7; break; case 0x8c: builder.append(".SHIM6"); indexReached = 7; break; case 0x8d: builder.append(".WESP"); indexReached = 7; break; case 0x8e: builder.append(".ROHC"); indexReached = 7; break; case 0xfd: builder.append(".USE_FOR_EXPERIMENTATION_AND_TESTING_0XFD"); indexReached = 7; break; case 0xfe: builder.append(".USE_FOR_EXPERIMENTATION_AND_TESTING_0XFE"); indexReached = 7; break; case 0xff: builder.append(".RESERVED"); indexReached = 7; break; default: builder.append(".[" + String.format("%02x", topic[7])); builder.append("]->(CUSTOM)"); indexReached = 7; break; } break; case 0x42: builder.append(".WAKE_ON_LAN"); indexReached = 6; break; case 0x06: builder.append(".ARP"); indexReached = 6; break; } break; case 0x88: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0xe1: builder.append(".HOMEPLUG_AV_MME"); indexReached = 6; break; case 0xa2: builder.append(".ATA_OVER_ETHERNET"); indexReached = 6; break; case 0x63: builder.append(".PPPOE_DISCOVERY_STAGE"); indexReached = 6; break; case 0xe3: builder.append(".MEDIA_REDUNDANCY_PROTOCOL_IEC62439_2"); indexReached = 6; break; case 0x64: builder.append(".PPPOE_SESSION_STAGE"); indexReached = 6; break; case 0xa4: builder.append(".ETHERCAT_PROTOCOL"); indexReached = 6; break; case 0xe5: builder.append(".MAC_SECURITY_IEEE_802_1AE"); indexReached = 6; break; case 0x47: builder.append(".MPLS_UNICAST"); indexReached = 6; break; case 0x08: builder.append(".ETHERNET_FLOW_CONTROL"); indexReached = 6; break; case 0x48: builder.append(".MPLS_MULTICAST"); indexReached = 6; break; case 0xa8: builder.append( ".PROVIDER_BRIDGING_IEEE_802_1AD_SHORTEST_PATH_BRIDGING_IEEE_802_LAQ"); indexReached = 6; break; case 0x09: builder.append(".SLOW_PROTOCOLS_IEEE_802_3"); indexReached = 6; break; case 0xab: builder.append(".ETHERNET_POWERLINK"); indexReached = 6; break; case 0xcc: builder.append(".LLDP"); indexReached = 6; break; case 0xcd: builder.append(".SERCOS_III"); indexReached = 6; break; case 0x8e: builder.append(".EAP_OVER_LAN_IEEE_802_1X"); indexReached = 6; break; case 0x70: builder.append(".JUMBO_FRAMES"); indexReached = 6; break; case 0x92: builder.append(".PROFINET_PROTOCOL"); indexReached = 6; break; case 0xf7: builder.append(".PTP_OVER_ETHERNET_IEEE_1588"); indexReached = 6; break; case 0x19: builder.append(".COBRANET"); indexReached = 6; break; case 0x9a: builder.append(".HYPERSCSI_SCSI_OVER_ETHERNET"); indexReached = 6; break; case 0x7b: builder.append(".HOMEPLUG_1_0_MME"); indexReached = 6; break; } break; case 0x89: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0x02: builder.append( ".IEEE_802_1AG_CONNECTIVITY_FAULT_MANAGEMENT_CFM_PROTOCOL_ITU_T_RECOMMENDATION_Y_1731_OAM"); indexReached = 6; break; case 0x14: builder.append(".FCOE_INITIALIZATION_PROTOCOL"); indexReached = 6; break; case 0x15: builder.append(".ROCE"); indexReached = 6; break; case 0x06: builder.append(".FCOE"); indexReached = 6; break; case 0x2f: builder.append(".HSR"); indexReached = 6; break; } break; case 0xca: indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { case 0xfe: builder.append(".LLT"); indexReached = 6; break; } break; default: builder.append(".[" + String.format("%02x", topic[5])); indexReached = 5; if (topic.length == 6) { break; } switch (topic[6]) { default: builder.append(":" + String.format("%02x", topic[6])); builder.append("]->(CUSTOM_PROTOCOL)"); indexReached = 6; break; } break; } break; case 0x0b: builder.append(".FLOW_REMOVED"); indexReached = 4; break; case 0x0c: builder.append(".PORT_STATUS"); indexReached = 4; break; case 0x13: builder.append(".MULTIPART_REPLY"); indexReached = 4; break; case 0x15: builder.append(".BARRIER_REPLY"); indexReached = 4; break; case 0x17: builder.append(".ROLE_REPLY"); indexReached = 4; break; case 0x19: builder.append(".GET_ASYNC_REPLY"); indexReached = 4; break; case 0x1e: builder.append(".ROLE_STATUS"); indexReached = 4; break; case 0x1f: builder.append(".TABLE_STATUS"); indexReached = 4; break; default: builder.append(".[" + String.format("%02x", topic[4])); builder.append("]->(CUSTOM_OPENFLOWTYPE)"); indexReached = 4; break; } break; } break; case 0x01: builder.append(".SWITCH_REGISTRY_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".SWITCH_EVENT"); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { case 0x00: builder.append(".ADDED"); indexReached = 4; break; case 0x01: builder.append(".REMOVED"); indexReached = 4; break; case 0x02: builder.append(".CHANGED"); indexReached = 4; break; } break; } break; case 0x02: builder.append(".DEVICE_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".DEVICE_EVENT"); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { case 0x00: builder.append(".ADDED"); indexReached = 4; break; case 0x01: builder.append(".REMOVED"); indexReached = 4; break; case 0x02: builder.append(".CHANGED"); indexReached = 4; break; } break; } break; case 0x06: builder.append(".TOPOLOGY_MODULE"); indexReached = 2; break; } break; case 0xff: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0xf2: builder.append(".EXAMPLE_MODULE_A"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".RANDOM_NUMBER"); indexReached = 3; if (topic.length == 4) { break; } switch (topic[4]) { case 0x00: builder.append(".ZERO_TO_TEN"); indexReached = 4; break; case 0x01: builder.append(".GREATER_TEN"); indexReached = 4; break; } break; } break; case 0xf3: builder.append(".EXAMPLE_MODULE_B"); indexReached = 2; break; } break; } break; case 0x03: builder.append("REQUEST"); indexReached = 0; if (topic.length == 1) { break; } switch (topic[1]) { case 0x00: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0x01: builder.append(".SWITCH_REGISTRY_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".GET_ALL_SWITCHES"); indexReached = 3; break; case 0x01: builder.append(".GET_SWITCH_BY_ID"); indexReached = 3; break; } break; case 0x02: builder.append(".DEVICE_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".GET_ALL_DEVICES"); indexReached = 3; break; case 0x01: builder.append(".GET_DEVICE_BY_MAC_ADDRESS"); indexReached = 3; break; case 0x02: builder.append(".GET_DEVICES_BY_FILTER"); indexReached = 3; break; } break; case 0x06: builder.append(".TOPOLOGY_MODULE"); indexReached = 2; break; } break; case 0xff: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0xf3: builder.append(".EXAMPLE_MODULE_B"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".SOME_REQUEST"); indexReached = 3; break; } break; } break; } break; case 0x04: builder.append("REPLY"); indexReached = 0; if (topic.length == 1) { break; } switch (topic[1]) { case 0x00: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0x01: builder.append(".SWITCH_REGISTRY_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".GET_ALL_SWITCHES"); indexReached = 3; break; case 0x01: builder.append(".GET_SWITCH_BY_ID"); indexReached = 3; break; } break; case 0x02: builder.append(".DEVICE_MODULE"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".GET_ALL_DEVICES"); indexReached = 3; break; case 0x01: builder.append(".GET_DEVICE_BY_MAC_ADDRESS"); indexReached = 3; break; case 0x02: builder.append(".GET_DEVICES_BY_FILTER"); indexReached = 3; break; } break; case 0x06: builder.append(".TOPOLOGY_MODULE"); indexReached = 2; break; } break; case 0xff: indexReached = 1; if (topic.length == 2) { break; } switch (topic[2]) { case 0xf3: builder.append(".EXAMPLE_MODULE_B"); indexReached = 2; if (topic.length == 3) { break; } switch (topic[3]) { case 0x00: builder.append(".SOME_REPLY"); indexReached = 3; break; } break; } break; } break; } for (int i = indexReached + 1; i < topic.length; i++) { builder.append("." + String.format("%02x", topic[i])); } return builder.toString(); } }
<reponame>smnalex/twilio-go package chat // Meta stores information about a current view of a request. type Meta struct { Page int `json:"page"` PageSize int `json:"page_size"` FirstPageURL string `json:"first_page_url"` PreviousPageURL string `json:"previous_page_url"` URL string `json:"url"` NextPageURL string `json:"next_page_url"` Key string `json:"key"` }