text:
Q: How synchronous can a number of electrical clocks in separate devices remain? Imagine we have 5 circuits/devices and in each we have an electrical clock that generates a pulse (for example with a constant frequency of 100 Hz or 1 kHz).
In the beginning we have wired all the devices together in order to synchronize the clocks.
After synchronization, we remove the wires and the 5 circuits run independently, with hopefully synchronized clocks.
My question is: since even in the beginning they may not be perfectly synchronized, what can our expectation be usually? Or how perfect/synchronized can these clocks remain?
It is completely of my choice what type of clock or technology to use and is also my question which provides the most synchronous result.
I wonder for example if the clocks even at the beginning may have around a 1 μs delay compared to each other, or if even we can do better than this, or how much this delay may grow after a few hours or what's the best we can achieve with what is in the market for it.
Here are a few specifications that may provide clarification, though I would not observe them as hard specifications, but rather flexible.

*

*Maximum deviation after 2 hours: 1 μs or 500 ns

*Maximum deviation after 1 minute: 200 ns

*Used to sync a number of camera chip frames' acquisition, a few meters apart

*The setup can vibrate (like a small electrical motor, toy, drone, etc.)

*Maximum cost $1500 (is more flexible)

----edit:

*Hard-wire(e.g., coax) support is possible only every 60 minutes cycles to help resynchronization/fine-tuning. Basically, all clocks should be sync with a master to which they are allowed to hard-wire only every 60 minutes, disconnect again and leave freely again until the next hour.

*Wireless supports are optional to help with synchronization (e.g.,  Synchornization signals between cameras, or from a master refrence).

*The vibration problem may be alleviated using some mechanical low-pass filter over which the circuit is mounted.

*Acoustic signals are not possible.

*The master reference does not vibrate and is temperature compensated and can use atomic clocks.

*In each separate free runing circuit, it is also possible to have multiple clocks whose output are combined (e.g., averaged over time or filterred) in order to give a more accurage sync.

*circuit size of each free-running node should fit in a 10x10cm box and not weigh more than 500 grams. Though I would hope the technology is scalable to lower values.

A: Clock crystals are electromechanical devices: oscillation frequency depends on temperature, vibration, acceleration, supply voltage, etc. For example putting a cotton ball on a non temperature compensated crystal oscillator will change its drift characteristics by making temperature more constant (less air movement). It also has pink noise and "random walk" so over a period of hours, crystal oscillators will drift. How much depends on which oscillator is used.
But if you want 0.1ppb drift then you need atomic clocks which are not cheap.
Now, as is often the case there is a lot of information missing in the question. For example, you say synchronization is extremely important, but you ask for deviations that are extremely easy to achieve for almost no cost if all the systems are connected together with wires or by other means of synchronization, yet very difficult and expensive if all the systems use free-running oscillators. And then you say you want to use free-running oscillators without explaining why.
If the asker doesn't take time to explain the reasons behind such an exotic and unusual requirement to use free-running oscillators, then it probably means it's not important, so I'll ignore it.
So, I'll propose the following options:

*

*Connect everything together with coax. A pulse on a coax can arrive with picosecond precision ; however due to temperature drift and cable movement stretching the cable slightly it will vary a little bit. Still way below your requirement, so it'll be fine.

*If no cables are possible, then optical fibers. Any $1 TORX optical receiver will meet the 500ns requirement over plastic fiber.

*If no physical connection is possible, then either optical, radio, or sound.
Since cameras are involved, I suppose the experiment takes place in a medium that allows the transmission of light. If it's not vacuum, sound can be transmitted. Radio might upset some sensitive physics equipment. In all these three cases, a modulated wave can be transmitted and received to synchronize the devices. This does not need to happen constantly: if the devices are synchronized often enough, the requirement over the long-time drift of local oscillators is reduced substantially, making cheap crystal oscillators an option.
Some radio protocols already handle clock synchronization, for example bluetooth, but it doesn't seem accurate enough for your needs (>1µs error).
A master device can transmit the current timestamp to all devices. Or each slave device can emit a signal which the master receives, and then the master tells the device at which timestamp the signal was received, so the device knows its own time offset relative to the others.
If it has to be wireless and not take too much time to implement, personally I would look for a readymade solution using a radio protocol that already encodes time with sufficient accuracy and offers exploitable output signals. Preferably it should be available at mass market price: wireless audio, wireless video, etc.
Another option would be to take advantage of the fact that cameras require light. No matter how long the shutter is open, if the scene is illuminated by a short flash from one single light source, then all the pictures taken by all the cameras will be perfectly synchronized as they will only capture light during that flash. It is not trivial to pulse high power LEDs quickly due to their capacitance, but it is doable and that could be an interesting low-budget solution. In addition the devices can detect flashes with a light sensor to synchronize their clocks.
I should also mention that you should check the aperture jitter and latency in your cameras and other acquisition devices.

A: I'm in bed on my phone, but because I think you at least deserve a stub of an answer:
With your requirements 1. and 2., which, not having any other indication to go on, I'll have to take as hard requirements, no matter how much you like to see them as soft, we can deduct limits:
Over \$7.2\cdot10^{3}\$ s, you can accept an error \$5\cdot10^{-7}\$ s, which means you need an oscillator with a frequency accuracy of \$5/7.2\cdot10^{-7-3}\$, so in the order of \$10^{-10}\$, or 0.1 ppb.
That. Is. Hard. Normal quartzes don't achieve that kind of accuracy, not even temperature-compensated ones, and even using oven-controlled oscillators (OCXO), you will have not a trivial time.
At 1500 $ per synchronized device, you can try to go and combine a very stable quartz oscillator, usually an OCXO with a GPS receiver, which uses GPS to ever do slightly nudge the oscillator to run a bit faster or slower, should it run differently than GPS time. GPS works by solving a system with four unknowns (namely, three coordinates and time of the receiver) by observing (at least) 4 known signals from 4 different satellites with sufficiently known path (but initially unknown local time and thus position). Such GPSDOs (GPS-disciplined oscillators) can be commercially bought; that's mostly do to the fact that cellular best stations need a similar degree of synchronicity as you.
Note, however, that these stations are much further away from each other than a few meters, such that directly feeding in the same clock signal to multiple stations becomes hard. (You directly run into mathematically the same thing that you know as Heisenberg uncertainty - can't know your frequency domain position and your spatial domain position arbitrarily precisely at the same time. Hope that strikes a bell for you as physicist!)
So, you've got closely co-situated devices. Usually, everyone would just tell you to run coax cables from a central clock distributor everywhere, and then let all the clocks have the same, and thus, pairwise approximately zero, error.
But the fact that you're exposed to vibrations can make that mechanically hard - and oscillator-wise even harder: if the mechanical vibration effects a Doppler effect on the signal traveling the clock cable, that literally modulates your observed oscillator frequency - and you observe a red shift or blue shift away from your nominal frequency; of which you can, again, only tolerate \$10^{-10}\$! So that's going to take a bit of modelling to see whether you can tolerate that — you probably can, because I've long terms, you'd expect the dilation and contractions to be zero-mean, but you should definitely sit down and model that.
By the way, even if you end up building a system with local oscillators, every shape of quartz oscillator is an acoustic component and works by forming a oscillator that exchanges energy between mechanical stress in a crystal lattice and electrical potential at a relatively well-definable speed. So, such crystal oscillators are inherently sensitive to external acceleration, i.e., especially vibration.
So all in all, looking a bit deeper into my crystal ball, this sounds like a job for a good OCXO at each of your devices, together with control loop that gets informed about one central frequency standard, which can be GPS, but it could also be one local reference oscillator distributed to every device, used with a very low bandwidth to adjust the speed of the local oscillators, such that the mechanical vibrations are filtered out by virtue of being too high in frequency.

A: Injection locking is one mechanism where two remote oscillators can synchronize to the same frequency. For example, a regenerative radio receiver can have its weak local oscillator frequency-lock to the incoming antenna signal. Within the lock-in range, phase does vary. The lock-in range depends on relative signal strength and also depends on stability of oscillator(s) frequency. When carefully tuned, a 10 MHz regen receiver can injection-lock to WWV's carrier from a considerable distance (1000km). Be aware that very careful tuning is required to achieve lock.
Imagine TWO regenerative radio receivers, tuned to the same frequency. Each receiver has a short antenna attached so that it can receive its mate. Since a simple regenerative receiver is basically an oscillator with antenna coupled in, each receiver is also a weak transmitter when it is adjusted to weakly oscillate. They will tend to injection-lock to each other, and remain locked until separated by some distance.
Regarding pulses, I have observed that two digital clocks can lock to one another. The one-second pulse advancing the "seconds" hand can electromagnetically influence the 32768 Hz crystal oscillator of the other clock. A similar effect to injection-locking.
When the battery voltage of the crystal oscillator drops from old age, the two clocks are likely to un-lock because the crystal oscillator frequency is also influenced by the battery's dropping voltage. Not a mechanism easily engineered...
The old NTSC colour TV system modulates an RF carrier with synchronizing pulses and bursts used in a few locking systems:

*

*Colour burst (3.579 MHz) phase-locks to reproduce proper colour

*Horizontal sync pulse

*Vertical sync pulse


text:
Q: Tricky Object Sorting and Removing from NSMutableArray I have an array of objects (that contain a message), every object has the same structure. It has a message property which is an NSDictionary. One dictionary looks like this:
<message: {
    keyCreateDate = "06/08/14 21:23";
    keyMessage = Lorem ipsum;
    keyReceiverChannel = sampleString;
    keySenderUser = SampleName;
},...

My goal is to make an "inbox" where i would like to display the newest messages from every user in each cell. I want the show only the newest messages from each user, like the Fb messages, What'sApp or iMessage inbox, every cell in the table view represents the recent message from a friend. It looks very easy, but it's much harder than i imaged. So i need to remove every message from every friend, but always keep newest one. Actually i can remove all message from one user, but can't keep the newest while removing the others. Is it possible to do this?
I can remove all message for one specified user with this code:
    NSMutableArray *originalArray = [[NSMutableArray alloc]initWithArray:message];
    NSMutableArray *objectsToRemove = [[NSMutableArray alloc]init];
    NSMutableArray *cloneArray = [NSMutableArray arrayWithArray:originalArray];

    for (NMessage *messageObject in originalArray) {
        if ([messageObject.message[@"keySenderUser"] isEqual:usernameString]) {
            [objectsToRemove addObject:messageObject];
        }
    }

    if ([objectsToRemove count]>0) {
        [cloneArray removeObjectsInArray:objectsToRemove];
        NSLog(@"deleted: %@", objectsToRemove);
        self.messagesArray = [[NSMutableArray alloc]initWithArray:cloneArray];

I think it would be the easier, if i could somehow add an exception to the [cloneArray removeObjectsInArray:objectsToRemove]; line, that doesn't let to remove the newest ones. But it's also a problem that i need to sort the messages based on the keySenderUser before i delete them. My actual code can't do that, it can find only one pre-defined user's message and remove all of them. Please share with me if you have any idea. Thanks in advance.

A: I feel bottom up is better in your case where you build a new array which contains latest message dictionary.
The solution is as below.
1. sort the array using date.
2. Create a new list for holding user messages.
2. Loop through each object check whether the user is already present, If not add it to the created list.
The code solution is below, pass in your array of messaged, which would give a list of messages which are latest for an user.
-(NSArray *) GetLatestMessageListForEveryUser:(NSArray *) array
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    NSArray *sortedArray = [array sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
        NSDate *obj1Date = [formatter dateFromString: [(NSDictionary *)obj1 objectForKey:@"keyCreateDate" ] ];
        NSDate *obj2Date = [formatter dateFromString:[(NSDictionary *)obj2 objectForKey:@"keyCreateDate" ] ];
        return  ([obj1Date earlierDate:obj2Date] == obj1Date);
    }];

    NSMutableArray *messageArray = [NSMutableArray array];
    NSMutableArray *usersArray = [NSMutableArray array];

    for (NSDictionary *messageDictionary in sortedArray)
    {
        NSString *userName = [messageDictionary objectForKey:@"keySenderUser"];
        if (![usersArray containsObject:userName])
        {
            [usersArray addObject:userName];
            [messageArray addObject:messageDictionary];
        }
    }
    return messageArray;
}

redpajama_set_name: RedPajamaStackExchange


text:
Q: Base class without instances? I'm sure I'm not the first one to ask this question, but I can not find any answer for it.
The thing I want is a base class from which multiple classes are inherited. The inherited classes all have some functions (with implementation) and variables in common and have some variables and functions (different functions for every derived class) of there own. The common members I would like to combine in the base class. The thing is the base class should really just be a base class and I don't want any instances to be made of the base class. How should I do this?
If the above description is not clear, maybe this makes it more clear: let's say I want a base class mammals and derived class such as human, ape, blue whale, etc. I want to create instances of the human, ape, blue whale, etc. but not of mammals.
I have read somewhere you could put the constructor as private, but I need a public constructor of the derived classes

A: Making the base class abstract is your solution.
If you don't want to make any base class method pure virtual then you can make the destructor pure virtual
#include <iostream>
using namespace std;

class IMammal //I for Interface
{
    public:
        virtual ~IMammal() = 0; //Makes the class abstract, Pure virtual destructor
};

IMammal::~IMammal() //Its necessary or ld will complain
{
    cout << "In ~IMammal" << endl;
}

class Ape : IMammal
{

};

int main()
{
//    IMammal m; // error: cannot declare variable 'm' to be of abstract type 'IMammal'
    Ape a;
}

A: I think the suggestion of Alan Birtles might indeed work. Check this question What are practical uses of a protected constructor?
All functions I would have in the base class have an implementation in the base class. Otherwise using a virtual function would indeed be an option as well. I checked this website  https://www.geeksforgeeks.org/pure-virtual-functions-and-abstract-classes/ maybe this is useful for others.

A: Since every method is implemented in the base class, using a protected constructor will allow you to add extra member variables to the derived class without being able to construct the base. To make it even more obvious, I'd probably put the base class in a different namespace, so the caller gets a strong hint that they shouldn't even try to create one.
namespace detail
{

class Mammal
{
public:
    void layEggs() { /*implementation*/ }

protected:
    //Stop anyone creating a Mammal
    //Can still be accessed by derived classes,
    //and anyone that Mammal has declared a friend
    Mammal(int age) : age_(age);

    int age_;
};
}

class Dog : public detail::Mammal
{
public:
    //Dog is still allowed to access Mammal constructor
    Dog(int age, const std::string& name) :
        Mammal(age), name_(name)
    {}

protected:
    std::string name_;
};

Edit: I originally answered without understand that every method was implemented in the base class
You can do this by making the class an abstract class. You do this by creating at least one function a pure virtual function.
class Mammal
{
public:
    void layEggs()
    {
        //implemented in base
    }

    virtual std:string speak() = 0 //pure virtual, so class cannot be instantiated
};

class Dog : public Mammal
{
public:
    virtual std::string speak()
    {
        return "woof";
    }
};

Because Mammal contains a pure virtual function, a variable cannot be created from it. However, Dog has implemented all of the functions, so a variable can be created.
Mammal m; //will result in compiler error, because what would m.speak() do?
Dog d; //is allowed, because we know what d.speak() should do


text:
Q: How does the intent of an interface differ from an abstract class with abstract methods? Explanation/preamble
In Java, if you declare an abstract class with abstract methods, e.g.
public abstract class MyAbstractClass {
  private String m_id;

  // default behavior
  public MyAbstractClass() { setId(null); }
  public String getId() { return m_id; }
  public void setId(String id) { m_id = id; }

  // overridenable method
  public void doSomething() { /* does nothing by default */ }

  // to-be-defined behavior
  public abstract void setSomething(Object o);
  public abstract Object getSomething();
}

you can effectively declare a class which has a "default behavior" of sorts (the getters and setters for m_id) as well as forcing that this class is instantiated by a subclass which has to implement the "missing" (abstract) methods, e.g.
public class MyClass extends MyAbstractClass {
  private Object m_o;

  // implements some actual complex behavior
  public void setSomething(Object o) { m_o = o; }
  public Object getSomething() { return m_o; }
}

possibly even overriding methods in the superclass.
So it seems that an abstract class with abstract methods behaves as if it were an interface,
public interface IMy {
  public void setSomething(Object o);
  public Object getSomething();
}

because to use it, it will have to eventually point to an actual object.
The questions
It almost appears as if it makes no sense in existing both interface and abstract class-with-abstract-methods (ACWAM), since they seem very similar.

*

*The ACWAM seems so incredibly similar to an interface! I suppose that the essential difference is in their intent.

*I understand that the interface intends to provide a means with which a library user can "talk" to the library without depending on the implementation of the library. Is it a correct interpretation that an interface is intended to "show something to the public" whereas an ACWAM is something that is intended for the library developer(s) to "agree on", but with the "added bonus" of providing a default (overridenable) behavior?

*Would it make sense to use an interface at the same time as an ACWAM?

Can you provide one or two simple examples (pointing to another document would be fine) to illustrate the difference in intent (or "good use") for those two, namely interface and the ACWAM?

A: The big difference between an interface and an abstract class is:

*

*an abstract class imposes a "is a" relationship to the implementation. You must subclass the abstract class. You are forever tied into a particular class hierarchy

*an interface imposes a "looks like a" relationship to the implementation. You can subclass anything you like as long as it obeys the interface. This frees you up to swap in any class you like to do the job. This is especially useful if a better one comes along

A good rule to work by is that APIs should always refer to interfaces.
Note that the JDK is littered with mistakes made early on where (abstract) classes were used where interfaces should have been used. Stack is a good example: Stack should have been an interface, but it's a class. If you want to implement your own Stack, you must subclass java.util.Stack, which is very prescriptive - you may not want to do that - perhaps you need a super lightweight version etc.
Abstract classes do have their place however: They can provide default implementations of interfaces. A good example is java.util.AbstractMap, a class which is a skeletal implementation of the java.util.Map interface.

A: Java does not support multiple inheritance.  Therefore, a class can implement many interfaces, but it cannot inherit from multiple base classes.

A: If it helps, you can think of a Java interface as a contract, and a Java abstract class as a template.

A: Abstarct class is with some/all abstract methods.
but Interface is with ALL abstract methods.
In senarios where all the methods are abstarct then go for interface like :
interface City
{
   public void pin();
   public void state();
}

which any city implements will have to provide their own implementation for both the abstract methods.
Ex:
class Bangalore implements City
{
   public void pin()
   {
       System.out.println("127351731");
   }
   public void state()
   {
       System.out.println("Karnataka");
   }
}

class Lisbon implements City
{
   public void pin()
   {
       System.out.println("87456964");
   }
   public void state()
   {
       System.out.println("Lisbon");
   }
}

But lets say for example : in scenarios like this where some methods are common for the classes which extend this class but some they have to give different implementation :
abstract class Animal{
  public abstract void eat();

  public void run()
  {
     System.out.println("I can Run");
  }

}

And lets say Dog and Cat both extend this abstract class. They both will inherit same run() from the class Animal.
class Dog extends Animal
{
    public void eat()
    {
       System.out.println("I eat Meat");
    }
}

class cat extends Animal
{
    public void eat()
    {
       System.out.println("I eat only Fish");
    }
}

A: If you have to choose between an interface and an abstract class with ONLY abstract methods, you should choose the interface, since it gives you more possibilities for later : you can have multiple interfaces, but only one abstract class.
If you need some common behavior, you may also choose the interface, since you can have the common behavior via composition in concrete classes (and you benefit of multiple inheritance).


text:
Q: QML: Get QObject parent QML introduces a separate ownership (QObject) tree from the visual tree (QtQuick scene graph).

*

*parent returns the visual parent.

*children returns the visual children.

*data returns the QObject children.

But how do I access the QObject parent?
FYI, I intend on dynamically creating and destroying nested layouts containing a custom type, so I need to manage the QObject tree - just using the visual tree will result in the 'wrong' objects disappearing after reparenting and then deleting.

A: If you don't actually know the parent of the item, I don't think you can find out without going into C++. If you just want to change the item's QObject parent, you should be able to do so in QML by adding it to the data property of its new parent. (This will also change its visual parent, if applicable.)
Quoting the the Qt Quick Concepts documentation:

Any object assigned to an item's data property becomes a child of the item within its QObject hierarchy, for memory management purposes. Additionally, if an object added to the data property is of the Item type, it is also assigned to the Item::children property and becomes a child of the item within the visual scene hierarchy. (Most Qt Quick hierarchy crawling algorithms, especially the rendering algorithms, only consider the visual parent hierarchy.)

A: You can avoid unwanted ownership of objects by previous parents by creating them like this:
const someObject = someComponent.createObject( null, { parent: someItem });

This way someItem is only visual parent of someObject. You can move the child elsewhere then delete the container.


text:
Q: Dynamically populating two  list from SQL database I have a query about how to populate two separate  lists from an SQL database, my database looks like this;
shoe_id      shoe_type       shoe_color
_________________________________________
001          Hi-Top          Blue
002          Loafer          Black
003          Brogue          Brown
004          Brogue          Black
005          Loafer          Brown
006          Loafer          Red
007          Hi-Top          Yellow

I'm wondering how to create a select list to display the shoe_type and the second one to dynamically change depending on the shoe_type, to show the shoe_color.
For example, 'Brogue' is selected in the first select list and then both 'Brown' and 'Black' displayed in the second select list.
Thank you in advance.

A: You can produce this structure based on your database if it is prefetched:
shoes array(3) {
    ['Hi-Top'] => array(2) {
        [1] => 'Blue',
        [7] => 'Yellow'
    }
    ['Loafer'] => array(3) {
        [2] => 'Black',
        [5] => 'Brown',
        [6] => 'Red',
    }
    ['Brogue'] => array(2) {
        [3] => 'Brown',
        [4] => 'Black'
    }
}

and in HTML generator:
<select name="type">
    <?php foreach($shoes as $shoeType => $shoeColors): ?>
        <option value="<?= $shoeType ?>" <?php if(isset($_POST['type']) && $_POST['type'] == $shoeType) echo 'selected="selected"'?>><?= $shoeType?></option>
    <?php endforeach; ?>
</select>
<select name="color">
    <?php if (isset($_POST['type']) foreach($shoes[$_POST['type']] as $k => $v): ?>
        <option value="<?= $k ?>" <?php if(isset($_POST['color']) && $_POST['color'] == $k) echo 'selected="selected"'?>><?= $v ?></option>
    <?php endforeach; ?>
</select>

Now if you could save $_POST['type'] and $_POST['color'] in the session to use later on, you'd never need JS at all and your code works even if JS is disabled on the browser.
But if you like, you can use JS. Json encode it and use it in your javascript. Rather than that the only way is to use AJAX.
var shoes = <?= json_encode($shoes) ?>


text:
Q: Definition of coevaluation map of a stable category defined in Tammo tom Dieck's Algebraic Topology. The following picture is from [Tammo tom Dieck, Algebraic Topology, pp.176].

Question
I want to ask if the statement that $j$ induces an h-equivalence :
$$C(V|K)\overset{}{\longrightarrow}C(\mathbb{R}^n|K)$$
is correct.
Attempt
In the book, the author stated

So as a first step, I want to show that $j:V\to\mathbb{R}^n$ is an h-equivalence, but I don't think it is possible to do so, since $\mathbb{R}^n$ is contractible but not all open subset of $\mathbb{R}^n$ has only one component or path component.


text:
Q: Why don't sessions start properly in Internet Explorer and Google Chrome, but work fine in Firefox? I'm asking (and answering) this question mainly because I couldn't find anything that exactly matched my specific circumstance in any of the other similar SO questions asked, nor did any of them that I read exactly match the solution I found. It's my hope that this will benefit others in the future.
I'm trying to set a very restrictive session cookie that is valid only for the admin section of my site, so I'm using session_set_cookie_params() to do so. Here is the original code:
  // Set session parameters
  $session_name = 'PGO_Admin';
  $session_lifetime = 86400; // 24 hours, expressed in seconds
  $session_cookie_path = './'; // This session is only valid within the confines of the admin folder
  $session_cookie_domain = filter_input(INPUT_SERVER,'HTTP_HOST');
  session_set_cookie_params($session_lifetime, $session_cookie_path, $session_cookie_domain);
  session_name($session_name);
  session_start();

This code works well in Firefox, but fails in IE and Chrome. In Firefox, if I put in some PHP code to display the contents of $_SESSION, I get this:
<!-- SESSION vars:
Array
(
    [GitHubVersion] => 2.4.5
    [poadmin] => Array
        (
            [curPage] => main
            [uid] => 1
            [name] => Dave
            [lip] => 127.0.0.1
            [prior_login] => Tuesday 9th of December 2014 03:11:56 PM
            [ip] => 127.0.0.1
            [last_login] => Tuesday 9th of December 2014 03:42:51 PM
            [bot_id] => 1
            [bot_name] => Test
            [logged_in] => 1
        )
)
-->

Which is what I expect to see. In IE or Chrome, however, the same code only produces an empty array:
<!-- SESSION vars:
Array
(
)
-->

If I comment out the call to session_set_cookie_params(), the script functions properly, but the cookie that gets set is accessible everywhere within the site, and that is not acceptable to me. After banging my head against the wall for several hours, I finally found a solution that's pretty simple. Please see my answer for the solution.

A: Here's my theory:
It seems that Firefox "understands" that './' means the current directory path, while IE and Chrome do not. They expect a "full path" from the server's document root, which in my case was "/Program-O-master/admin/". Armed with this knowledge, I revised the code in the following manner:
  $session_name = 'PGO_Admin';
  $session_lifetime = 86400; // 24 hours, expressed in seconds
  $session_cookie_domain = 'http://' . filter_input(INPUT_SERVER,'HTTP_HOST');
  $session_cookie_path = str_replace($session_cookie_domain, '', _ADMIN_URL_);
  /* The constant _ADMIN_URL_ is set earlier, in a different file */
  session_set_cookie_params($session_lifetime, $session_cookie_path, $session_cookie_domain);
  session_name($session_name);
  session_start();

This set the "proper" cookie path, and now all of the browsers I've tested with (including several that weren't mentioned earlier) work as expected. I hope this will help others in the future.


text:
Q: Rails Grape API include module - Zeitwerk::NameError - expected file to define constant, but didn't: I want to make a small code refactor and extract client external client from gem to a separate module (it's use to connect to the DatoCMS API via gem 'dato'). My standard class, which works well, look like:
app/services/receive_webhook/fetch_model_name.rb
module ReceiveWebhook
  class FetchModelName
    def initialize(model_id)
      @model_id = model_id
    end

    def call
      fetch_model(@model_id).dig('name')
    end

    private

    def client
      @client ||= Dato::Site::Client.new(Rails.application.credentials.datocms_api_token)
    end

    def fetch_model(model_id)
      client.item_types.find(model_id)
    end
  end
end

I want to separate client method to a different module and include it in FetchModelName class (like in standard Rails app). To do so I use below code:
app/dato_cms_api/dato_client.rb
module DatoCmsApi
  module DatoClient
    def client
      @client ||= Dato::Site::Client.new(Rails.application.credentials.datocms_api_token)
    end
  end
end

With updated FetchModelName class:
app/services/receive_webhook/fetch_model_name.rb
module ReceiveWebhook
  class FetchModelName
    include ::DatoClient

    def initialize(model_id)
      @model_id = model_id
    end

    def call
      fetch_model(@model_id).dig('name')
    end

    private

    def fetch_model(model_id)
      client.item_types.find(model_id)
    end
  end
end

But I'm getting an error:
Zeitwerk::NameError - expected file app/dato_cms_api/dato_client.rb to define constant DatoClient, but didn't:
  app/services/receive_webhook/fetch_model_name.rb:5:in `<class:FetchModelName>'
  app/services/receive_webhook/fetch_model_name.rb:4:in `<module:ReceiveWebhook>'
  app/services/receive_webhook/fetch_model_name.rb:3:in `<main>'
  app/controllers/api/v1/webhooks/dato_cms/receive_webhook.rb:29:in `block in <class:ReceiveWebhook>'

Does Grape API not support include module practice?

A: Did you try to downgrade your autoloader to classic?
In your application.rb file, add this:
config.autoloader = :classic


text:
Q: Rest Api for MS Access? I currently have an existing MS Access database. I need to create an app to view or edit it on the go.
Is there anyway I can create a REST API or anything similar for an existing MS Access database that I can make HTTP Requests through an app or website?

A: Yes You Can Do That and you have a many options

*

*Java EE , With java EE you can make a restful api on any database with servlet or with spring freamwork

*PHP , with php you can make a rest api with any database too LINK

*asp.net , also with asp.net you can make an api for database LINK

*nodejs , with nodejs you can make an api on this database use this module LINK
note : the first thing you need it to make any api on any database must get the concept of restful api and every thing will be easy


text:
Q: pass member object of ArrayList to function by value.how does the native object took the value? I am using ready code from this.
in the code we have circles shapesArrayList<Circle> mCircles;
the shapes are created in a custom view class. and drawn in the view see like the following
private void createCircles() {
    mCircles = new ArrayList<Circle>();
    mCircles.add(new Circle(30, 30, 20));
    mCircles.add(new Circle(120, 30, 20));
}
private void drawCirclesOnCanvas(Canvas canvas) {
    for (Circle c : mCircles) {
        canvas.drawCircle(c.getCurrentX(), c.getCurrentY(), c.getRadius(),
                mForeCirclePaint);
    }
}

in summary the handle touch function for the circle shape is
private void handleTouchedCircle(MotionEvent me, Circle c) {
    final float me_x = me.getX();
    final float me_y = me.getY();
    final int action = me.getAction();
    switch (action) {
    case MotionEvent.ACTION_DOWN:
        c.setActionDownX(c.getCurrentX());
        c.setActionDownY(c.getCurrentY());
        c.setActionMoveOffsetX(me_x);
        c.setActionMoveOffsetY(me_y);
        break;
    case MotionEvent.ACTION_MOVE:
    case MotionEvent.ACTION_UP:
        c.setCurrentX(c.getActionDownX() + me_x - c.getActionMoveOffsetX());
        c.setCurrentY(c.getActionDownY() + me_y - c.getActionMoveOffsetY());
        break;
    case MotionEvent.ACTION_CANCEL:
        c.restoreStartPosition();
        break;
    }
}

this make the circle move. my question how does the original circle object in ArrayList take values from the above function?
this is how we called it
public boolean onTouchEvent(MotionEvent event) {
    // 1. get the x and y of MotionEvent
    float x = event.getX();
    float y = event.getY();
    // 2. find circle closest to x and y
    Circle cr = findCircleClosestToTouchEvent(x, y);
    // 3. find cross closest to x and y
    Cross cx = findCrossClosestToTouchEvent(x, y);
    // 4. compute euclid distances to find which is
    // closer - circle or cross
    float dtcr = euclidDist(cr.getCurrentX(), cr.getCurrentY(), x, y);
    float dtcx = euclidDist(cx.getMidX(), cx.getMidY(), x, y);
    // 5. if distance to closest circle is smaller
    // handle the circle; otherwise, handle the cross
    if (dtcr < dtcx) {
        handleTouchedCircle(event, cr);
    } else {
        handleTouchedCross(event, cx);
    }
    return true;
}

I searched a little people say there is no pass by reference in Java (it has different meaning from c++), so what is the criteria
thank you


text:
Q: Maximize CPU Usage How do I maximize the CPU usage for my application? I tried setting it to "Real-time" in the Task Manager, but there was no noticeable improvement - it's stuck at 50%.
I'm working in Windows XP with Visual C++ 2005.

A: You probably have a dual core processor and your program is probably single-threaded.

A: Priority will have little or nothing to do with how much CPU your process uses. This is because if there is something available to run, the OS will schedule it to be run, even if it is low priority. Priority only comes into it when there are two or more runnable threads to choose from. (Note: This is an extreme simplification.)
Number crunching programs such as Prime95 run at the lowest possible priority and spawn multiple threads to use all of as many CPUs as you have.

A: I'm assuming you running on a dual-core computer.  Try starting another thread.
If you only have one thread of execution in your application, it can only be run on one CPU core at a time.  The solution to this is to divide the work in half, and get one CPU core to run one half and the other core to run the other half.  Of course you might want to generalize this to work with 4 cores or more....
Setting the priority for your application is only going to move it up the queue for which process gets first chance to use the CPU.  If there is a real-time process waiting for the CPU, it will always get it before a high priority, and so on down the priority list.  Even if your app is low priority, it can still max out a CPU core if it has enough work to do, and no higher-priority process is wanting to use that core.
For an introduction to multithreading, check out these questions:

*

*C++ multithreading tutorial

*What is easiest way to create multithreaded applications with C/C++?

*Good multithreading guides?

A: Real time will not necessarily eat CPU cycles. Try spawning a thread or two, or three that run tight loops that count, at the most basic. If you want to (ab)use memory, you can also allocate and deallocate some arbitrary objects within your loops.


text:
Q: Python OSX $ which Python gives /Library/Frameworks/Python.framework/Versions/2.7/bin/python Hello I'm trying to run twisted along with python but python cannot find twisted.
I did run $pip install twisted successfully but it is still not available.
ImportError: No module named twisted.internet.protocol
It seems that most people have $which python  at /usr/local/bin/python
but I get /Library/Frameworks/Python.framework/Versions/2.7/bin/python
May this be the issue? If so, how can I change the PATH env?

A: By the path your giving for OS X python I'm guessing your a rev-or-so old on your OS X (leopard?) so I can't directly compare with my machine.
But, adding packages to the base OS X install is always a touchy thing, one check I would recommend is the permissions on any packages you add.  Do a ls -l /Library/Python/2.7/site-packages/ and make sure everything has r rights (and x rights for directories) (I.E. -rwxr-xr-x or drwxr-xr-x).
I had a recent case where a sudo pip wouldn't set user read rights on installed packages, and I believe "No module" was the error I was getting when I tried to use them
Because adding packages is so touchy on OS X, there are tons of guide on the net to doing hand installs of python.  The first one I matched on a google is Installing / Updateing Python on OS X (use at your own risk, I personally haven't followed that guide)
(... the 3rd part install system Brew is a very common method for people to do automated installs of python as well)

A: It is just fine.
Python may be installed in multiple places in your computer.
When you get a new Mac, the default python directory may be
 'usr/bin/python2.7'

You may also have a directory
'System/Library/Frameworks/Python.framework/Versions/2.7/bin/python'

The first one is the symlink of the second one.
If you use HomeBrew to install python, you may get a directory in
'usr/local/bin/python2.7'

You may also have a directory as
'Library/Frameworks/Python.framework/Versions/2.7/bin/python'

which is exactly where my directory is.
The difference between the second one and the fourth one, you may find it here
Installing Your Framework
In your question, as you mentioned pip install is successful, but the installed packages still not available. I may guess your pip directory is not in your default python directory, and the packages are installed where your pip directory is. (Please use 'which pip' to check it out)
For example, in my computer, the default pip directory is
/Library/Frameworks/Python.framework/Versions/2.7/bin/pip

though, I have also pip in usr/local/bin.
So, all my packages installed via 'pip install' are stored in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages

Hope that resolves your doubt. Similar things have happened to me, and it took me a whole night to figure out.
Here is the solution:
Use PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH" to modify your python directory, or modify your pip directory.
However, I would recommend a better way, use virtualenv. This can isolates Python environments, and can help you easily set up packages for each project.

A: Okay well in the terminal I finally found out:
open .bash_profile located at your user root (simply do a $cd in terminal to go there) and add where the path is the location of twisted
PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
export PYTHONPATH

A: I too was getting a ImportError: No module named xxxeven though I did a pip install xxx and pip2 install xxx.
pip2.7 install xxx worked for me. This installed it in the python 2.7 directory.


text:
Q: Reference to drawn text using drawText() on a canvas I have a canvas on which I have drawn some text using drawText(), is it possible to get a reference to that text? I want to select that text using the onLongPress() gesture and I think I need to have the reference of that text to do that.

A: You won't be having refrence to what you drawn using drawText() on canvas.To implement select text you have to use Paint.measureText() to get height and width of your text and then draw the backgound to make a custom effect of text selection(handle long press using onTouch()).
 When drawing text on canvas you have to handle every behaviours of text view as your own.
An alternate way is to to Create a TextView and add it to any layout and then use the following code to draw the layout into canvas
//measure the width and height of the layout(covers entire canvas)
vLayout.measure(canvas.getWidth(), canvas.getHeight());
//set the bounds of the layout.
vLayout.layout(0, 0, canvas.getWidth(), canvas.getHeight());
vLayout.draw(canvas);


text:
Q: Why doesn't my page get refreshed after login in to facebook? I have been trying add facebook login to my page. I have facebook login button placed on my page using following script:
    <script src="http://connect.facebook.net/en_US/all.js">
    </script>
    <script>
        FB.init({
            appId:'<?php echo APP_ID;?>', cookie:true,
            status:true, xfbml:true
        });
    </script>
    <fb:login-button perms="email,user_checkins">
        Login with Facebook
    </fb:login-button>

It shows the login button too. while clicking it opens the login screen of facebook too.
after making successfull login the popup box just closes without refreshing the parent page.
what am i missing?

A: You are not asking the page to refresh after a successful login:
// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
  window.location.reload();
});

See the PHP-SDK example for more information.

A: Two Great Solution

*

*// whenever the user logs in, we refresh the page
FB.Event.subscribe('auth.login', function() {
  window.location.reload();
});`

*<fb:login-button onlogin="LoginFunction()" perms="email,user_likes,user_photos">CONNECT Bla Bla</fb:login-button>
When the user Login we call the function LoginFunction() and then we can do whatever such as refresh or redirect the user.


text:
Q: Can data size be less than index size in sql database? Can the indexes on a SQL Server table consume more disk space than the table itself?
I have gone through several articles and studied this and a few expert recommended table partitioning, for example, this MSDN forums question
why can and index be of greater size than the actual data?
How can I reduce index size?
How can I identify unnecessary indexes in this context?

A: A completely valid table setup might be:
CREATE TABLE dbo.A
(
    a int NOT NULL
    , b varchar(30) NOT NULL
    , c varchar(30) NOT NULL
);

CREATE INDEX A_01 ON dbo.A (a, b);
CREATE INDEX A_02 ON dbo.A (a, c);
CREATE INDEX A_03 ON dbo.A (a, c, b);

Pretty clearly, the total space used by the indexes will be more than the space used by the table itself.
There are many reasons why the total amount of index space might be higher than that used by the table itself.  Several that immediately come to mind:

*

*Carelessly chosen index strategy where we "index everything".

*Implementation of every single index recommended by the Database Engine Tuning Advisor

*Favoring query speed for many combinations of queries on a primarily read-only workload, such as a data warehouse.

If you provide the table definition in your question along with all existing indexes, in T-SQL CREATE TABLE statements, we may be able to suggest improvements.

A: A single non clustered index could theoretically be larger than your data size too, since the clustered key is included in the non clustered index as a pointer to the actual row.
So let's say you have a table like this
CREATE TABLE dbo.Table
(
    a char(30) NOT NULL
    , b char(30) NOT NULL
    , c char(30) NOT NULL
);

With a clustered index on a and b, and then create a nonclustered index on b and c the nonclustered index will contain the following column values
+------------------+---------------------+
|   index columns  |  bookmark           |
+------------------+---------------------+
|  b     |  c      |  a       |   b      |
+------------------+---------------------+

Read this post by Kalen for an introduction.
If your clustered key isn't unique SQL will even add a 4 bit uniquifier to the index.


text:
Q: How to format a list based on its number of indexes So I saw a program that can format a sentence with strings inside a list. That program looks like this:
animals = ["dog", "bear"]

safari = " I saw {} and {}

print(safari.format(*animals))

So I was wondering what if I had a bigger list, then I would have to put so many {} to format. That's why I wanted to create a program that adds these brackets {} based on how many strings are there in a list. The program looks like this but doesn't work:
animals = ["dog", "cat", "mouse", "elephant", "bird", "lion", "llama", "flamingo", "cow", "whale", "shark", "fish", "bear", "pig"]

safari = "I saw "
for i in range(len(animals)):
x = " {} ".join(safari)

print(safari.format(*animals))

It's really simple, yet I don't understand why it won't work.

A: The problem with your code is that it will join the elements with {}. You got confused how .join works.
Consider the following:
>>> a=['a','b','c']
>>> ', '.join(a)
'a, b, c'

It returns a string by joining the given iterable with the delimiter.
Similarly, that is what is happening with '{}'.join(animals)
>>> '{}'.join(a)
'a{}b{}c'

You can try this:
animals = ["dog", "cat", "mouse", "elephant", "bird", "lion", "llama", "flamingo", "cow", "whale", "shark", "fish", "bear", "pig"]
new='I saw '
new+=', '.join("{}" for i in animals)

print(new.format(*animals))


text:
Q: c sharp reordering Buttons from top to bottom in panel after event i am trying to make a simple game which has colored buttons in panel. these buttons are randomly colored and dynamically added in the panel. when i click a button, it kills same colors.I do this with floodfill. then clicked button remains and there is a space after the kill. how can i move the buttons from top to bottom and left to right? i would be appreciated. the images are attached.

below are my codes
public partial class Form3 : Form
{
private MyButton[,] btnGrid;
    private Color origColor, currColor;
    private Color Renk = Color.Red;
    private int rows, cols;
    int count=0;
    int indexX = 0;
    int indexY = 0;
    public Form3()
    {
        InitializeComponent();
        doldur();

    }

    public void doldur()
    {

       cols = panel1.Height / MyButton.Btn_size;
        rows = panel1.Width / MyButton.Btn_size;

        //yeni buton dizisi
        btnGrid = new MyButton[rows, cols];
        //her satır ve sütüna yeni buton atama
        for (int r = 0; r < rows; r++)
        {
            for (int c = 0; c < cols; c++)
            {
                btnGrid[r, c] = new MyButton();
                btnGrid[r, c].Name = "" + (r+1).ToString()  + (c+1).ToString() + "";
                btnGrid[r, c].row = r;
                btnGrid[r, c].col = c;

                //paneldeki her butona event atama
                btnGrid[r, c].Click += tiklama;

                //panele buton ekleme
                panel1.Controls.Add(btnGrid[r, c]);

                //butonları düzgün xy koordinatlarına göre yerini değiştirme
                btnGrid[r, c].Location = new Point(r * (MyButton.Btn_size), c * (MyButton.Btn_size));
                listBox2.Items.Add(btnGrid[r, c].Name.ToString());

            }

        }

    }

    private void tiklama(object sender, EventArgs e)
    {

        MyButton btn = (MyButton)sender;

        origColor = btn.BackColor;
        floodfill(btn.row, btn.col);
        btn.BackColor = origColor;
        textBox2.Text = btn.Name;

        kaldir();
        kaldir();
        kaldir();
        say();

    }
    private void floodfill(int r, int c)
    {

        if (isValid(r, c) && btnGrid[r, c].BackColor.Equals(origColor))
        {
            btnGrid[r, c].BackColor = Renk;

            floodfill(r + 1, c);
            floodfill(r - 1, c);
            floodfill(r, c + 1);
            floodfill(r, c - 1);

        }

    }

    private bool isValid(int r, int c)
    {
        if (r >= 0 && r < rows && c >= 0 && c < cols)
        {
            return true;
        }
        else
        {
            return false;
        }

    }

    private void kaldir()
    {

        foreach (Button item in panel1.Controls)
        {

                if (item.BackColor == Renk)
                {
                    listBox1.Items.Add(item.Name.ToString());
                    panel1.Controls.Remove(item);

                }

        }

    }

    private void say()

    {
        int say = 0;

        foreach (Control item in panel1.Controls)
        {
            if (item is Button)
            {
                say++;
             }
            count = 31-say;
            txtkalan.Text = say.ToString();

        }
    }


text:
Q: How to fetch certain keyword's record in Laravel? I would like to LIKE search.
If 'product' column has "AQ" string display data.
I wrote below code but I couldn't get any record.
Could you teach me right code please?
    public function w_mo_fb_m()
{
    $word = "AQ";
    $images = ImageGallery::where('product', 'like', "%$word%")->orderBy('id', 'desc')->get();
    return view('w_mo_fb_m',compact('images'));
}

A: How about try this.
where('product', 'LIKE', '%'.$word.'%')

//or

where('product', 'LIKE', "%{$word}%")

If this still not working you may need to run raw SQL to see if you can get any record. (you need to replace ImageGallery with your actual table name)
DB::select('select * from ImageGallery where product LIKE = ?', ['%'.$word.'%']);


text:
Q: Mule ESB -- Introduce a Middleware to Publish and Consume SOAP I just have started using Mule 3.8 CE version. My use case is to like this,
Publish SOAP -- Hit any method from Published SOAP -- Receive data   -- Pass this Data to consume SOAP -- Fetch Response -- Process response via Java -- Return this as response from Method of Published SOAP.
In short I want to introduce a middleware (not a proxy) from Mule which will publish endpoint (e1) -- receive data from that endpoint (e1) -- pass this data to another endpoint(e2) -- receive data from this another endpoint.(e2) -- return response to original endpoint (e1).

Currently I am using following Mule configuration to achieve this,
 <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8085" doc:name="HTTP Listener Configuration"/>
<endpoint exchange-pattern="request-response" address="http://192.168.2.3:9080/crestelBEExport/billexport/CrestelBEExportService/CrestelBEExport" name="Generic" doc:name="Generic"/>
<flow name="webserviceproducerFlow">
    <http:listener config-ref="HTTP_Listener_Configuration" path="/hello" doc:name="HTTP"/>
    <cxf:jaxws-service serviceClass="com.poc.example.ws.IHelloWorld" doc:name ="CXF" />
    <component class="com.poc.example.ws.HelloWorldWSImpl" doc:name="Java"/>
</flow>

In the 'HellowWorldWSImpl" I have Webmethod. I am consuming SOAP and receive data in this webmethod. I am returning this data consumed from SOAP as response to this Webmethod. Is this right approach or is there any better way to achieve my requirement?

A: You can use WS Consumer for calling the WS. No need in writing java code. This will be more "mule" way.

A: With Mule 3.8 enterprise edition, you have a feature, which will help you to specify WSDL in the beginning
This will create similar structure like a RAMLSample WSDL


text:
Q: UserDefault in Xamarin I am trying to assign textfield entries just right before SettingViewController dismissed, and checking them while URLViewController appears.
However, once I check it returns null even though user entered all required information;
//SettingViewController
partial class SettingViewController : UIViewController
    {
        public ServerSettings sSettings;
        public SettingViewController (IntPtr handle) : base (handle)
        {
            this.Title = "Settings";
            this.sSettings = new ServerSettings();

        }

        public override void ViewWillDisappear (bool animated)
        {
            sSettings.server=serverTF.Text;
            sSettings.port = portTF.Text;
            sSettings.password = passwordTF.Text;
            sSettings.userid = inboxuserTF.Text;
            sSettings.username = usernameTF.Text;
        }
    }

//URLViewController
public override void ViewWillAppear(bool animated)
        {
        base.ViewWillAppear (animated);
        SettingViewController callSetting = this.Storyboard.InstantiateViewController ("SettingViewController") as SettingViewController;

        if (callSetting == null)
            throw new Exception("callSetting is null"); // Or if you can handle having a null callSetting then correct for it, but realistically this is a problem, so I'd throw an Exception

        if (callSetting.sSettings == null)
            throw new Exception("sSetting is null"); // Or if you can handle having a null callSetting.sSetting then correct it (such as using a default value).

        if (string.IsNullOrEmpty(callSetting.sSettings.password)==true)
            Console.WriteLine("is null or empty");
        else
            Console.WriteLine (callSetting.sSettings.password);

    }

Even though user fullfill all the textfield entries, it returns null.
//SettingsViewController

//URLViewController

A: I would approach the problem by using dictionary& userdefaults as follows:
In the B Viewcontroller, keep the user entries in the dictionary, map it and assign it to the userdefault.
partial class BViewController : UIViewController
{
    const string server = "server";
    const string port = "port";
    const string password = "password";
    const string username = "username";
    const string inboxuserid = "inboxuserid";
    .............
    .............

  public override void ViewWillDisappear (bool animated)
  {
    var appDefaults = new NSDictionary (server, serverTF.Text, port, portTF.Text, password, passwordTF.Text,username,usernameTF.Text, inboxuserid,inboxuserTF.Text);
    NSUserDefaults.StandardUserDefaults.RegisterDefaults (appDefaults);
    NSUserDefaults.StandardUserDefaults.Synchronize ();
  }

}

and retrieve them in the A ViewController as follows:
partial class AViewController : UIViewController
 {

  public override void ViewWillAppear(bool animated)
   {
    NSUserDefaults.StandardUserDefaults.RegisterDefaults (appDefaults);
    NSUserDefaults.StandardUserDefaults.Synchronize ();
    var username = NSUserDefaults.StandardUserDefaults.StringForKey ("username");
    Console.WriteLine (username);
    }
}

There are also good examples in the following links:
https://github.com/xamarin/monotouch-samples/blob/master/AppPrefs/Settings.cs
http://forums.xamarin.com/discussion/9089/nsuserdefaults-standarduserdefaults-returns-null-first-time


text:
Q: Get value of array wih objects javascript I am using Firebug and when i console log an array, the value am getting is: Array [ ]
I can see in the right panel of Firebug how the array has items 3 objects, but i cannot reach them. How could i get the values?, here is an image:

A: Several JavaScript methods for accessing the array:
var array = ['foo', 'bar', 'hello', 'world'];

//simple for loop
for(var i in array){
    console.log('array item value: ', array[i]);
}

//forEach loop
array.forEach(function(value){
    console.log('array item value: ', value);
});

Your array may have strings, numbers, objects, booleans, etc as each item, once you have access to that item using one of the above methods you can manipulate that item however you'd like.
Information on forEach loops
Information on for loops
Information on iterating arrays


text:
Q: best approach to refine search in Lift? I need to render a list of objects which can be dynamically refined on some variables. As for example change the  order of the items. An example can be: https://www.airbnb.it/s/California
A possibility is:

*

*Build  a REST API according to the variables for the refinement;

*Use SHtml for embedding UI refinement elements  and fire a Js function;

*Write a Js function which calls the REST API and renders the HTML;

Are there other solutions?
An advantage is that I will use REST API for developing on Tablet/Smarthpone.

A: What you need here is strike balance. At best pull all data using REST API (json/xml) parse it and store on client side. When time comes refinement should work on client side if possible and if necessary pull more data from server. So in your case I'd stick to REST API for pulling data then client side should take care of rendering. It is slightly more complex but pays off in longer term. Also if you wan't to create mobile app then you need API to call. Using REST API you can refactor your code so both Lift generated html/js and API call same core functions and benefit from code reuse.


text:
Q: Regex returns no results even after escaping special characters My regex is not returning a match even though the pattern appears to match the string:
regex = /(.+)\\\\n(\w+),\s(\w{2})\s(\d+)/
address = "6761 SW 19 St\\nPark City, PA 19020"
address =~ regex
 => nil

I am expecting a 0 result so I can use $1,$2,$3 in order to extract the data I want.
The only thing I can imagine that is wrong here is the escape sequences. But am I right to escape like I did above?

A: Parsing addresses is very tricky, and it's very easy to either write an overly simplistic regex that doesn't catch all the many, many special cases, or to fall down the rabbit hole of trying to catch all those special cases.
Fortunately there's already two very well developed modules for this: Geocoder and StreetAddress. I personally worked on improving StreetAddress.
StreetAddress just parses addresses as best it can.
2.3.3 :001 > address = "6761 SW 19 St\\\nPark City, PA 19020"
 => "6761 SW 19 St\\\nPark City, PA 19020"
2.3.3 :002 > require 'street_address'
 => true
2.3.3 :005 > StreetAddress::US.parse(address)
 => #<StreetAddress::US::Address:0x007fcc62a88ca8 @number="6761", @street="19 St\\", @street_type="Park", @unit=nil, @unit_prefix=nil, @suffix=nil, @prefix="SW", @city="City", @state="PA", @postal_code="19020", @postal_code_ext=nil>

Note that it kept the backslash as part of the street name. A backslash in an address is quite abnormal. You can correct for this with an override to StreetAddress::US.parse which first strips trailing backslashes.
Geocoder takes a different approach to make a fuzzy match against US Census data. It's a bit more difficult to setup, but it can do a better job parsing real street addresses.
Use one of them, don't write your own. I'll go over the problems in your code only as an exercise.

There's multiple problems, and any one of them will cause the match to fail. This can't be fixed by just throwing more backslashes around until it happens to work.
First is in the address itself.
address = "6761 SW 19 St\\nPark City, PA 19020"
                        ^

\\n is a literal backslash followed by the letter n.
> address = "6761 SW 19 St\\nPark City, PA 19020"
 => "6761 SW 19 St\\nPark City, PA 19020"
> puts address
6761 SW 19 St\nPark City, PA 19020

I expect you meant \\\n which is a literal backslash followed by the letter n.
Then your regex has multiple problems. First, again, too many backslashes.
/(.+)\\\\n(\w+),\s(\w{2})\s(\d+)/
     ^^^^^

That is two literal backslashes followed by the letter n. You need \\\n.
The next problem is trying to match "Park City," with \w.
/(.+)\\\n(\w+),\s(\w{2})\s(\d+)/
         ^^^^^^

\w is letters and numbers and underscore only, no spaces. You'd need [\w\s]+ instead.
Now that "works" for that particular address, but it's pretty brittle and will probably fail on many others.

But using address =~ regex with $1 and such is not the best way to do matches in Ruby. Instead, use regex.match(address) which returns a MatchData object. You can then use that as an array. match[0] is everything which matched. match[1] is $1 (ie. the first capture) and so on.
2.3.3 :034 > match[0]
 => "6761 SW 19 St\\\nPark City, PA 19020"
2.3.3 :035 > match[1]
 => "6761 SW 19 St"
2.3.3 :036 > match[2]
 => "Park City"
2.3.3 :037 > match[3]
 => "PA"
2.3.3 :038 > match[4]
 => "19020"

This avoids using variables that might be blown over by other regexes and allows you to pass the MatchData object around as a single unit.

A: Another quick alternate regex:
regex = /(.+)\\n([^,]+),\s(\w{2})\s(\d+)/

Here we use the not character class to get the suburb


text:
Q: Regex: Non-Capturing Group in Non-Numeric? I am trying to test that a timestamp (let's use HH:MM:ss as an example) does not have any numeric characters surrounding it, or to say that I would like to check for the presence of a non-numeric character before and after my timestamp. The non-numeric character does not need to exist, but no numeric character should exist directly before nor directly after. I do not want to capture this non-numeric character. How can I do this? Should I use "look-arounds" or non-capturing groups?
Fill in the blank + (2[0-3]:[0-5][0-9]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9]:[0-5][0-9]) + Fill in the blank
Thanks!

A: The regex class for "anything that is not numeric" is:
\D

This is equivalent to:
[^\d]

So you would use:
\D*(2[0-3]:[0-5][0-9]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9]:[0-5][0-9])\D*

You don't need to surround it with a non-capturing group (?:).

A:
I would like to check for the presence of a non-numeric character before and after my timestamp. The non-numeric character does not need to exist, but no numeric character should exist directly before nor directly after. I do not want to capture this non-numeric character.

The best way to match such a timestamp is using lookarounds:
(?<!\d)(2[0-3]:[0-5][0-9]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9]:[0-5][0-9])(?!\d)

The (?<!\d) fails a match if there is a digit before the timestamp and (?!\d) fails a match if there is a digit after the timestamp.
If you use
\D*(2[0-3]:[0-5][0-9]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9]:[0-5][0-9])\D*

(note that (?:...) non-capturing groups only hamper the regex engine, the patterns inside will still match, consume characters), you won't get overlapping matches (if there is a timestamp right after the timestapmp). However, this is a rare scenario I believe, so you still can use your regex and grab the value inside capture group 1.
Also, see my answer on How Negative Lookahead Works. A negative lookbehind works similarly, but with the text before the matching (consuming) pattern.
A JS solution is to use capturing groups:

var re = /(?:^|\D)(2[0-3]:[0-5][0-9]:[0-5][0-9]|[0-1][0-9]:[0-5][0-9]:[0-5][0-9])(?=\D|$)/g;
var text = "Some23:56:43text here Some13:26:45text there and here is a date 10/30/89T11:19:00am";
while ((m=re.exec(text)) !== null) {
  document.body.innerHTML += m[1] + "<br/>";
}


text:
Q: How can I reuse a piece of HTML as a component and pass it to multiple components? I want to ask for a way to create a component, and from that Component, I can use it as a child component for multiple other Components to use.
In my case:
I have set up a route like this in App.js, it's very simple
        <Routes>
            <Route exact path="/" element={<Newest />} />
            <Route path="/movies" element={<Movies />} />
            <Route path="/tv" element={<TvShows />} />
            <Route path="/series" element={<Series />} />
            <Route path="/cartoons" element={<Cartoons />} />
        </Routes>

From then , I create 5 other components: Newest, Movies, TvShows, Series, Cartoon
As I see from my code, there's a piece of JSX that I've always used, for example
This is my Newest component:
import { useState, useEffect } from "react"
import axios from "axios"
import { SITE_API } from "../../constants/constants"

function Newest() {
    const [newestData, setNewestData] = useState([])
    const newestUrl = `${SITE_API}/update-film`

    useEffect(() => {
        const CancelToken = axios.CancelToken
        const source = CancelToken.source()

        axios
            .get(newestUrl, { cancelToken: source.token })
            .then((data) => {
                setNewestData(data.data.data.items)
            })
            .catch((thrown) => {
                if (axios.isCancel(thrown)) return
            })
    }, [])

    return (
        <>

NEWEST

                {newestData.map((item, i) => {
                    return (

                            <img
                                src={`shorten-URL-that-I-use{item.thumb_url}`}
                                alt=""
                            />

{item.name}

                    )
                })}

        </>
    )
}

export default Newest

There's a whole "holder-item" section that I can reuse for 4 Components left.
I tried to create a component called ItemCard and paste that whole section inside of it, it's like this:
import React from "react"

function ItemCard({ newestData }) {
    console.log(newestData)

    return (
        <>
            {newestData.map((item, i) => {
                return (

                        <img
                            src={`shorten-URL-that-I-use${item.thumb_url}`}
                            alt=""
                        />

{item.name}

                )
            })}
        </>
    )
}

export default ItemCard

And from that, back to Newest component, I changed it to:
import { useState, useEffect } from "react"
import axios from "axios"
import { SITE_API } from "../../constants/constants"

import ItemCard from "../ItemCard"

function Newest() {
    const [newestData, setNewestData] = useState([])
    const newestUrl = `${SITE_API}/update-film`

    useEffect(() => {
        const CancelToken = axios.CancelToken
        const source = CancelToken.source()

        axios
            .get(newestUrl, { cancelToken: source.token })
            .then((data) => {
                setNewestData(data.data.data.items)
            })
            .catch((thrown) => {
                if (axios.isCancel(thrown)) return
            })
    }, [])

    return (
        <>

NEWEST

                <ItemCard newestData={newestData} />

        </>
    )
}

export default Newest

So, is there a way for me to use the ItemCard component for 4 other components left? Because I think I need to pass 4 other props to ItemCard, but if so, how can I use it for each route, it's my first time trying this method, so please instruct me, I don't know what's this situation call to google it myself, thanks.

A: You can use it like you've already used it here, but you will either have to pass "newestData" as a prop, assuming it has a children/parent relationship. If it doesn't, you can use a common library called redux, with which you can set a global state of the newestData and use it anywhere in your code. If you do not want to use another library, you can accomplish the same using the built in react hook useContext.


text:
Q: i am getting an error while installing pycrypto in windos 10 in visual studio code I got this error while installing pycrypto in visual studio code. I tried previous answers it didn't work for me

    Building wheel for pycrypto (setup.py) ... error
    ERROR: Command errored out with exit status 1:
    command: 'c:\users\uaahacker\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"'; __file__='"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\uaahacker\AppData\Local\Temp\pip-wheel-gjdeek8y'
        cwd: C:\Users\uaahacker\AppData\Local\Temp\pip-install-703l_7f_\pycrypto_4e1a5a16405a462790fc020871778555\
    Complete output (153 lines):
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\Crypto
    copying lib\Crypto\pct_warnings.py -> build\lib.win32-3.8\Crypto
    copying lib\Crypto\__init__.py -> build\lib.win32-3.8\Crypto
    creating build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\hashalgo.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\HMAC.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD2.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD4.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD5.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA224.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA256.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA384.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA512.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\__init__.py -> build\lib.win32-3.8\Crypto\Hash
    creating build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\AES.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC2.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC4.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\CAST.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\DES.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\DES3.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\XOR.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\__init__.py -> build\lib.win32-3.8\Crypto\Cipher
    creating build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\asn1.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\Counter.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\number.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\py3compat.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\randpool.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\RFC1751.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\winrandom.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\_number_new.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\__init__.py -> build\lib.win32-3.8\Crypto\Util
    creating build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\random.py -> build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\__init__.py -> build\lib.win32-3.8\Crypto\Random
    creating build\lib.win32-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
creating build\lib.win32-3.8\Crypto\Random\OSRNG
copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    creating build\lib.win32-3.8\Crypto\SelfTest
    copying lib\Crypto\SelfTest\st_common.py -> build\lib.win32-3.8\Crypto\SelfTest
    copying lib\Crypto\SelfTest\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest
    creating build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    creating build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    creating build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    creating build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    creating build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    creating build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    creating build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    creating build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    creating build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    creating build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\KDF.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\__init__.py -> build\lib.win32-3.8\Crypto\Protocol
    creating build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\DSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\RSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\__init__.py -> build\lib.win32-3.8\Crypto\PublicKey
    creating build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\__init__.py -> build\lib.win32-3.8\Crypto\Signature
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_ext
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Random.OSRNG.winrandom' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
    ERROR: Failed building wheel for pycrypto
    Running setup.py clean for pycrypto
Failed to build pycrypto
Installing collected packages: pycrypto
    Running setup.py install for pycrypto ... error
    ERROR: Command errored out with exit status 1:
        command: 'c:\users\uaahacker\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"'; __file__='"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\uaahacker\AppData\Local\Temp\pip-record-9k1tmf02\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\uaahacker\appdata\local\programs\python\python38-32\Include\pycrypto'
            cwd: C:\Users\uaahacker\AppData\Local\Temp\pip-install-703l_7f_\pycrypto_4e1a5a16405a462790fc020871778555\
    Complete output (153 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\Crypto
    copying lib\Crypto\pct_warnings.py -> build\lib.win32-3.8\Crypto
    copying lib\Crypto\__init__.py -> build\lib.win32-3.8\Crypto
    creating build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\hashalgo.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\HMAC.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD2.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD4.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\MD5.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\RIPEMD.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA224.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA256.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA384.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\SHA512.py -> build\lib.win32-3.8\Crypto\Hash
    copying lib\Crypto\Hash\__init__.py -> build\lib.win32-3.8\Crypto\Hash
    creating build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\AES.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC2.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\ARC4.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\blockalgo.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\Blowfish.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\CAST.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\DES.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\DES3.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_OAEP.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\PKCS1_v1_5.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\XOR.py -> build\lib.win32-3.8\Crypto\Cipher
    copying lib\Crypto\Cipher\__init__.py -> build\lib.win32-3.8\Crypto\Cipher
    creating build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\asn1.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\Counter.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\number.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\py3compat.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\randpool.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\RFC1751.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\winrandom.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\_number_new.py -> build\lib.win32-3.8\Crypto\Util
    copying lib\Crypto\Util\__init__.py -> build\lib.win32-3.8\Crypto\Util
    creating build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\random.py -> build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\_UserFriendlyRNG.py -> build\lib.win32-3.8\Crypto\Random
    copying lib\Crypto\Random\__init__.py -> build\lib.win32-3.8\Crypto\Random
    creating build\lib.win32-3.8\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\FortunaAccumulator.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\FortunaGenerator.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\SHAd256.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
    copying lib\Crypto\Random\Fortuna\__init__.py -> build\lib.win32-3.8\Crypto\Random\Fortuna
    creating build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\fallback.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\nt.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\posix.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\rng_base.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    copying lib\Crypto\Random\OSRNG\__init__.py -> build\lib.win32-3.8\Crypto\Random\OSRNG
    creating build\lib.win32-3.8\Crypto\SelfTest
    copying lib\Crypto\SelfTest\st_common.py -> build\lib.win32-3.8\Crypto\SelfTest
    copying lib\Crypto\SelfTest\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest
    creating build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\common.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_AES.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC2.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_ARC4.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_Blowfish.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_CAST.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_DES3.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_15.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_pkcs1_oaep.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\test_XOR.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    copying lib\Crypto\SelfTest\Cipher\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Cipher
    creating build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\common.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_HMAC.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD2.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD4.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_MD5.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_RIPEMD.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA224.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA256.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA384.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\test_SHA512.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    copying lib\Crypto\SelfTest\Hash\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Hash
    creating build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_AllOrNothing.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_chaffing.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_KDF.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\test_rfc1751.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    copying lib\Crypto\SelfTest\Protocol\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Protocol
    creating build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_DSA.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_ElGamal.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_importKey.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\test_RSA.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    copying lib\Crypto\SelfTest\PublicKey\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\PublicKey
    creating build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_random.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test_rpoolcompat.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\test__UserFriendlyRNG.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    copying lib\Crypto\SelfTest\Random\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random
    creating build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaAccumulator.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_FortunaGenerator.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\test_SHAd256.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    copying lib\Crypto\SelfTest\Random\Fortuna\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\Fortuna
    creating build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_fallback.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_generic.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_nt.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_posix.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\test_winrandom.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    copying lib\Crypto\SelfTest\Random\OSRNG\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Random\OSRNG
    creating build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_asn1.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_Counter.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_number.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\test_winrandom.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    copying lib\Crypto\SelfTest\Util\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Util
    creating build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_15.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\test_pkcs1_pss.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    copying lib\Crypto\SelfTest\Signature\__init__.py -> build\lib.win32-3.8\Crypto\SelfTest\Signature
    creating build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\AllOrNothing.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\Chaffing.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\KDF.py -> build\lib.win32-3.8\Crypto\Protocol
    copying lib\Crypto\Protocol\__init__.py -> build\lib.win32-3.8\Crypto\Protocol
    creating build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\DSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\ElGamal.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\pubkey.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\RSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_DSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_RSA.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\_slowmath.py -> build\lib.win32-3.8\Crypto\PublicKey
    copying lib\Crypto\PublicKey\__init__.py -> build\lib.win32-3.8\Crypto\PublicKey
    creating build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_PSS.py -> build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\PKCS1_v1_5.py -> build\lib.win32-3.8\Crypto\Signature
    copying lib\Crypto\Signature\__init__.py -> build\lib.win32-3.8\Crypto\Signature
    Skipping optional fixer: buffer
    Skipping optional fixer: idioms
    Skipping optional fixer: set_literal
    Skipping optional fixer: ws_comma
    running build_ext
    warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
    building 'Crypto.Random.OSRNG.winrandom' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\uaahacker\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"'; __file__='"'"'C:\\Users\\uaahacker\\AppData\\Local\\Temp\\pip-install-703l_7f_\\pycrypto_4e1a5a16405a462790fc020871778555\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\uaahacker\AppData\Local\Temp\pip-record-9k1tmf02\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\uaahacker\appdata\local\programs\python\python38-32\Include\pycrypto' Check the logs for full command output.

A: Try in a admin shell (on windows cmd):
pip install pycrypto

And also what did you try already?

A: I have the same problem and pip requires Microsoft Visual C++ 14.0 or greater.
But if you are using anaconda framework, I strongly recommend if you are using Windows OS, "conda" command installs it.
Open CMD with admin privileges.
conda install pycrypto


text:
Q: Theme color meta tags not working with specific color A single color, old lace, is not working for me as a theme-color in the meta tag in Chrome Android.
Other colors work well. I tried providing the hex triplet instead and still nothing.
<html>
<head>
    ....
    <meta name="theme-color" content="oldlace"> <!-- content="#fdf5e6" doesn't work either -->
    ....
</head>
<body>
    ....
</body>
</html>

It just appears as the default white instead of the wanted color.

A: Here is a description from WHATWG

When using the theme color in UI, user agents may adjust it in implementation-specific ways to make it more suitable for the UI in question.

Color #fdf5e6 is a QUESTION here, because its too light to have a enough contrast.
Same problem with color #f5f5f5f and any other light colors.