## How to detect self loop in graph using greedy algorithm if given list of number of degrees

if you are given list of n integers that represents the degree of a graph. How to detect if there self loop in the graph using greedy algorithm.

Posted on Categories proxies

## Using the fundamental matrix for triangulation process?

Given the projection matrices from two cameras ($$P$$,$$P’$$) and a pair of corresponding points $$\{x_i,x’_i\}$$, it is straight forward to compute the triangulation using $$x_i=PX,x’_i=P’X$$.
I understand that a similar algebraic process can be used to find $$X$$ using only the fundamental matrix $$F$$, as it also contains $$[T]_xR$$, but I could not develop such equation.
Does someone know the derivation of such a process?

Posted on Categories proxies

## How to adjust PrecisionGoal and AccuracyGoal to solve my equation using NDSolve[]?

This is a very interesting question. I’m solving a differential equation to get a function z[$$\rho$$], the expected solution needs to start from $$z[\rho_c]=z[\frac{13}{5}]=\frac{24195890215702774518563237183870329}{8112963841460668169578900514406400}\approx 2.98$$, until when the function $$z[\rho]$$ hits on the $$\rho$$-axis. The code is as follows:

precTmp = 4 MachinePrecision; sol = (\[Rho]c = 13/5;    vt = Sqrt[zt^2 - \[Rho]c^2] - zt;     ParametricNDSolveValue[{(1 - z[\[Rho]]^3)^2/z[\[Rho]] +         3/2 z[\[Rho]]^2 Derivative[          z][\[Rho]]^2 + (1 - z[\[Rho]]^3) (Derivative[z][\[Rho]]^2/           z[\[Rho]] + (z^\[Prime]\[Prime])[\[Rho]]) + (        169 (-(13/5) + zt)^2 (13/5 +            zt)^2 z[\[Rho]]^2 (-3 z[\[Rho]]^2 +            2 (z^\[Prime]\[Prime])[\[Rho]]))/(200 zt^2) == 0,       Derivative[z][13/5] == -((13 (2 - (-(169/25) + zt^2)^(3/2)))/(        10 Sqrt[-(169/25) + zt^2])), z[13/5] == Sqrt[-(169/25) + zt^2],       WhenEvent[z[\[Rho]] == 10^-3, "StopIntegration"],       WhenEvent[z[\[Rho]] == 1.1 Sqrt[zt^2 - \[Rho]c^2],        "StopIntegration"]}, z, {\[Rho], \[Rho]c, R + 1}, {zt},      WorkingPrecision -> precTmp, AccuracyGoal -> precTmp/2, MaxSteps -> 10^6,      Method -> "StiffnessSwitching"]); 

Note that we can adjust the parameter precTmp to ramp up the precision. To check the correctness of the solution, it’s natural to plot the solution out, as follows:

ztValue = 24195890215702774518563237183870329/   8112963841460668169578900514406400; Plot[sol[ztValue][\[Rho]], {\[Rho], sol[ztValue]["Domain"][[1, 1]],    sol[ztValue]["Domain"][[1, 2]]}, PlotRange -> All,   WorkingPrecision -> precTmp] 

The first thing I can’t understand is that the shape of the solution $$z[\rho]$$ is different when I change the precision, for example, taking precTmp to be 3 MachinePrecision, 5 MachinePrecision, or 6 MachinePrecision, the solution is decreasing and hit on $$\rho$$-axis, but when taking precTmp to be 4 MachinePrecision, 8 MachinePrecision or 12 MachinePrecision, the solution turns out to be increasing. My first question is which one of them is the correct answer?

The second question that I can’t understand is when providing a PrecisionGoal in ParametricNDSolveValue[] function, for example, we take precTmp = 4 MachinePrecision again, and add PrecisionGoal->precTmp, the solution becomes a decreasing function, which is originally an increasing one. I’ve already learned the difference between precision and accuracy, which can somehow be regarded to be equivalent as long as the function doesn’t go to zero. Thus my second question is how to understand the difference brought by the PrecisionGoal set here.

Posted on Categories cheapest proxies

## Get x numbers of a woocommerce category products using Wp_Query

Is possible to show some woocommerce products inside a swiper slider? I want to create a slider that will show some “featured” products on the home page. For now I have a cpt that is achieving this, but I don’t know how to link them to the products that I will add to woocommerce. So I want to replace the cpt with a query to get an x number of products from woocommerce products and put them into the slider. Any help will be appreciated.

The code I’m using now is this

<div class="row featured-row" <?php $featured = new WP_Query( ['post_type' => 'featured', 'order' => 'ASC', 'posts_per_page' => 3] ); ?> <?php$  i = 0; ?> <?php if( $featured->have_posts() ): while($  featured->have_posts() ): $featured->the_post(); ?> <?php #$  class = get_post_meta( get_the_ID(), 'class', true); ?> <?php if( $i === 1 ): ?> <div class="col-md-6 col-lg-6 d-none d-sm-none d-md-block featured-desc"> <h2 class="featured-title-right text-right"><?php the_title(); ?></h2> <p class="featured-excerpt-right text-right"><?php echo get_the_excerpt(); ?></p> </div> <div class="col-md-6 col-lg-6 text-center d-none d-sm-none d-md-block featured-img"> <img class="img-fluid" src="<?php the_post_thumbnail_url(); ?>"> </div> <?php else: ?> <div class="col-md-6 col-lg-6 text-center d-none d-sm-none d-md-block featured-img"> <img class="img-fluid" src="<?php the_post_thumbnail_url(); ?>"> </div> <div class="col-md-6 col-lg-6 d-none d-sm-none d-md-block featured-desc"> <h2 class="featured-title"><?php the_title(); ?></h2> <p class="featured-excerpt"><?php echo get_the_excerpt(); ?></p> </div> <?php endif;?> <?php$  i++; ?> <?php endwhile; ?> <?php endif; wp_reset_postdata(); ?> </div>  `
Posted on Categories anonymous proxy

## Make custom post types using ACF

So I’m using the Genesis Framework with a theme provided by them, and I just implemented the Advanced Custom Fields plugin.

What’s the best way to create custom post types? I want to have a ‘People’ option that has the same UI as ‘Posts’ in that list shown below. ## Is it possible to run more than one Turing Machine emulator using only one processor kernel?

I had this question on computer architecture exam and can’t find an answer anywhere. Is it possible to run several Turing Machine emulators at once using only one processor kernel?

Posted on Categories proxies

## Using Alias in Calculations

i know that this Problem was adressed before but my SQL knowledge is not that good to figure it out. Maybe you can help me.

select ProductionLine, Product, POId, BatchNumber, Sum(Prime) as Prime, Sum(Offspec) as OffSpec, Sum(InQ) as InQ, Sum(Prime) + Sum(Offspec) + Sum(InQ) as Total

from @t2

group by ProductionLine, BatchNumber, POId, Product;

I now need a Column PercentagePrime where the column Prime is defides by the alias Total

I hope you can help me with this

## What attacks are prevented using Session Timeout or Expiry?

OWASP recommends setting session timeouts to minimal value possible, to minimize the time an attacker has to hijack the session:

Session timeout define action window time for a user thus this window represents, in the same time, the delay in which an attacker can try to steal and use a existing user session…

For this, it’s best practices to :

• Set session timeout to the minimal value possible depending on the context of the application.
• Avoid “infinite” session timeout.
• Prefer declarative definition of the session timeout in order to apply global timeout for all application sessions.
• Trace session creation/destroy in order to analyse creation trend and try to detect anormal session number creation (application profiling phase in a attack).

(Source)

The most popular methods of session hijacking attacks are session-fixation, packet sniffing, xss and compromise via malware, but these are all real-time attacks on the current session.

Once hijacked, the attacker will be able to prevent an idle timeout (via activity), and I would consider any successful session hijack a security breach anyway (unless you want to argue how much larger than zero seconds of access an attacker can have before it actually counts as an actual breach).

If the original method of getting the session token can be repeated, this seems to further limit the usefulness of a timeout — a 5-minute window that can be repeated indefinitely is effectively not limited.

What real-world attack exists (even theoretically) where a session timeout would be an effective mitigation? Is session expiry really just a form of security-theater?

Posted on Categories proxies

## Does switching between using a versatile weapon one-handed to two-handed cost anything with regards to the action economy?

The versatile weapon property says (PHB, p. 147):

Versatile. This weapon can be used with one or two hands. A damage value in parentheses appears with the property–the damage when the weapon is used with two hands to make a melee attack.

A weapon with the versatile property, such as a longsword or a quarterstaff, can be wielded with one or two hands. Does it consume any part of the action economy to switch between using one or two hands on your turn?

Intuitively I’d say no, I imagine it costs absolutely nothing, but I can imagine, at worst, there being arguments for it costing your “free object interaction” (PHB, p. 190). Which is it?

(Below are some related Q&As, but not specific to versatile weapons, sadly).

The accepted answer to a related Q&A (thanks @NautArch) suggests that:

Taking your hand off the weapon should not require any action expenditure – you are just letting go of it, same as if you dropped it.

You can then use your free object interaction to restore your grip after casting.

The reasoning for the first case makes sense, but the second case isn’t backed up by anything, although I can see the logic behind it.

The errata posted in that answer, to me, suggests that it would in fact cost nothing to grip the weapon with a second hand, almost like it’s “part of the attack”, similar to how the Ammunition weapon property works, but again, this is logic, not RAW.

To give a concrete example, if we imagine that a PC’s turn starts with a longsword in one hand and a spellcasting focus in the other; they spend their bonus action casting a spell with their focus, and then spend their free object interaction putting that focus away. With only their action left, can they now attack with their longsword using it as a versatile weapon (i.e. dealing 1d10 damage instead of 1d8)?

See also, the “following round” scenario of this question (thanks @Medix2), which involves sheathing a shortsword and attacking with a longbow that requires two hands. This is almost exactly the same scenario as the one I detailed above.

Posted on Categories Best Proxies

## How to get different html tags from the content using regex?

I am trying to get different html tags from a single post and display them as nested accordion. I have quite accomplished. the only problem I have is that. When I try to show all the p tags content inside span but it shows only the first paragraph for each nested menu content.

Any solution will be most appreciated. Thanks

History 2020 Jan 10 This is first paragraph.

Feb 2 this is second paragraph

Mar 23 this is third paragraph

2019 Jan 20This is fourth paragraph.

Feb 30this is fifth paragraph

Mar 2this is sixth paragraph

‘; $classesH = 100; for($ w = 1; $w (.*?)/s’,$ sampleH, $match); if($ match) { ?> (.*?)/s’, $sampleH,$ match1); if($match1) { ?> (.*?)/s’,$ sampleH, $match2); if($ match2) { ?>

var acc = document.getElementsByClassName(“accordion”); var i; var abc = document.getElementsByClassName(“accordion1”); var a; for (i = 0; i