Automator selecting only one picture when making a contact sheet

I have three folders with about 10 jpg images in each folder. I am using an Automator service to build a Contact Sheet – I select the images from a folder in the Finder window, right click on the images and then select the Make Contact Sheet from the services menu. I am running Big Sur 11.01.1 on a MacBook Pro.

The Automator service is set build a contact sheet of each of the images, and works fine for one set of files, but not the other two. For some reason it only selects one image from the second list of images (always the same one) in the second folder and it doesn’t select any of the images from the third folder. The process runs and generates a contact sheet, just doesn’t show any images. Any help greatly appreciated.

How to get a value-only flat array from $wpdb->get_results when selecting a single column, without foreach()?

My query is:

$var = $wpdb->get_results("SELECT field FROM {$wpdb->prefix}table", ARRAY_A);
var_dump($var);

it returns someting like array(2) { (0)=> array(1) { (“field”)=> string(5) “test1” } (1)=> array(1) { (“field”)=> string(t) “test2” }. I.e. each item is a row with a single name-value pair.

What I want is array(2) { (0)=> string(5) “test1” (1)=> string(5) “test2” }

Currently I achieve it like this:

$var = $wpdb->get_results("SELECT field FROM {$wpdb->prefix}table");
foreach($var as $v_key => $v_val) $var($v_key) = $v_val('field');
var_dump($var);

Is there a shorter way to do this?

modal windows – Selecting non-working days/holidays in settings – what would be the best approach?

I’m trying to come up with quite a tiny feature. A user (admin, rather experienced with this software) should be able to pick multiple dates (usually it will be around 15-30) that will be later displayed as non-working days in the table.

Currently, I have two approaches:

  1. User enters the setting page, goes to the section Select holidays and all options are available right away, clicking the date in the calendar is a selection of a date. Please take a look at the mockups

enter image description here
enter image description here

  1. Practically the same mechanism of adding dates, but the action happens within a modal triggered with the button +Add/Edit
    enter image description here
    enter image description here
    enter image description here

Which of the approaches seems clearer and more suitable for the use case presented above in your opinion?
I have a feeling that using modal is a bit an “overkill” to this feature although it prevents from adding items by mistake and perhaps the workflow looks more naturally.

The first approach though looks like a nice speed up and a straight forward solution, but not so very standard ergo potentially confusing.

I’d love to learn your opinions.
Thanks 🙂

addtocart – Magento2: Bundle Product add to cart without selecting options (Product Item)

I am working on cms page custom product layout for that I have written custom controller. but it show error

{“0″:”Please select all required options.”,”1″:”#1
MagentoCheckoutModelCartInterceptor->addProduct() called at
(app/code/Vendor/SmallBusiness/Controller/Index/AddCart.php:73)n#2
VendorSmallBusinessControllerIndexAddCart->execute()
called at
(generated/code/Vendor/SmallBusiness/Controller/Index/AddCart/Interceptor.php:24)n#3

Below is my controller

namespace VendorSmallBusinessControllerIndex;
use MagentoCatalogApiProductRepositoryInterface;
use MagentoFrameworkAppActionAction;
use MagentoFrameworkAppActionContext;
use MagentoFrameworkDataFormFormKey;
use MagentoCheckoutModelCart;
use MagentoCatalogModelProductRepository;

class AddCart extends Action 
{
    protected $formKey;   
    protected $cart;
    protected $productRepository;

    public function __construct(
        Context $context,
        FormKey $formKey,
        Cart $cart,
        ProductRepository $productRepository) {
            $this->formKey = $formKey;
            $this->cart = $cart;
            $this->_productRepository = $productRepository;      
            parent::__construct($context);
    }
    public function execute()
     { 
        $id = $this->getRequest()->getParam('product_id');
        $quote = $this->cart;
        $_product = $this->_productRepository->getById($id);

        $selectionCollection = $_product->getTypeInstance(true)
                           ->getSelectionsCollection(
        $_product->getTypeInstance(true)->getOptionsIds($_product),$_product);

         // create bundle option
        $cont = 0;
        $selectionArray = ();
        $selectionqtyArray = ();
        $selectionpriceArray = ();

        foreach($selectionCollection as $proselection){ 
            $selectionArray($cont) = $proselection->getSelectionId();
            $selectionqtyArray($cont) = $proselection->getSelectionQty();
            $selectionpriceArray($cont) = $proselection->getPrice();
            $cont++;
        }


        // get options ids
        $optionsCollection = $_product->getTypeInstance(true)->getOptionsCollection($_product);
   
        foreach ($optionsCollection as $options) {
           $id_option = $options->getId();
        }    
        
        // generate bundle_option array
        $bundle_option = ($id_option => $selectionArray);
        $bundle_qty = ($id_option => $selectionqtyArray);
        $bundle_price = ($id_option => $selectionpriceArray);
        
        $params = (
                    'product' => $_product->getId(),
                    'bundle_option' => $bundle_option,
                    'bundle_option_qty' => $bundle_qty,
                    'bundle_option_price' => $bundle_price,                           
                    'qty' => 1,
                    'original_qty' => 1
                  ); 


        $quote->addProduct($_product, $params);
        $quote->save();
        
     }
}

selection – “Shopping Cart behaviour” for selecting rows in a table?

I’m currently struggling with the design of a table that would allow the user to select rows/items from a filtered/unfiltered table (probably with a standard checkbox column) and then still keep this selection when the search or filters of the table gets changed.

On top of that “shopping cart” management (add or remove items, or clear the selection), there will be some specific batch actions that can be applied to the selected items; like adding all of them to a group, having those entries deleted (not from the selection, but from the system) and so on.

I considered using a tab that shows a table with the selected rows:

enter image description here

But that is a no-go, since we already use tabs like this to, for example, separate entries by a specific type (something like “current tasks” from “done tasks”).

Right now I’m fiddling with a bar on top of the title row that expands and replaces the “full list” table:

enter image description here

enter image description here

I’m not really happy with this, since the position of the bar will probably confuse the users on what they are seeing on the table and how it relates to that bar.

Using the bar on the bottom is also off the table (pun intended), since we use infinite scroll on tables (that can easily have hundreds of entries) and the navigation buttons (like “next-step”) already sit on a fixed bar on the bottom of the page.

I think that’s it. If anyone can help with examples or ideas, that will be greatly appreciated.

Poll Results: Which of These Features Do You Look for When Selecting a Provider?

Back on September 14, we asked you what features you look for when selecting a VPS provider.

Those who’ve been around for a while remember the old days when every provider slapped SolusVM on a master node, slurped in some OpenVZ templates, and setup shop.  Today’s consumer expects more, and so we were curious which features really matter to customers.

131 votes later, the results are in!

Interestingly, the ability to upload a custom ISO was the #1 feature, closely followed by DDOS mitigation and snapshots.  I’m very partial to autorun scripts, because I like the ability to deploy a server and immediately have it setup and running the way I want, but possibly people are scratching that itch with Ansible and similar technologies.

We allowed people to pick up to 4 features, so there is some weighting here on what’s most important to customers.  Providers should take note about what matters to the community as they try to differentiate themselves from their competition.

Thanks everyone for participating!

 

 

raindog308

I’m Andrew, techno polymath and long-time LowEndTalk community Moderator. My technical interests include all things Unix, perl, python, shell scripting, and relational database systems. I enjoy writing technical articles here on LowEndBox to help people get more out of their VPSes.

Poll: Which of These Features Do You Look for When Selecting a Provider?

Years ago, most providers offered SolusVM and OpenVZ templates. We’ve come a long way! Now even small providers have custom-developed features that rival the major public clouds. From block storage to custom ISOs to the ability to move your VM across a continent (or to a different one!) with the press of a button, there are a lot of features and capabilities that providers are bringing to the table.

Which of them matter the most to you? Please vote and inform our provider community what matters to you!

Note: You can select a maximum of four features, so please indicate those that are most important.

raindog308

I’m Andrew, techno polymath and long-time LowEndTalk community Moderator. My technical interests include all things Unix, perl, python, shell scripting, and relational database systems. I enjoy writing technical articles here on LowEndBox to help people get more out of their VPSes.

oracle – Selecting a record based off conditions CLOB

I have a table with a column storing JSON data as a CLOB. The JSON has a ‘miscData’ field that is made up of an array of JSON objects. Each object has 2 keys which are always the same, but the values are different.

.
.
.
"otherKeys" : "otherValues",
"miscData": [
        {
            "miscType": "date",
            "miscText": "2020-07-09T10:01:10.450Z"
        },
        {
            "miscType": "Comment",
            "miscText": "Comment body"
        },
        {
            "miscType": "CORRECT_TYPE",
            "miscText": "SELECT_ME"
        }
    ],
"confirmationNumber" : "123456789qwerty",
.
.
.

I need to

SELECT 
    CLOB_COL.miscData.miscText 
WHERE
    CLOB_COL.miscData.miscType = 'CORRECT_TYPE' 
AND 
    CLOB_COL.confirmationNumber = 'xxxx';

But I am having trouble since miscData is an array of objects which all contain miscType and miscData keys and I can’t guarantee the array will be the same size, or in the same order.

html – Hard coded cascading Drop down List item in asp.net core MVC always showing undefined while selecting second drop down list

I am working on Asp.Net Core 3.1 MVC web application Project, so looking forward simple Hard coded cascading Drop down List item in asp.net core 3.1 MVC.

I have two drop down select , if first drop down selected then second drop down should be enabled with respective of first drop down value.

Also I am looking forward to get selected drop down item from the view to controller action instead of selected value.

I have tried this given below article, but second drop down showing as undefined.

Referred Topic : https://stackoverflow.com/questions/23592167/populate-dropdown-list-according-to-the-value-of-another-dropdown-list-in-mvc

Please help me the on this.

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script language="javascript" type="text/javascript">
    function GetCity(_stateId) {
        var procemessage = "<option value='0'> Please wait...</option>";
        $("#ddlcity").html(procemessage).show();
       // var url = "Url.Action(GetCityByStaeId)";
        var url = "/BuildingAccessRequest/GetCityByStaeId/";

        $.ajax({
            url: url,
            data:{ stateid: _stateId },
            cache: false,
            type: "POST",
            success: function (data) {
                var markup = "<option value='0'>Select City</option>";
                for (var x = 0; x < data.length; x++) {
                   // markup += "<option value=" + data(x).Value + ">" + "</option>";
                    markup += "<option value=" + data(x).Value + ">" + data(x).Text + "</option>";
                }
                $("#ddlcity").html(markup).show();
            },
            error: function (reponse) {
                alert("error : " + reponse);
            }
        });

    }
</script>
<h4>
    MVC Cascading Dropdown List Using Jquery
</h4>
@using (Html.BeginForm())
{
    @Html.DropDownListFor(m => m.StateModel, new SelectList(Model.StateModel, "Id", "StateName"), new { @id = "ddlstate", @style = "width:200px;", @onchange = "javascript:GetCity(this.value);" })
    <br />
    <br />
    <select id="ddlcity" name="ddlcity" style="width: 200px">
    </select>

    <br />
    <br />
}
public ActionResult Create()
        {
            BuildingAccessRequest objcountrymodel = new BuildingAccessRequest();
            objcountrymodel.StateModel = new List<State>();
            objcountrymodel.StateModel = GetAllState();
            return View(objcountrymodel);
        }

        (HttpPost)
        public ActionResult GetCityByStaeId(int stateid)
        {
            List<City> objcity = new List<City>();
            objcity = GetAllCity().Where(m => m.StateId == stateid).ToList();
            SelectList obgcity = new SelectList(objcity, "Id", "CityName", 0);
            return Json(obgcity);
        }

        public List<State> GetAllState()
        {
            List<State> objstate = new List<State>();
            objstate.Add(new State { Id = 0, StateName = "Select State" });
            objstate.Add(new State { Id = 1, StateName = "State 1" });
            objstate.Add(new State { Id = 2, StateName = "State 2" });
            objstate.Add(new State { Id = 3, StateName = "State 3" });
            objstate.Add(new State { Id = 4, StateName = "State 4" });
            return objstate;
        }
        //collection for city
        public List<City> GetAllCity()
        {
            List<City> objcity = new List<City>();
            objcity.Add(new City { Id = 1, StateId = 1, CityName = "City1-1" });
            objcity.Add(new City { Id = 2, StateId = 2, CityName = "City2-1" });
            objcity.Add(new City { Id = 3, StateId = 4, CityName = "City4-1" });
            objcity.Add(new City { Id = 4, StateId = 1, CityName = "City1-2" });
            objcity.Add(new City { Id = 5, StateId = 1, CityName = "City1-3" });
            objcity.Add(new City { Id = 6, StateId = 4, CityName = "City4-2" });
            objcity.Add(new City { Id = 7, StateId = 3, CityName = "TN-2" });
            objcity.Add(new City { Id = 8, StateId = 3, CityName = "CHN-2" });
            return objcity;
        }
  public List<State> StateModel { get; set; }
    public SelectList FilteredCity { get; set; }



public class State
{
    public int Id { get; set; }
    public string StateName { get; set; }
}
public class City
{
    public int Id { get; set; }
    public int StateId { get; set; }
    public string CityName { get; set; }
}

oracle – Why is my view selecting hundreds of duplicates?

This view selects 696 entries. The CSV file has 48 entries.

CREATE OR REPLACE VIEW insert_3_char_abts AS SELECT
    ext.construct_id,
    n_term,
    enz_name,
    c_term,
    cpp,
    mutations,
    ext.g_batch,
    ext.p_batch,
    emptycol,
    
    c_batch,
    abts5_mean,
    abts5_SD,
    abts5_n,
    abts5_method,
    abts5_study_id,
    abts7_mean,
    abts7_SD,
    abts7_n,
    abts7_method,
    abts7_study_id,
    pur.pk_purified_enz_id
FROM EXTERNAL (( 
      construct_id NUMBER(10),
      n_term VARCHAR2 (50),
      enz_name VARCHAR2 (50),
      c_term VARCHAR2 (50),
      cpp VARCHAR2 (50),
      mutations VARCHAR2 (50),
      g_batch VARCHAR2 (50),
      p_batch VARCHAR2 (50),
      emptycol VARCHAR2(50),

      c_batch VARCHAR2 (50),
      abts5_mean NUMBER (5, 2),
      abts5_SD NUMBER (5, 2),
      abts5_n NUMBER (3),
      abts5_method VARCHAR2 (50),
      abts5_study_id VARCHAR2 (8),
      abts7_mean NUMBER (5, 2),
      abts7_SD NUMBER (5, 2),
      abts7_n NUMBER (3),
      abts7_method VARCHAR2 (50),
      abts7_study_id VARCHAR2 (8))
      
    TYPE ORACLE_LOADER
    DEFAULT DIRECTORY data_to_input
    ACCESS PARAMETERS (
        RECORDS DELIMITED BY NEWLINE 
        SKIP 1
        BADFILE bad_files:'badflie_view_before_insert_char_abts.bad'
        FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
        MISSING FIELD VALUES ARE NULL 
        ) 
    LOCATION ('CHAR_ABTS.CSV')
    REJECT LIMIT UNLIMITED) ext 
INNER JOIN purified_enz pur
ON ext.p_batch = pur.p_batch
INNER JOIN produced pr 
ON pr.pk_produced_id = pur.fk_produced_id;
;

If I finish this statement with

AND pr.fk_construct_id = ext.construct_id;

It selects 46 out of 48 records, which is better, but not great.