## privacy – General sites or documentation that specificies common information security points for individuals( small business)

I am wondering if there are concise sites that deal with how individuals can mitigate risks from data breaches, stolen phones, phishing attacks.
e.g.

• Contact credit bureaus to create freeze with pin.
• Online financial or medical transactions, use two-factor authentication.
• Virus software
• Backups
• Routers
• Encrypt phone
• Encrypt hard-drive

etc.

The reason I post this question is that being in IT, even I find new information periodically. I have aging parents, and I am certain without my help, they would be flying blind.

## sharepoint online – slick slider slides are not reducing when we add it in SP Page small section

I am using react slick slider, if i add it in a SP Modern page full section(3 slides) it works perfectly.but if i placed it in the One-third right sections. The same 3 slides appeared with conjusted width even in al sections but i want it to reduce into 2 or 1 slides as per the placed section width.

What should i do to reduce the slides when it is placed on different sized zones.

``````    export default class ReactSlickSlider extends React.Component<IReactSlickSliderProps, {}> {
public render(): React.ReactElement<IReactSlickSliderProps> {
var settings = {
dots: true,
infinite: false,
speed: 500,
slidesToShow: 4,
slidesToScroll: 4,
initialSlide: 0,
responsive: (
{
breakpoint: 1024,
settings: {
slidesToShow: 3,
slidesToScroll: 3,
infinite: true,
dots: true
}
},
{
breakpoint: 600,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
initialSlide: 2
}
},
{
breakpoint: 480,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
)
};
return (
<div>
<h2> Responsive </h2>
<Slider {...settings}>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
<div className={styles.card}>
<h3>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</h3>
</div>
</Slider>
</div>

);
}
}
``````

## 7 – Git branching strategies with a small team to develop a Drupal site

We’re a small team (5-6 developers) building a Drupal 7 site. Previously, we’ve used Features (https://www.drupal.org/project/features) to export our configurations from development to production. We’ve relied largely on assigning developers discrete, unrelated tasks.

Our upcoming work has distinct, but related development. For example, I anticipate we’ll need to add fields that will be used by two different tasks (for example, think about a date field for an event. One developer is working on the email invite and the other is working on the event display page). If we are able to anticipate this overlap, we’d be able to do this before either starts work.

However, if we don’t realize a common need until after work has begun in separate branches per developer/feature, this becomes trickier. I believe that we would need to merge their branches together to access the common code-which defeats the point of us having separate branches in the first place.

Curious for what you’d suggest or has worked well in the past! Thanks!

Note: I’ve identified these potential solutions, both with drawbacks:

• Cherry pick commits. While this could be helpful, it’s also likely that a cherry-picked commit will include extraneous changes beyond the narrow scope needed here. And it’s just as likely that the single commit won’t include all of the changes necessary (For example, if one commit created the feature, and a second created the field, you’d need to cherry pick both commits). This all seems to head for a merge headache down the road.

• Create a folder within sites/all/features/ignore, manually transfer the needed features there from the other branch. Include this directory in .gitignore. I don’t like that:

1. This has our team sending features files all over outside of git,
2. That it could introduce dependency errors if features are changed in
the original, but not updated in the other places that they are
used,
3. That users may make changes to the ignored features that
aren’t moved into git,
4. That switching between computers/development
environments would lose these files
5. That all related branches would need to be merged before deploying to production (which again, undermines the point of branching since these branches are now dependent on each other and would have to be released at once, rather than when ready/needed).
• Another option is to make the change (export the feature needed or cherry-pick commits) to the parent branch (e.g., Develop or Develop-Feature) so that it’s available to all child branches.

## Magento2 MultiStore Set Image as small, base and thumbnail programmaticaly not working

Requirement:- Upload multiple images from external url and mark them as thumbnail/small or swatch images. Using multi website, multi store.

Issue:- When i tried to do this by custom api in that case, those images are uploaded for both websites but the thumbnail/small/swatch are applied to only one store why.

What i tried:-

1. created custom api.
2. tried with setting current store to 0 (default)

``````{
"media_gallery_entries":(
{
"label":"tiny1_new_label",
"types":(
"thumbnail"
),
"file":"1.png"
},
{
"label":"tiny1_new_label",
"types":(
"small_image"
),
"file":"2.png"
},
{
"label":"tiny1_new_label",
"types":(
"swatch_image",
"image",
"small_image",
"thumbnail"
),
"file":"3.png"
}
)
``````

}

API code:-

``````<?php
``````

/**

• See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace ProductCustomApiModel;

use MagentoFrameworkExceptionInputException;
use MagentoFrameworkExceptionNoSuchEntityException;
use MagentoFrameworkAppRequestInterface;
use MagentoCatalogModelProduct;
Use TavantCustomApiHelperData;
use MagentoStoreModelStore;

class UpdateImage implements ProductCustomApiApiUpdateImageInterface
{
protected \$request;

``````protected \$product;

protected \$customApiHelper;

protected \$_productRepository;

protected \$productGallery;

protected \$imageProcessor;

public function __construct(

MagentoFrameworkWebapiRestRequest \$request,
MagentoCatalogModelProductRepository \$productRepository,
MagentoCatalogModelProductGalleryProcessor \$imageProcessor,
MagentoCatalogModelResourceModelProductGallery \$productGallery,
Product \$product,
Data \$customApiHelper
){

\$this->request = \$request;
\$this->product = \$product;
\$this->_productRepository = \$productRepository;
\$this->customApiHelper = \$customApiHelper;
\$this->productGallery = \$productGallery;
\$this->imageProcessor = \$imageProcessor;

}

/**
* {@inheritdoc}
*/
public function postUpdate()
{
\$post= \$this->request->getPost();

\$response('status') = 200;
\$response('message') = '';

\$post = \$this->request->getContent();

if(empty(\$post)){
}

\$data = json_decode(\$post);
\$data = (array) \$data;

\$media_gallery_entries = array();
if(isset(\$data('media_gallery_entries'))){
\$media_gallery_entries =  (array) \$data('media_gallery_entries');
}

try {
\$productSku = \$this->request->getParam('sku');
\$product = \$this->_productRepository->get(\$productSku);

if (!empty(\$product)) {

// Unset existing images
\$images = \$product->getMediaGalleryImages();
foreach(\$images as \$child) {
\$this->productGallery->deleteGallery(\$child->getValueId());
\$this->imageProcessor->removeImage(\$product, \$child->getFile());
}

/**
* Add image. Image directory must be in ROOT/pub/media for addImageToMediaGallery() method to work
*/
\$this->customApiHelper->checkIfTmpDirExist('new');

if(count(\$media_gallery_entries) && !empty(\$media_gallery_entries)){
foreach(\$media_gallery_entries as \$child) {
\$imageData = (array) \$child;
if(\$this->customApiHelper->checkIfImgExistInNewDir(\$imageData('file'))){
\$product->addImageToMediaGallery('new' . DIRECTORY_SEPARATOR . \$imageData('file'), \$imageData('types'), true, false);
}else{
\$logInfo() = \$imageData('file') . ' not exist in folder';
}
}
}
\$product->save();
\$this->returnResponse(200, 'media images for product updated', \$logInfo);
}else{
}
} catch (Exception \$e) {
\$this->returnResponse(400, \$e->getMessage());
}

}

protected function returnResponse(\$statusCode = 200, \$message, \$logInfo = ())
{
\$post = \$this->request->getContent();
\$data = json_decode(\$post);
\$requestData = (array) \$data;
\$productSku = \$this->request->getParam('sku');

\$statusCode = (\$statusCode == 200) ? 'success' : 'failed';
\$response('result') = \$statusCode;
\$response('message') = \$message;
\$response('request_date_time') = \$requestDateTime = time();

\$this->customApiHelper->writeIntoCustomLog('product-image', \$productSku, \$requestData, \$response, \$requestDateTime);

echo json_encode(\$response);die;
}
``````

}

## 7 – Git branching strategies with a small team to develop a D7 site

We’re a small team (5-6 developers) building a Drupal 7 site. Previously, we’ve used Features (https://www.drupal.org/project/features) to export our configurations from development to production. We’ve relied largely on assigning developers discrete, unrelated tasks.

Our upcoming work has distinct, but related development. For example, I anticipate we’ll need to add fields that will be used by two different tasks (for example, think about a date field for an event. One developer is working on the email invite and the other is working on the event display page). If we are able to anticipate this overlap, we’d be able to do this before either starts work.

However, if we don’t realize a common need until after work has begun in separate branches per developer/feature, this becomes trickier. I believe that we would need to merge their branches together to access the common code-which defeats the point of us having separate branches in the first place.

Curious for what you’d suggest or has worked well in the past! Thanks!

## python – Computing the angle between two vectors (vectorized) for small angles and with few copies

I am implementing a function that computes the angle between two vectors when given two n-dimensional arrays and an axis along which to operate. I want to do this with as few copies as possible, and as numerically stable as possible. (The latter gets problematic for small angles (see here)).

What I would like reviewed is primarily the speed of the implementation. There is a sign error hidden somewhere, so if you find it I’d love to know about it, too.

Here is a (primitive) test case for the function I implemented.

``````vec_a = (1, 0, 0)
vec_b = (0, 1, 0)
result = angle_between(vec_a, vec_b)
assert np.allclose(result, np.pi/2)

vec_a = (1, 0)
vec_b = (0, 1)
result = angle_between(vec_a, vec_b)
assert np.allclose(result, np.pi/2)
result = angle_between(vec_b, vec_a)
assert np.allclose(result, -np.pi/2)

vec_a = (1, 0)
vec_b = (0, 2)
result = angle_between(vec_a, vec_b)
assert np.allclose(result, -np.pi/2)

vec_a = ((1, 0), (2, 0))
vec_b = ((0, 2), (0, 1))
result = angle_between(vec_a, vec_b)
assert np.allclose(result, (-np.pi/2, np.pi/2))
``````

Note that the test currently fails, because of the sign error, but you can remove the offending `assert`.

Here is the function

``````def angle_between(vec_a: ArrayLike, vec_b: ArrayLike, *, axis:int=-1) -> np.ndarray:
"""Computes the signed angle from vec_a to vec_b (in a right-handed frame)

Notes
-----
Implementation is based on this StackOverflow post:
https://scicomp.stackexchange.com/a/27694
"""

vec_a = np.asarray(vec_a)(None, :)
vec_b = np.asarray(vec_b)(None, :)

if axis >= 0:
axis += 1

len_c = np.linalg.norm(vec_a - vec_b, axis=axis)
len_a = np.linalg.norm(vec_a, axis=axis)
len_b = np.linalg.norm(vec_b, axis=axis)

flipped = np.where(len_a >= len_b, 1, -1)

len_a = tmp

mu = np.where(mask, len_b - (len_a - len_c), len_c - (len_a - len_b))

numerator = ((len_a - len_b) + len_c) * mu
denominator = (len_a + (len_b + len_c)) * ((len_a - len_c) + len_b)

np.sqrt(angle, out=angle)
np.arctan(angle, out=angle)
angle *= 2
angle *= flipped
return angle(0)
$$```$$
``````

## python 3.x – Implementation of queue Message class, so both small text messages and big binary messages can be passed

I want to use mptools in a project. In my code, I need to pass both big Numpy arrays and short text messages between projects. It would be nice if both kinds of messages could go over the same type of queue. Currently, the messages are implemented very nicely like this (in line 75):

``````# -- Standard Event Queue manager
class EventMessage:
def __init__(self, msg_src, msg_type, msg):
self.id = time.time()
self.msg_src = msg_src
self.msg_type = msg_type
self.msg = msg

def __str__(self):
return f"{self.msg_src:10} - {self.msg_type:10} : {self.msg}"
``````

How can I extend this, so it becomes as easy to use with my big, perhaps compressed, Numpy arrays?

When I send numpy arrays over a queue system there were some gymnastics involved:

``````    raw_array = np.array(list(item.values()))
f = BytesIO()
np.savez(f, raw_array)
f.seek(0)
``````

Which I could send over the queue, and unpack on the other end. But there is no tagging of the message, no timestamp, etc., yet. How can I hide all those things as nicely as above, so it looks similar to this, which inherits from mpq.Queue, line 40 of the same file:

``````def safe_get(self, timeout=DEFAULT_POLLING_TIMEOUT):
try:
if timeout is None:
return self.get(block=False)
else:
return self.get(block=True, timeout=timeout)
except Empty:
return None
``````

## permissions – Develop your own policies assuming that the organization you are working for is a small private university or college

Do there exists integers $$a,b$$ such that their sum is a perfect cube while their product minus two is a perfect square?
Equivalently, do there exist integers $$x,y,z$$ such that
$$y(x^3-y)=z^2+2 quad ?$$