text:
"Communication in History" Contest
High school students Landon Stepp and Andrew Renegar were excited to find the September 20, 1943 issue of Life Magazine during their April 12 field trip to the Veterans History Museum of the Carolinas. These two sophomores are creating a 10-minute documentary for the national competition: "Communication in History: The Key to Understanding" for National History Day 2021. The mission of National History Day is "Engaging Students and Teachers in Historical Research & Skills Development." www.nhd.org
Stepp and Renegar had been researching the Life Magazine article and picture: "Three Dead Americans: How a Photograph Won WWII By Communicating the Casualties of War and Deepening Understanding of Home Front Morale." The picture was taken by Life Magazine photojournalist George Strock. Approval to print this picture had to go all the way to President Franklin D. Roosevelt.
The Life Magazine article (shown above) told the story of the Battle of Buna Beach (New Guinea) and was the first time pictures of war dead were shown to Americans. Before then, censors had used a heavy hand to prevent photos like this one from being shown.
The Actual 78-year-old Magazine Found
Students Stepp and Renegar had earlier seen a depiction of this article on the internet, never imagining they would ever get to see and hold the actual 78-year-old issue of Magazine. But with help from their teacher/headmaster Lisa Dillon, museum board member Larry Chapman, and curator Emmett Casciato, the students found the September 20, 1943 issue, which has famously been given credit for changing Americans' opinions about the war. The photo above shows them searching through hundreds of magazines. (The museum's library has a collection of 416 Life Magazines from 1939 through 1946.)
With 23 other freshmen and sophomores from Great Expectations Home School of Henderson and Buncombe Counties, they explored the museum's artifacts of World War I, World War II, the Korean War, the Vietnam War, and the Global War on Terror as a learning experience for their American History Studies.
The 25 students received first-hand stories of WWII in the museum's Merchant Marine gallery from WWII Merchant Marine Harold Wellington. Tour guides Ken Corn (war correspondent in Iraq), Ray Pavlik (U.S. Navy veteran in Vietnam), David Morrow (U.S. Navy Seabee in Vietnam), and Brevard College museum intern (history major) Sam Hipp (pictured with a student above) taught the students about the uniforms, artifacts, weapons, and stories given to the museum by veterans and their families.
School Headmaster Lisa Dillon said, "We're here to enable these students to learn by primary source analysis and critical thinking." To be able to learn from the people and their mementos who lived the history of America is a reason Dillon said she searched out this museum for her students.
The Veterans History Museum of the Carolinas welcomes student groups of all ages. Customized tours are available by contacting museum founder and curator Emmett Casciato at emmettcasciato@gmail.com or by calling the museum at 828-884-2141.
Please forward this email to any teachers you know who may be interested in bringing their students for a museum tour and "first source" history lesson.
Admission to the museum is free. The museum is open Thursday – Saturday from 11:00 am to 3:00 pm, and is located at 21 East Main Street (beside the court house) in Brevard. For more information and living histories of veterans, please visit www.theveteransmuseum.org.
Letter of Appreciation
Thank you so very much for coming in to give us a wonderful, private tour. I am so thrilled that I joined my son and his class to witness what a gem you have. Having a chance to talk with one on one veterans was definitely the highlight for the both of us. Being able to go through each room, ask questions and have the opportunities to hold special items gave us a unique experience of knowledge. We have spread the word and posted on social media. We will definitely be back soon for another visit where we have more time. Thank you for your time. A bigger thank you for your service!
Mandy Stepp (Mom of Landon)
Great Expectations Homeschool Co-op


text:
Q: How to open modal using dynamically added button? I am working on Html modal. I took the reference of the following link
jQuery hunterPopup Demo. I am trying to add buttons dynamically using JQuery which will further used to pop up modal. I used following code to add button dynamically.
$("#mainTable").append("<button  class='custom-samples-routes' id='popupReturn" + srNumber + "' style='height:30px'" + getRoute + "</button>");

I am having 3 buttons by default on screen and they pop up modal without any problem. The problem arises when I added button dynamically and tried to modal using this new button.
$(document).ready(function (e) {

    var popupEvent = function () {
    }
    $('.custom-samples-routes').hunterPopup({
        width: '380px',
        height: '270px',
        content: $('#tableContent'),
        event: popupEvent
    });
});

Where #tableContent is the id of the modal. How can I open modal using newly added button?

A: you can do it something like below.

var popupEvent = function() {
    alert("Hello")
}
var config = {
    width: '320px',
    height: '200px',
    title: "jQuery hunterPopup Demo",
    content: $('#tableContent'),
    event: popupEvent
}
var counter = 1;
$().ready(function(e) {

    $('#addnewDynamic').on('click', function() {
        debugger
        var _btn = $("<input/>", {
            type: "button",
            value: "Show popup",
            id: "btn_" + counter,
            class: "btn btn-success"
        })

        $("#container").append(_btn);
        $("#" + "btn_" + counter).hunterPopup(config);
        counter++;
    });

});
body { background-color:#34BC9D; font-family:'Roboto';}

<link href="https://www.jqueryscript.net/demo/Bootstrap-style-Popover-Plugin-For-jQuery-hunterPopup/css/hunterPopup.css" rel="stylesheet"/>
<link href="https://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">
        <link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<input type="button" id="addnewDynamic" value="Add New Button with Popup" style="margin: 20px 0 0 20px;" class="btn btn-default">

Sub Title

                        Item
                        Item
                        Item
                        Item

A: Attach listener to the document and check if it's element with class custom-samples-routes.

$(document).on('click', '.custom-samples-routes', function() {
  console.log('Listening')
});

$("#mainTable").append("<button class='custom-samples-routes'>Dynamic Button</button>");

  <button class="custom-samples-routes">Button 1</button>

A: Make sure that you bind the popup after you inject the button in the DOM. Your code should look something like:
$(document).ready(function (e) {

  // 1. inject button
  $("#mainTable").append("<Button class='custom-samples-routes' style='height:30px'>" + getRoute + "</Button>");

  // 2. bind popup
  var popupEvent = function () {}
  $('.custom-samples-routes').hunterPopup({
      width: '380px',
      height: '270px',
      content: $('#tableContent'),
      event: popupEvent
  });
});

Also, note that you have a couple typos in the code you posted which might also be a cause of error:

*

*There's a extra " at the end of the $("#mainTable").append().

*The button you inject has the class "samples-routes" and the label has "custom-samples-routes". It's probably safer to you the button for the event.

redpajama_set_name: RedPajamaStackExchange


¹ Roish Doon Edin, va'n preeu-valley soit ayns Sgàin as baljyn elley.
Va Reeriaght ny h-Albey (Gaelg Albinagh: Rìoghachd na h-Alba, Baarle Albinagh: Kinrick o Scotland, Baarle: Kingdom of Scotland) ny çheer ayns sheear hwoaie ny h-Oarpey veih'n vlein 843 derrey 1707. Va'n çheer soit ayns trass twoaie ellan ny Bretyn Mooar as va joarey thallooin da'n jiass eck lesh Reeriaght Hostyn. Rere çheoraghyn Aght yn Unnaneys ny bleeaney 1707, haink y daa heer ry-cheilley dy yannoo Reeriaght ny Bretyn Mooar. Veih 1482, ny yei haink y balley slystagh Berwick fo stiurey Hostyn, va eaghtyr Reeriaght ny h-Albey unnane as eaghtyr ny h-Albey noa-emshiragh. Va'n reeriaght caglit liorish Mooir Hostyn da'n shiar, y Cheayn Sheear da'n twoaie as y sheear, as liorish Ammyr ny h-Albey as Mooir Vannin da'n sheear yiass. Shaghrey magh ny mooarheer, va'n reeriaght jeant sheose jeh ny smoo na 790 ellanyn.
Roish haink er Doon Edin, y balley smoo ec y traa, dy ve ny phreeu-valley, va stayd phreeu-valjagh er Sgàin, Dùn Phàrlain as Strooley. 'Sy vlein 1700 va ny smoo na 1.1 villioon cummaltee ayns Reeriaght ny h-Albey.
Hie yn duillag shoh er ny reaghey er 10 Mee ny Nollick 2017, ec 20:00.


text:
GOP Moves to Slash EPA's Budget
Making sustainability sexy
Image: USDA Forest Service - Region 8 - Southern Archive, CC
Okay, okay, we get it. House Republicans don't like the idea of trying to reign in pollution. I mean really don't like it. Many of them already claimed that climate change wasn't real on the campaign trail, and said they'd fight climate legislation. Then, the powerful chairman of the House Energy Committee, Fred Upton (R-MI), has already sponsored a bill designed to prevent the EPA from enforcing the Clean Air Act, claiming it would kill jobs and whatnot. Now, House Republicans have released their vaunted plan for massive federal spending cuts. At the top of the list? The EPA.The GOP wants to slash over $1.6 billion from the EPA's budget. The prime targets within the agency are the Brownfield program -- which dedicates funds to cleaning up and restoring contaminated industrial factories that are leeching pollutants into nearby neighborhoods -- the Energy Star efficiency program, the greenhouse gas reporting system that's newly in place, and the Air Quality Management office. Nice. Many of these, as you can probably gather, are crucial to preserving the health and wellbeing of citizens. Which may be why 77% of Americans support the EPA.
But the EPA ain't the only green fixture on the chopping block. Kate Shepperd whipped up a list of the proposed cuts, and they're not pretty:
Energy Efficiency and Renewable Energy -$899M
Electricity Delivery and Energy Reliability -$49M
Nuclear Energy -$169M
Fossil Energy Research -$31M
Clean Coal Technology -$18M
Strategic Petroleum Reserve -$15M
Energy Information Administration -$34M
Office of Science -$1.1B
Land and Water Conservation Fund -$348M
NOAA -$336M
High Speed Rail -$1B
Amtrak -$224M
Natural Resource Conservation Service -$46M
DOE Loan Guarantee Authority -$1.4B
Woops.
More on the EPA and GOP
77% of Americans Support the EPA
GOP Plans Attacks on EPA , Climate Scientists
Okay, okay, we get it. House Republicans don't like the idea of trying to reign in pollution. I mean really don't like it. Many of them already claimed that climate change wasn't real on the
Bike-powered 'bread gym' for kids combines 'Bread & Brawn'
Lazivores unite: A manifesto for lazy gardening
Artist's 'Infinite Essence' affirms that we are all made of starstuff
15 of the most remarkable trees in the United States

redpajama_set_name: RedPajamaCommonCrawl


text:
Q: Delete icon from MDI container form
I have a parent form and some child forms. Each of the child form has an icon at the top and left of the form. I would like to discard those icons but when I click on the icon property, I can only browse another icon and not delete the existing one. For that reason I set the showIcon property in each child form to false and the icons are not visible any more on the forms. So far so good.
My problem is that when a child form is open and maximized, the icon is shown. I want to make it go away and unfortunately I didn't find a way to do this. Any suggestions?
Thanks!
EDIT: I added a screenshot of the form, the unwanted icon is shown above menu strip. I want it to go away. When child form is NOT maximized, the icon disappears.

A: I guess you need to create a custom form border.
Please check http://geekswithblogs.net/kobush/articles/CustomBorderForms3.aspx


text:
Q: Why can't I see a background image set with bootstrap CSS, but can see external image resource? I'm writing a Rails application using Bootstrap. I want to set an image background for it, which I've done using an override.css.scss file. The background displays white when looking at my image, which is in the app/assets/images/ folder.
if I set the image to an external resource, it displays fine.
CSS in override with local image:
html, body {
    padding-top: 60px;
    background-image: url('app/assets/images/nyc.png');
    /* background-repeat: no-repeat; */
    background-color: transparent;
    height: 1000px;

}

CSS in override with external image:
html, body {
    padding-top: 60px;
    background-image: url('http://www.google.com/intl/en_com/images/srpr/logo3w.png');
    /* background-repeat: no-repeat; */
    background-color: transparent;
    height: 1000px;
}

Baffling.

A: Relative URLs in CSS are relative to the to the CSS file, so perhaps you are pointing to the wrong location?
/path/to/app/assets/images/nyc.png
/path/to/style.css

Unless your CSS file lives here, relative to the file in question, you'll be getting a 404 on that image.


text:
Q: Number of inputs much greater than size of training (Neural Networks) I'm working with neural networks.
I have a number of inputs to the network which is far greater than the number of training instances ($\sim 7k$ inputs vs $700$ samples, $1$ order of magnitude, number of outputs $2k$).
My question, as a newcomer to neural nets, is this:
Should I diminish the size of the input layer (maybe through an autoencoder) ?
Dimensional reduction was suggested to me, but I didn't really understand why.

A: A NN's inputs can be equal to number of features in data, and have less relationship with number of data points. For example, we can some DNA data, where we only have 1000 people / instances, but each instance has millions of features in DNA. In such setting, it is perfectly OK to build a NN with millions of inputs.
For your question about dimension reduction: the key idea of using NN is letting the model to figure out the feature engineering / necessary transformation. So, the model can automatically do the feature reduction to us. It is not very common to run feature reduction (say PCA) first then feed into NN, unless there are some computational resource constraints.
Also, output is 2K seems too much for me. Are you trying to predict a discrete outcome with 2K possible values? In most cases, people predicting a much less possible values, such as binary Yes/No. (There are some reasons on why it is hard to do to predict 2K possible values, which I will not explain here.)


8.12/8.11 are based on the JBoss EAP 6.4.Alpha platform. The downloads page contains a consolidated single download file that contains EAP 6.4 Alpha + Teiid 8.12.0 + Teiid Web-Console. You also have choice of using Docker image if you choose to at Docker Hub.
Please note this is the LAST VERSION of Teiid that will be based on JBoss EAP. 8.13 and 9.0, we will be moving to WildFly. Any micro releases on 8.12 line like 8.12.1, 8.12.2 etc still be using JBoss EAP.
After a small delay, we are pleased to release Teiid 8.12 CR1. We were able to get quite a few issues resolved - to date there are 134 issues resolved. As usual CR1 can be found in maven and on the downloads page.
Expect a final release in approximately 2 weeks, followed shortly by an 8.11.5 release. Please let us know if you find any issues as we will address anything critical prior to the final release.


When it concerns the things that can make or break an event, couple of are as essential as the quality, taste and look of the food and beverages you serve. A lot is riding on your decision of which caterer to hire, and if you believe this choice really isn't that important, look at it by doing this, fantastic catering can save an occasion that's on the rocks, but bad catering will usually send visitors to the doors.
In addition, due to the fact that catering is often the # 1 or # 2 line-item cost for many events, the caterer you select is also a significant monetary decision and can affect just how much money you have actually left over to invest in other areas depending upon food costs and quantities.
Add in the fact that caterers can vary considerably in their pricing and the kinds of meals and services they offer, and the procedure of selecting a caterer can figuratively and actually feel like you are comparing apples to oranges.
Of all the event and catering professionals we talked with, this came up over and over and over again, primarily since how responsive and interested a catering service is during your initial discussions is indicative of how they will perform during the length of their contract with you (and more on contracts later).
A prospective catering service needs to be learning as much as they can about you in your very first couple of discussions with them, so you ought to expect them to be talking and asking questions about 20% of the time and you providing answers and describing your needs about 80% of the time.
So when interviewing your Footscray caterers (and you ought to consult with a minimum of 3 caterers for any event with a reasonable budget), you have to be specific about the kind of event you are preparing and the kind of food and/or presentation you are expecting. Otherwise, you might wind up selecting a caterer who simply isn't an excellent suitable for the type or style of your occasion.
Almost every catering service has a standard menu or menus to pick from, and numerous do supply some level of built-in versatility to adjust these menus to your specific requirements by replacing particular items and/or personalizing others.
Some people shy away from asking to sample the particular items they desire for their occasion since it appears like a hassle for the caterer, however it is standard to request for a tasting of exactly what you are intending to order prior to you sign on the dotted line.
In addition, you can request wine parings for these tastings if they are appropriate for your occasion (again, be prepared to pay a charge, it's a small price to pay to guarantee you select the right caterer). When you are tasting the food, also attend to how it is presented, as any caterer who takes the time to effectively show a sample will most likely be more likely to make that sort of effort on your event day.
You might remain in for a surprise if you work with a BBQ take-out joint to cater an official ballroom fundraiser. Or if you select a high-end business occasion caterer to serve a barn wedding event. Why? Since these caterers may not be accustomed to preparing and serving food in such a setting.
A lot more traditional venues can also have limitations that catering services should follow, like certain setup requirements or disposal constraints for waste food and water, so having a catering service that recognizes with a venue's guidelines can potentially save you great deals of hassle on event day.
The catering service's agreement need to plainly spell out exactly what food, drinks and services the catering service will be offering on the designated day( s). Furthermore, it ought to secure you from non-performance as much as it protects the caterer from non-payment/default, so you might want to consider having a lawyer} look at it prior to you sign it.
Every detail ought to be included in the contract, consisted of selected menus, variety of portions and/or people to be served, beverage/bar service details (if applicable) and all rates and extra services.
No catering service in Footscray with a shred of dignity and scruples participates in an agreement with plans to bail at the last minute, but you have to ensure there is a cancellation provision in your contract just in case your caterer has to cancel.
Obviously you will need to look into the caterers in Footscray you are considering, and it's always good to start online and check out sites.
Nevertheless, don't stop there, as online reviews are not constantly dependable (and even genuine); for example, a great catering service might have had a couple of nightmare/hater clients who skew their scores, while a really average caterer may have padded their online reviews. So see if you can find some past customers of the catering services you are considering and connect to them.
Surprisingly, the length of time a catering company in Footscray has actually stayed in business might not be as critical in selecting a fantastic catering service as you might think.


Thin Clients news and support resources, featuring the hottest solutions, technologies and vendors in the Thin Clients world. Use the powerful checkbox-driven menu to fine-tune the results to exactly what you are looking for in seconds!
To meet the corporate security requirements, users are required to access the virtual desktops from their personal authorized IGEL UD Pocket endpoints only. This video is from the fine folks at deviceTRUST.
To meet the corporate regulatory requirements, users are required to access the virtual desktops only from IGEL endpoints within authorized countries. This video is from the fine folks at deviceTRUST.
Visit the new IGEL Knowledge Base at https://kb.igel.com This video is from the fine folks at IGEL Technology! Learn more: Download IGEL OS and End-Point Management (UMS) Software. View more IGEL Resources, videos, white papers, case studies, data sheets.
This video explains what UEFI Secure Boot is and how you can enable it. This video is from the fine folks at IGEL Technology! Learn more: Download IGEL OS and End-Point Management (UMS) Software. View more IGEL Resources, videos, white papers, case studies, data sheets.
IGEL UD7 – Citrix Over 3 Monitors!
The following IGEL video shows another typical use case – one Citrix session over all three monitors! This video is from the fine folks at IGEL Technology! Learn more: Download IGEL OS and End-Point Management (UMS) Software. View more IGEL Resources, videos, white papers, case studies, data sheets.


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using ValidationPipeline.LogStorage.Models;

namespace ValidationPipeline.LogStorage.Services
{
    public class ArchiveService : IArchiveService, IDisposable
    {
        private ZipArchive _zipArchive;

        public bool Initialize(Stream archiveStream)
        {
            if (archiveStream == null || archiveStream == Stream.Null)
                throw new ArgumentNullException(nameof(archiveStream));

            archiveStream.Position = 0;

            try
            {
                _zipArchive = new ZipArchive(archiveStream, ZipArchiveMode.Read, true);
                return true;
            }
            catch (InvalidDataException e)
            {
                Debug.WriteLine(e);
                return false;
            }
        }

        public bool IsEmpty()
        {
            if (_zipArchive == null)
                throw new ArgumentException("Archive Service was not initialized!");

            return _zipArchive.Entries.Count(entry => !IsFolder(entry)) == 0;
        }

        public IEnumerable<MetaData> GetMetaData()
        {
            if (_zipArchive == null)
                throw new ArgumentException("Archive Service was not initialized!");

            return _zipArchive.Entries.Where(entry => !IsFolder(entry)).Select(entry => new MetaData
            {
                Name = entry.FullName,
                Length = entry.Length,
                LastModified = entry.LastWriteTime
            });
        }

        public Stream ExtractInnerFile(string innerFileName)
        {
            if (_zipArchive == null)
                throw new ArgumentException("Archive Service was not initialized!");

            if (string.IsNullOrWhiteSpace(innerFileName))
                throw new ArgumentNullException(nameof(innerFileName));

            return _zipArchive.GetEntry(innerFileName)?.Open();
        }

        public static bool IsFolder(ZipArchiveEntry entry)
        {
            return entry.FullName.EndsWith("/");
        }

        public void Dispose()
        {
            _zipArchive?.Dispose();
        }
    }
}

redpajama_set_name: RedPajamaGithub


This is a placeholder page for Ashley Braybrook, which means this person is not currently on this site. We do suggest using the tools below to find Ashley Braybrook.
You are visiting the placeholder page for Ashley Braybrook. This page is here because someone used our placeholder utility to look for Ashley Braybrook. We created this page automatically in hopes Ashley Braybrook would find it. If you are not Ashley Braybrook, but are an alumni of Fort Pierce Westwood High School, register on this site for free now.


Definition: The experience of seeing a brilliant red sunset blown up by manmade pollution and knowing you're not suppose to enjoy it but you do anyway because the colors are a brilliant bright orange red fire —intoxicating to the eyes.
Origin: Diana Chuong, Mario Rosado, Heidi Quante, Los Angeles Field Study, Art Center, March 2016.
Chuco (El Salavadorian) slang for dirty + 헐 (Korean) an expression of surprise, similar to 'Huh!' or "What?!" in English + Sol (Spanish) meaning sun.


This symbol represents Lidia. All her loved ones have been murdered by tyrants that will do everything to quench the last bastions of liberty. She will create a new family and inspire the fight for freedom.
This symbol represents Arpineia Davinia. She is a Vestal Virgin making her way across the upper echelons of her male-dominated society. She finally obtains the power to inspire women to serve Rome in new ways; albeit not enough restrain to avoid trouble.
This symbol represents Sextus Sergius, a knight and war-hero sold by his own kin into slavery. Familiar with power and impotence, he must find ways not only to continue defending the Republic, but to also renew the vows of friendship between Rome and its allies.
This symbol represents Marcus Considius, a simple Roman barber, who finds a position he never wanted forced upon him and the only person capable to stop the conspiracy that already took his loved ones and will not stop until they take over his plebeian neighborhood.
This symbol is Orcus. This gentle giant is the last of a once great civilization, a mythical ancestor and spiritual guide of the Roman people. Reserved and alienated from humanity, it might be the only one capable of standing against enemies beyond space and time.
This symbols evokes Diodorus of Alexandria, infamous pirate and alchemist and terror of the greek seas. Seen as nothing more than a rebel that bows to no man, he is actually the master of all magic and the unsung hero that maintains the first-line of defense against threats aliens and arcane.


The founder of Bay Area Orthopedics, Dr. Teodoro Nissen, is a Fellowship trained orthopedic surgeon with a special interest in arthroscopic reconstruction of shoulder, knee and ankle injuries. Dr. Nissen's surgical expertise involves joint replacement surgeries of the shoulder, hip and knee, as well as the Birmingham Hip Resurfacing procedure.
Dr. Nissen first became involved with sports related injuries at U.C. Berkeley while working with the Intercollegiate Sports Medicine Staff. During his tenure, Dr. Nissen worked extensively with the gymnastic and soccer teams, was the head undergraduate trainer for the Cal Football team and provided care for Cal Rugby team, winning three consecutive national titles. Dr. Nissen, graduated from Cal at the top of his class with a degree in Human Biodynamics, and was awarded the UC Berkeley Departmental Citation.
Dr. Nissen received his medical degree from The University of California, San Francisco, and completed his internship and residency at UCSF in the department of Orthopedic Surgery. While at UCSF, Dr. Nissen was awarded the UCSF post-sophomore fellowship in Pathology, and was elected to the Alpha Omega Honor Society. During his year as Chief Resident, he was awarded the Northern California Western Orthopedic Research Award for his research on computer-assisted surgery. Dr. Nissen received further specialized Fellowship training in Sports Medicine and Sports Trauma from The Lake Tahoe Orthopedic Institute.
With a commitment to the education of medical students, Dr. Nissen is currently an Adjunct Clinical Instructor for the Department of Orthopedic Surgery at UCSF, and an Adjunct Clinical Faculty at Tuoro University in Vallejo.
Dr. Nissen has a special interest in providing care for underserved communities. He has worked with St. Luke's Hospital in San Francisco, Operation Rainbow, the Marin County Clinic, San Francisco General Hospital, and the Institute for Global Orthopedics and Traumatology.
Involved in the education of medical students, residents and fellows.
Evaluate patients in Sports Medicine/Trauma clinic.
Involved in weekly Trauma teaching conference.
pathological specimens. Performed microscopic and gross post-mortem examinations.
trainers. Utilized techniques in prevention, treatment and rehabilitation of athletic injuries.
Responsible for the supervision and basic instruction of the fellow apprentices.
percutaneous insertion of sacral-iliac screws.
ultrastructure resulting from in vivo model of low ischemia and reperfusion.
in Sports Medicine/Trauma Clinic. Involved in weekly Trauma teaching conference.
didactic, clinical and operative arenas.
Nissen T. Ferguson T. Tay B. Holmes W. Ries M. Computer-assisted Surgery vs. conventional Fluoroscopy for Intramedullary Nailing of the Femur: a Cadaveric Study. Orhopaedic Trauma Association, 19th Annnual Meeting, October 2003, salt Lake City, Utah.
Ferguson T. Nissen T. Holmes W. Tay B, Ries M. Vitual Flouroscopy vs Conventional C-Arm Guided Sacroiliac Placement: An Evaluation of Radiation Exposure, Surgical Time and Accuracy in Cadaveric Pelves. Orthopaedic Trauma Association, 19th Annual Meeting, October 2003, Salt Lake City, Utah.
Ferguson T. Nissen T. Tay B. Holmes W. Ries M. Computer-assisted Surgery vs. conventional Fluoroscopy for Intramedullary Nailing of the Femur: A Cadavic Study. International Society for Computer Assited Orthopaedic Surgery, Third Annual Meeting, June 2003, Marbella Spain.
Ferguson T. Nissen T. Holmes W. Tay B, Kim H, Ries M. Vitual Flouroscopy vs Conventional C- Arm Guided Sacroiliac Screw Placement. International Society for computer Assisted Orthopaedic Surgery, Third Annual Meeting, June 2003, Marbella, Spain.
Rovinsky D. Nissen T. Otsuka N. Fungal Osteomyelitis of the Epiphysis. Orthopaedics, 2001 Nov 24 (11): 1083-4.
Gallinghouse J. Nissen T. Sievers R. Chakraborti P. Ursell P. Lee R. Adenoviral Mediated Gene Expression Localize to the Cardiac conduction System: Effects on Electrophysiologic Preperties. Human Gen Theraphy, Submitted for publication.
a long term network of comprehensive care for low income patients of this community.


text:
Huaorani are hosts at refurbished Ecolodge
by Amanda Marks | Nov 26, 2013 | Articles, Latin America, South America
Huarani Ecolodge in Ecuador's Amazon rainforest has been recently refurbished – in an eco-friendly way, of course!
The dining room roof was reconstructed using durable materials that replaced the former thatched roof that had a short shelf life. The new roofs that will last for around 20 years were built with wood covered with a waterproofing material called chova, a material made in Ecuador that is meant to repel moisture. Previously the roof required using up to nine palm trees from two different species: Paja Toquilla (Carludovica palmata) and Ungurahua (Oenocarpus bataua).
Kitchen, staff dining and storage room roofs were replaced using a metallic fabrication called "duratecho" that also makes using palm fronds redundant.
Sufficient construction material was left over to build covers for trash cans in the kitchen. Other projects planned for late fall are refurbishing kitchen and dining room wood surfaces, replacing in-room mosquito nets in the cabins and sanding and varnishing tables and dining chairs.
The nearby Huaorani-operated Nenquepare Camp (included in all Huaorani Lodge packages) also received improvements: a new bathroom with two each toilets, spacious showers and sinks overlooking the Shiripuno River. The local community of Nenquepare is involved in this development and will be trained to manage the site. The kitchen was upgraded with new ceramic walls and floor and in early winter a solar refrigerator and solar energy for light will be installed. New walking paths also connect the dining room with cabins and bathrooms.
A popular feature, a nearby jungle waterfall, also has easier access thanks to stairway maintenance. A new bridge is being constructed over a creek that leads to a self-guided trail.
The conservation/tourism partnership with the Huaorani has helped bring positive changes to the region. "The canopy is re-appearing over sections that were slashed and burned and along the rivers," notes Carvalho, from the partner company working with the Huaorani. "The region is showing signs of regeneration with more sightings of giant river otter, jaguars, giant armadillos and the very rare short-eared dog."
Carvalho notes that since the Huaorani Ecolodge was created in 2008 the particular interest this ancient people now show toward their ancestral land in Yasuni National Park has encouraged natural reforestation along waterways and in turn ever-more-frequent sightings of wildlife whose habitat is no longer being suppressed.
VISIT THE HUAORANI
Tribes offers rainforest adventures staying with the Huaorani at their Ecolodge in Ecuador. Indeed Guy Marks of Tribes was one of the first travel specialists in the UK to visit this wonderful place when tourism first started here in about 2000.
Amanda Marks is the founder and managing director of award-winning tour operator, Tribes Travel. Having started travelling professionally in her mid-twenties as a tour leader in Africa and the Middle East, she set up Tribes with her husband Guy in 1998. She travels regularly both alone and with her family, and is committed to sustainable travel so we can protect the earth's diversity and beauty for future generations.


text:
Sean Byrnes
Peter	2020-01-26
Sean Byrnes | Field Notes
Outlier.ai | Collect and monitor data in real-time
Twitter – @seanbyrnes | 3700 followers
SeanByrnes.com | Personal homepage
Sean on Startups | Personal blog
Enjoys disagreeing with me on Twitter
Sean Byrnes | VC Hunted!
Listen to "SEAN BYRNES | Outlier.ai | What is Your Data Saying? – On Acquisition of Flurry – Full Transparency!" on Spreaker.
LISTEN ON: iTunes, Google Podcasts, Spotify, Castbox, Deezer, Podcast Addict
Hating on the 1980s? Common man! | #VCHunted Twitter Story
Sean is transparent. He leads by example. I love this.
We're all about hunting for the untold stories of venture capital. I see 'venture capital' in a broader spectrum to include those that are a part of that ecosystem, whether it be a founder who is venture-funded and even angel investors like Kevin Lee (immi) and Jeff Haynie (Pinpoint). Sean Byrnes is all that and more.
I knew our conversation was going to be awesome. Reason? I've been following Sean for a good while now and even heard good things years ago when he was getting his company Flurry acquired by Yahoo! Not only that, he's a man with opinions and through his writing, has shown that he's earned every single battle scar he has. I can appreciate that as a founder and wanted to dig a bit deeper into who Sean is and what he's building today.
Sean Byrnes on learning and growing as a founder and leader. Love it! @outlierai
A post shared by Peter Saddington (@vchunting) on Jan 13, 2020 at 6:48pm PST
Sean wanted to do Outlier.ai much better than his last. Values and culture first!
Outlier.ai is a company that is a response to the plethora of data that companies have to sift through and understand. While modern dashboards and development tools are great, they're only as useful as the questions you ask.
"The founding principle of Outlier is 'how do you know the right questions to ask?' We need a new generation of tools that can look at vast amounts of data to bring us the questions we need to be asking."
Sean Byrnes | VC Hunting S2E8
So how is Outlier making sense of all this raw consumer data today as it all lives in different systems that an organization has, from databases to data warehouses? It makes sense that Outlier uses lots of machine learning and artificial intelligence to extract the data, but what's the secret sauce?
Sean Byrnes is here and he's ready for action!… or data science. Same same.
Outlier is special as they have designed their systems with privacy in mind. With all the data privacy issues today, you can't just extract personal data from all these different systems. Outlier grabs the data as it is and is able to leverage it without compromising any privacy needs of the user or organization.
"All major business decisions start from change. That change might be an opportunity or a problem, but it's always a change. Outlier is designed to produce insights the same way a human would. For example, if you change your website, it changes the way you sell, it may also affect customer support requests, it might affect how your inventory system is tracking things. The kind of things you'd expect a human to do is what Outlier does automatically at scale. A person would be able to look at a little bit of data, while Outlier can go through all of it."
Sean Byrnes | VC Hunted S2E8
So how did Sean get to building this type of data analytics company? It turns out he's just the perfect personality for a founder: He enjoys the multidisciplinary requirements of being a founder. Getting his hands dirty learning lots of different things. He never felt like he could fit in a corporate job where they want you to learn how to do something really well and then repeat it over and over. After successfully building Flurry to acquisition over a 9 year period, he got to meet a lot of the 500K customers that were using his software for their apps. One of the most common questions he got from them is: "Sean, how do I know what to look for in all this data?" – This became the seed of Outlier as Sean sought to find a solution to this very apparent problem (and opportunity)!
Just a small example of the very intentional language used on the Outlier.ai website!
One of the things that struck me about Sean was his candor, from speaking about his experiences having an acquisition to identifying that he created many bad habits during the process of building a company, to make sure that his next company was built on principles and values that really mattered. And here's the thing. I actually believe what he wrote on the website. You see, many websites have the exact same 'values.' But when push comes to shove, those values are merely just great art pieces on the wall. For Sean, I can tell (from reading his blogs and digging deep on him) that he really did mature a lot from his first startup. He grew, learned, and has realized that a great company starts with the leaders.
Sean Byrnes of @outlierai tells us that his company is made of people who can chose the work style they desire. Family focused. But if you wanna do a 20 hr day, you can too… but probably not recommended!
Join a company of mature and responsible people. Sounds pretty great to me!
"We started the company with the idea not just to solve a problem, but can we set an example for other tech companies that you can build a business in a healthier more sustainable way, and accessible to people in all stages of life (those with kids and those kids who are willing to work 20 hour days). This is a big asset for us as a company."
I especially loved his answer to my question about his blog post from 2015, the three (three and a half) best words as a CEO to say: "I don't know." When was the last time he said that and what did he learn?
"I think the challenge of being a founder when you're sitting in front of an investor and you're trying to pitch them, you want to have the answers. You want to be the person that has all the information. Some part of you thinks the investor wants you to be the person with all the answers, as they'll invest in you if they think you know what you're doing. At this point in my career, I'm ok with saying 'I don't know.' I tell that to my team and [they know] I'm being honest with them and that's the best way to build that trust with them."
I love this. It really shows Sean's leadership maturity and I'm certain the culture at Outlier is really special.
We're laughing about how startups almost killed us.
Pivoting a bit to venture capital talk, I was curious about Sean's opinion of the venture capital landscape today. He had to have some great opinions on it as he's been through the entire lifecycle. What I found was that his ideas around how venture capital is broken today very much align with my feelings as well. So how is venture broken? According to Sean:
Venture capital is not a transparent industry – If you go to a venture capital fund website, there is no information on their process of evaluating deals, how they source deals, what do they look for, and if they have a consistent process for evaluating deals. You never know what the next step is in the process! Why is this true? I believe none of these are on VCs websites because there is no consistent process. Every deal is different. There is a lot of judgment going on in each deal process. With that type of inconsistency, how can the fund be sure they are sticking to their principles, values, and thesis?
There is not enough diversity – The problem is very deep and systemic. How do women and people of color get access to venture capital? How do you open up that sourcing? So many founders of color have completely different networks. They don't overlap in the slightest with venture capitalists networks. There must be a way to bridge that gap!
Misalignment of incentives – Venture funds have a portfolio of investments. It's irresponsible for you as a VC to not invest in lots of companies. However, each founder is only invested in one company, their own. What happens is that the 1 out of 10 companies in the portfolio is doing well. So the VC will push that one company to do the most aggressive strategy possible to get an outsized return for the entire portfolio and push founders to take risks that they otherwise might not take or aren't ready for. As a founder, they just want to have a return, period. No matter the size. What VCs don't tell the founder that there are only a few ways to really receive a huge return (that they are looking for). The founder is therefore net-worse off for having raised money.
Venture capital is a capital class of industry that is driven by supply, not demand – Venture funds have swelled in size. We're seeing a venture capital bubble and we're seeing ridiculous valuations. Valuation is a side-effect of financing not a driving force. When an investor invests in your $10M company and wants 25% as an ownership target, then suddenly your company is worth $40M! Just like that! Since venture funds have swelled, they can no longer make small investments.
I've written and spoken about these exact issues for years now (Maybe that's one reason why I finally got off my butt to do something about it)! Did I feel good being validated by Sean's analysis? You better believe it.
Why would Sean tweet publically something I believe is so private?
Is this how Sean de-stresses? No, it was part of his plan to become a better person.
Sean is just dead wrong here. The 80s were the fucking jam!
From here I wanted answers to 3 of Sean's tweets from the past. I don't need to type out his responses, it's just better that you listen to it yourself. I will say though, that if you listen to Sean's answers, you too will hear a man who has clearly been through the darkest of days and best of days and come out of it a better man. His candor, honesty, transparency, and authenticity shines. To be frank, that's kind of why I wanted to interview Sean. I knew he would be able to answer my questions with truth.
What more would you want from a leader?
Sean Byrnes | VC Hunting Retrospective
Sean Byrnes Social Media
Sean Byrnes Instagram Quote
Sean Byrnes Twitter Quote
Sean Brynes Youtube Thumbnail
Sean Brynes Youtube Quote
@vchunting
Sean Byrnes is Outlier.ai tells us that you can learn to build a better business. Growth! #venturecapital #vchunted #proofofvc #startups
♬ original sound – vchunting
Whatsh do you want? Can't you shee I'm trying to drinksss here? Pour yourshelf one.
Categories: Venture Capitalist Interviews
Tagged: angel investor, interview, outlierai, proof of vc, sean byrnes, vc hunted
Top 50+ Venture Capital Podcasts for 2020!
The Top 50 Venture Capital Podcasts for VCs, founders, startup entrepreneurs, and the tech-curious!
Online Education Resources – Courses and Study Programs
Get a full education for free! There are tons of courses out there! Find yours for your student!
Jeff Haynie
Humility is the key to success. You don't know what you don't know.
Teach everything you know.
Roy Bahat
AI is the future of work. I'm a student of people and entrepreneurs. Teach me what you know, I'm all ears.
End of Sprint 2 of My…
The first step when managing dependencies
Agile For Alls's Quote of the…
Results of my First 2021 Writing…
Using Scrum in 2021
Scrum Guide 2020 – What Changed…
GRAVITY Book Updated to V4.2!
Market Meditations Podcast with Peter Saddington
The History of Management Trends
Venture Marketing
Introduction to the Product Owner in…
Tips on How to Make Effective…
5 Tips for Handling Multiple Coaches…
5 Tips for Building Relationships at…
Becoming an Agile Coach – 5…
GRAVITY [PDF eBook] – How to Create an Irresistible Brand, Unlimited Deal Flow, and Infinite Possibilities


Situated in Prestatyn on the beautiful North Wales coast, Vehicles for Leisure offer a wide range of quality new and used motorhomes at affordable prices. Most used motorhomes come with 12 months MOT, 6 months guarantee, a gas safety check with certificate, full valet, a service including new cambelt, and an electric hook-up lead, all you need is your sleeping bag (which we sell in our fully stocked accessory shop).
We are pleased to announce that we now have a branch in Chester.
Please feel free to browse through our stocklist, we update it regularly, however if there is a specific motorhome you can not find please contact us and we can add you to our list of customers looking for specific motorhomes.


Yes, yet another Peugeot mixte, this time a real vintage one from, I'm guessing, about 1968. If anyone knows how to definitively date these things, let me know. My friend Zan, who rides SF2G with us sometimes down to work, had this kicking around for a long time in semi-functional condition. This is often the case with old 10-speed drivelines that were never very good to begin with, but are universally much worse for the years.
So, as usual, to start, we stripped it down to the frame/fork/headset and (unfortunately) the oddball 24mm Frenchie seatpost.
Naturally, being French, this thing had some issues. First was the bottom bracket, which was expected. To teach it a thing or two, we applied the Park BTS-1, which is very good at persuading threads to see its way of thinking. In this case, 24 thread-per-inch English style, so we could install a modern Shimano UN-72 bottom bracket.
What? a 7mm quill stem bolt? Only the French. Note: this is not the original; it was severely beaten.
Next was the stem. Being averse to global standards -- why do what everyone else does when we can be different and French? -- the Peugeot guys decided a 24mm handlebar was a good idea, so the stem had to go. Naturally it was seized in place, so much Liquid Wrench was applied over several weeks, and a good beating with a hammer commenced. At last it came around, and was summarily buried deep in the parts bin.
Interesting lug cutout detail -- meant to evoke Mayan pyramids perhaps?
What made it sweet was that the bar clamp is 25.4mm, which is very common, even in 2011, and so getting nice modern riser bars wasn't a problem. I picked up some Origin8s, which are pretty similar to Sparrows.
As for brakes, well, of course they needed to be long-reach, so I just used some of my standard Shimano Nexus super long-armed dual-pivots. They are kinda cheap, but work fine and have plenty of reach/fender clearance. You can pick them up for $10-15 each.
Brake bridge is flat, which made it necessary to use spacers for mounting the caliper. C'est la vie.
The front brake was no problem of course, but the rear was obtuse. This frame has two of the usual brake bridges, but the are both drilled "vertically", which means I think they were meant as fender attachment points. The only bridge with "horizontal" drilling is a flat one, which is a bit of an issue with these particular calipers' super long bolts. Cutting off extra bolt with Mr. Dremel is no trouble, but the bolts are only threaded about half way, so I had to come up with some spacers. Fortunately I found a random 1" aluminum tube with 1/8" thick walls, which I cut in half with a hacksaw and pressed into service. Seems to be fine, but we'll see how the braking turns out.
That's about it. Replaced the 5 lb. original diamond-patterned vinyl seat with something reasonably comfortable by WTB. Doesn't look bad either.
Zan test rode it to the Deepistan National Parklet on Valencia to shake it down, and declared it Worthy.


text:
Alex Ferguson's fierce Sunderland vow and emotional John O'Shea after Man Utd lost league
Manchester United beat Sunderland on the final day of the 2011-12 Premier League season, but Manchester City's victory over Queens Park Rangers denied them the league title
Tom VictorSport Trends Writer
Ferguson took the positives from Man Utd's final-day heartbreak (Image: PA)
Can United mount a title challenge? Get our FREE daily Manchester United email newsletter
Former Manchester United manager Alex Ferguson was visibly upset when his team lost the 2011-12 Premier League title at the last moment, but the reaction of Sunderland supporters added another layer onto things.
Sunderland were United's opponents on the final day, when a Wayne Rooney goal decided the game in the favour of Ferguson's team. However, it wasn't enough, with late goals from Edin Dzeko and Sergio Aguero giving Manchester City the victory they needed against 10-man Queens Park Rangers
However, the decision from some home fans at the Stadium of Light to cheer for City left its mark on the United boss. It was still on his mind months later, when the Red Devils prepared to take on the Black Cats once more as they pushed to reclaim the title.
Speaking at an awards ceremony shortly after the end of the 2011-12 season, Ferguson compared the Sunderland game to United's disappointing end to the 1991-92 season. On that occasion, they were beaten by Liverpool in their penultimate game, narrowly missing out on the title to Leeds United.
"When we lost the league to Leeds United in 1992, the young players came out that day and the Liverpool supporters were asking for their autographs," he said. "They were tearing them up, they were tearing the autographs up, and I said to Giggs and the boys 'remember this day'.
"That's exactly what I said to them yesterday; those Sunderland fans were cheering for City - remember the day, we won't forget that. Well done to the players, a fantastic group - they will be alright, don't worry about them."
Was the 2012 title race the best ever? Have your say in the comments section
Ferguson wasn't happy with the Sunderland fans' reaction (Image: AFP/Getty Images)
So it proved, with United going on to reclaim the title in 2013. However, ahead of the next meeting with Sunderland, the events of May 2012 appeared to still be playing on the manager's mind.
"It was a disappointing reaction when you think of the number of players we've given Sunderland over the years," Ferguson said in December 2012, as reported by The Mail. "Jonny Evans and Danny Simpson got them promoted a few years back.
"It's just fans. It wasn't malicious, it was them enjoying the moment. Revenge won't come into anything tomorrow. Winning the game is more important to us because after the impetus we got from last week, it's time for us to really kick on."
O'Shea joined Sunderland from Man Utd (Image: Getty Images)
Not only had former United players helped the Black Cats come back up and establish themselves in the Premier League, but several were playing in that season-ending game in 2012. Fraizer Campbell started up front, with Phil Bardsley at left-back, while John O'Shea joined Bardsley in defence.
However, while some Sunderland fans seemed pleased with City's league win, the opposite was true of O'Shea. The Irish international was in his first season on Wearside after more than a decade with United, and Ferguson would later recall his reaction to events on May 13, 2012.
"I went from half ready to celebrate to coming back into the dressing room," Ferguson said in 2017, at An Evening With Rory McIlroy at the Convention Centre (via The Star ). "I'll always remember, as we were going down the tunnel, John O'Shea was standing there and he was almost crying. John was a Sunderland boy [by then].
"He said, 'Boss, what can I say?' I had to brush by him as my mind was going 'What can I say to these boys of mine?"
Rooney's winner at Sunderland wasn't enough to bring United the title (Image: Getty Images)
The Sunderland game also left an impact on Rooney, who scored United's winner but was upset by the fans' response. Indeed, he would later share his thoughts in his autobiography.
"When the fixtures come out I look for three games — City, Liverpool and Everton. This time I checked the Sunderland game," Rooney wrote. If there is one team that I want to beat this season it will be Sunderland.
"When the final whistle went, we didn't really know what the score at City was. But then we heard the Sunderland fans cheering," the former England striker said after the game.
"It was sad to see because they should be supporting their own team really. They didn't have the best of seasons so for them to be cheering like that was sad. It was something myself and a lot of the players won't forget."
United won both meetings with Sunderland in 2012-13, with Rooney on target in a 3-1 home win and a Titus Bramble own goal settling the reverse fixture. Sure enough, Ferguson's men would take the positives from their final day heartbreak and lift the title in their manager's final season in charge.
John O'Shea
Sean Dyche aims thinly-veiled dig at Everton predecessors after landing Toffees job
After being appointed as Everton's new manager, Sean Dyche has opened up about why he made the move to Goodison Park and what he hopes to achieve at the Toffees
Inter Milan are pursuing a transfer policy which sees them target Premier League stars who are not getting enough game time, with Harry Maguire and an Arsenal defender on their wish list
Room To ImproveRTE Room to Improve viewers left impressed and jealous of one unusual feature to dry clothesViewers were left 'googling' a cabinet popular for drying clothes in Sweden - as they wanted one too
Holly Newton: Young girl, 15, stabbed to death outside takeaway as new boyfriend fought to save her
The 15-year-old girl died after the alleged attack in Hexham, Northumberland
This MorningHolly Willoughby mercilessly teased over Spin to Win blunder on This MorningHolly Willoughby accidentally ruined a surprise on This Morning earlier, with her having been teased over it by her co-host Phillip Schofield in the build-up to the Spin to Win segment of the show
Rory McIlroy major odds slashed after Dubai Desert Classic victory
Major bookies have slashed the odds on a McIlroy major this year after he won the Dubai Desert Classic
Wales v Ireland date, kick-off time, TV and stream information, betting odds and more
Andy Farrell's side are the outright favourites to win the tournament ahead of the World Cup later in the year


text:
package com.evolveum.midpoint.wf.impl.util;

import com.evolveum.midpoint.model.api.ModelAuthorizationAction;
import com.evolveum.midpoint.model.api.ModelInteractionService;
import com.evolveum.midpoint.model.api.context.ModelContext;
import com.evolveum.midpoint.model.api.context.ModelElementContext;
import com.evolveum.midpoint.model.api.util.DeputyUtils;
import com.evolveum.midpoint.model.common.SystemObjectCache;
import com.evolveum.midpoint.model.impl.lens.LensFocusContext;
import com.evolveum.midpoint.model.impl.lens.LensProjectionContext;
import com.evolveum.midpoint.prism.*;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.prism.polystring.PolyString;
import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.DeltaConvertor;
import com.evolveum.midpoint.schema.ObjectTreeDeltas;
import com.evolveum.midpoint.schema.ResourceShadowDiscriminator;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.schema.util.OidUtil;
import com.evolveum.midpoint.security.api.MidPointPrincipal;
import com.evolveum.midpoint.security.api.SecurityEnforcer;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.task.api.TaskManager;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.wf.impl.WfConfiguration;
import com.evolveum.midpoint.wf.impl.activiti.ActivitiEngine;
import com.evolveum.midpoint.wf.impl.processes.common.CommonProcessVariableNames;
import com.evolveum.midpoint.wf.impl.processes.common.LightweightObjectRef;
import com.evolveum.midpoint.wf.impl.processors.BaseModelInvocationProcessingHelper;
import com.evolveum.midpoint.wf.impl.processors.primary.WfPrepareChildOperationTaskHandler;
import com.evolveum.midpoint.wf.impl.processors.primary.WfPrepareRootOperationTaskHandler;
import com.evolveum.midpoint.wf.util.ApprovalUtils;
import com.evolveum.midpoint.wf.util.ChangesByState;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.TaskService;
import org.activiti.engine.form.FormProperty;
import org.activiti.engine.task.IdentityLink;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;
import java.util.*;
import java.util.stream.Collectors;

import static com.evolveum.midpoint.prism.delta.ChangeType.ADD;
import static com.evolveum.midpoint.schema.ObjectTreeDeltas.fromObjectTreeDeltasType;
import static org.apache.commons.collections.CollectionUtils.addIgnoreNull;

/**
 * @author mederly
 */

@Component
public class MiscDataUtil {

    private static final transient Trace LOGGER = TraceManager.getTrace(MiscDataUtil.class);

    @Autowired @Qualifier("cacheRepositoryService") private RepositoryService repositoryService;
    @Autowired private PrismContext prismContext;
	@Autowired private TaskManager taskManager;
	@Autowired private SecurityEnforcer securityEnforcer;
	@Autowired private WfConfiguration wfConfiguration;
	@Autowired private ActivitiEngine activitiEngine;
	@Autowired private BaseModelInvocationProcessingHelper baseModelInvocationProcessingHelper;

    public static ObjectReferenceType toObjectReferenceType(LightweightObjectRef ref) {
		if (ref != null) {
			return ref.toObjectReferenceType();
		} else {
			return null;
		}
	}

	//region ========================================================================== Miscellaneous
    public PrismObject<UserType> getUserByOid(String oid, OperationResult result) {
        if (oid == null) {
            return null;
        }
        try {
            return repositoryService.getObject(UserType.class, oid, null, result);
        } catch (ObjectNotFoundException e) {
            // there should be a note in result by now
            LoggingUtils.logException(LOGGER, "Couldn't get user {} details because it couldn't be found", e, oid);
            return null;
        } catch (SchemaException e) {
            // there should be a note in result by now
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get user {} details due to schema exception", e, oid);
            return null;
        }
    }

    // returns oid when user cannot be retrieved
    public String getUserNameByOid(String oid, OperationResult result) {
        try {
            PrismObject<UserType> user = repositoryService.getObject(UserType.class, oid, null, result);
            return user.asObjectable().getName().getOrig();
        } catch (ObjectNotFoundException e) {
            // there should be a note in result by now
            LoggingUtils.logException(LOGGER, "Couldn't get user {} details because it couldn't be found", e, oid);
            return oid;
        } catch (SchemaException e) {
            // there should be a note in result by now
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get user {} details due to schema exception", e, oid);
            return oid;
        }
    }

    public ObjectDelta getFocusPrimaryDelta(WfContextType workflowContext, boolean mayBeNull) throws JAXBException, SchemaException {
        ObjectDeltaType objectDeltaType = getFocusPrimaryObjectDeltaType(workflowContext, mayBeNull);
        return objectDeltaType != null ? DeltaConvertor.createObjectDelta(objectDeltaType, prismContext) : null;
    }

    // mayBeNull=false means that the corresponding variable must be present (not that focus must be non-null)
    // TODO: review/correct this!
    public ObjectDeltaType getFocusPrimaryObjectDeltaType(WfContextType workflowContext, boolean mayBeNull) throws JAXBException, SchemaException {
        ObjectTreeDeltasType deltas = getObjectTreeDeltaType(workflowContext, mayBeNull);
        return deltas != null ? deltas.getFocusPrimaryDelta() : null;
    }

    public ObjectTreeDeltasType getObjectTreeDeltaType(WfContextType workflowContext, boolean mayBeNull) throws SchemaException {
		WfProcessorSpecificStateType state = workflowContext.getProcessorSpecificState();
		if (mayBeNull && state == null) {
			return null;
		}
		if (!(state instanceof WfPrimaryChangeProcessorStateType)) {
			throw new IllegalStateException("Expected WfPrimaryChangeProcessorStateType but got " + state);
		}
		return ((WfPrimaryChangeProcessorStateType) state).getDeltasToProcess();
    }

    public static String serializeObjectToXml(PrismObject<? extends ObjectType> object) {
        return serializeObjectToXml(object, object.getPrismContext());
    }

    public static String serializeObjectToXml(PrismObject<? extends ObjectType> object, PrismContext prismContext) {
        try {
            return prismContext.serializeObjectToString(object, PrismContext.LANG_XML);
        } catch (SchemaException e) {
            throw new SystemException("Couldn't serialize a PrismObject " + object + " into XML", e);
        }
    }

    public static String serializeContainerableToXml(Containerable containerable, PrismContext prismContext) {
        try {
            PrismContainerValue value = containerable.asPrismContainerValue();
            return prismContext.xmlSerializer().serialize(value, value.getContainer().getElementName());
        } catch (SchemaException e) {
            throw new SystemException("Couldn't serialize a Containerable " + containerable + " into XML", e);
        }
    }

    public static ObjectType deserializeObjectFromXml(String xml, PrismContext prismContext) {
        try {
            return (ObjectType) prismContext.parserFor(xml).xml().parse().asObjectable();
        } catch (SchemaException e) {
            throw new SystemException("Couldn't deserialize a PrismObject from XML", e);
        }
    }

//    public static PrismContainer deserializeContainerFromXml(String xml, PrismContext prismContext) {
//        try {
//            return prismContext.processorFor(xml).xml().unmarshallContainer(null);			// TODO will 'null' work?
//        } catch (SchemaException e) {
//            throw new SystemException("Couldn't deserialize a Containerable from XML", e);
//        }
//    }

    public void resolveAssignmentTargetReferences(PrismObject<? extends UserType> object, OperationResult result) {
        for (AssignmentType assignmentType : object.asObjectable().getAssignment()) {
            if (assignmentType.getTarget() == null && assignmentType.getTargetRef() != null) {
                PrismObject<? extends ObjectType> target = null;
                try {
                    target = repositoryService.getObject(ObjectType.class, assignmentType.getTargetRef().getOid(), null, result);
                    assignmentType.setTarget(target.asObjectable());
                } catch (ObjectNotFoundException e) {
                    LoggingUtils.logException(LOGGER, "Couldn't resolve assignment " + assignmentType, e);
                } catch (SchemaException e) {
                    LoggingUtils.logUnexpectedException(LOGGER, "Couldn't resolve assignment " + assignmentType, e);
                }
            }
        }
    }

    /**
     * Retrieves focus object name from the model context.
     */
    public static String getFocusObjectName(ModelContext<? extends ObjectType> modelContext) {
        ObjectType object = getFocusObjectNewOrOld(modelContext);
        return object.getName() != null ? object.getName().getOrig() : null;
    }

    public static String getFocusObjectOid(ModelContext<?> modelContext) {
        ModelElementContext<?> fc = modelContext.getFocusContext();
        if (fc.getObjectNew() != null && fc.getObjectNew().getOid() != null) {
            return fc.getObjectNew().getOid();
        } else if (fc.getObjectOld() != null && fc.getObjectOld().getOid() != null) {
            return fc.getObjectOld().getOid();
        } else {
            return null;
        }
    }

    public static ObjectType getFocusObjectNewOrOld(ModelContext<? extends ObjectType> modelContext) {
        ModelElementContext<? extends ObjectType> fc = modelContext.getFocusContext();
        PrismObject<? extends ObjectType> prism = fc.getObjectNew() != null ? fc.getObjectNew() : fc.getObjectOld();
        if (prism == null) {
            throw new IllegalStateException("No object (new or old) in model context");
        }
        return prism.asObjectable();
    }

    public Task getShadowTask(Map<String, Object> variables, OperationResult result) throws SchemaException, ObjectNotFoundException {
        String oid = (String) variables.get(CommonProcessVariableNames.VARIABLE_MIDPOINT_TASK_OID);
        if (oid != null) {
            return taskManager.getTask(oid, result);
        } else {
            return null;
        }
    }

    @NotNull
	public static String refToString(@NotNull ObjectReferenceType ref) {
    	return
				(ref.getType() != null ? ref.getType().getLocalPart() : UserType.COMPLEX_TYPE.getLocalPart())
				+ CommonProcessVariableNames.TYPE_NAME_SEPARATOR
				+ ref.getOid();
	}

	public static List<String> refsToStrings(@NotNull Collection<ObjectReferenceType> refs) {
    	return refs.stream().map(r -> refToString(r)).collect(Collectors.toList());
	}

	@NotNull
	public static List<String> prismRefsToStrings(Collection<PrismReferenceValue> refs) {
		List<String> rv = new ArrayList<>();
		for (PrismReferenceValue ref : refs) {
			addIgnoreNull(rv, refToString(ObjectTypeUtil.createObjectRef(ref)));
		}
		return rv;
	}

	@NotNull
	public static ObjectReferenceType stringToRef(@NotNull String s) {
    	String[] parts = s.split(CommonProcessVariableNames.TYPE_NAME_SEPARATOR);
    	if (parts.length == 0 || parts.length > 2) {
    		throw new IllegalArgumentException("Incorrect reference string representation: " + s);
		} else if (parts.length == 1) {
    		return new ObjectReferenceType().oid(parts[0]).type(UserType.COMPLEX_TYPE);
		} else {
			// TODO support namespaces other than c:
    		QName type = StringUtils.isEmpty(parts[0]) ? UserType.COMPLEX_TYPE : new QName(SchemaConstants.NS_C, parts[0]);
			return new ObjectReferenceType().oid(parts[1]).type(type);
		}
	}

	public enum RequestedOperation {
    	COMPLETE(ModelAuthorizationAction.COMPLETE_ALL_WORK_ITEMS, null),
		DELEGATE(ModelAuthorizationAction.DELEGATE_ALL_WORK_ITEMS, ModelAuthorizationAction.DELEGATE_OWN_WORK_ITEMS);

    	ModelAuthorizationAction actionAll, actionOwn;
		RequestedOperation(ModelAuthorizationAction actionAll, ModelAuthorizationAction actionOwn) {
			this.actionAll = actionAll;
			this.actionOwn = actionOwn;
		}
	}

    public boolean isAuthorized(WorkItemType workItem, RequestedOperation operation) {
        MidPointPrincipal principal;
		try {
			principal = securityEnforcer.getPrincipal();
		} catch (SecurityViolationException e) {
			return false;
		}
        if (principal.getOid() == null) {
            return false;
        }
		try {
			if (securityEnforcer.isAuthorized(operation.actionAll.getUrl(), null, null, null, null, null)) {
				return true;
			}
			if (operation.actionOwn != null && !securityEnforcer.isAuthorized(operation.actionOwn.getUrl(), null, null, null, null, null)) {
				return false;
			}
		} catch (SchemaException e) {
			throw new SystemException(e.getMessage(), e);
		}
		for (ObjectReferenceType assignee : workItem.getAssigneeRef()) {
			if (isEqualOrDeputyOf(principal, assignee.getOid())) {
				return true;
			}
		}
		return isAmongCandidates(principal, workItem.getExternalId());
    }

	public boolean isEqualOrDeputyOf(MidPointPrincipal principal, String eligibleUserOid) {
		return principal.getOid().equals(eligibleUserOid)
				|| DeputyUtils.isDelegationPresent(principal.getUser(), eligibleUserOid);
	}

	public WfConfigurationType getWorkflowConfiguration(SystemObjectCache systemObjectCache, OperationResult result) throws SchemaException {
    	PrismObject<SystemConfigurationType> systemConfiguration = systemObjectCache.getSystemConfiguration(result);
    	if (systemConfiguration == null) {
    		return null;
    	}
    	return systemConfiguration.asObjectable().getWorkflowConfiguration();
    }

    // principal != null, principal.getOid() != null, principal.getUser() != null
    private boolean isAmongCandidates(MidPointPrincipal principal, String taskId) {
        String currentUserOid = principal.getOid();
        List<IdentityLink> identityLinks;
        try {
            TaskService taskService = activitiEngine.getTaskService();
            // working around activiti bug, see MID-3799.6 (the NPE when task does not exist)
			org.activiti.engine.task.Task task = taskService.createTaskQuery()
					.taskId(taskId)
					.singleResult();
			if (task == null) {
				return false;
			}
			identityLinks = taskService.getIdentityLinksForTask(taskId);
        } catch (ActivitiException e) {
            throw new SystemException("Couldn't determine user authorization, because the task candidate users and groups couldn't be retrieved: " + e.getMessage(), e);
        }
        for (IdentityLink identityLink : identityLinks) {
            if (identityLink.getUserId() != null && identityLink.getUserId().equals(currentUserOid)) {
                return true;
            }
            if (identityLink.getGroupId() != null) {
                if (isMemberOfActivitiGroup(principal.getUser(), identityLink.getGroupId())) {
                    return true;
                }
            }
        }
        return false;
    }

    public boolean isAuthorizedToClaim(WorkItemType workItem) {
        return isAuthorizedToClaim(workItem.getExternalId());
    }

    public boolean isAuthorizedToClaim(String taskId) {
        MidPointPrincipal principal;
        try {
            principal = securityEnforcer.getPrincipal();
        } catch (SecurityViolationException e) {
            return false;
        }
        String currentUserOid = principal.getOid();
        if (currentUserOid == null) {
            return false;
        }
        return isAmongCandidates(principal, taskId);
    }

    // todo move to something activiti-related

    public static Map<String,FormProperty> formPropertiesAsMap(List<FormProperty> properties) {
        Map<String,FormProperty> retval = new HashMap<String,FormProperty>();
        for (FormProperty property : properties) {
            retval.put(property.getId(), property);
        }
        return retval;
    }

    public boolean isMemberOfActivitiGroup(UserType userType, String activitiGroupId) {
        ObjectReferenceType groupRef = stringToRef(activitiGroupId);
        return userType.getRoleMembershipRef().stream().anyMatch(ref -> matches(groupRef, ref))
				|| userType.getDelegatedRef().stream().anyMatch(ref -> matches(groupRef, ref));
    }

	public boolean matches(ObjectReferenceType groupRef, ObjectReferenceType targetRef) {
		return (ObjectTypeUtil.isMembershipRelation(targetRef.getRelation()))	// TODO reconsider if we allow managers here
				&& targetRef.getOid().equals(groupRef.getOid());
	}

	public PrismObject resolveObjectReference(ObjectReferenceType ref, OperationResult result) {
		return resolveObjectReference(ref, false, result);
	}

	public PrismObject resolveAndStoreObjectReference(ObjectReferenceType ref, OperationResult result) {
		return resolveObjectReference(ref, true, result);
	}

	public void resolveAndStoreObjectReferences(@NotNull Collection<ObjectReferenceType> references, OperationResult result) {
    	references.forEach(ref -> resolveObjectReference(ref, true, result));
	}

    private PrismObject resolveObjectReference(ObjectReferenceType ref, boolean storeBack, OperationResult result) {
        if (ref == null) {
            return null;
        }
		if (ref.asReferenceValue().getObject() != null) {
			return ref.asReferenceValue().getObject();
		}
        try {
            PrismObject object = repositoryService.getObject((Class) prismContext.getSchemaRegistry().getCompileTimeClass(ref.getType()), ref.getOid(), null, result);
			if (storeBack) {
				ref.asReferenceValue().setObject(object);
			}
            return object;
        } catch (ObjectNotFoundException e) {
            // there should be a note in result by now
            LoggingUtils.logException(LOGGER, "Couldn't get reference {} details because it couldn't be found", e, ref);
            return null;
        } catch (SchemaException e) {
            // there should be a note in result by now
            LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get reference {} details due to schema exception", e, ref);
            return null;
        }
    }

    public ObjectReferenceType resolveObjectReferenceName(ObjectReferenceType ref, OperationResult result) {
        if (ref == null || ref.getTargetName() != null) {
            return ref;
        }
        PrismObject<?> object;
        if (ref.asReferenceValue().getObject() != null) {
            object = ref.asReferenceValue().getObject();
        } else {
            object = resolveObjectReference(ref, result);
            if (object == null) {
                return ref;
            }
        }
        ref = ref.clone();
        ref.setTargetName(PolyString.toPolyStringType(object.getName()));
        return ref;
    }

	public void generateFocusOidIfNeeded(ModelContext<?> modelContext, ObjectDelta<? extends ObjectType> change) {
		if (modelContext.getFocusContext().getOid() != null) {
			return;
		}

		String newOid = OidUtil.generateOid();
		LOGGER.trace("This is ADD operation with no focus OID provided. Generated new OID to be used: {}", newOid);
		if (change.getChangeType() != ADD) {
			throw new IllegalStateException("Change type is not ADD for no-oid focus situation: " + change);
		} else if (change.getObjectToAdd() == null) {
			throw new IllegalStateException("Object to add is null for change: " + change);
		} else if (change.getObjectToAdd().getOid() != null) {
			throw new IllegalStateException("Object to add has already an OID present: " + change);
		}
		change.getObjectToAdd().setOid(newOid);
		((LensFocusContext<?>) modelContext.getFocusContext()).setOid(newOid);
	}

	public void generateProjectionOidIfNeeded(ModelContext<?> modelContext, ShadowType shadow, ResourceShadowDiscriminator rsd) {
		if (shadow.getOid() != null) {
			return;
		}
		String newOid = OidUtil.generateOid();
		LOGGER.trace("This is ADD operation with no shadow OID for {} provided. Generated new OID to be used: {}", rsd, newOid);
		shadow.setOid(newOid);
		LensProjectionContext projCtx = ((LensProjectionContext) modelContext.findProjectionContext(rsd));
		if (projCtx == null) {
			throw new IllegalStateException("No projection context for " + rsd + " could be found");
		} else if (projCtx.getOid() != null) {
			throw new IllegalStateException("No projection context for " + rsd + " has already an OID: " + projCtx.getOid());
		}
		projCtx.setOid(newOid);
	}

	// TODO move somewhere else?
	public ChangesByState getChangesByStateForChild(TaskType childTask, TaskType rootTask, ModelInteractionService modelInteractionService, PrismContext prismContext, OperationResult result)
			throws SchemaException, ObjectNotFoundException {
		ChangesByState rv = new ChangesByState(prismContext);

		final WfContextType wfc = childTask.getWorkflowContext();
		if (wfc != null && wfc.getProcessInstanceId() != null) {
			Boolean isApproved = ApprovalUtils.approvalBooleanValueFromUri(wfc.getOutcome());
			if (isApproved == null) {
				if (wfc.getEndTimestamp() == null) {
					recordChangesWaitingToBeApproved(rv, wfc, prismContext);
				} else {
					recordChangesCanceled(rv, wfc, prismContext);
				}
			} else if (isApproved) {
				if (rootTask.getModelOperationContext() != null) {
					// this is "execute after all approvals"
					if (rootTask.getModelOperationContext().getState() == ModelStateType.FINAL) {
						recordResultingChanges(rv.getApplied(), wfc, prismContext);
					} else if (!containsHandler(rootTask, WfPrepareRootOperationTaskHandler.HANDLER_URI)) {
						recordResultingChanges(rv.getBeingApplied(), wfc, prismContext);
					} else {
						recordResultingChanges(rv.getWaitingToBeApplied(), wfc, prismContext);
					}
				} else {
					// "execute immediately"
					if (childTask.getModelOperationContext() == null || childTask.getModelOperationContext().getState() == ModelStateType.FINAL) {
						recordResultingChanges(rv.getApplied(), wfc, prismContext);
					} else if (!containsHandler(childTask, WfPrepareChildOperationTaskHandler.HANDLER_URI)) {
						recordResultingChanges(rv.getBeingApplied(), wfc, prismContext);
					} else {
						recordResultingChanges(rv.getWaitingToBeApplied(), wfc, prismContext);
					}
				}
			} else {
				recordChangesRejected(rv, wfc, prismContext);
			}
		}
		return rv;
	}

	// TODO move somewhere else?
	public ChangesByState getChangesByStateForRoot(TaskType rootTask, ModelInteractionService modelInteractionService, PrismContext prismContext, Task task, OperationResult result)
			throws SchemaException, ObjectNotFoundException {
		ChangesByState rv = new ChangesByState(prismContext);
		recordChanges(rv, rootTask.getModelOperationContext(), modelInteractionService, task, result);
		for (TaskType subtask : rootTask.getSubtask()) {
			recordChanges(rv, subtask.getModelOperationContext(), modelInteractionService, task, result);
			final WfContextType wfc = subtask.getWorkflowContext();
			if (wfc != null && wfc.getProcessInstanceId() != null) {
				Boolean isApproved = ApprovalUtils.approvalBooleanValueFromUri(wfc.getOutcome());
				if (isApproved == null) {
					if (wfc.getEndTimestamp() == null) {
						recordChangesWaitingToBeApproved(rv, wfc, prismContext);
					} else {
						recordChangesCanceled(rv, wfc, prismContext);
					}
				} else if (isApproved) {
					recordChangesApprovedIfNeeded(rv, subtask, rootTask, prismContext);
				} else {
					recordChangesRejected(rv, wfc, prismContext);
				}
			}
		}
		return rv;
	}

	private void recordChangesApprovedIfNeeded(ChangesByState rv, TaskType subtask, TaskType rootTask, PrismContext prismContext) throws SchemaException {
		if (!containsHandler(rootTask, WfPrepareRootOperationTaskHandler.HANDLER_URI) &&
				!containsHandler(subtask, WfPrepareChildOperationTaskHandler.HANDLER_URI)) {
			return;			// these changes were already incorporated into one of model contexts
		}
		if (subtask.getWorkflowContext().getProcessorSpecificState() instanceof WfPrimaryChangeProcessorStateType) {
			WfPrimaryChangeProcessorStateType ps = (WfPrimaryChangeProcessorStateType) subtask.getWorkflowContext().getProcessorSpecificState();
			rv.getWaitingToBeApplied().merge(fromObjectTreeDeltasType(ps.getResultingDeltas(), prismContext));
		}
	}

	private boolean containsHandler(TaskType taskType, String handlerUri) {
		if (handlerUri.equals(taskType.getHandlerUri())) {
			return true;
		}
		if (taskType.getOtherHandlersUriStack() == null) {
			return false;
		}
		for (UriStackEntry uriStackEntry : taskType.getOtherHandlersUriStack().getUriStackEntry()) {
			if (handlerUri.equals(uriStackEntry.getHandlerUri())) {
				return true;
			}
		}
		return false;
	}

	private <F extends FocusType> void recordChanges(ChangesByState rv, LensContextType modelOperationContext, ModelInteractionService modelInteractionService,
			Task task, OperationResult result) throws ObjectNotFoundException, SchemaException {
		if (modelOperationContext == null) {
			return;
		}
		ModelContext<F> modelContext = unwrapModelContext(modelOperationContext, modelInteractionService, task, result);
		ObjectTreeDeltas<F> deltas = baseModelInvocationProcessingHelper.extractTreeDeltasFromModelContext(modelContext);
		ObjectTreeDeltas<F> target;
		switch (modelContext.getState()) {
			case INITIAL:
			case PRIMARY: target = rv.getWaitingToBeApplied(); break;
			case SECONDARY: target = rv.getBeingApplied(); break;
			case EXECUTION:	// TODO reconsider this after EXECUTION and POSTEXECUTION states are really used
			case POSTEXECUTION:
			case FINAL: target = rv.getApplied(); break;
			default: throw new IllegalStateException("Illegal model state: " + modelContext.getState());
		}
		target.merge(deltas);
	}

	protected void recordChangesWaitingToBeApproved(ChangesByState rv, WfContextType wfc, PrismContext prismContext)
			throws SchemaException {
		if (wfc.getProcessorSpecificState() instanceof WfPrimaryChangeProcessorStateType) {
			WfPrimaryChangeProcessorStateType ps = (WfPrimaryChangeProcessorStateType) wfc.getProcessorSpecificState();
			rv.getWaitingToBeApproved().merge(fromObjectTreeDeltasType(ps.getDeltasToProcess(), prismContext));
		}
	}

	protected void recordChangesCanceled(ChangesByState rv, WfContextType wfc, PrismContext prismContext)
			throws SchemaException {
		if (wfc.getProcessorSpecificState() instanceof WfPrimaryChangeProcessorStateType) {
			WfPrimaryChangeProcessorStateType ps = (WfPrimaryChangeProcessorStateType) wfc.getProcessorSpecificState();
			rv.getCanceled().merge(fromObjectTreeDeltasType(ps.getDeltasToProcess(), prismContext));
		}
	}

	private void recordChangesRejected(ChangesByState rv, WfContextType wfc, PrismContext prismContext) throws SchemaException {
		if (wfc.getProcessorSpecificState() instanceof WfPrimaryChangeProcessorStateType) {
			WfPrimaryChangeProcessorStateType ps = (WfPrimaryChangeProcessorStateType) wfc.getProcessorSpecificState();
			if (ObjectTreeDeltas.isEmpty(ps.getResultingDeltas())) {
				rv.getRejected().merge(fromObjectTreeDeltasType(ps.getDeltasToProcess(), prismContext));
			} else {
				// it's actually hard to decide what to display as 'rejected' - because the delta was partly approved
				// however, this situation will not currently occur
			}
		}
	}

	private void recordResultingChanges(ObjectTreeDeltas<?> target, WfContextType wfc, PrismContext prismContext) throws SchemaException {
		if (wfc.getProcessorSpecificState() instanceof WfPrimaryChangeProcessorStateType) {
			WfPrimaryChangeProcessorStateType ps = (WfPrimaryChangeProcessorStateType) wfc.getProcessorSpecificState();
			target.merge(fromObjectTreeDeltasType(ps.getResultingDeltas(), prismContext));
		}
	}

	private ModelContext unwrapModelContext(LensContextType lensContextType, ModelInteractionService modelInteractionService, Task task, OperationResult result) throws
			ObjectNotFoundException {
		if (lensContextType != null) {
			try {
				return modelInteractionService.unwrapModelContext(lensContextType, task, result);
			} catch (SchemaException | CommunicationException | ConfigurationException | ExpressionEvaluationException e) {   // todo treat appropriately
				throw new SystemException("Couldn't access model operation context in task: " + e.getMessage(), e);
			}
		} else {
			return null;
		}
	}

}


text:
The Character Study
Where I pretend to know what I'm talking about
Discussion · Recommendations
Dark Academia Books I Want to Read
27 de Jul, 2021 28 de Jul, 2021 Maria @ The Character Study
It is fair to say that I was hooked on dark academia way before I knew what it was called. My fascination probably kick-started when I decided to watch Kill Your Darlings back in 2014, or arguably a few months before that when I read A Great and Terrible Beauty by Libba Bray. The truth is that I've always been drawn to decadence in storytelling—as I mentioned in my dark reads post—and dark academia does a great job of offering just that. Despite my love of it, I can't say I have read that many dark academia books or watched that many films. It was just back in 2019 that I finally watched Dead Poets Society, and last year that I read THE dark academia book per excellence, Dona Tartt's The Secret History. This comes as no surprise, considering that this genre/aesthetic saw a huge increase in popularity during the pandemic. During that time I also read If We Were Villains by M.L. Rio.
It is also worth noting that I'm very peculiar when it comes to classifying books as dark academia, and there are a few that people sometimes consider as such and I just don't. For me, the necessary characteristics go beyond the academic setting and the moral deviance—although both are vital to the genre— and as such, I wouldn't categorise books like The Raven Boys by Maggie Stiefvater or The Picture of Dorian Gray by Oscar Wilde as dark academia. It's more about a specific kind of feeling that they evoke, but that's possibly just me thinking too deeply about it.
Whatever the case, my ever-growing love for this genre has led me to curate a list of dark academia books that I would love to read—something that I rarely do, I'm not the biggest fan of TBRs, as I mentioned here. So, without further ado, here are the books:
1. People Like Us by Dana Mele
I've been wanting to read this for way to long, and somehow I still haven't got around to it. However, I know for sure that I'll love it when I do, considering it's a sapphic dark academia.
Kay Donovan may have skeletons in her closet, but the past is past, and she's reinvented herself entirely. Now she's a star soccer player whose group of gorgeous friends run their private school with effortless popularity and acerbic wit. But when a girl's body is found in the lake, Kay's carefully constructed life begins to topple.
2. The Atlas Six by Olivia Blake
Everyone talks wonders of this book, and it's big diverse cast of characters is a selling point for me, so I must read it eventually.
The Alexandrian Society, caretakers of lost knowledge from the greatest civilizations of antiquity, are the foremost secret society of magical academicians in the world. Those who earn a place among the Alexandrians will secure a life of wealth, power, and prestige beyond their wildest dreams, and each decade, only the six most uniquely talented magicians are selected to be considered for initiation. Five, they are told, will be initiated. One will be eliminated.
3. These Violent Delights by Micah Nemerever
I'm not sure how I first came across this, but it's made its way up to the top of the books I want to read. Simply looking at the cover gives me the right feeling that I will love it, so I hope it delivers.
When Paul and Julian meet as university freshmen in early 1970s Pittsburgh, they are immediately drawn to one another. A story about two college students, each with his own troubled past, whose escalating obsession with one another leads to an act of unspeakable violence.
4. Madam by Phoebe Wynne
I have to be truthful and admit I don't know that much about this one, and that I was pulled in—once again—by the cover. The reviews are very mixed, but that doesn't make me any less excited.
For 150 years, high above rocky Scottish cliffs, Caldonbrae Hall, a boarding school for girls, has sat untouched, a beacon of excellence in an old ancestral castle. Into its illustrious midst steps Rose Christie: a 26-year-old Classics teacher, Caldonbrae's new head of the department, and the first hire for the school in over a decade. At first, Rose is overwhelmed to be invited into this institution, whose prestige is unrivaled. But she quickly discovers that behind the school's elitist veneer lies an impenetrable, starkly traditional culture that she struggles to reconcile with her modernist beliefs—not to mention her commitment to educating "girls for the future."
5. Plain Bad Heroines by Emily M. Danforth
I've previously loved dual timeline books, and this one sounds right up my alley, so I can't wait to read it. This is one that I've seen around quite a bit, so I have high expectations.
The Plain Bad Heroine Society meet in secret in a nearby apple orchard, the setting of their wildest happiness and, ultimately, of their macabre deaths. This is where their bodies are later discovered with a copy of Mary MacLane's book splayed beside them, the victims of a swarm of stinging, angry yellow jackets. Less than five years later, The Brookhants School for Girls closes its doors forever—but not before three more people mysteriously die on the property, each in a most troubling way. But as a century Brookhants opens its gates once again to make a horror film based on these events past and present become grimly entangled and soon it's impossible to tell where the curse leaves off and Hollywood begins.
6. Ninth House by Leigh Bardugo
Leigh Bardugo's books have been a hit or miss for me. However, this one sounds very interesting and like something I would enjoy. I did start it but had to put it aside, so I look forward to jumping back into it.
Galaxy "Alex" Stern is the most unlikely member of Yale's freshman class. Raised in the Los Angeles hinterlands by a hippie mom, Alex dropped out of school early and into a world of shady drug dealer boyfriends, dead-end jobs, and much, much worse. By age twenty, in fact, she is the sole survivor of a horrific, unsolved multiple homicide. Some might say she's thrown her life away. But at her hospital bed, Alex is offered a second chance: to attend one of the world's most elite universities on a full ride. What's the catch, and why her?
7. How We Fall Apart by Katie Zhao
I've said it time and time again, this is one of my most anticipated reads of the year. There are only a few days left until it comes out, so I'm very excited.
Nancy Luo is shocked when her former best friend, Jamie Ruan, top ranked junior at Sinclair Prep, goes missing, and then is found dead. Nancy is even more shocked when word starts to spread that she and her friends—Krystal, Akil, and Alexander—are the prime suspects, thanks to "The Proctor," someone anonymously incriminating them via the school's social media app. The four must uncover the true killer before The Proctor exposes more than they can bear and costs them more than they can afford, like Nancy's full scholarship.
8. A Lesson in Vengeance by Victoria Lee
Birdie @ Birdie's Booktopia said this was a sapphic dark academia and I was immediately interested. I simply can't imagine sweeter words to describe a book.
Felicity Morrow is back at Dalloway School. Perched in the Catskill mountains, the centuries-old, ivy-covered campus was home until the tragic death of her girlfriend. Now, after a year away, she's returned to graduate. She even has her old room in Godwin House, the exclusive dormitory rumored to be haunted by the spirits of five Dalloway students—girls some say were witches. The Dalloway Five all died mysteriously, one after another, right on Godwin grounds.
9. Ace of Spades by Faridah Àbíké-Íyímídé
Another book I've heard nothing but good things about. The stunning cover was what initially drew me in, but after reading the synopsis I know for sure I want to read it.
Welcome to Niveus Private Academy, where money paves the hallways, and the students are never less than perfect. Until now. Because anonymous texter, Aces, is bringing two students' dark secrets to light. Talented musician Devon buries himself in rehearsals, but he can't escape the spotlight when his private photos go public. Head girl Chiamaka isn't afraid to get what she wants, but soon everyone will know the price she has paid for power.
10. Babel by R.F. Kuang
This is not set to come out until next year, but I'm already highly anticipating it. An exploration of translation as a colonialist tool is genuinely one of the most interesting topics I can imagine.
Oxford, the city of dreaming spires, is a fairytale for Robin; a utopia dedicated to the pursuit of knowledge. But knowledge serves power, and for Robin, a Chinese boy raised in Britain, serving Babel—the world's center of translation and, more importantly, of silver-working—inevitably means betraying his motherland. As his studies progress Robin finds himself caught between Babel and the shadowy Hermes Society, an organization dedicated to sabotaging the silver-working that supports imperial expansion. When Britain pursues an unjust war with China over silver and opium, Robin must decide: Can powerful institutions be changed from within, or does revolution always require violence? What is he willing to sacrifice to bring Babel down?
11. Catherine House by Elisabeth Thomas
One of the first books I came across while I was researching dark academia after finishing The Secret History. Once again, the creepiness of being isolated mixed with the elitism of a boarding school sounds fantastic.
Catherine House is a school of higher learning like no other, hidden deep in the woods of rural Pennsylvania. For those lucky few selected, tuition, room, and board are free. But acceptance comes with a price. Students are required to give the House three years—summers included—completely removed from the outside world. Family, friends, television, music, even their clothing must be left behind. In return, the school promises its graduates a future of sublime power and prestige, and that they can become anything or anyone they desire. A story about a dangerously curious young undergraduate whose rebelliousness leads her to discover a shocking secret involving an exclusive circle of students . . . and the dark truth beneath her school's promise of prestige.
12. The Ivies by Alexa Donne
I first came across this book on youtube—I can't remember on whose channel—and I was immediately intrigued, so I had to add it to my list. What is it about privileged rich kids committing crimes that is so interesting?
Everyone knows the Ivies: the most coveted universities in the United States. Far more important are the Ivies. The Ivies at Claflin Academy, that is. Five girls with the same mission: to get into the Ivy League by any means necessary. I would know. I'm one of them. We disrupt class ranks, club leaderships, and academic competitions…among other things. We improve our own odds by decreasing the fortunes of others. Because hyper-elite competitive college admissions is serious business. And in some cases, it's deadly.
What are your thoughts on dark academia? Have you read any of this books? Do you have any other recommendations?
Published by Maria @ The Character Study
Hi, I'm Maria! I'm a 24-year old book lover from Spain!	View all posts by Maria @ The Character Study
bookish Books dark academia lgbt+ YA
Previous Post Mini Reviews: The Pronoun Book and True Loaf
Next Post The Feelings Book Tag
14 thoughts on "Dark Academia Books I Want to Read"
1 de Aug, 2021 at 1:25 pm
Love the list!!! ❤ I definitely want to read every book you mention, I love dark academia books 😍👏🏻
Maria @ The Character Study says:
I'm glad you liked it! Dark academia is such a fun genre! ❤
Veronika @ Wordy and Whimsical says:
I looooved Ace of Spades and Plain Bad Heroines, so I really hope you'll love both of these novels. I want to read more dark academia, so now I'm off to check out the books I haven't heard of from your list. 😀
I'm really looking forward to both of them, I have high hopes!!
journeyintobooks says:
Great post, I have been meaning to pick up more dark academia and will definitely give some of these ago 💜
I'm glad to help, I've done my fair share of research for more dark academia books!
Pingback: Book Bloggers Appreciation | July 2021 💻 – A Book. A Thought.
Birdie @ Birdie's booktopia says:
5 de Aug, 2021 at 12:45 pm
YESS A lesson in vengeance is so good!! I hope you'll love it, thank you so much!!
I hope I do too!
tasya @ the literary huntress says:
7 de Aug, 2021 at 7:03 am
So many amazing titles! I also have The Atlas Six, Plain Bad Heroines, How We Fell Apart, and A Lesson in Vengeances on my TBR!
7 de Aug, 2021 at 10:07 am
I'm so excited to read them all!!
Pingback: Lately With Lila July 2021 | The Lazy, Hazy Dog Days Of Summer – Hardcover Haven
Pingback: Book Review: How We Fall Apart by Katie Zhao – The Character Study
Pingback: Book Review: The Atlas Six by Olivie Blake – The Character Study
Storygraph
Book Review: How to Marry Keanu Reeves in 90 Days by K.M. Jackson 11 de Jan, 2022
2022 Reading Wishes 7 de Jan, 2022
December Wrap-Up 4 de Jan, 2022
Follow The Character Study on WordPress.com
Get the latest blog posts right in your inbox! 🌼


Rudi Vandeputte brings us this slice of pinhole dreaminess.
Rudi likes to work with his Olympus Pen camera, set up with a Wanderlust pinhole cap and a Gorillapod – an enviably mobile configuration for sure!
We chose to share Rudi's pinhole photo because of how well the format fits this subject. The natural vignetting of the pinhole, and the soft focus, highlights a feeling on this beachfront scene that evokes memories of childhood vacations. Enjoy!