How To Add Patterns To Clothes In Photoshop | Photoshop Tutorial

How To Add Patterns To Clothes In Photoshop | Photoshop Tutorial

combat – How do Patterns and Cover Interact?

I am having trouble finding a confirmation one way or another in relation to how cover does or doesn’t affect Pattern attacks, and if it does, when and how. I suspect that it’s actually spelled out somewhere and I’m missing the quote.

Example of an interaction scenario that caused this uncertainty for me:

Let’s say you have the Barbarossa Siege Cannon. You shoot it in siege mode. It is Arcing and Blast 2. You are in a broken landscape, where there’s a bunch of buildings (cover), and a target or several behind them. So of course you shoot in an arc over the buildings, with the target(s) being within the blast area. Arcing by itself doesn’t help ignore cover, but the blast is coming from a direction where cover doesn’t stand in-between . . . but the shooter doesn’t directly see the target(s). I’m not sure whether the Cover penalty applies or not.

For a less ambiguous scenario, imagine the same terrain and targets, but with a weapon doing a Line Pattern. Intuitively it seems the cover should apply for weapons such as a Railgun, but perhaps not for some other types of Line attacks.

Obviously, a GM can always make a ruling, but I would like to know what the RAW (or errata or the like) say about the interaction, or a confirmation that the interaction is not officially disambiguated/clarified.

design patterns – Can a class contain its own class?

Suppose I have the following class structure:

enter image description here

  1. A forest can have any number of trees, but each tree can belong to only one forest. If the forest is deleted, the tree is deleted.

  2. A tree must have at least one branch, but can have many more, however each branch can belong to only one tree. If the tree is deleted, the branch is deleted.

  3. A branch can have any number of leaves, and each leaf can belong to only one branch. If the branch is deleted, the leaf is deleted.

I believe this is a ‘composition’ structure, where each child depends on its parent for existence.

How might I represent a structure where each branch can contain other branches, which can contain other branches, and so on and so forth, essentially like this:

enter image description here

Notice the infinite loop I’ve added to branch, suggesting that a branch can contain any number of ‘child’ branches, which can in turn contain any number of child branches etc etc, similar to how a real tree might function, where each branch can contain smaller branches, which can in turn contain smaller branches:

enter image description here

How might I therefore create a structure where:

  1. Each branch class can contain an infinite (and unknown) number of ‘child’ branch classes

  2. Each branch can have access to itself and its child branches only (i.e it cannot see parent data)

  3. Each branch has the ability to make decisions for itself and its child branches only (i.e. the chain of power over subordinates increases as you move up the chain towards the parent)

In other words, a simple heirarchy structure, but with a flexible hierarchy depth.

It is this unknown number of parent/child generations which is causing me difficulty. If I knew that a ‘grandparent’ branch can only contain ‘parent’ branches, which in turn can only contain ‘child’ branches, then I could easily hardcode 3 classes to represent grandparent/parent/child branches.

However since the number of ‘generations’ is unknown, I can’t seem to get my head around how this might be represented in a UML Class Diagram, and later implemented.

How might I best approach this?

design patterns – Is there a website to search for architectural approaches to solving common problems?

Suppose I want to build a graphics editor app.

Is there a place I can go (google isn’t helping) to find out what different people have done, how they’ve been able to extend on their design, etc?

Sort of like a search engine where you search for some feature/system capability and the results are solutions and different approaches one can take?

And maybe those are broken down by technology used:

  • web, dekstop, mobile, etc

factorization – Perfect squares digit patterns in base 2

Is there a pattern in the digits of perfect squares when expressed in base 2? Of course some patterns are straightforward.

For instance taking the series 1,4,9,16,25,… in binary (that is 1,100,1001,10000,11001,…):

  • the first (rightmost) bits of these numbers are 1,0,1,0,1,0,1,…
  • the second bits are of course 0,0,0,0,0,0
  • the third bits are 0,1,0,0,0,1,0,0,0,1,…
    going forward the patterns get very confused and it’s hard to find a generating function

In order to find a possible solution, I’ve first proved that n is a perfect square IFF there exist k,t such that n = (4^k)*(1 + 4 * (1+2+3+…+t)).

Doing this transformation I can look for a pattern in the series 1,3,10,15,… (sums of integers from 1 to x), that in binary are 1,11,1001,1111,… however other complications arise

Thanks for any help or hint

The reason I’m looking for these patterns is to develop a fast /integer factorization algorithm

design patterns – Maintain different versions of the same entity for different locations. Find a standard approach for this

I’m designing an enterprise application (SQL + REST API + Web UI) and I’m trying to find some standard approach for the following problem:

Definition:
I have a company with multiple locations. I also have some common entity which may belong to all or some of these locations. I want to have a way to CRUD this entity in the simplest possible way and maintain specific versions of this entity for every location where it’s necessary.

Example:
Imagine a chain of grocery stores (Store 1) (Store 2) (Store 3). I have a web portal where managers (store managers & chain manager) can create items to sell in these stores. Chain manager creates an item as follows (COKE) ($1.00). He assigns this item to all stores. Later store manager may want to change the price of this item only in his store. All other items in the different stores will stay intact. But the relation between the changed version of the item in a specific location and the base item must be kept. Later, chain manager may change this item again and these changes will affect all versions of the item in all stores.

Here’s my current data structure. The problem is that there’s only one version of item available:
enter image description here

I tried to simplify the question as much as possible, of course in the real application the tables are much more complex and there’re more layers of extra functionality like groups & hierarchy of locations, related entities (for example: item related to a department), access rights and so on and so forth.

Is there any pattern for this problem?
What database schema could you suggest for such problem?

design patterns – How to model derived types (polymorphism?) in DDD

I have a concept similar to an Order, but each order is a ‘type’ which dictates how the invoice is calculated. To keep things simple, lets limit the scope to two types –

For a Fixed Price Order, all products are purchased for a fixed price, whereas with a Per Product Order, a price is agreed per product (this is all set up on product set up).

How would you go about modelling this? A Fixed Price order will need to hold the fixed price agreed, and an ‘OrderProduct’ Product will need to hold the price agreed on a Per Product order.

Would you have a base Order and Product classes, with derived types to hold the extra pieces of information?

design patterns – Minimal list definition in Rust

As a purely pedagogical exercise, I’ve been trying to use Rust’s (very expressive) type system to define the bare minimum one might expect from an ordinary list type.

While there’s likely a higher-level argument here about mutable vs immutable lists, and how lists should be implemented in Rust, please note that this is purely an educational exercise.

One thing I’ve encountered, is that Rust lends itself to quite some verbosity with respect to the number of different logical blocks of code one might need in order to comply with prevailing conventions. I’m unsure as to whether this is actually true of Rust itself, or due to my own misunderstandings about Rust as a language and as an ecosystem.


list.rs:

use std::fmt::Debug;
use std::ops::{Index, IndexMut};

pub trait List<T: Sized + Clone + Eq + Debug>:
    Eq + Index<usize> + IndexMut<usize> + IntoIterator + Debug
{
    type Error;

    fn insert(&mut self, pos: usize, elem: T) -> Result<(), Self::Error>;
    fn remove(&mut self, pos: usize) -> Result<T, Self::Error>;
    fn length(&self) -> usize;
    fn contains(&self, elem: T) -> bool;
}

veclist.rs:

#!(allow(clippy::unit_arg))
use std::cmp::Ordering;
use std::fmt::Debug;
use std::ops::{Index, IndexMut};

use crate::list::List;

#(derive(Clone, Debug, Eq, PartialEq))
pub struct VecList<T: Clone + Debug + Eq> {
    pub elems: Vec<T>,
}

impl<T: Clone + Debug + Eq> List<T> for VecList<T> {
    type Error = String;

    fn insert(&mut self, pos: usize, elem: T) -> Result<(), Self::Error> {
        match pos.cmp(&self.elems.len()) {
            Ordering::Less => Ok(self.elems.insert(pos, elem)),
            Ordering::Equal => Ok(self.elems.push(elem)),
            Ordering::Greater => Err("Out of bounds".to_string()),
        }
    }

    fn remove(&mut self, pos: usize) -> Result<T, Self::Error> {
        match pos.cmp(&self.elems.len()) {
            Ordering::Less => Ok(self.elems.remove(pos)),
            _ => Err("Out of bounds".to_string()),
        }
    }

    fn length(&self) -> usize {
        self.elems.len()
    }

    fn contains(&self, elem: T) -> bool {
        self.iter().any(|x| x == elem)
    }
}

impl<T: Clone + Debug + Eq> VecList<T> {
    pub fn iter(&self) -> VecListIterator<T> {
        self.into_iter()
    }
}

impl<T: Clone + Debug + Eq> Index<usize> for VecList<T> {
    type Output = T;

    fn index(&self, pos: usize) -> &Self::Output {
        &self.elems(pos)
    }
}

impl<T: Clone + Debug + Eq> IndexMut<usize> for VecList<T> {
    fn index_mut(&mut self, pos: usize) -> &mut Self::Output {
        &mut self.elems(pos)
    }
}

pub struct VecListIterator<T: Clone + Debug + Eq> {
    pos: usize,
    list: VecList<T>,
}

impl<T: Clone + Debug + Eq> Iterator for VecListIterator<T> {
    type Item = T;

    fn next(&mut self) -> Option<Self::Item> {
        if self.pos < self.list.length() {
            self.pos += 1;
            Some(self.list(self.pos - 1).clone())
        } else {
            None
        }
    }
}

impl<T: Clone + Debug + Eq> IntoIterator for VecList<T> {
    type Item = T;
    type IntoIter = VecListIterator<T>;

    fn into_iter(self) -> Self::IntoIter {
        VecListIterator { pos: 0, list: self }
    }
}

impl<T: Clone + Debug + Eq> IntoIterator for &VecList<T> {
    type Item = T;
    type IntoIter = VecListIterator<T>;

    fn into_iter(self) -> Self::IntoIter {
        VecListIterator {
            pos: 0,
            list: self.clone(),
        }
    }
}

impl<T: Clone + Debug + Eq> IntoIterator for &mut VecList<T> {
    type Item = T;
    type IntoIter = VecListIterator<T>;

    fn into_iter(self) -> Self::IntoIter {
        self.iter()
    }
}

  1. Is the definition of the list type, List<T>, sensible?
  2. Is the implementation of the list type, VecList<T>, sensible?
  3. Are there any defects in the codebase itself?

ids – Are sequential patterns used in practice?

I study computer security and I read articles about the potential usage of sequential pattern mining in IDPS products:

I am curious if any of you have seen these sequential patterns and set any rule for them in practice e.g. in a SIEM or IDPS system. I have the impression that most products support only association rules and don’t analyse the sequence of the events, packets, etc. I think some attacks can be detected only by checking the sequence, because a single event or packet does not contain enough info about the ongoing attack. I guess most people do this manually instead of using sequential pattern mining and matching algorithms or they use a fully automated system and don’t even know about this kind of filtering. Am I right or is this used in practice?

ids – Did any of you met with sequential patterns in practice?

I study computer security and I read articles about the potential usage of sequential pattern mining in IDPS products: https://www.sciencedirect.com/science/article/abs/pii/S2214212620308115#! https://www.sciencedirect.com/science/article/abs/pii/S0164121206003517 I am curious if any of you met with these sequential patterns and set any rule for them in practice e.g. in a SIEM or IDPS system. I have the impression, that most products support only association rules and don’t analyse the sequence of the events, packets, etc. I think some attacks can be detected only by checking the sequence, because a single event or packet does not contain enough info about the ongoing attack. I guess most people do this manually instead of using sequential pattern mining and matching algorithms or they use a fully automated system and don’t even know about this kind of filtering. Am I right or is this used in practice?