Is there any code I can enter in my URL that will allow my YouTube video to play continuously without exceeding time? like automatic refresh or automatic reload

when you try to stream live video for display using your tube, the timer runs until the next day Is there any code I can enter in the camera? URL that will allow the video to play continuously without stopping? similar to having autoplay (? autoplay = 1) in the URL

php – enable users by code

I have this code in wordpress, which allows you to register a user, and the wp_mail line sends you the randomly generated key. and do it correctly. But I want the user to click on a link to activate the account, but I can not find the form because when he tries to access the site with his email and the password generated, he does not enter the site.

I would like to know if there is a way to activate the account or manually generate the link on which they have to click to send the activation.

add("empty-user", "El campo nombre es obligatorio");
  }
  if ( empty( $email ) ) {
    $reg_errors->add("empty-email", "El campo e-mail es obligatorio");
  }

  if ( !is_email( $email ) ) {
    $reg_errors->add( "invalid-email", "El e-mail no tiene un formato válido" );
  }

  if ( is_wp_error( $reg_errors ) ) {
    if (count($reg_errors->get_error_messages()) > 0) {
      foreach ( $reg_errors->get_error_messages() as $error ) {
        echo $error . "
"; } } } if (count($reg_errors->get_error_messages()) == 0) { $password = wp_generate_password(); $userdata = array( 'user_login' => $user, 'user_email' => $email, 'user_pass' => $password ); $user_id = wp_insert_user( $userdata ); if ( !function_exists( 'xprofile_set_field_data' ) ) { require_once '/bp-xprofile/bp-xprofile-functions.php'; } $field = 10; wp_mail("micorreo@gmail.com", "Ejemplo de la función mail en WP", "Este es un ejemplo del contenido de del mensaje de la funcion wp_mail() de WordPress ".$password); $is_required = false; $result = xprofile_set_field_data(10, $user_id, $ciudad, $is_required); } } ?>

Thank you very much in advance

plugins – Is there a WP plug-in that accepts a referral code at checkout without discounting a product? And a real-time map locator?

Have a good day! I need your expertise before making a purchase on plugins. I need TWO plugins that will achieve both of these goals: 1.) E-commerce that will allow a special code (like a coupon code, BUT we will not reduce the product.) We must follow where he comes from. We have affiliate stores that encourage people to buy directly from us on our own website. We want to give a commission to the affiliate store that has referred our product, etc., and must respectfully follow it with the utmost integrity. This code represents their store, the reference was made. AND 2.) We need a store location map on our website, exactly how it appears here: https://www.acehardware.com/store-locator. Thank you all for your help. The tech gurus of my hosting company referred me here.

java – I have finished a beginner challenge, but I have the impression that my code is unnecessarily complicated.

I am just starting to learn programming. I had already coded functions and elements in other languages ​​and, while trying to meet this challenge Python

View post on imgur.com

I went to Java.

Initially, I wanted to start learning Python, but the company I just started learning uses Java almost exclusively. So I thought I might as well learn that language.

I've tried to complete it using mostly essays and errors and some google, I have not watched a lot of guides so far, so I've figured out what I needed coding in what way it took me a lot of hours. Now, my code does what it's supposed to do, but I get the impression that it's written unnecessarily complicated and could be much shorter.

Having not yet really understood the scope and accessibility of the methods, I have not been able to reuse any code because I would have liked and much needed to rewrite it.

public static void main(String() args)
{
    System.out.println("Please enter a word");
    Scanner consoleInput = new Scanner(System.in);
    String userInput = consoleInput.nextLine(); 



    System.out.println(GetVowels(userInput).size() + " words starting with wovels: " + GetVowels(userInput));
    System.out.println(GetConsonants(userInput).size() + " words starting with consonants: " + GetConsonants(userInput));
}

 static ArrayList GetVowels(String userInput){ 
    char() vowels = "aeiou".toCharArray(); 
    ArrayList possibleWords = new ArrayList(); 

    for(int i = 0; i < vowels.length; i++){ 
        int offset = 0; 
        while(userInput.indexOf(vowels(i), offset) >= 0){ 
            int wordStartingIndex = userInput.indexOf(vowels(i), offset); 
            for (int u = wordStartingIndex; u <= userInput.length(); u++)  
            {
                String maybeAWord = userInput.substring(wordStartingIndex, u); 
                if(maybeAWord.length() > 0 && possibleWords.indexOf(maybeAWord) < 0) 
                {
                    possibleWords.add(maybeAWord); 
                }
            }
            offset = userInput.indexOf(vowels(i), offset) +1; 
        }
    }
  return possibleWords;

}


static ArrayList GetConsonants(String userInput){
    char() vowels = "aeiou".toCharArray();
    ArrayList possibleWords = new ArrayList();
    ArrayList vowelIndexes = new ArrayList();
    ArrayList consonantIndexes = new ArrayList();


    for(int i = 0; i < vowels.length; i++) { 
        int offset = 0;
        while (userInput.indexOf(vowels(i), offset) >= 0)
        {
            vowelIndexes.add(userInput.indexOf(vowels(i), offset));
            offset = userInput.indexOf(vowels(i), offset) + 1;
        }

    }

    for(int i = 0; i < userInput.length(); i++)
    {
        if(vowelIndexes.indexOf(i) < 0)
        {
            int wordStartingIndex = i;
            int offset = wordStartingIndex;

            while(offset <= userInput.length())
            {
                String maybeAWord = userInput.substring(wordStartingIndex, offset);
                if(maybeAWord.length() > 0 && possibleWords.indexOf(maybeAWord) < 0)
                {
                   possibleWords.add(maybeAWord);
                }
                offset = offset + 1;
            }

        }

    }
    return possibleWords;
}

I do not expect anyone to rewrite part of my code in a more compact or efficient way, but I would be very grateful if you could give advice or tips on what I could write differently, how I could reuse some of these codes. I had to write several times, or just things that I should avoid in the future.

Thanks in advance!

algorithm – code to find the first day of the year given in relation to the Gregorian calendar

I want to know if it's safe or accurate if I use the following method to find the first day of the given year, using GCC with a block of code

 int determinedaycode(int year)
   {
int daycode;
 int d1, d2, d3;

  d1 = (year - 1.)/ 4.0;
 d2 = (year - 1.)/ 100.;
 d3 = (year - 1.)/ 400.;
 daycode = (year + d1 - d2 + d3) %7;
return daycode;
 }

It gives me a precise output is it good or bad

object-oriented – Calculation of the first n primes: example of the revised Clean Code for C ++

I'm trying to improve the examples of Own code* by re-implementing them in C ++. This time, it is the sieve of Eratosthenes, an example of computation based on the primordial computer science on pp.

Below, the original adapted for C ++, without improvements:

.h

class PrimeGenerator { 
public:
    PrimeGenerator() = default;
    ~PrimeGenerator() = default;

    static std::vector generatePrimes(unsigned maxValue);

private:
    static void uncrossIntegersUpTo(unsigned maxValue);
    static void crossOutMultiples();
    static unsigned determineIterationLimit();
    static void crossOutMultiplesOf(unsigned i);
    static bool notCrossed(unsigned i);
    static void putUncrossedIntegersIntoResult();
    static unsigned numberOfUncrossedIntegers();

    static std::vector crossedOut;
    static std::vector result; 
};

cpp

std::vector PrimeGenerator::crossedOut;
std::vector PrimeGenerator::result;

std::vector PrimeGenerator::generatePrimes(unsigned maxValue)
{
    if (maxValue < 2)
        return {};

    uncrossIntegersUpTo(maxValue);
    crossOutMultiples();
    putUncrossedIntegersIntoResult();
    return result;
}

void PrimeGenerator::uncrossIntegersUpTo(unsigned maxValue)
{
    crossedOut = std::vector(maxValue + 1, false);
    crossedOut(0) = true;
    crossedOut(1) = true;
}

void PrimeGenerator::crossOutMultiples()
{
    unsigned limit = determineIterationLimit();
    for (size_t i = 2; i <= limit; ++i)
    {
        if (notCrossed(i))
            crossOutMultiplesOf(i);
    }
}

unsigned PrimeGenerator::determineIterationLimit()
{
    // Every multiple in the array has a prime factor that
    // is less than or equal to the root of the array size,
    // so we don't have to cross out multiples of numbers
    // larger than that root.
    double iterationLimit = std::sqrt(crossedOut.size());
    return static_cast(iterationLimit);
}

void PrimeGenerator::crossOutMultiplesOf(unsigned i)
{
    for (size_t multiple = 2 * i; multiple < crossedOut.size(); multiple += i)
    {
        crossedOut(multiple) = true;
    }
}

bool PrimeGenerator::notCrossed(unsigned i)
{
    return !crossedOut(i);
}

void PrimeGenerator::putUncrossedIntegersIntoResult()
{
    result = std::vector(numberOfUncrossedIntegers());
    size_t j = 0;
    for (size_t i = 2; i < crossedOut.size(); ++i)
    {
        if (notCrossed(i))
            result(j++) = i;
    }
}

unsigned PrimeGenerator::numberOfUncrossedIntegers()
{
    unsigned count = 0;
    for (size_t i = 2; i < crossedOut.size(); ++i)
    {
        if (notCrossed(i))
            count++;
    }

    return count;
}

What we see here is a static class with static functions and members. We do not like this in C ++, so it seems that this code could be better served with a namespace and free functions. Let's try - my attempt at improvement comes below.

.h

namespace PrimeGenerator
{
    std::vector generatePrimes(unsigned maxValue);
}

cpp

namespace {

std::vector uncrossIntegersUpTo(int maxValue)
{
    std::vector crossedOut(maxValue + 1, false);
    crossedOut(0) = true;
    crossedOut(1) = true;

    return crossedOut;
}

unsigned determineIterationLimit(size_t size)
{
    // Every multiple in the array has a prime factor that
    // is less than or equal to the root of the array size,
    // so we don't have to cross out multiples of numbers
    // larger than that root.
    double iterationLimit = std::sqrt(size);
    return static_cast(iterationLimit);
}

void crossOutMultiplesOf(unsigned i, std::vector& crossedOut)
{
    for (size_t multiple = 2 * i; multiple < crossedOut.size(); multiple += i)
    {
        crossedOut(multiple) = true;
    }
}

void crossOutMultiples(std::vector& crossedOut)
{
    unsigned limit = determineIterationLimit(crossedOut.size());
    for (size_t i = 2; i <= limit; ++i)
    {
        if (!crossedOut(i))
            crossOutMultiplesOf(i, crossedOut);
    }
}

std::vector putUncrossedIntegersIntoResult(const std::vector& crossedOut)
{
    std::vector result;
    for (size_t i = 2; i < crossedOut.size(); ++i)
    {
        if (!crossedOut(i))
            result.push_back(i);
    }

    return result;
}

}

namespace PrimeGenerator {

std::vector generatePrimes(unsigned maxValue)
{
    if (maxValue < 2)
        return {};

    auto crossedOut = uncrossIntegersUpTo(maxValue);
    crossOutMultiples(crossedOut);
    return putUncrossedIntegersIntoResult(crossedOut);
}

}

A quick summary of the changes:
- I deleted the class, leaving only one interface function in a PrimeGenerator namespace.
- The numberOfUncrossedIntegers() the function did not seem to make much sense, so I refactored putUncrossedIntegersIntoResult(...) get rid of the old.
- notCrossed(...) would now need two parameters, so that makes no sense. It's gone now.

Now, I have two questions about my code. First of all, we must now pass the crossedOut vector around, which is a disadvantage compared to the previous design. Would you suggest an alternative solution to mitigate this? Secondly, are there any additional places where I should have used size_t instead of unsigned?

Cheers!


* Clean Code: An Agile Software Craft ManualRobert C. Martin

WhatsApp Web Does Not Work on Firefox – QR Code Does Not Load

When I open web.whatsapp.com in Firefox (67.0.4, Win10), the QR code is not loaded. At the same time, it works in Chrome.

What I have tried:

  • recharge
  • Clearing the cache
  • disable add blocker
  • about: config privacy.resistFingerprinting = false

What I found:

  • Also a bug is described here but no solution. Unfortunately, the bug is closed https://bugzilla.mozilla.org/show_bug.cgi?id=1468870#c11
  • I see the following errors in the browser console: Firefox kann keine Verbindung zu dem Server unter wss://web.whatsapp.com/ws aufbauen. (~ Firefox could not connect to the server)

screen capture

Microsoft Office 365 – How to open a short code file on a USB key?

I was working on an article and my work was not saved between the changes.

My automatic registration was activated, the backup on Onedrive was not, and I remember to be in a hurry to close the document and see the option "Save as copy" instead to "Save" or "Save As". I just closed the document knowing that it was already saved on my desk. I last recorded at 23:09 (I'm 95% sure that's the version I want), but when I reopened it, the version I saw was from from 17.20.

Anyway, after trying to browse the location of AutoSave, recently opened, etc., there was nothing, fearing to write too much file, I quickly installed EaseUS Data Recovery. He found a shortcut file saved at 23:09 that I retrieved on my external USB drive (D 🙂

Now, I'm trying to find it in its original form since last night. I've already missed my deadline so I'm already super late.

But here is what I've done so far:

almost all websites recommended the same line of words for typing cmd; Not been administered =
https://www.anysoftwaretools.com/fix-files-folders-become-shortcuts/

My last saved was old with barely a few words, so it does not help me = https://www.extendoffice.com/documents/word/887-word-auto-recover-file-location.html

How to recover shortcut files on a USB key =
https://youtu.be/sz377SjQP_c

I did not understand how to change the path here, so did not help = https: //helpdeskgeek.com/how-to/fix-not-recognized-as-an-internal-or-external-command/

CMD executed as administrator after reading this and added a path without the colon because another website stated that it was only required for older versions of windows =
https://www.thewindowsclub.com/is-not-recognized-as-an-internal-or-external-command

Other things that I have looked at but that I did not think apply to me:

https://stackoverflow.com/questions/49032646/ls-is-not-recognized-as-an-internal-or-external-command-operable-program-or-b?rq=1

https://blog.pcrisk.com/windows/12550-how-to-fix-system-cannot-find-the-path-specified-error

I have tried to scan my computer for viruses and updates, changed my username to a name containing no special characters because I learned that the system Windows operating system did not like that, tried to use cmd: add my username, then try it without username, then insert "C: "as a recovery location (after copying the shortcut to the desktop).

I am totally helpless. I can not rewrite the article the way I wrote it before, is there still hope for me?

NOTE: DO NOT FORGET, I have the version of the shortcut word on USB, I'm just trying to open it

and im mostly a lurker, but first post so new on this forum, so maybe do not know how to answer + formatting

android – How to generate and play a frequency with code?

My problem is that I want to create a frequency and reproduce it, but no matter what I look for in forums and others, I can not find an answer.
I have tried everything.

val duration = 10 // duration of sound
val sampleRate = 22050 // Hz (maximum frequency is 7902.13Hz (B8))
val numSamples = duration * sampleRate
val samples = DoubleArray(numSamples)
val buffer = ShortArray(numSamples)
var note :IntArray =  IntArray(buffer.lastIndex)

    var i :Int = 0
    while (i < buffer.lastIndex){
        i++

        samples(i) = Math.sin(2.0 * Math.PI * i.toDouble() / (sampleRate / note(0))) // Sine wave
        buffer(i) = (samples(i) * java.lang.Short.MAX_VALUE).toShort() // Higher amplitude increases volume

}
    var audioTrack = AudioTrack(
        AudioManager.STREAM_MUSIC,
        sampleRate, AudioFormat.CHANNEL_OUT_MONO,
        AudioFormat.ENCODING_PCM_16BIT, buffer.lastIndex,
        AudioTrack.MODE_STATIC)

    audioTrack.write(buffer, 0, buffer.lastIndex)
    audioTrack.play()

java – What is the preferred / appropriate way to filter the data? [directly in program code]

Suppose you need to filter customers based on 3 criteria:

  • first name
  • labels assigned to the customer
  • the customer's location

For some reason, you must do it directly in your program code, without database queries or PL / SQL.

Which of these two solutions do you find better in any way? (eg, code readability, performance, cleanliness)

First example

public List filterStepbyStep(List customers, 
                                       String searchString, 
                                       List selectedTags,
                                       List selectedLocations) {
    List filteredCustomers = new ArrayList(customers);
    boolean searchStringNotEmpty = searchString != null && !searchString.trim().isEmpty();
    boolean locationsNotEmpty = selectedLocations != null && selectedLocations.size() > 0;
    boolean selectedTagsNotEmpty = selectedTags != null && selectedTags.size() > 0;

    filteredCustomers.removeIf(customer -> {
        boolean valid = true;

        //searchString
        if (valid && searchStringNotEmpty) {
            valid = customer.name.contains(searchString);
        }

        //locations
        if (valid && locationsNotEmpty) {
            valid = selectedLocations.stream().anyMatch(locationId -> locationId.equals(customer.locationId));
        }

        //tags
        if (valid && selectedTagsNotEmpty) {
            boolean tagValid = false;
            for (Tag selectedTag : selectedTags) {
                for (Tag customerTag : customer.getTags()) {
                    if (selectedTag == customerTag) {
                        tagValid = true;
                        break;
                    }
                }
                if (tagValid) {
                    break;
                }
            }
            valid = tagValid;
        }

        return !valid;
    });

    return filteredCustomers;
}

Second example

public List filterWithLambda(List customers,
                                       String searchString, 
                                       List selectedTags,
                                       List selectedLocations) {
    List filteredCustomers = new ArrayList(customers);
    boolean searchStringNotEmpty = searchString != null && !searchString.trim().isEmpty();
    boolean locationsNotEmpty = selectedLocations != null && selectedLocations.size() > 0;
    boolean selectedTagsNotEmpty = selectedTags != null && selectedTags.size() > 0;

    filteredCustomers.removeIf(customer -> {
        return (searchStringNotEmpty && !customer.name.contains(searchString))
                || (locationsNotEmpty && !selectedLocations.stream().anyMatch(locationId -> locationId.equals(customer.locationId)))
                || (selectedTagsNotEmpty && !selectedTags.stream().anyMatch(selectedTag ->
                      customer.getTags().stream().anyMatch(customerTag ->
                        selectedTag == customerTag)));
    });

    return filteredCustomers;
}

For me, the second example is more readable, I can immediately see that the client is filtered (deleted) if one of the three operands of the OR operator is true.
On the other hand, to repeat if (valid) for each property of the first example does not seem to me too clean. I find it tedious and tedious to follow a valid variable. Having this kind of state with a valid variable is subject to IMO errors.
The only reason I see that we would prefer a first example is the lack of knowledge of lambda expressions.

I've created a small repl.it to try these approaches.

If you can find a better way to do this than the two examples above, feel free to post it here.