What should I consider when creating a time travel adventure?

Question: I'm sure that many would advise against doing so at all, but knowing that I will likely try to do so anyway, what are the factors I should consider when creating a time travel adventure?  Specifically, what spells might accomplish this feat, what effects might time travel have on memory or spellcasting, and what paradoxes would I have to take steps to avoid (ie characters killing themselves), and what resources might already be out there to help me with this attempt?  I am working in a Dungeons and Dragons v3.5 setting, but any other systems with elegant solutions/resources/mechanics that you could point out would be appreciated...
Comment: [Time travel tropes](http://tvtropes.org/pmwiki/pmwiki.php/Main/TimeTravelTropes) should be considered.
Comment: [Just a picture](https://9gag.com/gag/5795881)
Comment: Two games worth looking at that are specifically *about* this: **Feng Shui** (where characters messing with the timeline is part of the point) and if you can find it, **Continuum** (where all PCs are epically powerful time travellers, but dare not alter their own futures, lest more powerful future time travellers take care of the paradox for them.)
Comment: The new TimeWatch game from Pelgrane is a GUMSHOE system time travel game, but is full of advice for any time travel GM. Don't know if you can still get the kickstarter rules or will have to wait for release.
Comment: [Wikihistory](http://www.tor.com/stories/2011/08/wikihistory) seems like a deliciously appropriate link for a site where we're capable of editing each other's answers. :)
Comment: This link is awesome!  I will have to take some time to read through it all, but it is exactly the kind of material I was looking for.
Answer: I have been DMing a Time Travel campaign since quite some time, with characters having the power to travel in time more or less at will (but only as a group), and here is what you should be careful about.
Timeline Alteration
My players are surprisingly responsible and are trying to avoid to change the timeline as much as possible, even when I encourage it. Basically you can allow it, warn them beforehand of the possible consequences, and allow only one in every "era" they are in.
So if they travel to medieval Japan, they might accidentally (or willingly) do something that would shame the image of katanas, and no one would ever dare use a katana again in Japan. If later they accidentally kill the Emperor, I would use the "Well, someone else take his place, and that's who History remembered" trick.
The only kind of alteration you need to be careful about is:
Paradoxes
One way of handling it is the "Time protects itself" trick. Alterations are allowed, but if you do something that would cause a paradox regarding the previous events, Time prevents it. You shoot a bullet at your father before you were born, the bullet disappears. You try to stab him, the knife disappears. You try to strangle him... Well...
It's also a good way of leading the PCs. Sometimes in a fight, they realize that they can't kill their opponents because of Time Self-Preservation, but they don't have any idea of who those opponents are exactly, or why it would cause a paradox if they died. One of the PCs also got hunted by one of his ancestors who was disappointed in him, and tried to murder him repeatedly. That PC was unable to fight back, as it would have caused a paradox. Fun times :)
As said above, you can also use the "Rubber band History" method. They can do changes, but whatever change they make ends up being smoothed over by History. They could kill their grand-father, but their grand-mother actually found someone else, who is who they remembered as their grand-father. Or a character kills himself when he was a baby, only to realize that he was actually a clone from the beginning. You can get more options here, but for a RPG game "Enforced Immutability" and "Rubber Band History" are your best bets.
How?
This is the easiest one: there is no way to do it in RAW. Done. So, invent what you want! A trip to the Astral plane gone wrong, two "Time Stop" spells interacting.. The parameters you have to consider are:

Do you want the Time Travel method to be easily reproductible?
Do you want it to be one way? Two-way (to past and back, or to future and back)? Flexible (from whatever point in time to any other point in time)?
How accurate do you want it to be? Can characters travel two seconds in the past if they want? Or one day? Or are they limited to specific "nexus" in time?

Final Advice
DMing Time Travelling is awesome and very rewarding, but you will have to plan a lot and be very flexible in your scenarios. Take advantage of it and plan relations and links between different characters and places:

"The witch you just captured has the exact same eyes as the old lady you met yesterday! And you remember the old lady telling you she didn't remember her past and was found injured at around the same age than the witch, years ago..."

...but keep it open and vague, and be ready to have to change it at the very last moment, and to adapt seamlessly:

"So, you killed the witch... Congrats. You go to deliver the human sacrifices, and realize two things: the only one alive is a gravely injured little girl, and she has the exact same eyes as the old lady you met yesterday! You also remember the old lady telling you she didn't remember her past and was found injured at around the same age than the little girl, years ago..."
Comment: @thedarkwanderer That was 5 years ago, I have no idea. I'm guessing that since the question mentioned D&D I was replying to that (hence the mentions of Time Stop and the Astral Plane)
Answer: There are two ways you can handle this.
The Resilient Traveller Theory
The Doctor is a resilient traveller. Everything that has happened in the series has happened to him in his almost 1000 years of life. Doesn't mean it's all happened to anyone else. For instance, the Battle of Canary Wharf had never happened by the time the 11th Doctor met Amy Pond. This is why we are constantly surprised by the aliens, despite them destroying London since the 60s.
To make this work, keep the frame of reference on the players at all times. Play up the difference between what they know and what actually happened. When someone leaves the players frame of reference, there is no guarantee that they will exist next time the players go looking in that time period.
In actual play, playing up that difference would include scenes like:

PCs have not been born in the new timeline. They have effectively appeared fully formed out of thin air. Imagine Back to the Future if Marty hadn't started fading.
Big events that the players have been involved in haven't happened. "You remember, Daleks flying all over london. Laser blasts. Giant metal men walking every street in the country? That's odd, it only happened counts on fingers three years ago."
NPCs are different. That helpful barman who's always willing to listen to your problems is different since you came back. Turns out that his house is being foreclosed in this timeline.
The time machine doesn't exist anymore. The changes bubbled out and now there's no way to go back and make things like it was. Unless you can rebuild it.
APOCALYPSE! You screwed up bad. Time to see what the consequences of your thoughtless actions were.

These should only apply when people revisit a particular time and area; they have more impact when they have a home base they keep coming back to.
There is a Doctor Who: Adventures in Time and Space system put out by Cubicle 7 that may work well for you as a game. It's a light rule system which has a great combat resolution order for the source material. In any round the talkers get to go, then the runners, then the people who want to fight.
Fate, Heal Thyself
This comes from a description of Suzerain that I've been given. It sounds like an awesome, yet almost unplayable, game.
First a quick description of the setting. You are avatars of powers that have found themselves one moment before the end of existence. To keep existence going just a little bit longer, these powers figure they have to send you back to fiddle with elements of the past. Imagine Quantum Leap if Beckett was an avatar.
The simplest example is "make sure that this person in New York dies at a particular moment". Easy, right? Just push him in front of a car.
Fate doesn't like this and something happens. The car swerves at the last moment and causes a major pile up, but your target gets up and walks away. Then you get sent back to do it again, but this time, not only do you have to kill this person but there's a major pile up going on at the same time.
To actually achieve your goal, you have to create a major distraction for Fate and on your second or later run, actually do what needs doing.
That's not too bad. But just imagine the situation if you have to help Samuel Coleridge to write all of Kubla Khan without distraction.
You can use this to help protect "key" events from being disturbed. Hitler moves at the last second to avoid a sniper bullet. An extra seed falls to grow a tree in a slightly different place. Somebody has a slightly different surge of electricity in their brain that causes them to think of a different pop song. And so on.
Comment: Maybe you could elaborate a bit more on the resilient traveller theory for people (like me) who haven't watched that series or played the game?  For instance "Play up the difference between what they know and what actually happened" ... I don't quite follow.  Sorry for my denseness!
Comment: +1 for the Resilient Traveller Theory. It's surprisingly good for roleplaying games, since it's generally easy for players to get their heads around, allows players to keep their characters when they accidentally erase themselves from the timeline, and enables the particularly fascinating kind of exploration and investigation gameplay that results when once-familiar time periods are changed in small but meaningful ways.
Answer: The two most important considerations in my experience are Player Knowledge of the Setting's Timeline, and Change resolution.
Several minor considerations as well exist - Paradoxes, Languages, Mana Levels, Social system changes... but those are secondary.
Player Knowledge of the Timeline
Time Travel in fiction is axiomatically about changing events in the past. The question is, whose past? In a D&D game, players may have only the vaguest sense that the world even has a past, let alone what it is. In a near-future Earth setting, players should have at least some concepts of the timeline. In a Traveller 3rd Imperium game, players can look up key elements easily, but there is little support for actually running back in the early days. (Milieux Zero was badly flawed - and one of the most cited reasons for the ultimate failure of T4, as it was set in the "past" of the OTU... and had the same maps and populations as the 1000 year later main setting from earlier editions.)
When players become unstuck in the timeline, it's very easy to get lost in differences between GM knowledge and player knowledge. Lack of knowledge even figured into the plot lines of some of the non-game time-travel fiction: Voyagers!
If some event in a fantasy timeline is to be changed, it needs to be both iconic and tied to character motivations.
Change Resolution
If players are mucking about in the timeline, they've got several potential reasons to do so... to undo some error in their own actions, to see what might have been, to escape a timeline that either bores or oppresses them... or because it's simply the conceit of the game, such as games based upon Voyagers!, Quantum Leap or Sliders, where not everyone along is intentionally so.
For those who are looking for changes, figuring out what changes happen because of the PC actions is a strong point of argument for many players. It touches on both "Elastic Time" and "Thread-hopping Traveller" elements, as well as "If I can go, so can they." It also can be the "Nail Mission From Hell," and the more commonly known  "Butterfly Effect." (See Ray Bradbury's "A Sound of Thunder" for the origin of the term.)
Elastic Time
No matter what you do, the timeline adapts to minimize your changes. You go kill JFK in 1958 to prevent the Bay of Pigs, RFK becomes president and gets assassinated at Dealy Plaza, having authorized the Bay of Pigs. You kill John Wilks Booth, and a drunken prostitute assaults President Lincoln, fatally wounding him, right after the play. Or just before.
In an Elastic Time game, it really doesn't make a whole lot of difference what the PC's do - when they get home, it's status quo.
Thread-hopping Traveller
The Thread-hopping  Traveller is an odd phenomenon - Dr. Who is the archetypical example. The Time Traveller who knows lots, but is never certain what he's going to find after any time jump, because wherever he is, he wasn't, and he might never hit the same strand of time again.
It's a core element of both Sliders and Dr. Who that the Time Traveller is constant, and the universe is not... but the two have different means and understandings. Each jump is, essentially, to a different pocket universe, and so the effects of mucking about are pretty immaterial... unless you have some means of getting back.
Butterfly Effect
When they get back, nothing is the same. Even the tiniest changes have massive and far reaching consequences. That smoke Joe lit up in 63 AD caused an Italian hurricane in July of 64 AD, preventing the fire of Rome... the heat from it disturbed the chaotic system and that grew over 18 months to cause a strange and unseasonable storm that left rome wet-but-standing. That butterfly Jill stopped from feeding in 152 BC didn't make it, and so there are now almost no ravens in 1960. And because of the lack of ravens, lots of bears and thus people starved, making the western conquest of North America a pushover, forcing the Mormons to flee the US to Siberia, rather than Salt Lake City...
Or, killing one guard in Babylon results in all the jews being put to death, rather than enslaved, in the Babylonian Exile... No Jews, no Christians, No Christians, and almost all post AD500 history is null and void. Islam also is fundamentally changed, if it even comes to exist.
Butterfly Effect is also at the heart of many time travel stories, but it is, most fundamentally, a reason to never return from the past - because anything you do ruins your timeline so badly that it's essentially a different place.
Nail Mission from Hell
A nasty variation on either elastic or butterfly effect timelines is that accomplishing something can be extremely hard, and/or require multiple precise changes with many return trips.
In some such stories, the return isn't a return - merely an info-dump into the past from a future where the protagonist is about to die. A Star Trek: The Next Generation Episode used information-only time looping; Data had to break the time loop by sending messages back to himself. Great as fiction, lame as a game mechanic.
In others, one has to go back, and make a single precise change. Talk to no-one, just whack the needed guy, and get out.
In still others, on might be stuck until some element of the timeline is fixed - the whole premise of Quantum Leap is that he becomes unstuck the moment he fixes the timeline.
In the Nail Mission from Hell, one has not only the issue of player knowledge of the timeline, but also getting the clues on how to succeed into the players' hands.
Paradox
Paradox is when you do something that makes it impossible for you to have done that same something. The classic example is the Grandfather Paradox: You go back in time and kill your Grandfather before your parent was born, and you immediately cease to exist, and thus haven't killed your Grandfather. Another is snagging an A-Bomb an blowing up the Manhattan Project while it's still in Chicago.
In Elastic Time, the Grandfather Paradox resolves by simply having your grandfather have been cuckolded... the man you thought was your grandfather never was, but the milkman knocked up your Grandma. The A-bomb gets developed by someone else and due to bad placement, most of the city survives.
In Butterfly Effect, your arrival alone alters things drastically, so you might cease to exist upon return, or even fade out like Marty in Back to the Future.
Even in middle of the road settings, many time travel theorists posit that you can't create a paradox - fate will prevent you from doing anything that would cause a paradox - the A-Bomb fizzles, You merely wound grandpa who miraculously recovers and sires mom.
In Thread-hopping, go ahead and kill Grandpa - it doesn't affect you, because you don't affect your own past, but some other timeline, where you may yet exist, or not, and so in a literal sense, tho' you have the same genes, he's not actually your grandfather, just the man with the potential to sire another you.
Languages
We don't actually know for certain how most pre-modern languages sounded. We can guess, but guessing wrong can be fatal for a time traveller. If I go back even to 1960 and ask for a cell phone, I'll be presumed to be either a monastic or criminal wanting a phone in their cell. In 1700, I'll be considered a madman speaking gibberish. In 1700, a computer is a person rather than a machine. At best, people from 1700 would think my accent strange, even were I to be in an area speaking English - many words have changed a lot in 300 years. The best examples are old rhymes that no longer are.
This is the single-most overlooked time travel stumbling block overlooked in fiction, and it's also frequently overlooked in gaming.
If making accidental time travel, or one-way, it's occasionally fun to have the players have to learn the local langage the hard way.
If Time Travel was planned, it's best to either have some variant on the babelfish or a universal translator as an implant, or to otherwise render it null, because usually, it's not that much fun, especially not every new jump.
Final Advice
Make certain your players are on board with time travel as a game conceit. Especially since you're looking at D&D. Make certain they know when they're going, why, and what the historic matter is that they are going to change.
And pick a semi-resilient timeline - one that ignores minor changes, but major items can be readily done as simpler nail missions. Have paradox prevention be part of the timeline - anything that would result in paradox simply fails. And when it doesn't fail, it rebounds. Kill enough Grandpas, and turn granny into a roundheel... but you still exist. Kill both granny and grandpa, and mom was adopted anyway.
Answer: The question did ask for resources and I have to say that GURPS Time Travel is essential reading here. There are some game stats but most of the book covers the kinds of things all GMs need to know (and there's also a condensed timeline of human history, which might not matter much for D&D).
Comment: And if the 3e book *GURPS Time Travel* is not available, its extensive advice for constructing/managing time travel campaigns is incorporated into the 4e book *GURPS Infinite Worlds*.
Answer: I would lean towards creating an alternate timeline.  The party goes back in time, changes the past, returns to the "present", only to find things they love and care about are not as they remember.  The characters themselves are unchanged and know a different history to the people inhabiting the timeline they're in.
Depending on their actions in the past, there could be permanent changes in the way magic works.  Magical items may have a side-effect that wasn't present in their own timeline.
Now that they've joined a new timeline, they are dopplegangers of their selves who were born in the new timeline.  This prevents autohomicidal paradoxes.
This allows the time travel element to entirely boil down to story telling and does not require any new mechanics, making it suitable for any system.
Comment: Warning: Do NOT split the party and allow some to travel and others not to. Reasons should be self-evident.
Comment: So long as your players can handle having different in-character memories, splitting the party and changing time could be fun. Just make sure everybody agrees to it beforehand.
Comment: I would be more concerned by the unfairness for the non-travelling characters, who kind of "miss the fun". On another hand, I've tried characters Time Travelling to different eras, but same place... Difficult but awesome :)
Answer: I have little to offer in terms of actual game mechanics - even if I read a couple of fairly old-school games based on time travel.
I just want to urge you to keep in mind what "time travel" really is at least at the narrative level. It's the chance to redeem some past error, or at least to use hindsight.
A second chance - assassinate Hitler, do not drink too much that fateful night, save your loved one from the fire... or die trying.
Having said this, it works best with just one character (especially because he will often have to meet a future or past version of himself) - so traditional group playing will not work very well, I am afraid. Unless time travel is just a gimmick to go visit some sort of "alternate place".
In any case, if you don't know this already, I suggest you read The Merchant and the Alchemist's Gate by Ted Chiang which is an extremely well written short story about what Time Travel is, and in a fantasy setting, to boot.
Extremely recommended.
Comment: There's a third role for time travel in narratives, almost as prevalent as the two you have mentioned, though more easily overlooked. Besides being a way to fix mistakes and engage in tourism, time travel can also be a powerful investigative tool: It allows agents to observe both the aftermath of a event and the circumstances that led up to it, thereby gaining a fuller understanding of the event itself. In fiction, this information is usually immediately applied to trying to change the outcome of history, but this need not necessarily be the case in an RPG.
Comment: You are correct. I'd add another take on it (even if in a sense it could be considered a twist on the "tourism" genre). In "To Say Nothing of the Dog" (by Connie Willis) agents travel to the past in order to "import" back to the present lost art pieces. I.e. the past can be "mined" to get things not available anymore (e.g.: works of painters or writers) - the catch is that you can only get stuff that was really lost, in order to avoid altering the timeline.
Answer: With regards to spells to accomplish the feat, I would suggest against making them player available. If they can scoot back-and-forth through time at will, then they will play merry hell with your game planning. Given them specific means of time travel, limited as dictated by your adventure. For example in my game, they had access to a tower that would allow them to travel through time, but was only available to them after certain events had taken place, didn't exist in the time they travelled back to (they had to build it themselves) and then became dormant after they returned.
With regards to memory and/or spell casting, I don't think it's wise playing with these things; if you change character memory as a result of time travel, then you will have endless problems trying to reconcile player and character knowledge, and you'll also have significiant problems coming to terms with exactly who knows what, and when. Keep it simple. Players always know their historiers. NPCs might not always remember then same things the players do.
With regards to paradoxes and similar, it depends on the constraints of your world. In my game it was relatively simple, since they travelled back to a period none of them had much familiarity with, and sufficiently far in the past that any major changes they made could have been smoothed over with the passage of time. Per another answer above, my players were actually very cautious about the time line, and did only what they were supposed to do in the past.
In a game where they travel back to somewhere nearer the "current" time, then you have to be very careful; I think the best solution is to ask (yourself) what it is that they're trying to achieve, and make sure that they have reasons to stick to the plot.
I suggest that, unless they are trying to undo something they did, that you explicitely state that they can't undo anything any PC did. This rule alone gives you a lot of leeway in restricting actions, and most players are willing to accept that they shouldn't be able to change the actions of another player (clearly going back in time to correct a mistake needs to be an exception to this).
Finally, I think you should consider carefully what you will allow them to change, and work within this to allow for them to affect the world they return to. Players love to see that their actions have had an impact, and things as simple as changing the name of a major city in the "present" can be a huge reward for them.
Answer: One way it could be:
The characters' existence and past is the result of many observations and reported observations. Not all of those reports have to be true.
Part 1

While walking home, I cut through an alley where there isn't anybody else and I fall and break my arm. I go to the hospital and say "I fell and now my arm hurts and I think it's broken.

Part 2

While walking home, I cut through an alley where I don't see anybody else, you step out from the shadows and attack me breaking my arm. You then threaten to kill everyone I hold dear, if I reveal you did this. Believing you will follow through on your threat, when I go to the hospital I say "I fell and now my arm hurts and I think it's broken."

Those two result in the same actions and observations and so it is possible for you to go back in time and be the cause of my broken arm.
The catch is that if your actions don't result in me saying the same thing at the hospital (the next point I am observed), then the universe will start erasing you from existence at the point of the change. If I see you come out of the shadows to hurt me but then you disappear, I am likely to say something about it so your existence at that point must be erased too. The logical conclusion is that if you can't force me to say the right thing at the hospital you will fade from existence at the moment you step into my view.
Since the outcome of your actions isn't known until they occur, you perceive your existence beginning to fade the moment you make a real change (get close enough for me to know you intend to interact with me) and it lasts until the results become fixed. Either your intimidation succeeds at which case you were wholly solid all along, or I'm stubborn and don't go along with it at which point your attack never happened and I did actually trip.
This approach preserves history as the players know it but also gives them some ability to accomplish things in the past if they can figure out how to keep the future aligned. It is essentially a "puzzle" scenario and so your players must enjoy that type of thing. I would also rule that their personal history is untouchable, because they have already observed everything that has thus far happened to them and would already know if they will have intervened in their own timeline.
Comment: sorry meant to preface it with here's one way it could be:
Comment: That would help put it in context, yeah. You can edit your answers here after the fact, and that's encouraged when it improves them. I've edited that preface in for you, anyway. :)
Answer: Better yet,you can just have your players be outsiders. So they can't see their parents or other people that can affect them.So you just lose that problem
Comment: Please note that your answer needs to provide an answer to the question being posed using sources, citations, and personal experience to support your answer. I strongly recommend you edit this to include these items or you'll see a lot of downvotes.


2D-otsu algorithm in Digital image processing

Question: I'm working on image project using Matlab & I heard about 2D-otsu algorithm as effective segmentation with low SNR and low contrast images, but I can't find enough information about it or how to implement it. I'll be thankful if anyone can help me in such case.
Comment: the 2D otsu which counts the local average gray level as w by w window  so the decision is taken by both the max variance between class and the min within class
Comment: If I understand correctly from your description, it is an algorithm based on Otsu histogram bimodal thresholding method which has been modified to perform locally adaptive thresholding? You can read about locally adaptive thresholding in general (which performs thresholding with sliding windows), and then plug in Otsu there.
Answer: The Otsu algorithm most responders are referring to, is the 1D algorithm indeed, exactly for the reason mentioned above. The main drawback is that it does not work very well in images with low s/N ratio or low contrast. Also, when you only have a small object with a big background, Otsu will incorrectly select background pixels.
The 2D Otsu provides a solution to this. I don't know the maths involved, but it performs '2D histogram projection', I found it was well documented in:
J. Zhang, J. Hu, 2008 International Conference on Computer Science and Software Engineering
From what I understand it projects the histograms in such way and then applies some filters to it so that the peaks relating to the 'object' will appear more profound in the resulting histogram, enabling better segmentation.
Both algorithms can be applied in 2D and 3D ( to add some more confusion).
Answer: The Otsu's method works on the histogram of the image, and it is implemented by the graythresh function.  I don't know what 2D-otsu algorithm is...
Answer: Otsu's method sets a threshold on the image such that the intra class variance is minimized. The wikipedia article has a reasonable description and example implementation.
As Dima points out it is implentented by graythresh in matlab, but only if you have the image processing toolbox.
If you want to see Otsu's original article it is here (might be paywalled I didn't check).
It is a bit of a misnomer to call it the 2D-Otsu as the method set the threshold only on the pixel intensity and does not account for position/dimensionality of the image.


Fresh pearl onions vs frozen

Question: Our recipe called for frozen pearl onions & I only found fresh.  What do I need to do to the fresh ones?
Comment: Can you post the recipe? Do they get cooked substantially?
Answer: Fresh ones will require peeling, and probably slightly longer cooking, as the freezing process tends to break down some of the cell membranes. The frozen ones are typically pre-peeled.
The easiest way I've found to peel pearl onions is to score them accross the top in an X pattern with a paring knife, dip them in a pot of boiling water for 15 seconds or so, shock in an ice bath. Then, one by one, grab them by the stem-end, and squeeze gently -- the onions will typically pop right out of the peels!
Again, depending on the dish, you may have to cook them a little bit longer. If it's a fast saute or stir fry, you may want to leave them in the boiling water for another 30-60 seconds when you're peeling them to soften them up more. If it's a long braised or stewed dish, I wouldn't bother.
Answer: Peel them and you are ready to go!
Answer: Onions tend to soften when they un freeze, so if you only get fresh ones you can always rinse them for 15 minutes in boiling water or if you have a couple of days, put them in the freezer :-) there you go, frozen pearl onions for you!

Fresh pearl onions vs frozen


Efficient way to secure tomcat database connections

Question: Our customer has a problem with database information in plaintext within a server.xml or context.xml file on the Tomcat server.  I've looked at several sites like OWASP and it seems like there's no obvious solution.  I've also seen things like this wordpress blog which describe implementing a custom Tomcat extension to do this.  There must exist some standard implementation(s) already without having to roll your own.  Does anyone have experience with such a solution?
Answer: The password is currently stored in plaintext in the config file.  The alternative, which is often used in, say, DES-encrypted SSL private keys, is to use a symmetric algorithm to encrypt the sensitive data.
This would be no more secure than just storing the password in plaintext in the .xml file. The service would be configured with the encryption key of the encrypted secret (unless you require someone to be at the keyboard to enter the password every time the service starts), which can be used by an attacker to get at the encrypted data.  This provides a layer of obscurity, but not a layer of security.
Comment: Ah, well, that means encrypting the password text is not really a solution even if it is what they "think" they want. Are there better solutions to securing the connection information?
Comment: @Graymeister Secure the system that the service runs on, and secure the file that contains the password so that only the service's user can read it.  If the service itself is compromised, the database connection is compromised, password or not.
Answer: Encrypting the password is marginally better than having it plan text.  CVS does a character replacement of its plain text password to protect against accidental disclosure when browsing files.  The file containing the password needs to be properly secured no matter what the form.
A standard encryption method is marginally better than a plain-text password.  This is a well recognized security risk.  A simple method such as CVS uses does protect against accidental disclosure to administrators who have access to the file.
MySQL allows restrictions based on the originating host which I would implement if that is your database.  Database servers of any sort should have limited access.
Once someone gains access to your host, the battle is pretty well lost.


Open farthest right tab in Safari

Question: In Chrome, one can press cmd+1 to open the first tab, cmd+3 to open the third tab, etc...  Safari has replicated this behavior now but has not replicated cmd+9 which takes the user to the far right tab even if there are dozens of tabs in the window.  Is there a way to map cmd+9 or another key mapping to that action?
Answer: That was a fun question to tackle! Follow the instructions below and paste this code in step 1.8:
set n to 0

tell application "Safari"
    repeat with w in windows
        try
            set n to n + (count tabs of w)
        end try
    end repeat
end tell

tell front window of application "Safari"
    set current tab to tab n
end tell

This will tell Safari to change to the right most tab. Then, to map it to a key shortcut, just follow the steps listed here by Monomeeth which is shown below. The code was adapted from here
In summary you will need to use:

Automator to create a service that runs an Apple Script
System Preferences to assign a keyboard shortcut to the service

Below are the steps involved for each.
1. Create a service using Automator

Launch Automator (usually found within your Applications folder)
Go to File > New
Select Service and click Choose
In the top right hand of the window that appears, ensure that "No input" is selected from the Service receives drop-down list
Ensure the In drop-down list is showing "Any application"
In the second column containing the long list, find "Run AppleScript" and double-click on it
This will add the Run AppleScript window on the right
Now, replace the (* Your script goes here *) with the script you want (the one I provided above)
Save the service using a meaningful name (e.g. RightMostTab).

Now to the next step.
2. Creating your shortcut

Go to System Preferences > Keyboard > Shortcuts
Select Services from the sidebar
Find your service (it'll be in the list on the right-hand side)
Add a shortcut by double clicking on the service name
Now go to System Preferences > Security & Privacy > Privacy
Select Accessibility in the sidebar
Click on the + sign (you may need to unlock the padlock if it's locked)
Add Automator.
Add Finder (to find this you will need to navigate to /System/Library/CoreServices/Finder.app).
Exit your System Preferences.

Let me know how it goes!

Open farthest right tab in Safari


SQL Server Backups on DataDomain

Question: Our sysadmins keep pushing us to use data domain and DD boost for taking our SQL Backups.  Has anyone successfully used this solution?  I know what Brent Ozar says about Data domain and sql backups. But apparently the DD boost makes it a better solution.  Has anyone used DD boost and also used SQL Backup by redgate? Just wanted to get thoughts on what you would say to your sysadmins and managers apart from this article from Brent Ozar.
Comment: Make sure you read the comments on that linked blog post - they're pretty enlightening. Especially the ones from Data Domain folks who keep saying, "The new version is better" but then won't provide numbers or proof. Interesting.
Comment: Brent. I have a similar request from our sysadmins. Granted the verifies and restores were slower with DD but they claim that with DD Boost and with DD6800 (SSD's in the controllers for disk read/write access specifically) , it is faster. They also claim they are now able to send back the data compressed and have the server uncompress it. Just curious if you have heard of this from any other clients or if this product is discussed in any of the SQL Pass/blogs? Your comments/feedback are much appreciated. Thanks!
Comment: @BrentOzar see some long-awaited actual numbers in my post below!
Answer: Data Domains use their own deduplication and compression features, which don't always play well with SQL Server's own compression. That's the main point.
Whether this is problematic or not depends on many factors. If you're not compressing your backups with SQL Server, the Data Domain will be able to deduplicate the data more efficiently, but more data will have to travel through the network. If you're compressing your backups, the Data Domain will deduplicate less efficiently, so your sysadmin will likely push you in the uncompressed route.
Another possible issue is an higher amount of time for restores, since the DD will have to apply its magic to the data before making it available to you.
In the end, there is only one way to know for sure: test it. Take backups with and without DD for a significant amount of time (take at least the number of backups you will normally keep online - say 1 month), with and without compression. Restore those backups to a test server regularly, compare the backup/restore times with and without DD and draw your conclusions.
We tested the impact of DD on our backups and it turned out to have an acceptable impact on performance in our case, especially taking into account the advantages offered by DD. YMMV: your RTO may or may not not allow such impact.
Answer: Yes, we've successfully implemented DDBoost SQL Agent Backups to a Data Domain backup device and seen fast backups and restores with good de-dup ratios. It's not perfect, and definitely should be well tested in your environment, but with the right settings, seems to work well.
Brett's 2009 article is describing a scenario where that deduplication takes place immediately before data is written to the storage device. In that case, he is absolutely right about the dilemma:

Bad Option A: Use SQL native (or 3rd-party) compression to send compressed backups over the network, annoying your storage admin since already compressed data dedups badly.
Bad Option B: Don't use backup compression, which means backups and restores take longer, since the entire (uncompressed) database has to travel across the network.

EMC's DDBoost MS agent (DDBMA is their acronym) in some ways works like SQL native compression (and 3rd party backup agents), it compresses the backup on the client side before sending over the network.
In addition, though, the client-side compression/de-duping is done in a way that is compatible with how the de-duped blocks are stored on their appliance, and they claim they can do some sort of weird "block lookup" thing to see if it even needs to compress and send the bits across the network at all! Sounds kind of like black magic to me (obviously something has to go over the network), here is their super vague marketing diagram:

To be clear, DDBMA is already a 3rd-party SQL backup agent, so wouldn't be compatible with other 3rd-party backup agents like Redgate Backup or Litespeed or whatever. That means, though, that we can just test it against native SQL compression, or against Litespeed, in an apples-to-apples comparison.
(Caveats: all environments are different, test with your own databases, results may vary, do not taunt happy fun ball.)
In our testing, we found that backups and restores were slightly but not intolerably slower using DDBMA than SQL native compressed backup and restores to the same device. In our case, the resulting de-dup space savings (especially across time, and across multiple environments that have similar copies of the same huge databases) was enough to tip the scale.
The key to getting good performance, we found, was to use the "-S" switch to enable backup striping to multiple files. Now, you can do this with native backups as well (BACKUP DATABASE foo TO DISK='foo_1.bak', DISK='foo_2.bak'), but I seldom see people using this feature.
Here were our backup test times for a 1TB test database:

(The longer times for SQL compressed were a quirk of this one DB, we think it had to do with internal row/table compression.)
The single-stripe DDBMA backup times were extremely concerning at first, until we found the -S switch.
Restore times (of a different db) showed a similar trend (title should be 300 GB, not 300 MB):

I should note that the latest version of DDBMA (v3.5) supports a compressed restore option (which I have not extensively tested), so these times might improve even more.
In our environment, the time savings (vs uncompressed, which is what we were doing previously) were significant enough that we no longer do nightly differentials, even on our largest servers; we do nightly fulls everywhere. Our weekend full backups used to take 12-18 hours on some boxes, and now run in 1-2 hours.
All that said, it's not a perfect tool. I find the UI quite awkward and the TSQL script syntax annoying. Versions prior to v3.5 had a bug that made some UI actions (and scripted tran log backups!) super slow, which is now fixed. v3.5 has a new bug that tries to restore files to the server default file path when they should go to the original file path.
I can't speak to cost/value/ROI or anything, I was just tasked with testing different SQL backup methods to this device.
Answer: We use DDBoost for Veeam backups and not with our SQL Server environment, yet.  We were able to test native SQL backups/restores versus native SQL compressed backups/restores and found the best option.  We use SQL 2012 compressed backup and transmit from one DataDomain 2500 to another DataDomain 2500.  The restore for the SQL 2012 database was slow until I found the best performance using this SQL query.
RESTORE DATABASE foo FROM DISK = '\\datadomain-01a\site-test\test_DB\foo_ddmmyy.bak'
WITH REPLACE, blocksize = 1024, buffercount = 2, maxtransfersize = 524288

We recently upgraded from SQL 2012 to SQL 2014 and the compression ratio on the DataDomain 2500 (OS: 126.96.36.199-532316) decreased from around 7x to 1.3x, equating from transmitting 50GB to transmitting 200GB.
Answer: its not black magic and it seems that Brent Ozar don't know a lot about Deduplication or maybe his post is very old! with right configuration its 10 times faster than native sql backup and backups will consume extremely less storage between 10 to 30 time less storage needed for storing backup.
just add to that SQL backups can bansported using FC not Copper and data can be Deduplicated at source not Destination! you can have full backups with speed of tlog backups.
also rehydration of data in DataDomain is 100% transparent its so fast no one can feel it.
recently 2020-2021 backup solutions add incremental restore feature in their products, they don't even need to send full backup data to client for restore just changed blocks from last backup! i don't know how this gonna work for SQL but for VM its a winner.

SQL Server Backups on DataDomain


Could the flagging profile be clarified?

Question: Can we please make the flagging weight page better? When I go to my profile, and I see my flag weight has changed, I click on the flag weight button, and the thing is, I can't tell which of my flags are valid, invalid, or not yet reviewed. Could we please format it so that there are three sections?
Answer: Hi; you might find this meta.stackoverflow discussion useful: Please show what flags were deemed good or bad
But the short version — it is intentional that it isn't displayed.

In most cases, it should be obvious from the follow-up information (deleted, edited, left-comment, etc.) if it has been enacted.
We really value (appropriate) flagging, but often flags can be a bit subjective. As such it is not necessarily helpful to focus intently on any one single flag.
The other issue is that it then creates a "hey! why was my flag rejected?" loop... Moderation takes effort by our much-valued community moderators, and we don't want to make that worse by having to justify every single call (again, emphasis on the subjective nature). Whether this is proactive (choosing a reason at post of rejection) or reactive (trying to think back when somebody raises it on meta), we don't really want to add more work there.
And (related) we don't want users to start getting worked up about it, either.

In fact, for many of the above reasons we didn't show anything on flag-weight for a while. It is a useful measure (and helps prioritise the moderation queue), but it really shouldn't be a distraction from the real every-day usage of the site — discussing language.
I welcome other views, thoughts, suggestions, etc. — even syntax/punctuation critique ;p
Answer: There is no problem with the flags considered valid, as if a flag is considered valid, then the answer being flagged has been closed, deleted, or migrated.
There is effectively no way to understand which flags has been considered invalid or are not yet reviewed.
It would be helpful to understand which flags have been considered invalid, to avoid to flag another question/answer for the same reason.
If the page listing all the flags is changed, then it will be changed in all the SE sites. If you want to really see such feature implemented, you should post the question on meta.stackoverflow.com, where more users can vote it, if they want to see this feature implemented.


Can blockchain be used for auditing?

Question: It has been argued that with the use of blockchain in auditing, the transaction and the record of the transaction will be the same thing. What does this mean?
Answer: the transaction are all available here:
http://www.blockchain.info
or here:
http://www.blockexplorer.com
or if you set up a full node on your own machine.
for a transaction to be valid it needs to appear on that global auditable log
Comment: How could the blockchain be used for auditing fiat transactions though because financial institutions in my country are averse to using bitcoin.
Comment: what you should do is get some bitcoin and send it to someone- me for instance- and then you can go onto that website, any blockchain explorer site, and see how it gets tracked around the network, an example transaction would be [this one](https://blockchain.info/tx/949ed3851a57df20c264269fbf39ac2d3e16a0d3697e092fae42889a52ebcc5d)
Answer: Since the blockchain is an append-only log of all transactions that ever happened, the act of sending a transaction also creates the record of the transaction in the blockchain. To allow someone to audit your finances, you can now simply provide them with a list of all your addresses and records about the transactions to provide full transparency. Naturally, since fiat cannot be transferred with Bitcoin directly, this does not help to audit fiat payments.
However, there are some services building on top of Bitcoin such as e.g. colored coin systems that allow to transfer fiat denominated IOUs. These transactions could be audited similarly as regular Bitcoin transactions.
Answer: First Question:
"Can blockchain be used for auditing?"
Yes. Please take a look at this paper produced by Delloite.
This is the conclusion of the paper:

The blockchain technology has the potential to shapeshift
  the nature of today's accounting. It may constitute a way  to vastly
  automate accounting processes in compliance  with the regulatory
  requirements. As described above,  there are numerous starting points
  to leverage blockchain  technology. A cascade of new applications will
  likely  follow that are built on top of each other, leading way for
  new, unprecedented services.

Second Question:
"The transaction and the record of the transaction will be the same thing. What does this mean?"
This means that the accounting records of my transaction will be the same as the registered in the shared ledger, called blockchain.
At the present moment we don't have a such pure system.
Our actual system is easily corruptible, since I can go to a store, buy something from a merchant and pay him with paper money - my banknotes.
Since the paper money isn't 100% trackable - like a digital currency - we can't be 100% certain that this merchant will inform the government about this transaction, and thus let the government system "validate" this transaction according to the local regulatory requirements.
Example of the content of a record being different than it's original transaction:
Imagine that I got involved in a transaction while buying an used car. I paid the guy with 10k, (7k money and 3k transferred by bank).
This guy don't necessarily have to inform his accountant that he sold the car for 10k... Maybe he'll just tell that he sold the car for 3k and got a loss instead of a profit!
This way the 'formal economy' ledger will have the record for a 3k transaction, instead of a 10k record - according to the original transaction.
Comment: @rfc This is interestinG. I am building out a business model that is exploring the blockchain for auditing in financial institution. THE COMPANIES WILL NOT USE BITCOIN. So I am wondering if the blockchain could be used to auditing fiat instead.

Can blockchain be used for auditing?


Is it allowed to follow the imam at the same time

Question: I see alot of people praying in the mosque in congregation, they always go into rukoo' at the same time of the imam when he is about to say Allaahu akbar, but then, they go into rukoo' when he is about to say the first part Allaa- or do whatever he is about to do, and i feel like this is wrong, even though he they should go after he finishes saying it and goes first is it allowed to do this?
Answer: According to this and other similar hadith:
Imams has to be followed:

Narrated Anas bin Malik:
Allah's Messenger (ﷺ) (p.b.u.h) fell down from a horse and his right
side was either injured or scratched, so we went to inquire about his
health. The time for the prayer became due and he offered the prayer
while sitting and we prayed while standing. He said, "The Imam is to
be followed; so if he says Takbir, you should also say Takbir, and if
he bows you should also bow; and when he lifts his head you should
also do the same and if he says: Sami`a l-lahu liman hamidah (Allah
hears whoever sends his praises to Him) you should say: Rabbana
walakal-Hamd (O our Lord! All the praises are for You.")
Sahih Al-Bukhari USC-MSA web (English) ref. Vol. 2, Book 20, Hadith 215

The word follow means going after not going besides he or she.


Can the Tenseigan be transplanted?

Question: Is the Tenseigan able to get transplanted? I've tried Googling it but it did not give me the results I was looking for.
Answer: Logically speaking, the Tenseigan should NOT be able to get transplanted, as long as the receiver isn't of the Otsutsuki.
According to a Quora page I found:

The Tenseigan is a dojutsu that can be awakened by a combination of a Byakugan and the Chakra of an Otsusuki clan member. The Tenseigan is a dojutsu that can be awakened by a combination of a Byakugan and the Chakra of an Otsusuki clan member.

Considering the fact that Tenseigan can only be awakened when a Byakugan is tied to the chakra of an Otsutsuki Clan member, it should not be able to get transplanted because once taken out of the eyes, it is no longer tied to Otsutsuki chakra of any sort. This is assuming the receiver of the Tenseigan isn't Otsutsuki themselves.
For more information on the Tenseigan, please check out this link.
Answer: So, Based on this theory I can say that a Tenseigan cannot be transplanted I will tell you why If you watched the movie (The Last: Naruto the movie) where he meets Toneri Otsusuki who is a generation of Hamura where he kidnaps Hinata. Yes, Over there the plot mention as follows:
The Hyuga Clan revealed to be descended from Hamura's kin who remained on Earth, Toneri had transplanted Hanabi's eyes into himself so he can acquire the Tenseigan (転生眼, lit. "Reincarnation Eye") created from his ancestors' sealed eyes while proposing to Hinata.
So in theory a Tenseigan can gain the power if the person who wants to require it must be a descendent of a Hamura and in order to complete the Tenseigan they have to acquire a Byakugan from the Hyuga Clan since they are Byakugan users and it will take several days to mature it.
In Conclusion, A Tenseignan cannot be transplanted and even if they do it might not activate due to these facts.
Answer: It cannot be transferred like the sharingan. Like the sharingan it can be awakened.
Tenseigan can be acquired when an Ōtsutsuki is implanted with the Byakugan of a Hyūga: this combination of the two clans' chakra transforms the Byakugan into Tenseigan
Although the sharingan and byakugan is placed in the same category of dojutsu
https://naruto.fandom.com/wiki/Tenseigan

Can the Tenseigan be transplanted?


Preferred given name for contact

Question: I have used other contact systems in the past and as well as first_name and middle_name there has been a preferred name field. We have several people who have long first names but they go by a shortened name, additionally we have people who are known by a middle name rather than their first name.
What I would like is to display the preferred name as the display name.
Comment: Where are you looking to display the preferred name as the display name? On the contact profile? Emails? Letters?
Comment: On the contact profile and for emails.
Answer: You can change the display name for a contact in 2 ways

By using CiviCRM alter display name hook you can change the Display name to a preferred name.

Update the format for Sort name and/or Display name by navigating to Administer >> Customize Data and Screens >> Display Preference (civicrm/admin/setting/preferences/display?reset=1) and then update the 'Individual Sort Name Format ' and 'Individual Display Name Format' fields as per your choice.
(Note: This change will be reflected to contact only if New Individual is added or updated)

HTH
Pradeep
Comment: Thanks for the reply, I am more familiar with MySQl than civi and had manually edited some triggers to test the logic I require. I can see that the hooks are a more robust way to achieve the result I want as my triggers would be overwritten during an upgrade.
Answer: For emails you can do this (considering you are using the Nickname field):
<code>{capture assign=nickname}{contact.nick_name}{/capture}
Dear {if $nickname}{contact.nick_name}{else}{contact.display_name}{/if}
</code>
Answer: Also, there ia a nickname in CiviCRM which you can use for this purpose? There is also a setting that allows you to search on the nickname too.
Comment: Thanks for reply, I have used the nick_name to store the preferred name for this purpose and I will try using Pradeeps's suggestion of a hook to create the preferred display name.

Preferred given name for contact


How to flatten MDF board

Question: I have just acquired 84" rails for my tablesaw and constructed a new outfeed table  that spans the whole width.  Now I want to build a filler table at the side of the table to continue cast iron top surface between the rails (approx 27" x 36").  I have some 3/4" MDF in the shop, but it appears to have some warp and twist (about 1/4" corner to opposite corner). I have enough MDF to make the top two layers thick and have clearance below to add deeper wood supports to help keep the top flat.  When I tried dry fitting the two top panels with clamps I still show a little twist. Before I try laminating the top pieces together I want to be sure I am not missing some simple tricks to flatten the surfaces permanently.  Can the warp in these panels be permanently removed or is the material beyond hope in creating a surface flat enough for a tablesaw table?
Comment: Personally I'd get fresh MDF and use the warped stuff for something where the warp doesn't matter (eg where it is used in smaller pieces, since the warp per piece may be negligible.)
Comment: What kehslam said! :-) *"Can the warp in these panels be permanently removed?"* possibly, but many variables (minor warping can be removed just by fixing a board to stiff framing, but not always). *"is the material beyond hope in creating a surface flat enough for a tablesaw table?"* just how flat does the table need to be? A 1/4" deflection more than 6 feet from the blade doesn't sound like it would actually be a problem...
Comment: The piece was stored vertically and had leaned a bit in the storage rack causing a slight twist.
Comment: Totally off topic, but how did the MDF warp in the first place? I have this problem where *none* of my MDF stays straight, and it frustrates me because all I hear about is how stable MDF is.
Comment: no good can come from MDF. it is basically bleached mulch with glue. one spilled cup of coffee and it is done.
Comment: @SkipBerne, that's what waterproof finishes are for ;-)
Comment: @SkipBerne No One DARES to bring an open coffee cup near my table saw! :)
Answer: Rather than laminating two pieces of MDF together which is not guaranteed to remove the warp you see I recommend you build a torsion-box style lattice structure out of straight stock and skin it on each side with your MDF.  The lattice structure is incredibly rigid and because you are building it with solid wood you can mill it to ensure consistency and flatness.  Once you fasten the MDF on top and bottom of it (glue should be sufficient) it should overcome your warping.
I am assuming you are trying to make use of what you have in the shop, otherwise I maintain my recommendation but would use thinner MDF for the skin.
Answer: All I do whenever I have a warped MDF board is put it down on a flat surface and weigh it down and leave it. For me that works every time.

How to flatten MDF board


What sort of things can an Arduino do?

Question: Sorry for the question, I'm just starting out in robotics - as a hobby- and I was just interested in what I'll be able to actually do, please let me know,
Answer: Arduino is very flexible.  You can do a lot of neat stuff with it.  It's one of the best tools for interfacing software to the real world.  However, it might be useful to also ask "What can an Arduino not do?".  Arduino has very limited memory and I/O compared to modern computers.  So some of the things the Arduino cannot do or cannot do easily are things that require a lot of memory or access to complex peripherals, like:

video recording, processing & output
high-fidelity audio recording & processing
act as USB host for USB devices like flash drives, disk drives, cameras, keyboards, etc.

So, you can't easily make a video game system that hooks to your TV with an Arduino.  That doesn't mean people haven't done it, but that level of hacking is in the realm of deep voodoo, and the results still end up looking like a 1980s videogame.
Often you see Arduino boards hooked up as peripherals to a larger computer.  The computer does the A/V and the Arduino handles all the other physical world interfacing.  Another common use is the fully embedded system where a more mundane device is made "smart" with a hidden Arduino. ("Your coffee table now knows when you set cups on it and buzzes you if you don't use a coaster")  This is where Arduino seems happiest.
Answer: It depends on whether you're only talking about the bare Arduino, or Arduinos with shields or other augmented bits attached.  One great thing about Arduinos is that it's relatively easy to design shields that add capabilities to the Arduino.  Without anything attached, the Arduino is pretty useless.  It has no way to interact with the outside world other than USB serial.
Once you've got peripherals added to your Arduino you communicate wirelessly, read sensors, trigger motors, audio outputs, light shows, etc.  The sky's the limit.  I especially like being able to put an entire microcontroller development environment, including programmer and an assortment of components (jumper wires, resistors, etc) in my laptop bag and go off to a coffee shop to hack on it.
What the stock arduino doesn't do well:

heavy processing - like face or motion detection from a camera.  It just doesn't have the processing power or RAM for it.
super low power consumption - the stock arduino tends to draw too much current for really long-lived battery powered applications.  For those you have to switch to an arduino compatible device (e.g. Arduino Pro Mini), at which point running for months on some AAs is easily achievable (and you can still prototype with the stock arduino).
Answer: The Arduino is good at a particular class of problems.
These are situations where you receive a bunch of inputs, make a decision based on them, and as a result output something.
It can do many things, but is especially good at this. Fortunately this is a very wide class of problems.
Another way to understand this is "What is the Ardunio NOT good at". There are two main classes of problem it does not do well at:

It is not good at processing intensive applications, or
Where a general purpose system is required - one that can switch between many different applications on demand.

So it has more in common with your washing machine than it does with your laptop. You can think of it as a computer appliance, not a PC.
Answer: Arduino's can do a variety of things for robots, including but not limited to: process data from sensors and control servos/motors. For some general examples take a look at

Freeduino.org
Arduino.cc Examples

You can connect other modules to an Arduino using what is called a shield. Shields are available from several small businesses like LittleBird Electronics, AdaFruit Industries, Sparkfun, etc.
Answer: have a look at: http://tronixstuff.com/tutorials :)
Answer: check out the arduino playground http://www.arduino.cc/playground/, and for robotics in particular http://www.arduino.cc/playground/Main/InterfacingWithHardware#Physical_Mechanical
Answer: Go to instructables and search on arduino.  Lots of hits.
Comment: I can return your two accounts to be the same one and get that fixed.

What sort of things can an Arduino do?


Bundling python library with addon

Question: I'm making an add-on that uses the websocket library from python. Is there a way to include it in the add-on .zip file? Or do I have to add it to the site packages folder in blenders included python folder?
Comment: Related: https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules, https://blender.stackexchange.com/questions/8509/including-3rd-party-modules-in-a-blender-addon
Comment: For recent versions of Blender (2.81 and later), you can install them through `pip`.
Comment: How would I make it install to the right place? It just installs to my user directory
Comment: You need to use subprocess and pass it the correct path to Blender's python interpreter. Unless somebody is faster I will write an answer later this evening.
Answer: Blender includes pip on Windows since version 2.81, but not on other operating systems. Therefore, pip has to be installed through ensurepip.bootstrap() on Linux and macOS. This function can also be called on Windows, when pip is already installed. It will detect the existing installation of pip and won't modify it. Installing pip and Python packages through a script or an add-on may require that Blender is started with elevated privileges, for instance if Blender is located in C:\Program Files. Please note that this is generally not recommended for security reasons.
Important: ensurepip.bootstrap() calls pip during for the installation. pip sets the environment variable PIP_REQ_TRACKER which is used as a temporary directory. This directory doesn't exist anymore once ensurepip.bootstrap() finishes execution, but the environment variable PIP_REQ_TRACKER remains. This is a problem, because subsequent calls to pip will attempt to use the directory in PIP_REQ_TRACKER. It is necessary to remove PIP_REQ_TRACKER from the environment variables after calling ensurepip.bootstrap():
ensurepip.bootstrap()
os.environ.pop("PIP_REQ_TRACKER", None)

Once pip is installed, subprocess can be used to to install the required packages. The path to Blender's Python interpreter is bpy.app.binary_path_python. Installing a package, for example matplotlib*, would therefore be done in the following way:
subprocess.check_output([bpy.app.binary_path_python, '-m', 'pip', 'install', 'matplotlib'])

*matplotlib is used as an example, since I wasn't sure which websocket package you were referring to.

Important: It's common courtesy to not connect to the internet or install packages without the explicit consent of the user.
The following add-on has a button in the preferences that allows the user to install the required Python packages. If the dependencies aren't installed, a panel with instructions is displayed in place of the add-on's operators. This approach respects the user's privacy and doesn't install packages without their permission.
User Preferences

Instructions

After successful installation of dependencies

The import_module(module_name, global_name=None) functions allows to programmatically import modules based on their name and optionally specify a global_name under which the module can be accessed. For your own implementation it may not be necessary to use importlib and globals(), but it significantly reduces code redundancy if you need to import or install multiple modules. The installation of Python packages, as described above, is implemented in install_pip() and install_and_import_module(module_name, package_name=None, global_name=None).
Please check GitHub for the updated version of this example add-on.
#    Copyright (C) 2020  Robert Guetzkow
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <https://www.gnu.org/licenses/>

bl_info = {
    "name": "Install Dependencies Example",
    "author": "Robert Guetzkow",
    "version": (1, 0, 2),
    "blender": (2, 81, 0),
    "location": "View3D > Sidebar > Example Tab",
    "description": "Example add-on that installs a Python package",
    "warning": "Requires installation of dependencies",
    "wiki_url": "https://github.com/robertguetzkow/blender-python-examples/add-ons/install-dependencies",
    "tracker_url": "https://github.com/robertguetzkow/blender-python-examples/issues",
    "support": "COMMUNITY",
    "category": "3D View"}

import bpy
import subprocess
from collections import namedtuple

Dependency = namedtuple("Dependency", ["module", "package", "name"])

# Declare all modules that this add-on depends on. The package and (global) name can be set to None,
# if they are equal to the module name. See import_module and ensure_and_import_module for the
# explanation of the arguments.
dependencies = (Dependency(module="matplotlib", package=None, name=None),)

dependencies_installed = False

def import_module(module_name, global_name=None):
    """
    Import a module.
    :param module_name: Module to import.
    :param global_name: (Optional) Name under which the module is imported. If None the module_name will be used.
       This allows to import under a different name with the same effect as e.g. "import numpy as np" where "np" is
       the global_name under which the module can be accessed.
    :raises: ImportError and ModuleNotFoundError
    """
    import importlib

    if global_name is None:
        global_name = module_name

    # Attempt to import the module and assign it to globals dictionary. This allow to access the module under
    # the given name, just like the regular import would.
    globals()[global_name] = importlib.import_module(module_name)

def install_pip():
    """
    Installs pip if not already present. Please note that ensurepip.bootstrap() also calls pip, which adds the
    environment variable PIP_REQ_TRACKER. After ensurepip.bootstrap() finishes execution, the directory doesn't exist
    anymore. However, when subprocess is used to call pip, in order to install a package, the environment variables
    still contain PIP_REQ_TRACKER with the now nonexistent path. This is a problem since pip checks if PIP_REQ_TRACKER
    is set and if it is, attempts to use it as temp directory. This would result in an error because the
    directory can't be found. Therefore, PIP_REQ_TRACKER needs to be removed from environment variables.
    :return:
    """

    try:
        # Check if pip is already installed
        subprocess.run([bpy.app.binary_path_python, "-m", "pip", "--version"], check=True)
    except subprocess.CalledProcessError:
        import os
        import ensurepip

        ensurepip.bootstrap()
        os.environ.pop("PIP_REQ_TRACKER", None)

def install_and_import_module(module_name, package_name=None, global_name=None):
    """
    Installs the package through pip and attempts to import the installed module.
    :param module_name: Module to import.
    :param package_name: (Optional) Name of the package that needs to be installed. If None it is assumed to be equal
       to the module_name.
    :param global_name: (Optional) Name under which the module is imported. If None the module_name will be used.
       This allows to import under a different name with the same effect as e.g. "import numpy as np" where "np" is
       the global_name under which the module can be accessed.
    :raises: subprocess.CalledProcessError and ImportError
    """
    import importlib

    if package_name is None:
        package_name = module_name

    if global_name is None:
        global_name = module_name

    # Try to install the package. This may fail with subprocess.CalledProcessError
    subprocess.run([bpy.app.binary_path_python, "-m", "pip", "install", package_name], check=True)

    # The installation succeeded, attempt to import the module again
    import_module(module_name, global_name)

class EXAMPLE_OT_dummy_operator(bpy.types.Operator):
    bl_idname = "example.dummy_operator"
    bl_label = "Dummy Operator"
    bl_description = "This operator tries to use matplotlib."
    bl_options = {"REGISTER"}

    def execute(self, context):
        print(matplotlib.get_backend())
        return {"FINISHED"}

class EXAMPLE_PT_panel(bpy.types.Panel):
    bl_label = "Example Panel"
    bl_category = "Example Tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout

        for dependency in dependencies:
            if dependency.name is None:
                layout.label(text=f"{dependency.module} {globals()[dependency.module].__version__}")
            else:
                layout.label(text=f"{dependency.module} {globals()[dependency.name].__version__}")

        layout.operator(EXAMPLE_OT_dummy_operator.bl_idname)

classes = (EXAMPLE_OT_dummy_operator,
           EXAMPLE_PT_panel)

class EXAMPLE_PT_warning_panel(bpy.types.Panel):
    bl_label = "Example Warning"
    bl_category = "Example Tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    @classmethod
    def poll(self, context):
        return not dependencies_installed

    def draw(self, context):
        layout = self.layout

        lines = [f"Please install the missing dependencies for the \"{bl_info.get('name')}\" add-on.",
                 f"1. Open the preferences (Edit > Preferences > Add-ons).",
                 f"2. Search for the \"{bl_info.get('name')}\" add-on.",
                 f"3. Open the details section of the add-on.",
                 f"4. Click on the \"{EXAMPLE_OT_install_dependencies.bl_label}\" button.",
                 f"   This will download and install the missing Python packages, if Blender has the required",
                 f"   permissions.",
                 f"If you're attempting to run the add-on from the text editor, you won't see the options described",
                 f"above. Please install the add-on properly through the preferences.",
                 f"1. Open the add-on preferences (Edit > Preferences > Add-ons).",
                 f"2. Press the \"Install\" button.",
                 f"3. Search for the add-on file.",
                 f"4. Confirm the selection by pressing the \"Install Add-on\" button in the file browser."]

        for line in lines:
            layout.label(text=line)

class EXAMPLE_OT_install_dependencies(bpy.types.Operator):
    bl_idname = "example.install_dependencies"
    bl_label = "Install dependencies"
    bl_description = ("Downloads and installs the required python packages for this add-on. "
                      "Internet connection is required. Blender may have to be started with "
                      "elevated permissions in order to install the package")
    bl_options = {"REGISTER", "INTERNAL"}

    @classmethod
    def poll(self, context):
        # Deactivate when dependencies have been installed
        return not dependencies_installed

    def execute(self, context):
        try:
            install_pip()
            for dependency in dependencies:
                install_and_import_module(module_name=dependency.module,
                                          package_name=dependency.package,
                                          global_name=dependency.name)
        except (subprocess.CalledProcessError, ImportError) as err:
            self.report({"ERROR"}, str(err))
            return {"CANCELLED"}

        global dependencies_installed
        dependencies_installed = True

        # Register the panels, operators, etc. since dependencies are installed
        for cls in classes:
            bpy.utils.register_class(cls)

        return {"FINISHED"}

class EXAMPLE_preferences(bpy.types.AddonPreferences):
    bl_idname = __name__

    def draw(self, context):
        layout = self.layout
        layout.operator(EXAMPLE_OT_install_dependencies.bl_idname, icon="CONSOLE")

preference_classes = (EXAMPLE_PT_warning_panel,
                      EXAMPLE_OT_install_dependencies,
                      EXAMPLE_preferences)

def register():
    global dependencies_installed
    dependencies_installed = False

    for cls in preference_classes:
        bpy.utils.register_class(cls)

    try:
        for dependency in dependencies:
            import_module(module_name=dependency.module, global_name=dependency.name)
        dependencies_installed = True
    except ModuleNotFoundError:
        # Don't register other panels, operators etc.
        return

    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in preference_classes:
        bpy.utils.unregister_class(cls)

    if dependencies_installed:
        for cls in classes:
            bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

Comment: This is cool and I want to star it. Would you consider hosting it on your github?
Comment: @Leander https://github.com/robertguetzkow/blender-python-examples
Comment: Suggest something like `loader = importlib.util.find_spec(module_name)` to check if install required.
Comment: The answer currently does not include the trick to install without elevated permissions through `--user` and appending the user site-packages to `sys.path` because loading of the user site-packages was intentionally disabled (see [T76993](https://developer.blender.org/T76993) and [D6962](https://developer.blender.org/D6962)). It still works though, in case somebody needs this.
Comment: @Alexis.Rolland Yes, that is possible. You would have to modify [install_and_import_module](https://github.com/robertguetzkow/blender-python-examples/blob/4a3c99a843305b91e05db386559905b23cf6eb87/add-ons/install-dependencies/install-dependencies.py#L89) to take another optional argument, the version number. If the value is different from the default, then you can run `subprocess.run([sys.executable, "-m", "pip", "install", package_name_with_version], check=True, env=environ_copy)` where `package_name_with_version` is the concatenation of `package_name`, `==` and the version number.
Comment: @Alexis.Rolland Please keep in mind that this will cause trouble when there is already a more recent matplotlib version installed by another add-on though. Since there is no isolation between add-ons they all share the same modules and dependencies. Uninstalling the newer version is not an option as then the other add-on will likely fail to work.
Comment: @Alexis.Rolland Could it be that the dependency was already installed in your user site-packages? You need to exclude the user site-packages otherwise pip will think the requirements are already satisfied (see https://github.com/robertguetzkow/blender-python-examples/tree/master/add_ons/install_dependencies#installing-the-package).
Comment: I will probably update the example add-on soon so nobody copies this into their add-on without reading the note.
Comment: @batFINGER Sounds good, will improve/update the answer this weekend.
Comment: Or  `ModuleNotFoundError` Look forward to it.  Been coming at this from a different direction re checking for dependencies. (a deps tuple in bl_info dict would be handy, since it appears blender greps this out for fake module) This looks very handy for the next step. Consider it stolen, lol.
Comment: @batFINGER Posted the updated version.
Comment: @Leander Sure, why not. I will create a repository this evening.
Comment: Thank you for this very detailed answer! Is it possible to specify the version of the dependent library to be installed? For instance matplotlib 3.1.0 instead matplotlib 3.2.1
Comment: Thank you @RobertGützkow for your answers. I'm encountering another issue. I tried pip install with `subprocess`, with both `sys.executable` and `bpy.app.binary_path_python` and my dependencies are being installed in `c:\users\my.user\appdata\roaming\python\python39\site-packages` instead of `c:\program files\blender foundation\blender 2.93\2.93\python\lib\site-packages`. Blender is running as administrator... any idea why? :-/ Thanks again!
Comment: You're the best!

Bundling python library with addon


In "Descent" why did the renegade Borg retrieve their dead the first time, but in the second attack, they didn't?

Question: In the beginning of the episode "Descent" from Star Trek: The Next Generation, when they fight the Federation on their (Federation's) outpost, they did what Borg usually do with their dead, but in the second fight they had with the Federation, against Captain Picard, on his ship, and against his crew, they didn't. Why?
Comment: Downvoter, care to comment?
Answer: When the Enterprise surprised the borg during their attack on the MS 1 Colony, the borg did not want to risk going into battle against a top-of-the-line federation starship.   So they made an effectively knee-jerk decision to send over and sacrifice two of their own simply in order to create enough time for their ship to make a quick getaway.  The only reason the two drones were left behind was because by the end of the firefight, the borg ship was no longer around to pick them up.
That these borg were exhibiting such un-borg like behaviour was puzzling to the Enterprise crew, but that was what they had to think.
That was what they were intended to think.   Right from the start.  You see, EVERYTHING in the opening paragraph was fake - to take a couple of my quotes :
"Enterprise surprised the borg" - nonsense;  the borg had been baiting the Enterprise precisely to bring on this confrontation.   After all, Picard just a few moments earlier had said that the borg were only attacking when the Enterprise was the only ship around :)
"The borg didn't want to risk a battle" - absurd; the borg ship was FAR more powerful.   In Descent part 2, the Enterprise's weapons couldn't make a scratch.  It had no reason to run away, let alone sacrifice some of its own crew to do so,
So what was really going on ?   In a word, Lore.
Lore wanted Data by his side.  In the opening firefight, the borg named each species in the landing party - and identified Data.  Lore and his Borg now knew exactly where Data was, and everything that followed was PLANNED by Lore for the sole purpose of getting his borg onto the Enterprise, where they would be in a position to influence Data using the emotion chip.
Military deception, a plan within a plan - and Picard and co fell for it Hook, Line and Sinker !
Comment: Lore was the culprit. I get that.
Comment: Absolutely agreed that all the attacks were a plot and Picard picked it up: to paraphrase, "Doesn't seem strange that there have been two attacks and the Enterprise has been the closest ship in both of them?" Although I don't think they were deceptive so much as they were trying to ambush them.


How do I get the entire landscape in focus?

Question: According to this calculator at 16mm, my hyperfocal distance is at 0.7m at f/11. So on the safe side, if I wanted to make sure the scenic background is tack sharp I would focus at 1m or so. But now the question is, what if I needed things to be sharp in front of 1m? Say a flower in the foreground and a mountain in the background?
Comment: I suspect that the combination of both those questions effectively answers this one.
Answer: If you calculate your hyperfocal distance to be .7M, subjects as close as .35M should be in acceptable focus. A flower at .4M for example should be in acceptable focus. A flower at .2M likely is not in acceptable focus. If your subject is closer than .35M, then you either have to modify your aperture, use a larger format sensor, use a wider focal length, other techniques such as focus stacking to get the shot.
Part of your original assumption is incorrect I believe. If you want to make sure that the background is tack sharp by focusing at 1M instead of .7M, you are also pushing out the nearest objects that are acceptably sharp. You should be fine focusing at the hyperfocal distance, while still achieving a tack sharp background at infinity. Some people do say to focus at the hyperfocal distance, then a few feet further to "be safe". I think this is OK, but I would rather just stop down a bit if I am only at f/11 to begin with. If you are already at f/20 or similar you might not want to do that, and you probably don't need to anyways.
I think this question is already covered in:
What is "Hyperfocal Distance"?
Answer: To get deeper DoF at the same focal length and focus distance, you need to narrow the aperture. Another option to get something too close in the foreground into the DoF is to move your shooting position back until the desired element in the scene is within the DoF for your selected aperture.
First, you must realize that depth of field (DoF) is always based on a particular viewing size and distance as well as focal length, aperture, and focus distance. The calculator you linked to is set up for an 8" X 10" print viewed at 10" (25cm) by a person with the manufacturers definition of viewer's eyesight. If you want to display the picture at a larger display size and viewing distance, the hyperfocal distance will change for any given aperture. If you are viewing the image at 100% on a monitor with 72 ppi, a 24MP (6000X4000) full frame image would be displayed at about 83" X 56"! At that viewing size and a 50cm viewing distance the DoF would be much less that of the 8" X 10" print, and the hyperfocal distance at f/11 for a 16mm lens would be 3 meters. For a 1.6x APS-C camera the hyperfocal distance would be 4.8m.


Equation of motion for the reduced density matrix

Question: The equation of motion for the density matrix of a many body isolated quantum system is the von Neumann's equation: $\dot{\rho }(t)=i[\rho (t),H]$. How about the equation of motion for the reduced density matrix of one particle, is there a general procedure to obtain it?
Comment: Yes, you put N=1, where N is the number of particles.
Comment: @Vladimir: he means deriving the effective decoherence parameters for one particle. This is a question I investigated many years ago, for the purpose of replacing Caldera Legett. It is very difficult to get the coefficients from theory, but you can explore the space productively.
Answer: There are a number of schemes that have been developed over the years to describe the dynamics of the reduced density matrix. The problem that you encounter is that you have to make a choice between computability versus generality.
Let me make an overview of some of the approaches you can find. We typically think of system consisting of a some particle in contact with a heat bath (a reservoir). Starting with the Liouville equation
$$ \frac{d W}{dt} = -i[H,W(t)] \equiv \mathcal{L}(t)W(t)$$
where $W(t)$ is the density matrix of the full system, $H$ the full Hamiltonian and $\mathcal{L}(t)$ the Liouville operator.
The reduced density matrix is obtained by projecting to the relevant subspace,
$$\rho(t) = PW(t)$$
where $P^2=1$ is a projection operator. This operator takes the partial trace of $W$, as is standard with reduced density matrices, and the reduced density matrix is still an operator on the total Hilbert space.
We now substitute $W(t) = \rho(t) + (1-P)W(t)$ in the Liouville equation, and project with $P$ and $(1-P)$ from the left. This gives two coupled equations of motion, one for $\rho$ and one for $(1-P)W$. Solving formally for $(1-P)W$ and substituting this back into $\dot{\rho}$ gives the Nakajima-Zwanzig equation,
$$\dot{\rho}(t) = P\mathcal{L}\rho(t) + \int_0^t dt'P\mathcal{L}e^{(1-P)\mathcal{L}t'}(1-P)\mathcal{L}\rho(t-t') + P\mathcal{L} e^{(1-P)\mathcal{L}t}(1-P)W(0)  $$
It is a mixed integral and differential equation (integro-differential). It shows that the time evolution of the reduced density matrix not only depends on the state of $\rho$ at time $t$, but also on the history of the system leading up to that time, including the initial entanglement between the subsystem and the reservoir. This retarded effect comes in through the second term, the integral. It has a natural interpretation: in the strictest sense you have to keep track of what the external reservoir is doing if you want to describe the dynamics of the subsystem. This "information" has to be stored somewhere, hence the integral over some memory kernel.
Simplifications have to be made. The most straightforward one disregards the initial term $W(0)$ (such that you do not worry about the initial conditions, which definitely does not apply to all systems) and assumes a Markovian time evolution, i.e. where the time evolution only depends on the state at time $t$. This leads to the Born-Markov approximation, which is an example of a Lindblad equation.
The Lindblad equation assumes some features like positivity of the density matrix at all times, trace preserving and no external time dependence. But do note that it is not unitary (which is ok!). Assuming the Hamiltonian can be written as $H=H_S+ H_R + H_I$ (subsystem, reservoir and interaction) we can write down
$$\dot{\rho}(t) = -i[H_s,\rho] +\frac{1}{2} \sum_j \left\lbrace -\frac{1}{2}\hat{V}_n^\dagger \hat{V}_n\rho(t) - \frac{1}{2}\rho \hat{V}_n^\dagger\hat{V}_n + \hat{V}_n\rho \hat{V}_n^\dagger\right\rbrace $$
Here the sum runs over a specific basis of the subsystem, and the operator $\hat{V}$ describes all the effective dynamics of the subsystem due to coupling with the reservoir. This is probably the best known equation of motion for the reduced density matrix, although it is not as general as the NZ-equation (which is not really useful though).
To give some insight to this equation: the last term represents quantum jumps or (quantum) fluctuations between states of the subsystem - transitions between states of the subsystem due to the external reservoir. The first two terms are, mathematically speaking, there to ensure positivity and preserve the trace of the reduced density matrix. They are dissipative terms.
Answer: The more general and direct procedure is to take the partial trace over the rest of particles at both sides of the whole equation. One obtains the exact equation $\dot{\sigma_1 }(t)=iTr_{2,...N}[\rho (t),H]$ for the one-particle density matrix $\sigma_1 =Tr_{2,...N}\rho$.
Different physical approximations can be introduced in this exact equation. For instance, taking the non-correlated state $\rho = \sigma_1 \otimes \sigma_2 \cdots \otimes \sigma_N$ we obtain the mean field master equation.
NOTES: The Nakajima-Zwanzig equation given above by Olaf is dimensionally incorrect. I have not checked all the equation but in a first look the integral term is lacking a $P\mathcal{L}$ term because this term is obtained from the $P\mathcal{L}(1-P)$ subspace. Even corrected this equation is problematic both physically and computationally. The Lindblad equation can give violation of translation invariance and when this is corrected by adding a counter-term the improved equation fails to give the correct approach to equilibrium.
Comment: Thanks for your comment -- a factor of $P\mathcal{L}$ was missing in the integral. I understand that this equation is computationally problematic, and you need to resort to some approximation scheme. I don't completely follow your last comment though.
Comment: Thank you. I am new and do not have edit permissions to correct it myself. What last comment do you refer? The part about physical problems of the Nakajima- Zwanzig equation or the part about the Lindblad equation?


Is there any reason to buy the Ascension base game?

Question: Since Ascension: Storm of Souls is both a standalone and expansion to Ascension: Chronicle of the Godslayer, is there any reason to buy COTG? SOS adds new mechanics and seems to have better artwork.
Answer: Not to be Captain Obvious, but you would buy CotG if you want the cards.
I quickly glanced at the card list and a few "must-haves" stuck out:
Enlightened: Master Dhartha, Twofold Askara, and Tablet of Time's Dawn (though you might NOT want the possibility of infinitely many turns...)
Mechana: all the constructs in this set are valuable, Burrower Mark II maybe not as much.
Comment: Burrower Mark II is at least one 'free' card, often several over the course of the game, virtually never dead in your hand, and 3 veeps for 3 cost.  It's a rock-solid card.
Comment: All the Mechana constructs are 1:1 (cost:VP), though, aren't they? Maybe it's just a preference. I've gotten to the point where I own 40+ constructs, with infinite turns. In this context, the BMII is barely on the radar :)
Answer: I own all of the Ascension blocks and personally play CotG the most since the minimal mechanics allow it to be more accessible to my wife.  I find it as a good introduction into the world of Ascension and then once she becomes more comfortable with it, I'll pull out the other blocks :-)
Answer: Hmm, I find the artwork in SoS vs. CotG to be the same difference.  Then again, my taste in art is typically less sophisticated when compared to many other board gamers.  However, the fact that this is so subjective means it could be a good reason or not to the next person.
Speaking of art, SoS has new art for the starter deck and "always on" deck (Mystics, Apprentices, HI, Militia, Cultist).  Aesthetics aside, the layout colors, and patterns of one set here may be more pleasing and distinguishable compared to another.
Key (x/y faction/noun)
x is the cost, or power of monster.  Y is the honor it gives
faction is enlightened, void, etc.  Noun is hero, construct, or monster
As for the cards and the games themselves, in some ways, SoS is a superset of CotG.  OTOH, there are some cards that round out SoS nicely.  It's a hassle to deal with twice as many cards, but it can be worth it.  For example,
-The Pen/Umbral Edges (6/3 v/c) can be a bit overpowered with just SoS due to higher odds of getting both of them.  Adding another set keeps it more diluted and less of a power creep
-The base game m/c were rather OP-ed... you go for them, and it's a solid path to winning.  Dilution helps with that.
-Two-Fold Askara (4/2 e/h) lets you copy the effect of any here, and is always fun to have around.
-Arha Templar (4/3 e/h) pairs nicely with Rise Of The Cult event since they can go after Fanatics that now have their power/hp at 4.
-some interactions between the Events and base game cards
-SoS's Events and Trophy Monster system makes going power a more viable path, but adding base game brings back the "classic cards"


Cache channel service default port in case of second

Question: I have installed 2 instances of cache channel micro servive for Staging and Live environment. I have left with default port. How can I find, which port my second instance is using? Also how can I register it as a capability with discovery service?
Comment: http://elenaserghie.blogspot.in/2013/10/under-magnifying-glass-cache-channel.html
Answer: You can't have two instances of the service listen on the same port. One will fail.
One option is to configure the services to run on separate ports like this:
Is it possible to specify your own port number for the cache microservice
You could also consider running the instances on separate servers.
Comment: Thanks for your answer. As suggested in your question, I am able to setup the port. I am wondering why server.port parameter suggested in SDL docs is not working. Is there anything missing?
Answer: I have looked at the readme.md file available with the Cache channel service installation for the default port
<code>in both cases (windows and linux) the service will be reachable on port:`1099`.
</code>
Comment: As 1099 is already in use by staging cache channel service, I am wondering how can live also use that?


How to picking broken glass out of gravel, in the rain

Question: Picking up glass on big gravel stones in the rain. How do I pick up the tiny glass shards on the big gravel stones in the rain?  I can't find a better day to pick the glass up because I am busy.
Comment: This is a suggestion instead of an answer, and I don't know if you'll like it. But since broken glass is dangerous, I would remove all the gravel and glass, and replace it with new gravel. Otherwise there is a danger that in the coming days-weeks-months, a person or animal will get cut and may even have a shard of glass embedded under their skin.
Comment: As I have experience doing this, I usually walk across the gravel barefoot, then pull the shards out of my feet.  This works best if the person walking doesn't know the glass exists...  Of course, I don't recommend this, it's just my own experience in a similar situation.
Answer: Use a screen that has holes smaller than the gravel, and then sift the glass out.