magento2 – I have created a custom module for backed to add menu and submenu but it shows me on phtml file in Magento 2

I have created a custom module for back end Menu and sub menu but it shows me an error for phtml file.

1 exception(s):
Exception #0 (MagentoFrameworkExceptionValidatorException): Invalid template file: 
'Admin_CreateMenuBackend::helloworld.phtml' in module: 'Magento_Backend' block's name: 
'content_schedule_block1'

My routes.xml file is

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="admin">
<route id="createmenubackend" frontName="createmenubackend">
<module name="Admin_CreateMenuBackend" before="Magento_Backend"/>
</route>
</router>
</config>

My createmenubackend_create_index.xml is

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
   <referenceContainer name="content">
           <block class="MagentoBackendBlockTemplate" template="Admin_CreateMenuBackend::helloworld.phtml"/>
   </referenceContainer>
</body>
</page>

blockchain – Can Hyperledger Fabric smart contracts be shared with peers outside of the channel where the contract was created?

I am a beginner in Hyperledger Fabric. From my understanding, smart contracts between individuals on a channel are signed and validated by peers within that channel. Can a smart contract between two peers be shared with a peer outside of that channel so that the third peer has “proof” of some of the details in the contract?

For context, I watched this video: https://youtu.be/js3Zjxbo8TM?t=42 (shouldn’t take more than 90 seconds of watching to get context to my question). In this scenario, if the Californian “Organic Market” wanted to sell the radishes to a consumer, can the market provide proof to the consumer that the radishes came from that specific grower in Chile? Additionally, can the organic market share proof of this without sharing all the individual details (wholesale price) of the contract? Thank you for your help.

postgresql – Is there a better way to exclude all “not actively created by a human” indexes than what I’m doing?

My goal is to list the indexes which I, a human, have actually added into my database. I don’t want to see ones that were created by PG when creating PKs and whatnot. I didn’t even know it did that, but it sure seems to do. A lot. It’s not obvious how to sort out all those, since there is no column such as “was_created_automatically_by_pg”. I started with:

SELECT schemaname, tablename, indexname, indexdef FROM pg_indexes;

That causes tons of “junk” records to be returned with the schemaname “pg_catalog”. So, ignoring those:

SELECT schemaname, tablename, indexname, indexdef FROM pg_indexes WHERE schemaname <> 'pg_catalog';

I still get a lot of indexes which I never created.

SELECT schemaname, tablename, indexname, indexdef FROM pg_indexes WHERE schemaname <> 'pg_catalog' AND indexdef NOT LIKE 'CREATE UNIQUE INDEX %';

Now, all the resulting records seem to correspond to indexes which I remember having created, some with names such as “djhhcdhxchhhsxhsddf” and some with names that were auto-created, based on the columns it involves. Not sure how I made those since pgAdmin 4 refuses to let me create an index without manually naming it. (Which is quite annoying, might I add.)

However, what if I added a “UNIQE INDEX” myself? It feels like my own “final” query is “hiding” some records this way. It doesn’t seem reliable.

How come they didn’t have a column as I described above? Or is this actually pgAdmin 4 creating the indexes automatically? Is it actually possible to create a PRIMARY KEY without an internal index on it? I don’t understand why anyone would ever want to create a PK which is not unique and indexed. That’s the whole point of the field… to be unique and enable fast FKing from other tables.

It makes me anxious to see how many indexes there are which I never thought of. I assume that I shouldn’t touch them, ever, but I always assumed that the PKs and whatnot had “internal” indexes which are never mentioned/displayed/returned.

algorithms – Calculate the area of the shape created by multiple paths

I’m trying to write an algorithm to calculate the area created by multiple paths that can be overlapping or not. Here is an example:

Example Paths

Basics

  • 4 separate paths (A,B,C,D) which are a collection of vertices (A1,A2,…)
  • Area desired is represented by green

Edge Cases

  • As shown with B, a path might have segments that don’t contribute to a filled shape
  • As shown with C, a path might be completely enclosed by other paths and therefore should basically be ignored.
  • As shown with D, paths may create independent shapes
  • As shown with A and B, it should be a union of all the shapes

My first question is if an algorithm for this already exists. If it does, it would save me a lot of effort :). I tried searching around but I don’t even know how to describe this problem concisely.

Assuming one doesn’t exist for this exact purpose I have to move on to figuring it out myself. I’m assuming the right data structure for the job is a graph. I’m thinking I will add points for each intersection (highlighted in red) as I insert paths into the graph.

Then “all I need” is an algorithm for tracing around the outside of each shape because calculating the area of those irregular polygons will be simple. Does something like that already exist? My primary hangups when I think about how to do this are:

  • What vertex do I “start” at?
  • How do I account for multiple shapes (D as well as A,B,C)?
  • How do I account for the parts of shapes like formed by A1,A5,A5 where I’ll be visiting that intersection point multiple times?

I’m not necessarily looking for a complete solution, I’d love thoughts on if you think I’m approaching this the best way so far and if you have any ideas/suggestions on how to achieve this.

Thanks in advance!

8 – How do I detect whether any contact forms have been created?

Context: On my Drupal 8 site I’m trying to add in a new section containing a view that lists out all forms. The user can then click on one of the form and it launches a download of all the messages sent through that form. However that section should only be visible if the user has created at least 1 form.

What I’ve tried: So far what I’ve discovered is that the contact forms are stored in the config table in the database, so I could theoretically run a query like “SELECT 1 FROM config WHERE name LIKE ‘%contact.form%'” or whatever the equivalent in D8 is. However, it seems like there has to be a quicker way to return either the presence of contact forms or the contact forms themselves programmatically.

Final question: How can I return either the contact forms themselves or at least a boolean representing the presence of contact forms programmatically?

mac – Created a looping Automator application. Now process is running indefinitely by launchd and cannot kill it

I’m losing my mind.

I created a super simple Application in Mac Automator which just runs a one-line Python script and then has a loop action at the end. I ran this and it started working. Then no matter what I tried, deleting the application, killing the process, it doesn’t stop.

For one, the PID of the process is constantly changing and the parent process seems to be launchd (1). And I know it’s still running because the Python script writes “foo” to a .txt file I have and it’s still writing it. I tried rebooting to no success either.

Please tell me how to stop this process..

postgresql – Calling a function that creates records and referencing the created records in a join

I have a function that creates records for different tables that are referenced with each other. The function returns the record from the “parent” table. So I am using that function in the FROM of my query so that I can then perform JOIN on the associated records so that I can piece the tables together. My problem is that the associated records aren’t getting returned and I know for certain that they are getting created.

From what I understand, FROM and JOIN are pretty much executed at the same time so it makes sense that the FROM‘s creation of the records that are used in the JOIN would not exist.

So how can I ensure that the call to the function is executed first before the JOIN is executed? I tried doing this with CTE but no avail.

SELECT
  i.invoice_id,
  i.invoice_date,
  i.invoice_due_date,
  i.created_by_id,
  i.currency_id,
  i.created_at,
  si.supplier_info,
  bi.billing_info
FROM invoices.create_shift_invoice(
  CAST(NULLIF($invoice_date, NULL) AS TIMESTAMP),
  CAST(NULLIF($invoice_due_date, NULL) AS TIMESTAMP),
  CAST(NULLIF($currency_id, '') AS INT8),
  CAST(NULLIF($created_by_id, '') AS INT8),
  CAST(NULLIF($supplier_info, NULL) AS JSONB),
  CAST(NULLIF($billing_info, NULL) AS JSONB),
  CAST(NULLIF($invoice_items_shifts, NULL) AS JSONB)
) i
JOIN (
  SELECT
    _si.invoice_id,
    json_build_object(
      'supplier_info_id', CAST(_si.supplier_info_id AS VARCHAR),
      'invoice_id', CAST(_si.invoice_id AS VARCHAR),
      'suppler_name', _si.supplier_name
    ) AS supplier_info
  FROM invoices.supplier_infos _si
) si USING (invoice_id)
JOIN (
  SELECT
    _bi.invoice_id,
    json_build_object(
      'billing_info_id', CAST(_bi.billing_info_id AS VARCHAR),
      'invoice_id', CAST(_bi.invoice_id AS VARCHAR),
      'customer_id', CAST(_bi.customer_id AS VARCHAR)
    ) AS billing_info
  FROM invoices.billing_infos _bi
) bi USING (invoice_id)

And here’s my attempt at a CTE:

WITH create_shift_invoice AS (
  SELECT *
  FROM invoices.create_shift_invoice(
    CAST(NULLIF($invoice_date, NULL) AS TIMESTAMP),
    CAST(NULLIF($invoice_due_date, NULL) AS TIMESTAMP),
    CAST(NULLIF($currency_id, '') AS INT8),
    CAST(NULLIF($created_by_id, '') AS INT8),
    CAST(NULLIF($supplier_info, NULL) AS JSONB),
    CAST(NULLIF($billing_info, NULL) AS JSONB),
    CAST(NULLIF($invoice_items_shifts, NULL) AS JSONB)
  )
)

SELECT
  i.invoice_id,
  i.invoice_date,
  i.invoice_due_date,
  i.created_by_id,
  i.currency_id,
  i.created_at,
  si.supplier_info,
  bi.billing_info
FROM create_shift_invoice i
LEFT JOIN (
  SELECT
    _si.invoice_id,
    json_build_object(
      'supplier_info_id', CAST(_si.supplier_info_id AS VARCHAR),
      'invoice_id', CAST(_si.invoice_id AS VARCHAR),
      'suppler_name', _si.supplier_name
    ) AS supplier_info
  FROM invoices.supplier_infos _si
) si USING (invoice_id)
LEFT JOIN (
  SELECT
    _bi.invoice_id,
    json_build_object(
      'billing_info_id', CAST(_bi.billing_info_id AS VARCHAR),
      'invoice_id', CAST(_bi.invoice_id AS VARCHAR),
      'customer_id', CAST(_bi.customer_id AS VARCHAR)
    ) AS billing_info
  FROM invoices.billing_infos _bi
) bi USING (invoice_id)

website design – Is it a good practice to include created and last modified for technical articles?

As a software developer, I often read technical documentation. I might be biased due to the high usage of Stack Overflow and internal tools like Confluence which are full of timestamps (almost any piece of information has a creation date).

However, every now and then I stumble across technical articles (example) which do not provide any timestamp information. I typically view source and search for a hidden (technical) tag that might contain some timestamp, but this is not someone using a Web site normally would normally do.

I am curious if from a UX perspective technical content creation/modification timestamps are a must or at least a good practice.

Question: