## algorithms – Need help understanding Knuth’s proof that: The set of all pure words is well-ordered by the relation >

In the paper linked below by Knuth and Bendix, theorem 1:

The set of all pure words is well-ordered by the relation ‘$$>$$

has a proof that I can’t seem to follow despite staring at it all day. I can’t even decipher what the notation is trying to represent.

So, we have four fixed sequences:

• An infinite sequence of variables $$v_1, v_2, v_3, …$$ etc. (not relevant for Theorem 1)
• A finite sequence of operators $$f_1, f_2, f_3, …, f_n$$
• A finite sequence of degrees $$d_1, d_2, d_3, .., d_n$$
• (i.e. degree of $$f_4 = d_4$$)
• and a finite sequence of weights $$w_1, w_2, w_3, …, w_n$$
• (i.e. weight of $$f_4 = w_4$$)

A word is then defined inductively as either a variable alone or an operator followed by an appropriate number of other words depending on the degree of said operator.

A ‘pure word’ is a word with no variables and the weight of a pure word, $$alpha$$ is defined as follows:

• $$w(alpha) = sum_j w_jn(f_j , alpha)$$ where $$n(f_j, alpha)$$ is the number of occurrences of $$f_j$$ in the word $$alpha$$

Finally the relation $$>$$ that orders all pure words that is proved to be well-ordered is defined as:

$$alpha > beta$$ if and only if:

1. $$w(alpha) > w(beta)$$
• (I’m assuming the ‘$$>$$‘ here is strict integer inequality and not the same ‘$$>$$‘ that is being defined.)
1. $$w(alpha) = w(beta)$$ and $$alpha = f_jalpha_1 … alpha_{dj}$$, $$beta = f_kbeta_1 … beta_{dk}$$, and either:
• 2a) $$j > k$$; or
• 2b) $$j = k$$ and $$alpha_1 = beta_1,…, alpha_{t-1} = beta_{t-1}, alpha_t > beta_t$$, for some $$t, 1 leq t leq d_j$$

Finally on page 266, for the proof that $$>$$ is well-ordered the exposition states:

Now let $$alpha$$ be a pure word with $$n_j$$ symbols of degree $$d_j$$. It is easy to prove inductively that:

$$n_0 + n_1 + n_2 + … = 1 + 0.n_0 + 1.n_1 + 2.n_2 + …,$$

i.e. $$n_0 = 1 + n_2 + 2n_3 + …$$

I don’t know whether it really is ‘easy’ to prove the above because I don’t really know what the above is.

I’m fairly sure symbols are just operators in this context of pure words but if $$n_0, n_1,$$ etc. are symbols then how are they being summed? Does $$n_0$$ in the above actually represent $$w(n_0)$$. That doesn’t seem to provide any clarity as to what is going on with the proof.

I’ve reread the first four pages of the paper multiple times and nothing seems to be getting any clearer:

https://www.cs.tufts.edu/~nr/cs257/archive/don-knuth/knuth-bendix.pdf

Any insight would be appreciated.

## lebesgue integral – Understanding the \$1\$-norm of \$L^1(mathbb{R}^d)\$

I have a quick question about a proof I was reading. The proof is basically asking about the continuity of the translation operator in the $$L^1$$-norm. Here is a snippet of the proof

I am not sure how their integral over $$mathbb{R}^d$$ turned into just an integral over $$E$$ (first line to second). It seems to me that this is not too clear. Unless I am missing something very simple…

## Detecting and understanding malware/spyware [closed]

Recently, stumbled upon the new FB 500m+ leak and decided to satisfy my curiosity and poke around.

Basically just wanted to see how 500m+ user records were kept and what info was released( it was pretty much all publicly scrapable data with ocassional email address.)

Curiosity satisfied, I guess.
BUT.. what is this! Slowed response, unusually high resource usage, ridiculous boot times, amongst other things this laptop just got a lot worse! Could it be… has BonziBuddy finally returned? No seemingly just another piece of malware…

Well to be expected I guess when you download dodgy shit, but I’d love to know what is happening in the background of my computer right now.

So my hopefully decipherable question is this:

1 Ignore anti-virus programs.

2 Using the simple tools we have at our disposal(taskmanager/monitoring active net connections/sniffing packets with wireshark.)
Is it possible for a layman to figure out exactly what is going on in the background of their computer?

I can open wireshark but I cannot figure out what is what, going where, or for what purpose(admittedly I know nothing about this software)

I can run netstat, which is like the simple-mans wireshark without the packets displayed, look at active connections and corresponding local address and foreign address, along with PID, trace that to an executable, but do I know what is actually happening?

Is it impossible to see exactly what processes are doing what because without the original code we end up with undecipherable compiled jargon?

I can see files behaving strangely(unprecedented resource hog) but that alone is meaningless, what is it actually doing and can I find out?

To those people understand my ramblings and this field of computing a bit more and are impartial enough to want to shed light, what do YOU do when you have had an infection slip under the radar? Restore/Reformat? Do you use virtual machines on suspect files? What are your red flags? Dont you ever have a desire to pirate software you cant allow yourself to buy, because its for a short period of time or the use is not for commercial gain but simply out of good old primate curiosity?

## mysql – Understanding Laravel relationships better

I want to make a simple project to understand better the Laravel database relationships. So I decided to make a movie storage project which is holding some movie names and some informations about that movie, it should be look like this:

So I wrote the relationships between these fields like this:

``````Movie AND Actor : Many To Many

Movie AND Director : Many To One

Movie AND IMDB : Many To One

Movie AND Genre : Many To Many
``````

So now my question is, are these relationships correct or wrong ?

## geometry – Problem understanding angle between two lines

I’ve tried to sovle this pyramid problem from some Chinese contest, but can’t understand how the provided angle from the question exists and how to uitlize it. Here’s the problem and the soltuion:

How do AB and CD form an angle? They don’t intersect, right? And how can we find the angle ECD then? Thanks.

It says I need five headlines. If I try to add less I get a “Too few elements in the collection” error. Does Google switch out between the headlines? What if I’d rather it just use one headline for all ads? I tried to copy / paste the same headline 5x and got an error about duplicates existing.

I looked at another existant campaign on my website and that campaign appears to have 3x duplicate headlines (not 5x). Is that campaign just kinda being grandfathered in?

And what if I wanted certain headlines to go with certain descriptions? From the UI there doesn’t appear to be a way to link the two.

Finally, does the order of the headlines / descriptions matter?

Any ideas?

## currencies – Understanding liquidation when trading Cryptocurrency in ByBit

I’m trying to understand how to trade cryptocurrency using ByBit but as you can see I have no idea what I’m doing.

I had \$100 dollars (0.0460 ETH) and I got liquidated in less than an hour.

Can someone please explain how did that happen so quickly based on the settings below?

My understanding was that I was going enter at the Etherium price of `\$2,115` and that the trade would close at either `\$2,300` or `\$2,089` whichever hit first.

How did I lose the whole \$100/0.0460 ETH, I’m confused.

## digital signature – Understanding public key cryptography example

Frankly, I wasn’t sure whether this belongs in crypto.stackexchange.com or here, so forgive me. I’ve been going through a book where in one of the chapters the author tries to illustrate public key cryptography by imagining a “four-step business plan for Murder Incorporated” in a “world of strong privacy”.

1. Arrange for mystery billboards on major highways. Each contains a
single long number and the message “write this down.” Display ads with
the same message appear in major newspapers.

2. Put a full-page ad in the New York Times, apparently written in
gibberish.

3. Arrange a multiple assassination with high-profile targets, such as
film stars or major sports figures – perhaps a bomb at the Academy
Awards.

4. Send a message to all major media outlets telling them that the number
on all of those bulletin boards is a public key. If they use it to
decrypt the New York Times ad they will get a description of the
assassination, published the day before it happened.

I don’t quite understand the mechanics of how the outlets are able to decrypt the ad and get a description of the assassination. Is the ad encrypted with his private key and since both public and the private keys are mathematically related, whatever is encrypted with the private key can be decrypted with the public key (visible on the billboard) and vice versa?

## Understanding the Output Columns From [sp_who3]

Looking for some assistance interpreting the results from (sp_who3). Four items:

• In the (Status) column, when it shows both runnable and suspended, sometimes with (x##) values after each, what does that mean? It’s a single SPID so it’s not clear how can it be running and suspended simultaneously, much less with (presumably) multiple instances of each, all inside that SPID.
• In the (BlockingInfo) column, what does ‘Tran Ct: #’ represent?
• There are separate (IndividualQuery) and (ParentQuery) columns. I assume that the locks/blocks seen in (BlockingInfo) are specific to the (IndividualQuery) and the (ParentQuery) is presented to aid in finding the exact code/call that’s causing the contention. Sound right? Also, if the (ParentQuery) isn’t shown with CREATE PROCEDURE text (I assume that’s a call from a proc), is it safe to assume that the (IndividualQuery) is a subquery?
• What does the T-SQL seen in the (LastRun) column represent? Sometimes it’s the same as the (IndividualQuery), other times it’s the same as the (ParentQuery) and other times it’s something else altogether.

Thanks for any assistance.

## php – Need help understanding ‘call shortcode in javascript’

I’m working on a website’s page that has about 20 PDF files. All those 20 PDF files are displayed with a “PDF viewer for Elementor” plugin in each separate template created using free “Elementor – Footer, Header & Blocks” plugin because I needed to paste shortcodes in tabs (tabs are simply named after their own PDF file simply for user to select which one he wants to read). I didn’t know how to display PDF’s in the page otherwise and selecting PDF file as an Image didn’t work and this is the approach I’ve come up with.

There is one problem though when you go to that page all those 20 templates with PDF’s are still being preloaded even though Elementor’s Tab widget hides them by default. This makes the user to wait quite some time for the PDF’s to appear. Better yet they sometimes don’t even show up but you can fix that if you refresh the page so I’m guessing that the server is overloading or something and as a result It doesn’t show up every time. I’m still a newbie student in this so I don’t know.

My approach to fix the page loading all the PDF’s was to use custom jQuery script and `append` templates shortcodes into html in which the result should be that the template with PDF that the user selects would start loading and showing only just then – when it’s selected by the user pressing a certain tab button.

Here’s my TABS html:

``````<div class="custom-tabs">
<button class="tabs" id="my-tabid1" data-target=".2019-METŲ-I-KETV">2019 METŲ I KETV.</button>
<button class="tabs" id="my-tabid2"  data-target=".2018-METŲ-METINIS">
2018 METŲ METINIS</button>
<button class="tabs" id="my-tabid3" data-target=".2018-METŲ-III-KETV">2018 METŲ III KETV.</button>

</div>

``````

PDF’s html:

``````<div class="2019-METŲ-I-KETV tab_content active" id="my-tab1">

</div>

<div class="2018-METŲ-METINIS tab_content" id="my-tab2">

</div>

<div class="2018-METŲ-III-KETV tab_content" id="my_tab3">

</div>

``````

And finally jQuery for this whole process:

``````var shortcodes = (
'<?php echo do_shortcode ("(pafe-template id="823")"); ?>',

'<?php echo do_shortcode ("(pafe-template id="890")"); ?>',

'<?php echo do_shortcode ("(pafe-template id="893")"); ?>'

);

var target_strings = (

'2019-METŲ-I-KETV',

'2018-METŲ-METINIS',

'2018-METŲ-III-KETV'

);

jQuery('.tabs').on('click', function(){
var target = jQuery(jQuery(this).data('target'));
target.siblings().removeClass('active');
console.log('test');
var targettostring = target.attr('class');

var i;
for(i = 0; i < 3; i++){
console.log('doing loop');
console.log(targettostring);
console.log(target_strings(i));
if(targettostring.includes(target_strings(i))){
console.log('found a match');
jQuery(target).append(shortcodes(i));

}

}

});
``````

At first in jQuery I only used shorter `(pafe-template id="890")` for “shortcodes” array. That’s before I’ve come across this Question:
call shortcode in javascript
I tried the `php echo` method for some reason before understanding that this goal is only achieved using AJAX method. This is the point where I need help.
I completely don’t understand the parts where @Douglas.Sesar wrote placeholders like:

`jQuery.ajax({ url: yourSiteUrl + "/wp-admin/admin-ajax.php",`

yourSiteUrl is literally my site url? It’s “https://ikiwi.website/telsiugaisrine” and it’s a placeholder which will change later (and + /veikla/ is the page of the website that has this whole pdf thing) so this means I’ll have to change yourSiteUrl and not that it’s a problem or anything but is there a way to automate this or something?

``````       'action':'your_ajax',
'fn':'run_shortcode_function',
'some_needed_value': jQuery('#input_for_needed_value').val()
},
``````

What is “data” here and what values do I write say in my case? What did he mean by `#input_for_needed_value`? Is this where I write my class or id of the desired div where I want to place and execute the shortcode template? I completely don’t understand what should I write here..

``````success: function(results){
//do something with the results of the shortcode to the DOM
},
error: function(errorThrown){console.log(errorThrown);}
});// end of ajax
``````

Do something with the results of the shortcode – is this something that’s optional to write like a console.log that I used in my jQuery before?

``````add_action('wp_ajax_nopriv_your_ajax', 'your_ajax_function');
Didn’t I wrote back in `data: action` that my ajax is called “your_ajax”? Thats how I don’t understand any purpose and where do those lines in quotes come from because ‘your_ajax_function’ has extra ‘_function’ line especially everything else.