PHP wordpress – template part including not working

EDIT –

I have since tried a blank and new php file and accessing it the same way – that worked. So I am now unclear why the existing file does not load at all. There are no errors.

I am trying to include a partial template and have read up on how to do so.

<div class="row">
    <div class="col-md-12">
        <?php get_template_part('/partials/category.php');
        ?>
    </div>
</div> 

The file I have included the above code in is in the theme main. The partial is in a folder in the theme main called partials. When I use /partials/category.php I get a blank with no PHP error in the area of the page where the information should be.

If I dont use the / on front of partials I get an error.

I have also tried removing the / on the front and at the same time removing the .php at the end. Same result where there is no error and no output

What am I missing about getting the template part to display>?

promoted links – Sharepoint Online – Custom CSS in Content Editor web part saves are overwritten

changing the promoted links is one of the tough task because most of the element inside it has inline styles, which can be overridden by only one way i.e. css !important mark, and when you change the width/height of promoted links, the animation stops working. It is not advised to customize promoted links via css. You can take advantage of SharePoint JSLink/CSR to achieve what you want to via CSS override.

If the above, is not your requirement then you can apply following css to get the desired size. I am using 100px box, you can provide your desired size.

.ms-promlink-body > div {
    width: 100px !important;
    height: 100px !important;
}

.ms-promlink-body > div > div{
    width: 90px !important;
    height: 90px !important;
}

.ms-promlink-body > div > div > a span, .ms-promlink-body > div > div > a div{
    width: 90px !important;
    height: 90px !important;
}

.ms-promlink-body > div > div > a div{
    top: 60px !important;
}

But this will stop animation part as all the css is marked as important. The output will look like following:

css promoted links

turing machines – When can a deterministic finite-state-automata along with its input sequence be said to be a part of another FSM?

There is a Finite State Automata / Finite State Machine (FSM) $F$. This FSM has an input alphabet, a set of possible states, an initial state, a set of possible final states and a state transition function.

For this FSM a finite input sequence $S$ is given, such that at the end of this sequence the FSM enters a final state and stays in that state.

Can this FSM $F$ along with the input sequence $S$ be considered a separate FSM $F’$?

Analogous to this, can a Turing machine $T$ along with the tape $P$ be considered a separate Turing machine $T’$?

What are the conditions, if any, for this to be true assuming it is true?

Note: I expect a formal proof, or a reference/outline to a formal proof that proves that either of this can or cannot be done. Some theory related to this is also welcome.

My research:

Related topic:

R. T. G. TAN (1979) Hardware and software equivalence, International Journal of Electronics, 47:6, 621-622, DOI: 10.1080/00207217908938690

I am aware of the principle of hardware and software equivalence, which states that a given task can be performed using hardware or software, i.e. digital hardware and software are equivalent models of computation. But I think that my question is different from this one.

Motivation:

  • From this question (
    Is there code below microcode? ) I think we can consider an FSM with its input sequence (microcode) to be a part of another FSM (the digital computer), but of course much more circuitry like Arithmetic and Logical Unit (ALU) and datapath is needed to make a computer. Microcode is used only for the control circuit.

  • This answer explains how the data in the RAM of a computer along with the CPU can be considered to be a part of a bigger circuit.

sharepoint online – Search result web part – formatting dates to days

I am using the SharePoint search Results web part which uses Handlebars JS.

I have two dates in these variables:

{getDate EventDateOWSDATE}

{getDate EndDateOWSDATE}}

I need to check if the 2 dates are on the same day, and if they aren’t, I need to display to the browser 1day, 2day etc.

So if:

EventDateOWSDATE = 27/02/2021

EndDateOWSDATE = 29/02/2021

Print to the browser: 3 days

I could do this using JavaScript and moment, but not sure how to do this inside this web part using handlebars and I don’t think I can add libraries like moment.

javascript – onClick in custom web part does not work

I have a custom web part, there is a, anchor link with an onclick method in it that I set the inner html to. This is the anchor link tag:
<a title="Download" class=${styles.download} href="#0" onClick="window.open(${this.properties.DocumentUrl})"> <img src="https://sharepoint.stackexchange.com/${String(download)}" /> </a>
When I run the app in hosted workbench, the onclick event fires as soon as my web part loads. Clicking the button does nothing. Further more, when I inspect the page, this is how the html was rendered.
enter image description here
So you can see the onclick attribute is undefined. How can I have a custom web part with an onclick function that works?

Thanks

web part – Implementing charts from data to sharepoint 2016

Prompt with the choice of the road.

Our employee and he is the customer gave the task for the implementation of his project in the portal.
The initial technical task consisted in displaying the entered data in the form of graphs. But after talking with him, I understand that the task is actually more difficult than it is.
enter image description here

  1. I need to visually display the upper levels of the data pyramid. (left side in the picture). it would be logical to hide nested sub-items with names under the spoiler.
  2. when clicking on them, there should be a transition to the page of the second and subsequent levels. There you also need to pull up the data (numbers. According to their values, this indicator will be highlighted in the range. For example: below 30 – bad; from 30 – 60 good; 60 – 100 – ideal;
  3. And by clicking on the third level, you need to get to the statistics page of a specific indicator. It is planned that there will be a sample of a specific indicator by year, and a breakdown by division. And all this will be displayed in graphs.

Now the question of implementation.
As usual, you need to do it all with minimal effort. A sub-site has been created for this resource. Some of the data has already been entered into the portal – into regular lists.
I wanted to do it by means of PerformancePoint. But so far it has not been possible to do this (PerformancePoint works with Sql 2016 and I have 2014)
Remark. Since we have done everything on-premise, the option of cloud solutions is not considered. (as well as app purchases) As far as I understand, the cloud includes – insignts; Poverviev)
Also, the option of displaying on JS is not considered.
how else can you implement ??

I created a PowerApps form, then placed it in a Page Viewer Web Part. I need to remove “New Item”, “Save”, and “Cancel”

So I customized a modern form in SharePoint with PowerApps. My client then wanted my to have this form display on a separate page. So I placed the form in a Page Viewer Web Part. It looks good except I need to remove “New Item”, which appears to just be static text. I also need to remove/hide “Save” and “Cancel” at the top, as I created custom buttons at the bottom of the form to perform that function. Here’s what I’m talking about:

enter image description here

I just want to know if it’s possible to hide/remove these parts. Or if I can even lower the top of the web part enough to cover them.

Thank you for your help!!

Chris

web part – SharePoint Online – Is it possible to provide custom formatting for Highlighted Content webpart List Layout

I am trying to get the recent updates across sites -i.e. content roll up.

By configuring the webpart, I do get the desired results in list format.

However, is it possible to apply custom formatting to that layout ?

Any help would be much appreciated!

docker – Which part of the software stack actually chooses the default settings for `/sys/fs/cgroup` mount passed to OCI runtime?

Background

Now that docker supports cgroups v2 I would like to take full advantage of it.

When I run a container with a private group using --cgroupns=private the nested cgroup2 filesystem created by systemd scope gets mounted into the containers /sys/fs/cgroup path properly, however, docker mounts it read-only by default:

cgroup2 on /sys/fs/cgroup type cgroup2 (ro,nosuid,nodev,noexec)

Rationale

Technical considerations

I think that this is legacy behaviour which was correct for cgroupv1 where the system-global cgroupfs was mounted into the container as rw rights would be a gaping security hole.

According to my knowledge a nested cgroup with delegated controllers should be able to write into /sys/fs/cgroup by design without negative security implications.

Target use-cases

Right now running containers with (nested) systemd init or other container runtime requires multiple hacks which seriously expose security and have portability problems.

Solving this problem would enable an easier, more secure and possibly even transparent mechanism for:

  • allowing containers with nested systemd init to manage its own resources via slices and scopes – kind of like with LXC’s nested mode but without the nasty security implication of bind mounting the real cgroupfs into the container
  • allowing nested containerized workloads with the help of fuse-overlayfs

The goal

My goal is to adjust the code so the cgroup2 filesystem is mounted read-write when container is run with a private cgroupns with delegated controllers.

The problem

The problem is that I don’t really know where to look. Which part of the stack is actually responsible for this? Is it docker, moby, containerd, runc or maybe systemd?

So far I’ve found the default settings in the moby project, but they are for cgroupv1.

Where do I find the code that I need to modify and submit a PR to?

PS For a more detailed writeup see my answer on serverfault and my post on r/docker.

encryption – Does knowing part of a passphrase for sure really mean that you can “disregard” that entire part when trying to crack it?

Alice bought 1 Bitcoin and encrypted her wallet.dat in Bitcoin Core.

Samantha, Alice’s friend, notices the Bitcoin price skyrocketing and, while Alice is in the bathroom, steals Alice’s wallet.dat as well as important.txt and goes home.

There she discovers that it’s passphrase-protected, so she cannot transfer the coin away to her own wallet.

Alice opens important.txt and discovers this:

Never delete the following!!!
Bitcoin passphrase: "ck3C83jcdldkj3isDkj2m3Db3ducMJm3wb3kdkxckDksk2kw54956848dkDkdkewj54t" + first_pet_nickname + house_number_for_second_temporary_house + guy_in_first_grade_i_had_a_crush_on + favorite_brand_of_cakes (all lowercase letters)

In other words, Alice has written down part of the passphrase with the rest being things that Samantha possibly could guess or brute-force.

My question is: assuming that she can’t just guess the unknown parts, and has to brute-force it, does the sheer length of the known part pose any kind of extra hurdle?

That is, has the passphrase just turned into simply first_pet_nickname + house_number_for_second_temporary_house + guy_in_first_grade_i_had_a_crush_on + favorite_brand_of_cakes? Since the first string is known, does that mean it “doesn’t exist” as far as brute-force time/resources needed? Or will this add significantly to the slowness of the brute-forcing because it has to do different (more complex) calculations with the long string as compared to without it?