bash – Code to retrieve BitBucket repositories

So it works really well (we have> 2k rest), but I'd really like it to start producing results as soon as it has it. Generally, it seems faster than it is (being more responsive)

   bbrepos(){
        local url=https://api.bitbucket.org/2.0/repositories/twengg
        local project=${1:+"q=project.key="$1""}
        curl -snL  "$url?pagelen=0&page=1" | jq '"$((((.size) / 50) + 1 ))"' 
            | xargs bash -c 'eval "echo $1"' _ | xargs seq 1 | xargs -L 1 printf "?pagelen=50&page=%s&${1:-$project}n" 
            | xargs -I {} -L 1 -P 20 -I {} bash -c 'curl -snL  "$1/$2" | jq -er .values().links.clone(1).href' _ $url {}  #clone(1) is ssh
            | sort -u
    }

How to use the Blockstream REST API to retrieve a JSON output on an address?

As others have said, you can use https://blockstream.info/api/address/bc1qgsmfaz22lzy08wqjspd8xtm43hal5tgz4hyac6 for JSON – the documentation refers to the execution of a local instance – the exact endpoint depends on the deployment, the default deployment we use at nginx forward /api/ requests to electrs without the api bit https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in#L32 but it depends on how users want to deploy it.

We should probably mention this in the API.md file to avoid confusion.

performance – PostgreSQL function with multiple joins to retrieve brief data

I have designed a database schema to store multiple translations in order to be able to easily extract data and add other translations if needed in the future without having to bring any changes.

Here is a dbdiagram.io from the part of the database relevant for this article: https://dbdiagram.io/d/5dd0b181edf08a25543e0336

One of my bot commands takes the name of the hero as input, grabs the id of the user's locale and passes it to the function's parameters. i_hero_name and i_locale_id respectively, and said function returns brief information about that hero, if any.

Most tables (in this case, those that are not joined in this function) are lookup tables to ensure referential integrity in the database.

The function I use is as follows:

CREATE OR REPLACE FUNCTION Game.get_hero(i_hero_name TEXT, i_locale_id SMALLINT)
    RETURNS TABLE (
        name TEXT,
        story TEXT,
        grade SMALLINT,
        face_id TEXT,
        attribute_id SMALLINT,
        attribute TEXT,
        role_id SMALLINT,
        role TEXT,
        zodiac_id SMALLINT,
        zodiac TEXT,
        bra SMALLINT,
        "int" SMALLINT,
        fai SMALLINT,
        des SMALLINT,
        devotion_name TEXT,
        devotion_slot TEXT,
        devotion_value FLOAT,
        self_devotion_name TEXT,
        self_devotion_value FLOAT,
        exclusive_equipment_name TEXT
    )
AS
$$
#variable_conflict use_column -- TODO remake this, use better column naming.
BEGIN
    RETURN QUERY
    SELECT
        COALESCE(c.name, b.name),
        COALESCE(c.story, b.story),
        a.grade,
        a.face_id,
        d.attribute_id,
        d.attribute_name,
        e.role_id,
        e.role_name,
        f.zodiac_id,
        f.zodiac_name,
        a.bra,
        a.int,
        a.fai,
        a.des,
        g.name,
        a.devotion_slot,
        g.effect,
        h.name,
        h.effect,
        i.name
    FROM
        Game.Hero a

    INNER JOIN (
        SELECT * 
        FROM Game.HeroTranslation
        WHERE locale_id = 2
    ) b ON a.hero_id = b.hero_id

    LEFT JOIN (
        SELECT * 
        FROM Game.HeroTranslation
        WHERE locale_id = i_locale_id
    ) c ON a.hero_id = c.hero_id

    LEFT JOIN (
        SELECT locale_id, attribute_id, attribute_name
        FROM Game.AttributeTranslation
        WHERE locale_id = i_locale_id
    ) d ON a.attribute_id = d.attribute_id

    LEFT JOIN (
        SELECT locale_id, role_id, role_name
        FROM Game.RoleTranslation
        WHERE locale_id = i_locale_id
    ) e ON a.role_id = e.role_id

    LEFT JOIN (
        SELECT locale_id, zodiac_id, zodiac_name
        FROM Game.ZodiacTranslation
        WHERE locale_id = i_locale_id
    ) f ON a.zodiac_id = f.zodiac_id

    LEFT JOIN (
        SELECT a.devotion_id, a.effect, b.name
        FROM Game.HeroDevotion a
        LEFT JOIN (
            SELECT stat_id, name
            FROM Game.StatTranslation
            WHERE locale_id = i_locale_id
        ) b ON a.stat_id = b.stat_id
    ) g ON a.devotion_id = g.devotion_id

    LEFT JOIN (
        SELECT a.devotion_id, a.effect, b.name
        FROM Game.HeroDevotion a
        LEFT JOIN (
            SELECT stat_id, name
            FROM Game.StatTranslation
            WHERE locale_id = i_locale_id
        ) b ON a.stat_id = b.stat_id
    ) h ON a.devotion_self_id = h.devotion_id  

    LEFT JOIN (
        SELECT 
            a.hero_id,
            COALESCE(c.name, b.name) AS "name"

        FROM Game.HeroExclusive a

        INNER JOIN (
            SELECT exclusive_id, name
            FROM Game.HeroExclusiveTranslation
            WHERE locale_id = 2
        ) b ON a.exclusive_id = b.exclusive_id

        LEFT JOIN (
            SELECT exclusive_id, name
            FROM Game.HeroExclusiveTranslation
            WHERE locale_id = i_locale_id
        ) c ON a.exclusive_id = c.exclusive_id
    ) i ON a.hero_id = i.hero_id

    WHERE (c.name IS NULL AND b.name ~* i_hero_name)
    OR (c.name ~* i_hero_name AND a.hero_id = c.hero_id);
END
$$
LANGUAGE plpgsql;

I have two joins for HeroTranslation translations whose one contains the default translation (if there are no translated data) and the other for the translation data user locale, and then COALESCE(translation, default_translation).

For Attribute, Role and Zodiac, I do not need to do as above because there will always be a translation for them.

And then each hero has two types of devotions, one that is for the whole team, noted as devotion_id on the Game.Hero table and the one reserved only for the hero, called devotion_self_id on the same table.

Finally, some heroes might or might not have equipment, unlike Zodiac / Role / Attribute, they might not be translated. I must therefore attach the default translations and the translations requested by the user.

I have no problem with the design, it works as I want it and it is powerful with timings ranging from 1 ms to 20 ms. I do not know if you need to publish the PostgreSQL schedule because of the length, so I will now post the timing results:

EXPLAIN ANALYZE SELECT * FROM Game.get_hero('Yufine', 2::SMALLINT);
                                                  QUERY PLAN
---------------------------------------------------------------------------------------------------------------
 Function Scan on get_hero  (cost=0.25..10.25 rows=1000 width=352) (actual time=18.196..18.197 rows=1 loops=1)
 Planning time: 0.061 ms
 Execution time: 18.254 ms
(3 rows)

Is there any improvement I can make to the query / function above?

sharepoint online – Using highlighted content to retrieve all documents with a managed property value

I want to configure the highlighted content Web Part on a pivot site to bring back all documents that contain a managed property column that defines a certain value.

I can configure a filter or CAML file if I point to a single library, but what if I have to embed all the document libraries in the hub family of sites?

Here I have configured my managed property

enter the description of the image here

then I configure my HCWP

enter the description of the image here

Nest I cry because nothing is recovered 🙁 I wonder if this restriction in the TSDP .. Is there a way to see the last query?

mysql – PHP warning: mysqli_error (): Unable to retrieve mysqli in

I am new in this field so here is my case:

I receive this error on my wp site and I need someone to tell me where to look for the problem. I know it's written in the log file and here it is. I just need a recommendation to do a search.

tail -f /var/log/apache2/error.log

(Wed Nov 06 17: 37: 34.338255 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_query (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php on line 2007, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.338540 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_errno (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php at line 1902, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.338756 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_error (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php on line 1929, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.339084 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_real_escape_string (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php on line 1172, referring: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.339421 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_query (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php on line 2007, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.339751 2019) (: error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_errno (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php at line 1902, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq
(Wed Nov 06 17: 37: 34.340001 2019) (error) (pid 7783) (client 192.168.0.167:55833) Warning PHP: mysqli_error (): Unable to retrieve mysqli in / home / mia / public_html / wp-includes /wp-db.php on line 1929, referent: https://mia.mk/wp-admin/edit.php?post_status=publish&post_type=post&lang=sq

javascript – Google SDTT does not retrieve URL structured data

Initially, I wrote code that created the structured data for the breadcrumb and server-side product markup, and then of the page. Although the implementation is correct according to Google's structured data test tool, I found no difference between the SERPs and when I chose to extract by URL. "rather than" extracted ", the tool only recovered the of the URL of the given page, so no structured data has been detected.

This was confusing, because in Google's documentation it is stated that the structured data can be inserted into the file. body or head of an HTML page.

I've changed my approach and decided to place the structured product data in the section, while leaving the structured navigation bar to render as is. I read in the documentation that there was no problem if you were adding data dynamically with JavaScript or AJAX. I've therefore written a script that creates the structured data and adds it to the end. of the page.

When I tested my new links with the "Extract URL" option, Google's tool was getting back the entire page (which it had not been). not done before), but did not display structured product data. This time, however, he was recovering data from the Ariane thread, which he had not done before and without changing anything in my code.

  1. Why would the tool initially only look for the but not the ?
  2. Why does the tool later retrieve the part?
  3. Why does not the brand of the product appear when the page is extracted by URL? Is it possible that, unlike the documentation, structured markup is not detected when it is added by JavaScript?

The JavaScript code that creates and adds the product brand to the works on document.ready. The Ariane thread tag renders with the HTML during runtime.

Can multiple processes retrieve the same record from an Oracle FIFO Queue?

From what I understand of Oracle AQ (Advanced Queuing), two (or more) processes can not extract (drain / consume) the same record of an Oracle FIFO queue. Is this correct or is a code needed to prevent this?

Retrieve the data live (json) and make available to the library javascript or javascript (React)

This is possible in Drupal without Drupal knowing anything about it. I've already done things like this in Twig templates:

{% if node.field_myfield is not empty%}
  

  
{% end if %}

Or request Basic JS makes a request to the Drupal server (custom route) that handles the request and assembles the response, which is then written to the div below. Nothing is recorded anywhere.

Here is a similar example, still in Twig, but this time, there is no basic treatment, React handles it:

Without going into details, the React component loads and triggers a request to the api value in the config object (props) attached here and React generates the full display in the div as a React component. Again, nothing is stored or saved, both occur during loading.

That said, you do not want the rendering to appear in a page (but will it not be, if it is a component of React?) – you can ask directly in Javascript without placing it elsewhere. , or from a non-Drupal site by doing the same thing.

Retrieve the data live (json) and make available to the library javascript or javascript (React)

This is possible in Drupal without Drupal knowing anything about it. I've already done things like this in Twig templates:

{% if node.field_myfield is not empty%}
  

  
{% end if %}

Or request Basic JS makes a request to the Drupal server (custom route) that handles the request and assembles the response, which is then written to the div below. Nothing is recorded anywhere.

Here is a similar example, still in Twig, but this time, there is no basic treatment, React handles it:

Without going into details, the React component loads and triggers a request to the api value in the config object (props) attached here and React generates the full display in the div as a React component. Again, nothing is stored or saved, both occur during loading.

That said, you do not want the rendering to appear in a page (but will it not be, if it is a component of React?) – you can ask directly in Javascript without placing it elsewhere. , or from a non-Drupal site by doing the same thing.

Retrieve the data live (json) and make available to the library javascript or javascript (React)

This is possible in Drupal without Drupal knowing anything about it. I've already done things like this in Twig templates:

{% if node.field_myfield is not empty%}
  

  
{% end if %}

Or request Basic JS makes a request to the Drupal server (custom route) that handles the request and assembles the response, which is then written to the div below. Nothing is recorded anywhere.

Here is a similar example, still in Twig, but this time, there is no basic treatment, React handles it:

Without going into details, the React component loads and triggers a request to the api value in the config object (props) attached here and React generates the full display in the div as a React component. Again, nothing is stored or saved, both occur during loading.

That said, you do not want the rendering to appear in a page (but will it not be, if it is a component of React?) – you can ask directly in Javascript without placing it elsewhere. , or from a non-Drupal site by doing the same thing.