tables – How to better display a long list of parameters: valuable items?

I would like to ask if there is a better way to display a number of categories containing long lists of items "parameter: value" than what I have for the moment :

Category 1

parameter1: value1
parameter2: value2


parameter1: value1
parameter2: value2

There are 4 categories. The number of parameters in a list can contain up to 15 elements. The value can be a word as well as several sentences. All this information must be visible simultaneously.

Thank you

plugins – How to pass multiple custom fields as shortcode parameters

I'm learning to pass parameters in short code, I know the basic step after being read by WP Codex.

But for now, the plugin comes with custom fields and as a title, I want to know how to do it.

Here is the code of the plugin that adds custom fields

$prefix = '_al_listing_';
$fields = ();

$fields() = (
    'name' => __( 'Price', 'auto-listings' ),
    'id'   => $prefix . 'price',
    'type' => 'number',
    'min'  => 0,
    'step' => '0.01',
$fields() = (
    'name' => __( 'Suffix', 'auto-listings' ),
    'desc' => __( 'Optional text after price.', 'auto-listings' ),
    'id'   => $prefix . 'price_suffix',
    'type' => 'text',

$fields = apply_filters( 'auto_listings_metabox_details', $fields );

ksort( $fields );

return (
    'id'         => $prefix . 'details',
    'title'      => __( 'Details', 'auto-listings' ),
    'post_types' => 'auto-listing',
    'fields'     => $fields,
    'context'    => 'side',

And here is the code I've built to call a shortcode with parameters, but I do not know what to pass 1 custom field at a time.

public function listings( $atts ) {
    $atts = shortcode_atts(
            'orderby' => 'date',
            'order'   => 'asc',
            'number'  => '20',
            'price' => ''

    $query_args = (
        'post_type'           => $post-type,
        'post_status'         => 'publish',
        'meta_key'            => '_al_listing_price',
        'orderby'             => 'meta_value',
        'meta_value' => $atts('price'),
        'order'               => $atts('order'),                
        'posts_per_page'      => $atts('number'),

    return $this->listing_loop( $query_args, $atts, 'listings' );

Any help is appreciated.

C # to C ++ (dependency injection, passing parameters)

I am really new to C ++ and I am trying to understand some C # conversions in C ++. I have trouble understanding when to use a parameter like reference / pointer / smart pointer or what to return.
I've read that it's best to use smart pointers as much as possible instead of returning a pointer.
I made an example in C # and converted it to C ++. Did I do something wrong or what would be an improvement of my code?


C #:

public struct Container
    public int Index { get; set; }

public interface IA
    Container() CreateContainers();
public class A : IA
    public Container() CreateContainers()
        return new Container()
            new Container() { Index = 1 },
            new Container() { Index = 2 }

public interface IB
    void DoSomething();
    void DoOtherStuff(List someContainer);
public class B : IB
    private readonly IA _a;

    public B(IA a)
        _a = a;

    public void DoSomething()
        var containerList = _a.CreateContainers();

        for (var i = 0; i < containerList.Length; i++)
            //do something

    public void DoOtherStuff(List someContainer)
        someContainer.Add(new Container() { Index = 4 });
        someContainer.Add(new Container() { Index = 5 });
        someContainer.Add(new Container() { Index = 6 });

public class Program
    public void Main()
        IA a = new A();
        IB b = new B(a);
        var list = new List();

C ++:

struct Container
    Container() noexcept : _index(0) {}
    int GetIndex() const { return _index; }
    void SetIndex(const int value) { _index = value; }
    int _index;

class IA
    virtual ~IA() noexcept = default;
    virtual std::unique_ptr>  CreateContainers() = 0;

class A : public IA
    std::unique_ptr> CreateContainers() override;

std::unique_ptr> A::CreateContainers()
    Container c1;
    Container c2;
    auto result = std::make_unique>(2);
    return result;

class IB
    virtual ~IB() noexcept = default;
    virtual void DoSomething() = 0;
    virtual void DoOtherStuff(std::vector& someContainer) = 0;

class B : public IB
    explicit B(IA& a) noexcept;
    void DoSomething() override;
    void DoOtherStuff(std::vector& someContainer) override;
    IA& _a;

B::B(IA& a) noexcept :

void B::DoSomething()
    const auto containerList = _a.CreateContainers();

    for (auto i = 0; i < containerList->size(); i++)
        //do something

void B::DoOtherStuff(std::vector& someContainer)
    Container c1;
    Container c2;
    Container c3;


int main()
    const std::unique_ptr a = std::make_unique();
    std::unique_ptr b = std::make_unique(*a);
    auto list = std::make_unique>();

adjustment – Combination of adjusted parameters to create a variable and tell me the error it contains

Assuming you are using mathematica 12 (or higher),
it's pretty simple with the use Around, VectorAround, AroundReplace, etc.

Mathematica, in these versions, has an integrated error propagation:
So, you extract the covariance matrix and use AroundReplace
(he even uses the correlated error propagation)

So let's start: assuming your adjustment is in the variable fit:

covMat = fit("CovarianceMatrix");
bestParams = fit("BestFitParameters");
vecErr = bestParams((All, 1)) -> 
  VectorAround(bestParams((All, 2)), 0.5*(covMat + Transpose(covMat)))
AroundReplace(ArcTan(-b/a), vecErr)

the 0.5*(covMat + Transpose(covMat)) is used because the covariance matrix is ​​computed by a matrix inversion that is sometimes insufficiently stable to produce an absolute symmetric matrix that VectorAround will complain about. We therefore symmetry with force by hand.

He will even tell you what is the formula of your error if you plug symbols:

  ArcTan(-b/a), {{a, b} -> 
    VectorAround({A, B}, {{C(A), C(A, B)}, {C(A, B), C(B)}})}), 
 A (Element) Reals && B (Element) Reals)

Release of AroundReplace symbolically

blockchain – Understanding the parameters of the API iquidus

I'm trying to understand the values ​​that are asked of me in the settings.json file to install the IQs explorer. I know how to get the genesis block because I hard-coded it when I created a fork to create a new altcoin. However, I do not know how to get the genesis_tx. I know you can convert it from the genesis block but I do not know how?

"Genesis": {
"genesis_tx": "",
"genesis_block": ""}

In terms of API parameters, they ask for an address, blockindex, blockhash and txhash. The blockindex can be any value in the height of your block … so, do I select any index value with the corresponding address in the list of transactions? Also, how can I get txhash and blockhash? In my opinion, these values ​​are subject to change and I know that they are stored in the blockchain … Does any one know how to retrieve this information?

"api": {
"blockindex": "",
"blockhash": "",
"txhash": "",
"address": " "

I appreciate your time and your consideration.

seo – Does the blocking of URL parameters in the Google search console remove pages from the index?

In GSC, it is possible to tell Google how to handle the URL parameters. Google has suddenly started indexing more than 600,000 URLs with settings on our website. I've set the parameter in GSC indefinable and about 400,000 pages disappear from the index. So I thought everything was working as expected and that the rest of the pages would also be deleted. After one month, 300,000 pages are indexed again.

Should this work and should I wait or should I set pages with noindex?

8 – Need to document the AJAX recall parameters?

Considering the PHPCS Warning:

phpcs: hook implementations should not duplicate @param documentation

Is it possible to say PHPCS that the function is an AJAX callback (for such warnings to be generated)?

Or, should we document all AJAX recall settings, with @param PHPDoc?


Our company has been discussing the AJAX booster function below:

 * Prevents popup's redirection from dashboard to another link.
 * Users were redirected to another page as soon as the Event-creation
 * popup form was submitted, just added an AJAX handler to submit button
 * which prevents the redirect using ajax,
 * and when there is any error on the form, the message is sent to the popup.
function _MYMODULE_popup_submit(array &$form, FormStateInterface $formState) {
  // ...

Where a developer insisted to add @param PHPDoc comments on each AJAX reminder as:

 * Prevents popup's redirection from dashboard to another link.
 * Users were redirected to another page as soon as the Event-creation
 * popup form was submitted, just added an AJAX handler to submit button
 * which prevents the redirection using ajax,
 * and when there is any error on the form, the message is sent to the popup.
 * @param array &$form
 *   All data of the form.
 * @param DrupalCoreFormFormStateInterface $formState
 *   State of the form.
 * @return DrupalCoreAjaxAjaxResponse
 *   Returns the data back as AjaxResponse object.
function _amt_dayview_popup_submit(array &$form, FormStateInterface $formState) {
  // ...

And the other considered it as understandable and that it should not be documented:

… remember that PHPCS warn you whenever we use @param on any hook, like "phpcs: Hook implementations should not duplicate @param documentation"and just because PHPCS can not differ AJAX-callback from normal functions it does not mean that we should do it …

FizzBuzz with more parameters in Swift

Here is my approach to an extensible version of the FizzBuzz challenge in Swift (so we can add more numbers with which to check 3 and 5).

I first tried using dictionaries, but since they do not necessarily preserve the order of the elements, this can lead to: BuzzFizz return values.

How can this code be improved?

func fizzBuzz (n: Int, responsesByMultiples: ((Int, String)) = ((3, "Fizz"), (5, "Buzz"))) -> String {
    var result: String = ""

    for key in responsesByMultiples {
        let (multiple, response) = key,
            isMultiple: Bool = (n % multiple) == 0

        if isMultiple {
            result += response
    return result == "" ? String(n) : result
for i in 1...100 {
    print(fizzBuzz(n: i))

Pass the parameters correctly in a Django URL

I have a view where I take a code in an entry, everything is fine there, but then I have to use this code in another URL to call a profile view, the problem being that in there passing, it generates random letters and I do not know how to solve it. I wish this to happen is only but that I generate

enter the description of the image here


def ingresar_matricula(request):
if request.method=='POST':
    if form.is_valid():
        return redirect('perfil',{a})

def perfil(request,Codigo):
return render(request,'listar/perfil.html',context)



Summary on Common Lisp Function Keyword Parameters

This is an experiment on extending a basic integrated Common Lisp sequence function (ie: remove), to provide more features with little or no impact on performance. The long-term goal might be to provide such extensions for many other CL functions.

The CL sequence functions appear to provide at least 3 different types of abstraction: 1) data type abstraction, a sequence that can be a list, a vector, or a string; 2) higher order functions, in which a function can be passed as a parameter; and 3) keyword parameters, different keyword arguments that can fit the calculation for specific uses.

The basic idea explored here is to add many more keywords, to give the programmer more capacity and flexibility in processing sequences. If successful, it could avoid having to write (or recall) many utility functions that support the sequences. It could also consolidate some of the existing CL sequence functions (for example, remove, remove-if, remove-if-not, delete, delete-if, delete-if-not, remove-duplicates, delete-duplicates) in a single operation (in this case simply called "remove-sequence" with additional keywords for: destructive and: duplicates). Other bindings not linked "in sequence" could also be possible – for example, for remhash, rempropetc.

For example, consider that there is no built-in provision for removing elements from a sequence based on their index. In this order of ideas, it might be convenient to have a keyword: index-test that takes a function like (lambda (idx elt) (= idx elt)), such as (remove-sequence (list 2 1 0) :index-test (lambda (idx elt) (= idx elt))) -> (2 0). An included feature that supports the index would prevent you from writing / finding the appropriate utility.

The following extensions add many more keywords of this type to remove-sequence to see how much is needed to generalize about the basic delete feature. Note that remove-sequence There then remains only one argument, the input sequence, with everything else specified by selecting keywords.

The following keywords are added up to now (in addition to standard built-in sequence keywords :from-end, :test, :test-not, :start, :end, :count, :key):

: item – simply move the required item parameter into remove to a keyword for consistency. (remove item sequence ...) = (remove-sequence sequence :item item ...). Example: (remove-sequence (list 1 2 3) :item 1) -> (2 3).

: items – Extends the built-in ability to remove a single element from a multi-element sequence. More intuitive than using (remove-if (lambda (elt) (position elt items)) sequence ...). Example: (remove-sequence (list 1 2 3) :items '(1 2)) -> (3).

: index-test – Indicator for a function of 2 arguments: a sequence index and the corresponding element. Allows you to process sequences based on item indices. Example: (remove-sequence (list 2 1 0) :index-test (lambda (idx elt) (= idx elt))) -> (2 0)

: duplicates – A boolean indicating whether to remove duplicates or not. Folds in the functionality of remove-duplicates. Example: (remove-sequence (list 1 2 3 2 1) :duplicates t) -> (1 2 3).

: Duplicate – A boolean indicating whether to delete all occurrences of duplicate elements. Example: (remove-sequence (list 1 2 3 2 1) :duplicated t) -> (3).

: destructive – A boolean indicating whether the input sequence can be changed or not. Consolidates the delete and delete functions. Example: (defparameter *sequence* (list 1 2 3)), (remove-sequence *sequence* :item 2 :destructive t) -> (1 3), where the input sequence can be changed to produce the result for reasons of efficiency.

The basic operation remove-sequence is implemented as a set of nested macros, which translate a macro call with particular keyword parameters into an integrated CL sequence function. This avoids the difficulty of evaluating arguments when running macros, avoids the extra effort of duplicating built-in CL functionality, takes advantage of highly optimized and debugged CL sequence functions, and enables compilation check of the appropriate combinations of keywords. The tagged function present-absent with arguments for the positive and negative keywords for each translation, determines whether a particular selection of keyword arguments in a macro call is valid or not. (With a total of 13 keywords up to now, there are many possible combinations, some of which are inconsistent.)

Here are some things I would like to understand better:

1) This approach builds on CL's established paradigm of specializing a basic function with keywords. But is there a problem with adding too many keywords?

2) I can not think of keywords "remove related words" for generalization remove-sequencebut I guess there could be more. Could he have many more?

3) Different keywords are appropriate for different basic functions (for example, delete from a sequence and delete from a tree). How does having a set of keywords at your disposal compare to a set of utilities? (I think I would prefer the keywords because they seem more integrated with the language and reduce the search for relevant libraries, but the experience of my CL project is limited.)

4) Is there a better way to implement the same type of functionality? Thank you for your opinion …

(ql:quickload :iterate)

(ql:quickload :alexandria)

(defpackage :rem (:use :cl :iterate :alexandria))

(in-package :rem)

(defmacro verify (expression value)
  "Simple test to verify that the macro expression evaluates to the given value."
  `(progn (unless (equalp ,expression ,value)
            (error "Verify failed for ~A = ~A" ',expression ,value))

(defmacro rem/del-item (sequence &key item items from-end (test #'eql) (start 0) end
                                 count (key #'identity) destructive)
  "Removes/deletes item (or sequence of items) from sequence."
  (if items
    (if destructive
      `(delete-if (lambda (elt) (position elt ,items :test ,test)) ,sequence
                  :from-end ,from-end :start ,start :end ,end :count ,count :key ,key)
      `(remove-if (lambda (elt) (position elt ,items :test ,test)) ,sequence
                  :from-end ,from-end :start ,start :end ,end :count ,count :key ,key))
    (if destructive
      `(delete ,item ,sequence :from-end ,from-end :test ,test :start ,start
               :end ,end :count ,count :key ,key)
      `(remove ,item ,sequence :from-end ,from-end :test ,test :start ,start
               :end ,end :count ,count :key ,key))))

(verify (rem/del-item '(1 2 3) :item 2)
        `(1 3))

(verify (rem/del-item '(1 2 nil 3) :item nil)
        `(1 2 3))

(verify (rem/del-item '((5 0 1 2) (5 1 2 3) (5 1 3 2) (4 1 2 3))
                      :item 2 :from-end t :test #'= :count 1 :key #'fourth)
        `((5 0 1 2) (5 1 2 3) (4 1 2 3)))

(verify (rem/del-item '(1 2 3 4 5) :items '(3 4) :test #'=)
        `(1 2 5))


(defmacro rem/del-duplicated (sequence &key (test #'eql) (start 0) end
                                       (key #'identity) destructive)
  "Removes/deletes all repeated sequence elements based on an equality test."
  `(let ((ht (make-hash-table :test ,test :size (length ,sequence))))
     (iterate (for elt in-sequence (subseq ,sequence ,start ,end))
              (incf (gethash (funcall ,key elt) ht 0)))
     ,(if destructive
        `(delete-if (lambda (elt)
                      (/= 1 (gethash elt ht)))
                    ,sequence :start ,start :end ,end :key ,key)
        `(remove-if (lambda (elt)
                      (/= 1 (gethash elt ht)))
                    ,sequence :start ,start :end ,end :key ,key))))

(verify (rem/del-duplicated '((5 0 1 2) (5 1 2 3) (5 1 3 2) (4 1 2 3))
                           :test #'equal :key #'cdr)
        `((5 0 1 2) (5 1 3 2)))


(defmacro rem/del-duplicates (sequence &key from-end (test #'eql) (start 0) end
                                       (key #'identity) destructive)
  "Removes/deletes duplicates from sequence."
  (if destructive
      `(delete-duplicates ,sequence :from-end ,from-end :test ,test :start ,start
                          :end ,end :key ,key)
    `(remove-duplicates ,sequence :from-end ,from-end :test ,test :start ,start
                        :end ,end :key ,key)))

(verify (rem/del-duplicates '((5 0 1 2) (5 1 2 3) (5 1 3 2) (4 1 2 3))
                            :test #'equal :key #'cdr)
        `((5 0 1 2) (5 1 3 2) (4 1 2 3)))


(defmacro rem/del-indexed (sequence &key from-end index-test (start 0) end
                                    count (key #'identity) destructive)
  "Removes/deletes elements satisfying the index-test (index element) in sequence."
  `(let* ((delta (if ,from-end -1 +1))
          (initial-index (if ,from-end (length ,sequence) -1))
          (closure (let ((index initial-index))
                     (lambda (element)
                       (incf index delta)
                       (funcall ,index-test index (funcall ,key element))))))
     ,(if destructive
          `(delete-if closure ,sequence :from-end ,from-end :start ,start :end ,end
                      :count ,count :key ,key)
        `(remove-if closure ,sequence :from-end ,from-end :start ,start :end ,end
                    :count ,count :key ,key))))

(verify (rem/del-indexed '(3 1 2 4) :index-test (lambda (idx elt) (= idx elt)))
        '(3 4))


(defun present-absent (positives negatives)
  "Determines whether a selection of keyword arguments is valid or invalid."
  (and (every (complement #'null) positives)
       (every #'null negatives)))

(defmacro remove-sequence (sequence &key item items (test #'eql) index-test from-end (start 0) end
                                     count (key #'identity) duplicates duplicated destructive)
  "Sequence operations for removing or deleting elements."
  (cond ((present-absent `(,sequence) `(,index-test ,duplicates ,duplicated))
          `(rem/del-item ,sequence :item ,item :items ,items :from-end ,from-end :test ,test
                         :start ,start :end ,end :count ,count :key ,key :destructive ,destructive))
        ((present-absent `(,sequence ,duplicated) `(,item ,index-test ,duplicates))
          `(rem/del-duplicated ,sequence :test ,test :start ,start :end ,end
                               :key ,key :destructive ,destructive))
        ((present-absent `(,sequence ,duplicates) `(,item ,index-test ,duplicated))
          `(rem/del-duplicates ,sequence :from-end ,from-end :test ,test :start ,start :end ,end
                               :key ,key :destructive ,destructive))
        ((present-absent `(,sequence ,index-test) `(,item ,test ,duplicates ,duplicated))
          `(rem/del-indexed ,sequence :from-end ,from-end :index-test ,index-test :start ,start
                            :end ,end :key ,key :destructive ,destructive))
        (t (error "Malformed argument list to remove-sequence."))))

(verify (remove-sequence '((5 0 1 2) (5 1 2 3) (5 1 3 2) (4 1 2 3))
                         :item 2 :from-end t :test #'= :count 1 :key #'fourth)
        '((5 0 1 2) (5 1 2 3) (4 1 2 3)))

(verify (remove-sequence '(1 2 nil 3) :item nil)
        `(1 2 3))

(verify (remove-sequence '(1 2 3 4 5) :items '(3 4) :test #'=)
        `(1 2 5))


(defmacro rem/del-ht-entry (hashtable &key item items (test #'eql) (key #'identity) destructive)
   "Removes/deletes an item (or sequence of items) from a hashtable."
   (if items
      (if destructive
         (if (eq `,key #'identity)
            `(iterate (for elt in-sequence ,items)
                      (remhash elt ,hashtable)
                      (finally (return ,hashtable)))
            `(progn (maphash (lambda (k v)
                                (declare (ignore v))
                                (when (position (funcall ,key k) ,items)
                                   (remhash k ,hashtable)))
         (if (eq `,key #'identity)
            `(let ((new-ht (alexandria:copy-hash-table ,hashtable)))
                (iterate (for elt in-sequence ,items)
                         (remhash elt new-ht)
                         (finally (return new-ht))))
            `(let ((new-ht (alexandria:copy-hash-table ,hashtable)))
                (maphash (lambda (k v)
                            (declare (ignore v))
                            (when (position (funcall ,key k) ,items)
                               (remhash k new-ht)))
     (if destructive
        (if (eq `,key #'identity)
           `(remhash ,item ,hashtable)
           `(progn (maphash (lambda (k v)
                               (declare (ignore v))
                               (when (funcall ,test ,item (funcall ,key k))
                                  (remhash k ,hashtable)))
       (if (eq `,key #'identity)
          `(let ((new-ht (alexandria:copy-hash-table ,hashtable)))
              (remhash ,item ht)
          `(let ((new-ht (alexandria:copy-hash-table ,hashtable)))
              (maphash (lambda (k v)
                          (declare (ignore v))
                          (when (funcall ,test ,item (funcall ,key k))
                             (remhash k ht)))

(defmacro rem/del-hashtable (hashtable &key item items (test #'eql) (key #'identity) destructive)
  (cond ((present-absent `(,hashtable) '(nil))
           `(rem/del-ht-entry ,hashtable :item ,item :items ,items :test ,test :key ,key
                              :destructive ,destructive))
         (t (error "Malformed argument list to rem/del-hashtable."))))

(defparameter *ht* (let ((ht (make-hash-table :test #'equal)))
                     (setf (gethash '(1 1) ht) 'a
                           (gethash '(2 2) ht) 'b
                           (gethash '(3 3) ht) 'c)

(verify (rem/del-hashtable *ht* :item 1 :test #'= :key #'car :destructive t)
        (let ((ht (make-hash-table :test #'equal)))
          (setf (gethash '(2 2) ht) 'b
                (gethash '(3 3) ht) 'c)

(verify (rem/del-hashtable *ht* :items #(2 3) :test #'= :key #'car)
        (make-hash-table :test #'equal))


(defmacro remove+ (container &key item items (test #'eql) index-test from-end (start 0) end count
                             (key #'identity) duplicates duplicated destructive)
  "Generalization of remove for some types of containers."
  (cond ((typep container 'sequence)
          `(remove-sequence ,container :item ,item :items ,items :test ,test :index-test ,index-test
             :from-end ,from-end :start ,start :end ,end :count ,count :key ,key
             :duplicates ,duplicates :duplicated ,duplicated :destructive ,destructive))
        ((typep container 'hash-table)
          `(rem/del-hashtable ,container :item ,item :items ,items :test ,test :key ,key :destructive ,destructive))
        ((error "First argument must be a sequence or hash-table container object: ~A~%" container))))

(verify (remove+ '(1 2 3 4 5) :items '(3 4) :test #'=)
        `(1 2 5))