files and directories – FileNames listing duplicates?

Whenever I use FileNames on Windows 10, it lists a nonexistent duplicate file containing a superfluous "._" in front of the filename like this:

files = FileNames[All, NotebookDirectory[], 2];
TableForm [FileNameDrop[#, 6] & /@ files]

Production:

{
 {"copied from mac"},
 {"copied from mac\20190816A_AL-Full_Spray_a82"},
 {"copied from mac\._morphoFiltering.nb"},
 {"copied from mac\morphoFiltering.nb"},
 {"copied from mac\._SEM_porosityReconstruction.nb"},
 {"copied from mac\SEM_porosityReconstruction.nb"},
 {"Erica's Images"},
 {"Erica's Images\20181207A"},
 {"Erica's Images\20181207B"},
 {"Erica's Images\20181207C"},
 {"Erica's Images\20190422A"},
 {"Erica's Images\20190422B"},
 {"Erica's Images\20190422C"},
 {"._SEM_porosity_Erica.nb"},
 {"SEM_porosity_Erica.nb"}
}

This does not happen on my MacBook. How can I prevent it from listing these duplicates?

javascript – Connecting and listing SQLite data using JS

Hello.
I am studying SQLite + JavaScript.

I am trying to establish a connection and list the data, but to no avail.

It does not show any error nor the result in the console.

database.db

enter description of image here

Javascript


database design – Separate table or listing on a client?

I have several tables and many of them have a "state", "measure_unit" and similar columns in them.

There are 2 approaches for working with columns such as "state".

  1. Create separate "status", "measure_units" tables in the database and reference them from the main tables using a foreign key. Either by string / slug or by id. That is to say that these "status", "measure_units" tables are those that contain at most 10 records and they will rarely be modified.

  2. Create enumerations / structures "statuses", "measure_units" on a client.

They both have their pros and cons.

What is the best approach in different ways?

WordPress theme / templates for a website listing world trade data

I'm trying to develop a website that will contain data on world trade:

For example:

https://www.infodriveindia.com/

zauba.com

https://www.seair.co.in/

The basic idea is to be able to upload bulk import / export data to the database via the admin panel and the website should be able to show it.

Do we have a wordpress theme / template that should support this. If not, what would be a good starting point to develop it in wordpress. I'm not looking for anything extraordinary or fanciful, just the basic functionality of importing export data with filters like country and HSN code like in shared websites.

Problem listing data in Firebase with Android Studio

Okay, I'm doing a project in Android Studio connected with Firebase. When I list the only data I have, if I go to the screen where the app should appear, it goes into error and restarts, I have already tried several ways and I can not correct the error.

The code of the class where the data is displayed is:

the result of the public class extends AppCompatActivity {
TextView tvResult, tv1, tv2, tv3, tv4, tv5, tv6, tvBrand, tvModel, tvDoors, tvYear, tvFuel, tvPriceDay;

DatabaseReference databaseReference;



@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_resultado);


    tvResultado = findViewById(R.id.tvResultado);
    tv1 = findViewById(R.id.tv1);
    tv2 = findViewById(R.id.tv2);
    tv3 = findViewById(R.id.tv3);
    tv4 = findViewById(R.id.tv4);
    tv5 = findViewById(R.id.tv5);
    tv6 = findViewById(R.id.tv6);
    tvMarca = findViewById(R.id.tvMarca);
    tvModelo = findViewById(R.id.tvModelo);
    tvPuertas = findViewById(R.id.tvPuertas);
    tvAño = findViewById(R.id.tvAño);
    tvCombustible = findViewById(R.id.tvCombustible);
    tvPrecioDia = findViewById(R.id.tvPrecio);

    databaseReference = FirebaseDatabase.getInstance().getReference("Coches");

    databaseReference.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(@NonNull DataSnapshot dataSnapshot) {

            if(dataSnapshot.exists()){

                String marca = dataSnapshot.child("marca").getValue().toString();
                String modelo = dataSnapshot.child("modelo").getValue().toString();
                int puertas = Integer.parseInt(dataSnapshot.child("puertas").getValue().toString());
                int año = Integer.parseInt(dataSnapshot.child("año").getValue().toString());
                String combustible = dataSnapshot.child("combustible").getValue().toString();
                int precioDia = Integer.parseInt(dataSnapshot.child("precioDia").getValue().toString());

                tvMarca.setText(marca);
                tvModelo.setText(modelo);
                tvPuertas.setText(puertas);
                tvAño.setText(año);
                tvCombustible.setText(combustible);
                tvPrecioDia.setText(precioDia);
            }
        }

        @Override
        public void onCancelled(@NonNull DatabaseError databaseError) {

            Toast.makeText(resultado.this,"Se ha producido un error, inténtalo más tarde por favor",Toast.LENGTH_LONG).show();

        }
    });

}

}

Here is a photo of the database:
comic RealTime image

magento2.3.3 – Magento 2.3.3: How to replace the Collect method in Magento Catalog Ui DataProvider Product Listing Collector Image

I have created a recently viewed product widget in the sidebar of the backend category page. I have a single store with multiple currency configurations when I see that the product is perfectly added to the list.

My problem is that when I change the currency, the image is deleted. Again, I need to see this product to sort out this problem. So I need to bypass the file below to fix the problem.

I need to replace the file below

Magento Catalog Ui DataProvider Product Listing Collector Image

I tried to use Preference but unfortunately it does not work.

$ this-> imageCodes returns an empty array. The value of this is defined in

module-catalog / etc / di.xml.

around the line 992

Could someone suggest a way around this class.

So far, what I have done is

app / code / Vendor / Module / etc / di.xml


Then, app / code / Vendor / Module / Plugin / Ui / DataProvider / Product / Listing / Collector / Image.php

design->getDesignTheme();
        print_r($this->imageCodes);die;
        foreach ($this->imageCodes as $imageCode) {
            /** @var ImageInterface $image */
            $image = $this->imageRenderInfoFactory->create();
            /** @var MagentoCatalogHelperImage $helper */
            $helper = $this->state
                ->emulateAreaCode(
                    'frontend',
                    ($this, "emulateImageCreating"),
                    ($product, $imageCode, (int) $productRender->getStoreId(), $image)
                );

            try {
                $resizedInfo = $helper->getResizedImageInfo();
            } catch (NotLoadInfoImageException $exception) {
                $resizedInfo = ($helper->getWidth(), $helper->getHeight());
            }

            $image->setCode($imageCode);
            $image->setHeight($helper->getHeight());
            $image->setWidth($helper->getWidth());
            $image->setLabel($helper->getLabel());
            $image->setResizedHeight($resizedInfo(1));
            $image->setResizedWidth($resizedInfo(0));

            $images() = $image;
        }

        $this->design->setDesignTheme($currentTheme);
        $productRender->setImages($images);
    }

    /**
     * Callback for emulating image creation
     *
     * Callback in which we emulate initialize default design theme, depends on current store, be settings store id
     * from render info
     *
     * @param ProductInterface $product
     * @param string $imageCode
     * @param int $storeId
     * @param ImageInterface $image
     * @return MagentoCatalogHelperImage
     */
    public function emulateImageCreating(ProductInterface $product, $imageCode, $storeId, ImageInterface $image)
    {
        $this->storeManager->setCurrentStore($storeId);
        $this->designLoader->load();

        $imageHelper = $this->imageFactory->create();
        $imageHelper->init($product, $imageCode);
        $image->setUrl($imageHelper->getUrl());
        return $imageHelper;
    }
}

Help kindly !!!

c # – Table of prime numbers, i.e. listing

I have written many variations of the Sieve of Eratosthenses, the fastest way to generate a large collection of prime numbers. If you want to query the prime numbers collected by number or at a specific index later, the sieve performance is insufficient compared to a list. So I thought, why not create a premium table that uses a high-performance sieve to generate the prime numbers, but then moved those first ones into a list (if the memory allows it).

Originally, I had written this to respond to someone else 's message, but most of my goals, codes, and features differed so much that I published them for myself. review them.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using System.Collections;

namespace Prime_Table_Core
{
    // What's in a name?  Variable/parameter names for any Int32 were chosen to denote context. 
    //
    //    number: any Int32 on the "number line" to be evaluated as prime, composite, or neither.
    //    prime : a subset of number where the Int32 is a prime.
    //    index : an Int32 used as the positional index into _knownPrimes list.
    //    value : no specific context or restriction on this Int32.

    public static class PrimeTable
    {
        private static readonly List _knownPrimes = new List() { 2 };

        public static bool IsInitialized { get; private set; } = false;
        public static TimeSpan LastDuration { get; private set; } = TimeSpan.Zero;

        // If you want to work directly with just the known primes, no need for streaming
        // since the table is already in memory.
        public static IReadOnlyList KnownPrimes => _knownPrimes;

        public static int KnownPrimeCount => _knownPrimes.Count;
        public static int LastKnownPrime => _knownPrimes.Last();
        public static int LastKnownIndex => _knownPrimes.Count - 1;

        // Track the very last number checked using GetNextUnknownPrime() or Initialize().
        // This number could be greater than LastKnownPrime.
        private static int _lastNumberChecked = 2;

        private static Func HasMoreNumbers = number => (int.MaxValue - number) > 2;
        private static Func DoubleIt = value => value << 1;
        private static Func HalveIt = value => value >> 1;
        private static Func IsEven = value => value % 2 == 0;

        public static int GetIndexAtOrBefore(int number)
        {
            if (number < 2)
            {
                return -1;
            }

            InitializeIfNeeded();

            if (number >= LastKnownPrime)
            {
                return LastKnownIndex;
            }

            var upperIndex = LastKnownIndex;
            var lowerIndex = 0;
            var midIndex = HalveIt(upperIndex + lowerIndex);

            // Instead of a while(true), let's completely avoid an infinite loop.
            // The for loop won't use it's index variable other than to prevent
            // the loop from being infinite.  But as a debugging bonus, you can use
            // "iteration" to see how many iterations were needed for a lookup.
            for (var iteration = 1; iteration < _knownPrimes.Count; iteration++)
            {
                if (number == _knownPrimes(midIndex))
                {
                    return midIndex;
                }

                if ((upperIndex - lowerIndex) <= 1)
                {
                    return (number > _knownPrimes(upperIndex)) ? upperIndex : lowerIndex;
                }

                if (number > _knownPrimes(midIndex))
                {
                    lowerIndex = midIndex;
                }
                else
                {
                    upperIndex = midIndex;
                }

                midIndex = HalveIt(upperIndex + lowerIndex);
            }

            return -1;  // for safety's sake, but really is unreachable.
        }

        public static int GetIndexBefore(int number) => (number <= 2) ? -1 : GetIndexAtOrBefore(number - 1);
        public static int GetIndexAfter(int number) => (number == int.MaxValue) ? -1 : GetIndexAtOrAfter(number + 1);
        public static int GetIndexAtOrAfter(int number)
        {
            var index = GetIndexAtOrBefore(number);
            if (index == -1)
            {
                return 0;
            }
            if (_knownPrimes(index) == number)
            {
                return index;
            }
            return ++index < KnownPrimeCount ? index : -1;
        }

        public static bool IsPrime(this int number)
        {
            // First, dispense with easy cases.
            if (number < 2) { return false; }
            if (IsEven(number)) { return number == 2; }

            InitializeIfNeeded();

            var index = 0;

            // Second, quickly check against _knownPrimes and _lastNumberChecked.
            if (number <= LastKnownPrime)
            {
                index = GetIndexAtOrBefore(number);
                return _knownPrimes(index) == number;
            }
            if (number <= _lastNumberChecked)
            {
                return false;
            }

            // Third, perform naive primality test using known primes.
            var sqrt = (int)Math.Sqrt(number);

            for (index = 0; index < _knownPrimes.Count; index++)
            {
                if (number % _knownPrimes(index) == 0)
                {
                    return false;
                }
                if (_knownPrimes(index) > sqrt)
                {
                    return true;
                }
            }

            //  Fourth, perform naive primality test on Odds beyond LargestKnownPrime
            for (var possibleDivisor = _lastNumberChecked + 2; possibleDivisor <= sqrt; possibleDivisor += 2)
            {
                if (number % possibleDivisor == 0)
                {
                    return false;
                }
            }

            // Finally, it must be prime.
            return true;
        }

        // This method will stream the known primes first, followed by the unknown ones.
        public static IEnumerable GetPrimes()
        {
            InitializeIfNeeded();

            foreach (var prime in _knownPrimes)
            {
                yield return prime;
            }

            for (; ; )
            {
                var next = GetNextUnknownPrime();
                if (next.HasValue)
                {
                    yield return next.Value;
                }
                else
                {
                    yield break;
                }
            }
        }

        // This method bypasses the known primes and starts streaming the unknown ones, if any.
        public static IEnumerable GetUnknownPrimes()
        {
            InitializeIfNeeded();

            for (; ; )
            {
                var next = GetNextUnknownPrime();
                if (next.HasValue)
                {
                    yield return next.Value;
                }
                else
                {
                    yield break;
                }
            }
        }

        public static int? GetNextUnknownPrime()
        {
            if (!HasMoreNumbers(_lastNumberChecked))
            {
                LastDuration = TimeSpan.Zero;
                return null;
            }

            int result = -1;

            InitializeIfNeeded();

            var sw = Stopwatch.StartNew();

            for (var candidate = _lastNumberChecked + 2; ; candidate += 2)
            {
                if (IsPrime(candidate))
                {
                    _lastNumberChecked = candidate;
                    result = candidate;
                    break;
                }
                _lastNumberChecked = candidate;
                if (!HasMoreNumbers(candidate))
                {
                    // Do this here instead of inside for condition so that
                    // we do not overflow past Int.MaxValue, or worse,
                    // wrap around to Int.MinValue.
                    break;
                }
            }

            if (result > 1)
            {
                _knownPrimes.Add(result);
            }

            sw.Stop();
            LastDuration = sw.Elapsed;
            return result;
        }

        // This will only initialize _knownPrimes once.
        public static void InitializeIfNeeded()
        {
            const int DefaultUpperLimit = 1_500_001;    // produces   114_155 primes in 0.01 seconds
            if (!IsInitialized)
            {
                Initialize(DefaultUpperLimit);
            }
        }

        // You may Initialize and re-Initialize to your heart's content.
        // Depending upon upperLimit, this may take a split second or half a minute or longer based
        // upon your CPU and RAM.
        public static void Initialize(int upperLimit)
        {
            const int MinimumUpperLimit = 1000;

            if (upperLimit < MinimumUpperLimit)
            {
                throw new ArgumentException($"{nameof(upperLimit)} must be {MinimumUpperLimit} or greater.");
            }

            var sw = Stopwatch.StartNew();

            GenerateSieve(upperLimit);

            sw.Stop();
            LastDuration = sw.Elapsed;
            IsInitialized = true;
        }

        // The intent is to start off with a small, very fast sieve to build the _knownPrimes up to a point.
        // While a BitArray uses less memory, it is also slower than bool().
        // Once this method completes, the array is set to null and memory can be GC'd.
        // If responsiveness is your goal, then a "reasonable" upperLimit is one that executes 
        // in less than 0.25 seconds on your hardware.
        private static void GenerateSieve(int upperLimit)
        {
            lock (_knownPrimes)
            {
                _knownPrimes.Clear();
                _knownPrimes.Add(2);

                // Evens all done.  Now check only odd numbers for primality

                if (IsEven(upperLimit))
                {
                    upperLimit++;
                }

                const int offset = 1;
                Func ToNumber = index => DoubleIt(index) + offset;
                Func ToIndex = number => HalveIt(number - offset);

                // initial flags are false
                var flags = new BitArray(ToIndex(upperLimit) + 1, true);
                flags(0) = false;

                var upperSqrtIndex = ToIndex((int)Math.Sqrt(upperLimit));

                for (var i = 1; i <= upperSqrtIndex; i++)
                {
                    // If this bit has already been turned off, then its associated number is composite. 
                    if (!flags(i)) { continue; }
                    var number = ToNumber(i);
                    _knownPrimes.Add(number);
                    // Any multiples of number are composite and their respective flags should be turned off.
                    for (var j = ToIndex(number * number); j < flags.Length; j += number)
                    {
                        flags(j) = false;
                    }
                }

                // Output remaining primes once flags array is fully resolved:
                for (var i = upperSqrtIndex + 1; i < flags.Length; i++)
                {
                    if (flags(i))
                    {
                        _knownPrimes.Add(ToNumber(i));
                    }
                }

                _lastNumberChecked = upperLimit;
            }
        }
    }
}

This was written in .NET Core 3.0, but was also upgraded to the full version of Framework 4.8. The complete structure is about 50% slower on the same hardware.

Once the premium table is generated, you can query the list of what I call the known prime numbers. But you can also continue to discover unknown prime numbers, if any, which, once discovered, are then added to the known prime numbers.

You can quickly initialize a larger number of known primes by using the Initialize(upperLimit) method. If your main goal is responsiveness, then a good upperlimit should be something that returns in 0.25 seconds or less on your particular material. If you want to maximize the integrity of Int32, you can do it too, but generating all 105 million primes can take a while.

An example of use:

PrimeTable.Initialize using assorted upper limits:
   Upper Limit = 1000001, PrimeCount = 78498, LastPrime = 999983, Duration: 00:00:00.0064373  (includes JIT time)
   Upper Limit = 1500001, PrimeCount = 114155, LastPrime = 1499977, Duration: 00:00:00.0043673
   Upper Limit = 2000001, PrimeCount = 148933, LastPrime = 1999993, Duration: 00:00:00.0072214
   Upper Limit = 5000001, PrimeCount = 348513, LastPrime = 4999999, Duration: 00:00:00.0180426
   Upper Limit = 10000001, PrimeCount = 664579, LastPrime = 9999991, Duration: 00:00:00.0330480
   Upper Limit = 17000001, PrimeCount = 1091314, LastPrime = 16999999, Duration: 00:00:00.0573246
   Upper Limit = 20000001, PrimeCount = 1270607, LastPrime = 19999999, Duration: 00:00:00.0648279
   Upper Limit = 50000001, PrimeCount = 3001134, LastPrime = 49999991, Duration: 00:00:00.1564291

Demo of index usage to KnownPrimes:
   GetIndexAtOrBefore(55551) = 5636, KnownPrimes(5636) = 55547
   GetIndexAtOrAfter (55551) = 5637, KnownPrimes(5637) = 55579

Demo fetching next 10 unknown primes:
   PrimeCount = 3001135, LastPrime = 50000017, Duration: 00:00:00.0004588  (includes JIT time)
   PrimeCount = 3001136, LastPrime = 50000021, Duration: 00:00:00.0000044
   PrimeCount = 3001137, LastPrime = 50000047, Duration: 00:00:00.0000188
   PrimeCount = 3001138, LastPrime = 50000059, Duration: 00:00:00.0000065
   PrimeCount = 3001139, LastPrime = 50000063, Duration: 00:00:00.0000180
   PrimeCount = 3001140, LastPrime = 50000101, Duration: 00:00:00.0000048
   PrimeCount = 3001141, LastPrime = 50000131, Duration: 00:00:00.0000071
   PrimeCount = 3001142, LastPrime = 50000141, Duration: 00:00:00.0000193
   PrimeCount = 3001143, LastPrime = 50000161, Duration: 00:00:00.0000097
   PrimeCount = 3001144, LastPrime = 50000201, Duration: 00:00:00.0000148

PrimeTable.Initialize(int.MaxValue):
   Upper Limit = 2147483647, PrimeCount = 105097565, LastPrime = 2147483647, Duration: 00:00:12.8353907
   GetIndexAtOrBefore(55551) = 5636, KnownPrimes(5636) = 55547
   GetIndexAtOrAfter (55551) = 5637, KnownPrimes(5637) = 55579
   GetIndexAtOrAfter (2147483647) = 105097564, KnownPrimes(105097564) = 2147483647
   GetIndexAfter (2147483647) = -1
   GetNextUnknownPrime() = 

Press ENTER key to close

There are 3 ways to list a large collection of prime numbers:

  1. Use the KnownPrimes table, a read-only list.
  2. GetUnknownPrimes () ignores known prime numbers and broadcasts the unknown.
  3. GetPrimes () will broadcast first known numbers, followed by the unknown.

Other features:

Since performance is a curiosity, there is a LastDuration property to inform you of the time it took the sieve to generate or the last GetNextUnknownPrime.

Anything that uses the index of the known prime does not discover any unknown prime number. This includes the IsPrime method, which is a bit long because it first tries to check the known prime numbers before resorting to a naive implementation.

Amazon and eBay listing with SEO

HI
We have a professional team for eBay Bulk Listing and Amazon and with a professional way to rank your product and boost sales in different styles with paid sources and others.
The 1st client will be entertained for free

How can I run a split test in MSN ads for product listing ads?

Hi all,

As the title indicates, I would like to run a split test between two campaign setups for PLA in MSN. In Google ads, I use a script to enable / disable controls and experiments every hour, but I do not find the same functionality in MSN. Is there a way to automatically pause / activate two campaigns to run a test?

thank you,
cgc2205

How can I run a split test in MSN ads for product listing ads?

Hi all,

As the title indicates, I would like to run a split test between two campaign setups for PLA in MSN. In Google ads, I use a script to enable / disable controls and experiments every hour, but I do not find the same functionality in MSN. Is there a way to automatically pause / activate two campaigns to run a test?

thank you,
cgc2205