Смешанное выравнивание блоков с помощью Bootstrap 4

Подскажите, пожалуйста, возможно ли с помощью Bootstrap 4 выполнить вот такую разметку:

Пример разметки

  1. Первый случай – ширины гораздо больше, чем нужно для помещения элементов в одну строку. Блоки 1,2,3 прижимаются влево, а блок 4 – вправо;
  2. Второй случай – ширины впритык. По-сути выравнивания блоков аналогичны предыдущему случаю, но визуально блоки просто соприкасаются;
  3. Третий случай – ширины для размещения всех четырех блоков в одну строку недостаточно. Блоки должны разместиться в две линии. При этом блоки 1,3 должны быть прижаты влево, а блоки 2,4 – вправо.

Важно!

  • В случае, когда блоки расположены в одну линию, промежутки между блоками 1,2,3 должны быть равными;
  • Желательно использовать flex-элементы bootstrap 4 и, по возможности, не использовать дополнительные стили через CSS.

Aurora Sensor Project

We are working on a project in which we implement a sensor library of aurora events. Here is a part of our code written in Python 3. We would like to get a review of the two classes below.

import logging  from aiohttp.hdrs import USER_AGENT import requests import voluptuous as vol  from homeassistant.components.binary_sensor import (     PLATFORM_SCHEMA, BinarySensorDevice) from homeassistant.const import CONF_NAME, ATTR_ATTRIBUTION import homeassistant.helpers.config_validation as cv from homeassistant.util import Throttle  Logger = logging.getLogger(__name__)  ATTRIBUTION = "National Oceanic and Atmospheric Administration"  DEFAULT_DEVICE_CLASS = 'visible'  HA_USER_AGENT = "Home Assistant Aurora"  MIN_TIME_BETWEEN_UPDATES = timedelta(minutes=10)  URL = "http://services.swpc.noaa.gov/text/aurora-nowcast-map.txt"  class AuroraSensor(BinarySensorDevice):     #Implementation of an aurora sensor.      def __init__(self, DATA, name):         #Initialize the sensor.         self.aurora_data = DATA         self._name = name      @property     def name(self):         # Return the name of the sensor.         return '{}'.format(self._name)      @property     def is_on(self):         # return true if aurora is visible.         return self.aurora_data._is_visible if self.aurora_data else False      @property     def DeviceClass(self):         # Return the class of this device.         return DEFAULT_DEVICE_CLASS      @property     def device_state_attributes(self):         # Return the state attributes.         attrs = {}          if self.aurora_data:             attrs['visibility_level'] = self.aurora_data.visibility_level             attrs['message'] = self.aurora_data._is_visible_text             attrs[ATTR_ATTRIBUTION] = ATTRIBUTION             return attrs          else: # if no data exist             return attrs      def update(self):         # Get the latest data from Aurora API and updates the states.         self.aurora_data.update()   class AuroraData:     # get aurora forecast      def __init__(self, latitude, longitude, threshold):         # Initialize the data object.         self.latitude = latitude         self.longitude = longitude         self.number_of_latitude_intervals = 513         self.number_of_longitude_intervals = 1024         self.headers = {USER_AGENT: HA_USER_AGENT}         self.threshold = int(threshold)         self._is_visible = None         self._is_visible_text = None         self.visibility_level = None      @Throttle(MIN_TIME_BETWEEN_UPDATES)     def update(self):         # Get the latest data from the Aurora service         try:             self.visibility_level = self.get_aurora_forecast()             if int(self.visibility_level) > self.threshold:                 self._is_visible = True                 self._is_visible_text = "visible!"             else:                 self._is_visible = False                 self._is_visible_text = "nothing's out"          except requests.exceptions.HTTPError as error:             Logger.error(                 "Connection to aurora forecast service failed: %s", error)             return False      def get_aurora_forecast(self):         # Get forecast data and parse for given long/lat.         raw_data = requests.get(URL, headers=self.headers, timeout=5).text         forecast_table = [             row.strip(" ").split("   ")             for row in raw_data.split("\n")             if not row.startswith("#")         ]          # Convert lat and long for data points in table         converted_latitude = round((self.latitude / 180)                                    * self.number_of_latitude_intervals)         converted_longitude = round((self.longitude / 360)                                     * self.number_of_longitude_intervals)          return forecast_table[converted_latitude][converted_longitude] 

Popular uma outra array com o resultado de uma busca

Preciso pegar a array de objetos após a busca que faço com ng2-search-filter.

Abaixo onde tenho o input da minha busca já funcionando, e quero passar o resultado toda vez que é digitada (keyup) alguma letra, no caso, só falta passar o resultado, no caso o “result”, para poder trabalhar com ele no arquivo .ts

<div class="search-venda">    <input class="form-control"  type="text"  [(ngModel)]="term" (keyup)="onKey($  event, result)"  autocomplete="off" placeholder="Digite para pesquisar"> </div> 

Faço a impressão dos dados em uma table com o *ngFor

 <tr  *ngFor="let submission of vendas | filter:term; ">               <td>{{submission.cnpj}}</td>               <td>{{submission.razao_social}}</td>               <td>{{submission.funcionario}}</td> </tr> 

Tudo funcionando, só gostaria do resultado da pesquisa ser colocada em uma array resultante para poder passar como parâmetro no (keyup) e trabalhar com esses valores no arquivo .ts, preciso disso pois preciso de calcular alguns valores com os resultados obtidos.

Magento 2 disable address validation for paypal

I have problem. getting this error:

PayPal gateway has rejected request. A match of the Shipping Address City, State, and Postal Code failed (#10736: Shipping Address Invalid City State Postal Code).

Maybe it is way remove this validation? Because from UX side it killing orders. for example if customer created paypal before 5 years and already forgot old address where he registered paypal, he getting error message.

Maybe it is possible just send user to paypal for login and finish him order?

I tried in vendor/magento/module-paypal/Model/Hostedpro/Request.php

'address_override' => 'true', change to 'false', but it not make magic.

What is the proper way to unspecify an integer’s value in C++? [on hold]

// Default initialization int i;    // i has an unspecified value return i; // Probably 0, but Unreliable i = 5;    // i has a specified value i = int();// This will give it a specified value, 0 i = int{};// This will give it a specified value, 0 return i; // Reliable, no good! int j;    // Workaround, obvious performance penalties i = j;    // Also seems a bit too verbose, making code unreadable.  i = *new int; // Doesn't seem like a good idea. 

What’s the proper way to unspecify i, or unassign its value, and make it unreliable again?

Applescript (move file to folder) and highlight next file in finder

i made an applescript, fairly easy, to move a file to another folder in finder and use it with bettertouchtool as shortcut.

tell application "Finder"     move selection to folder ((path to home folder as string) & "Dropbox:01") end tell 

this works great, but as soon as it moves the file it looses the place in the list and activates the window instead of just highlighting the next file in the list (as it would when i delete a file for instance)

is there a way i could tell the script to highlight the next file in the folder? (eg… i have files 01, 02, 03, 04 in the folder. i move file 02. i want file 03 highlighted)

thanks a lot! cheers, arne

Roll Dice to get a random number between 1 and 150

This question is not actually related to RPGs but is more of a real-world dice rolling scenario I’m looking for help with, from dice rolling experts.

I’m currently memorizing the Book of Psalms, which is divided into 150 chapters.

I’m looking for an analog, elegant way of quizzing myself, by rolling some number of dice (or whatever means, really, just nothing digital) to get a random (equally likely) number from 1 to 150.

Not being very aware of the dice world I start googling, starting with “150 sided dice” … which would obviously do the trick in one go.

Didn’t take long for me to realize there are only so many 3D shapes that lend themselves to being dice with 120 sided dice being the largest (and pretty ridiculous looking) I could find.

So it’ll be some combination of things. One solution I have thought of so far would be a d30 and a d5. I would subtract one from the d5 and multiply that number by 30, resulting in 0,30,60,90,120. I would then simply add the value of the d30.

Hopefully that example gives you an idea of what I’m trying to accomplish. Apologies in advance if I’m barking up the wrong tree and this question doesn’t belong. If so I’ll just edit my question “A Character in my RPG is memorizing the Book of Psalms…” 🙂

Are there any services that can reasonably guess what IP address a transaction originated from?

Are there any services/agencies running a large number of nodes so that they can guess the IP address of a transaction’s origin?

I guess they would need to run tens of thousands of nodes. However it’ll be useful in tracing stolen coins. Surely there must be some.

I have seen talks and papers claiming to do so but not found any such service.

Looking for WordPress blockchain developer

I'm looking for a developer who is good with WordPress, modifying plugins and is familiar with working with blockchain projects. The payment gateway we are using to accept our ERC20 token is mostly complete. We just need to make some modifications and fix a couple of bugs. We use Metamask to connect to the platform so users can transfer payments on the platform to one another using my ERC20 coin. You will be paid in the token that runs the platform. The token is on multiple exchanges and…

Looking for WordPress blockchain developer

Send a specific view of web element from workflow

I would like to know if there is the possibility to send from the workflow a specific view of a form created in infopath and uploaded to SharePoint 2013.

Example: I have a Vacation Request form with a default view Edit item, and another Area Manager view, I would like that view only to reach the area manager

Hola, me gustaria sable si existe la posibilidad de enviar desde el flujo de trabajo una vista especifica de un formulario creado en infopath y cargado a SharePoint 2013.

Ejemplo: Tengo un formulario de Solicitud de vacaciones con una vista predeterminada Edit item, y otra vista Jefe de area, me gustaria que esa vista solo le llegara al jefe de area