Minimum Binding Quadrilateral

In an image processing project (using opencv with python), I am trying to detect as precisely as possible the location of a rectangular object in a photograph. My final goal is to output the 4 corners of the object.

For example, an image could look like this: Original image

In the first stage I am able to detect an approximate boundary for the image, like so: Initial Detection

Now, I have the above red convex polygon.

Next, I would like to compute the Minimum Area Bounding Quadrilateral, and this is where I’m stuck.

My question is, given a convex polygon, what is an efficient algorithm to find a minimum area bounding quadrilateral?


Binding caps-lock to a range of commands

I never use caps lock, so I’d like to use it as an addition custom modifier key. What modifier keys are there? Super, meta, hyper?

Could I turn the caps lock key into say “hyper” and then assign commands to hyper-a, hyper-b etc? How would I do that?

I’m thinking mainly of commands like beginning of line, end of line etc. Where would those commands (that are currently found to other legal so I can assign them?

Does Planar Binding require you to keep concentrating on the summoning spell?

Planar binding states:

With this spell, you attempt to bind a celestial, an elemental, a fey, or a fiend to your service. The creature must be within range for the entire casting of the spell. […] At the completion of the casting, the target must make a Charisma saving throw. On a failed save, it is bound to serve you for the duration. If the creature was summoned or created by another spell, that spell’s duration is extended to match the duration of this spell.

Most summoning spells require concentration. Would the original caster be required to continue concentrating on that spell even when planar binding extends the duration?

I was inclined to say “yes” to this, but it was pointed out that upcasting planar binding extends its duration to as much as a year and a day.

At Higher Levels. When you cast this spell using a spell slot of a higher level, the duration increases to 10 days with a 6th-level slot, to 30 days with a 7th- level slot, to 180 days with an 8th-level slot, and to a year and a day with a 9th-level spell slot.

It seems really unreasonable to expect concentration to be even over these extreme lengths of time.

Am I missing something here?

So, does planar binding require the original caster to maintain concentration on the extended summoning spell when one is present?

In Magento 2 Uncaught ReferenceError: Unable to process binding “optgroup: function(){return options }”

In magento 2, how to get a custom attribute option value in select field in checkout page

enter image description here


    <?php namespace Bootsgrid\CustomerAttribute\Model\Plugin\Checkout; class LayoutProcessor {     /**      * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $  subject      * @param array $  jsLayout      * @return array      */     public function afterProcess(         \Magento\Checkout\Block\Checkout\LayoutProcessor $  subject,         array  $  jsLayout     ) {          $  jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']         ['shippingAddress']['children']['shipping-address-fieldset']['children']['custom_field'] = [             'component' => 'Magento_Ui/js/form/element/abstract',             'config' => [                 'customScope' => 'shippingAddress.custom_attributes',                 'template' => 'ui/form/field',                 'elementTmpl' => 'ui/form/element/select',                 'options' => [],                 'id' => 'custom-field'             ],             'dataScope' => 'shippingAddress.custom_attributes.custom_field',             'label' => 'Custom Field',             'provider' => 'checkoutProvider',             'visible' => true,             'validation' => [],             'sortOrder' => 250,             'id' => 'custom-field',             'options' => [                     [                         'value' => '',                         'label' => 'Please select'                     ],                     [                         'value' => '1',                         'label' => 'One'                     ],                     [                         'value' => '2',                         'label' => 'Two'                     ],                     [                         'value' => '3',                         'label' => 'Three'                     ]                 ]         ];           return $  jsLayout;     } } 

Please some one help me to get a attribute option

Bootstrap-vue multiselect data binding: infinite loop

I’m trying to setup a multi select control from bootstrap-vue and bind it to a JSON object. The problem is that I need a computed value to get my json data format in a int array for the multiselect selected values and vice versa. Using such a computed property means that I change date while rendering which leads to an infinite loop.

Currently I created a computed property which has a getter which transforms the JSON object array in a integer array as well as a setter which does the opposite. In my example code the JSON object only contains the id, but in my production code there are a lot of other fields inside a “company”.

<template>   <b-form>     <b-form-select     :id="`input-companies`"     v-model="companiesSelected"     multiple     :select-size="4"     :options="availableCompanies"     ></b-form-select>   </b-form> </template>  <script> const availableCompanies = [   { value: 1, text: 'company1' },   { value: 2, text: 'company2' },   { value: 3, text: 'company3' },   { value: 4, text: 'company4' } ]  export default {   data () {     return {       employee: { id: 1, name: 'test', companies: [ { id: 1 }, { id: 2 } ] },       availableCompanies: availableCompanies     }   },   computed: {     companiesSelected: {       get () {         if (this.employee.companies == null) {           return []         }         return => { return } )       },       set (newValue) {         if (newValue == null) {           this.employee.companies = []         } else {           this.employee.companies = => { return { id: companyId } })         }       }     }   } } </script> 

The setting of this.employee.companies leads to a infinite loop. I don’t really know how to avoid this. Does anyone know how to overcome this issue?

Problema com Binding e CaretIndex

Tenho uma Lista com Datagrid:

<DataGrid Name="GridLista"                       Grid.ColumnSpan="20"                       Margin="5"                       Grid.RowSpan="17"                       Grid.Row="3"                      CanUserAddRows="False"                      CanUserReorderColumns="True"                      AutoGenerateColumns="False"                       SelectionUnit="FullRow"                      SelectionMode="Extended"                      ItemsSource="{Binding Path=Lista}"                      SelectedValue="{Binding Path=Model, Mode = TwoWay}"                      IsReadOnly="True"               >                     <DataGrid.Columns>                         <DataGridTextColumn Width="0.1*" Binding="{Binding Codigo}" Header="Código"/>                         <DataGridTextColumn Width="0.9*" Binding="{Binding Nome}" Header="Nome Operador"/>                     </DataGrid.Columns>                 </DataGrid> 

Após clicar em uma das linhas, todos os textbox são preenchidos, abaixo um deles:

<TextBox Name="textOperadorNome" Text = "{Binding Model.Nome, Mode = TwoWay, UpdateSourceTrigger=PropertyChanged}" CharacterCasing="Upper" Margin="5" Grid.ColumnSpan="8"  Grid.Row="2" Padding="0" VerticalContentAlignment="Center" Grid.Column="4"/> 

Até ai nenhum problema, tudo funcionando.

Meu problema é: sempre que ele é preenchido depois de ser clicado na tabela, o textbox ganha o foco e ao invez dele colocar o cursor no final do texto, ele coloca no começo, tem alguma forma de corrigir esse problema?

PHP: Binding PDO result values to class properties

I am new to PHP and am trying to figure out the best practice with respect to binding column values to properties in a class. The column names in the database are not ideal and I would like to extract them in such a way that I can reference the object properties instead. Is the below example a reasonable approach?

class Assessment {   // @var object   private $  db;    // @var integer   public $  id;    // @var string   public $  name;    public function __construct($  db)   {       $  this->db = $  db;           }    public function getById($  id)   {     $  id = (int)$  id;      $  query = $  this->db->prepare("SELECT * FROM checkups WHERE checkup_id=:checkup_id");     $  query->bindValue(':checkup_id', $  id, PDO::PARAM_INT);     $  query->execute();      $  assessment = $  query->fetch();      $  this->id = $  assessment['checkup_id'];     $  this->name = $  assessment['checkup_name'];    } } 

And then used like so:

$  assessment = new Assessment($  db); $  assessment->getById(1539); echo $  assessment->name; 

Curious if there is an additional layer abstraction I should consider or other methods I should use for assigning the values to their properties. For example, I am not sure how I would handle fetchAll() using this method. I did note the PDO FETCH_OBJECT and similar methods but they seem only to apply if the class properties share the same name as the columns which I am trying to get away from… I am trying to avoid using a framework at the moment for learning purposes.

Checkbutton command binding to wrong values when instantiated in loop

When I click on a checkbutton in my project, it is not executing the correct functionality. The project can be found at

I am building an application using tkinter, and am working on a function to dynamically place ttk.Entry objects next to ttk.Checkbutton objects, and then link them together.

I have already rewritten this function a few times, and even added a special case for when self.numMandatory is 0, but nothing has worked.

This is taken from, line 323.

# add the optional fields         for i in range(self.numMandatory, self.numFields):             print(self.rowNum)             self.listEntryStates.append(BooleanVar())             self.listEntryData.append(StringVar())             self.listEntryData[-1].set(self.listDefaultEntryData[i])              self.listEntries.append(ttk.Entry(self, textvariable=self.listEntryData[-1], state=DISABLED, style="D.TEntry"))             self.listEntries[-1].grid(row=self.rowNum, column=1, sticky="ew")              #print(self.listEntryStates[-1])             #print(self.listEntries)             self.listCheckbuttons.append(ttk.Checkbutton(self, onvalue=1, offvalue=0, variable=self.listEntryStates[-1],                                                          command=lambda: self.cbValueChanged(self.listEntryStates[-1],                                                                                              [self.listEntries[-1]])))             self.listCheckbuttons[-1].grid(row=self.rowNum, column=2, sticky="e")              print(self.listCheckbuttons[-1].__str__(), end=" is bound to: ")             print(self.listEntries[-1].__str__(), self.listEntryStates[-1])              self.rowNum += 1         # end for 

This is taken from, line 349

    def cbValueChanged(self, entryState, modifiedWidgets):          for widget in modifiedWidgets:             print("The value of %s is:" % widget, end="\t\t")             print(entryState.get())             if type(widget) is str:                 break             elif entryState.get() is True:                 widget.config(state='enabled', style='TEntry')             elif entryState.get() is False:                 widget.config(state='disabled', style='D.TEntry')         #end for      #end cbValueChanged 

In the main window, when I scroll down and click “add trigger”, the new window appears properly. But when I click on the checkbutton next to the Entry that says “[]”, that entry should be enabled by cbValueChanged.

For some reason, when the loop to add the optional fields runs, the command= section binds only the last entry in self.listEntries (but the entry it’s binding each checkbutton to isn’t created until the very last time through the loop)

I’m not sure where else I could ask a question like this, and I know this is asking more than most questions. If there is any more information you need, I’ll be happy to provide it.

Is there a good way to hash abstract binding trees?

The hash function should be invariant under alpha-renaming. Using de Bruijn notation seems to be possible, but it requires alpha-converting the whole tree when a binding is created, and has the unhappy consequence that a substructure of an abt is not a well-formed abs (since the de Bruijn indices are broken). So, is there a good (neat, elegant and/or efficient) way to construct such a function? By the way, is there any study on this matter? Any help is appreciated!