mysql – c # – List of values ​​defined by PropertyInfo

PropertyInfo set value List

display the error in the conversion list

I tried to convert to json and I could not

public class PurchaseBill
{
    public DateTime Date { get; set; }
    public string Type { get; set; }
    public string BillType { get; set; }
    public List Listproduct { get; set; }
}
public class PurchaseProduct
{
    public Int64 id { get; set; }
    public String itemId { get; set; }
    public String image { get; set; }

}

code convert MySqlDataReader to the list

public static List DataReaderMapToList(MySqlDataReader dr)
{
    List list = new List();
    T obj = default(T);
    while (dr.Read())
    {
        obj = Activator.CreateInstance();


        foreach (PropertyInfo prop in obj.GetType().GetProperties())
        {
            if (!object.Equals(dr(prop.Name), DBNull.Value))
            {
                if (prop.PropertyType.Name == "List`1")
                {
                    var getval = Convert.ChangeType(dr(prop.Name), typeof(string)).ToString();

                    var objectType = prop.PropertyType.GetGenericArguments().First();

                    var Object = Activator.CreateInstance(objectType);
                    var company = JsonConvert.DeserializeObject>(getval);

                    // error in next line 'can`t convert to list`1 '
                    prop.SetValue(obj, Convert.ChangeType(dr(prop.Name), prop.PropertyType), null);
                }
                else
                {
                    prop.SetValue(obj, Convert.ChangeType(dr(prop.Name), prop.PropertyType), null);
                }
            }
        }
       list.Add(obj);

    }
    return list;
}

mysql MySqlCommand cmd = new MySqlCommand(query, connection); //Create a data reader and Execute the command MySqlDataReader dataReader = cmd.ExecuteReader(); //Read the data and store them in the list list = DataReaderMapToList(dataReader);

show error debug An exception of type System.InvalidCastException & # 39; it was produced in mscorlib.dll but was not handled in the user code. Additional Information: Invalid casting of "System.String" at & # 39; System.Collections.Generic.List`1 ((test. Purchase_Management + PurchaseProduct, App, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null)) & # 39 ;.

please i want solution see the error in the conversion list

8 – All entities are defined in English

You probably want to write this as update hook, something like that should work:

function MY_MODULE_update_N() {
  foreach (Drupal::entityTypeManager()->getDefinitions() as $entityType) {
    $entities = Drupal::entityTypeManager()->getStorage($entityType)->loadMultiple();
    foreach ($entities as $entity) {
      if ($entity->langcode->value != 'en') {
        $entity->set('langcode', 'en');
        $entity->save();
      }
    }
  }
}

This traverses all entity types and loads all entities for the given entity type, and then updates the language if it is not set to English.

You may want to create a batch process if you have multiple entities to update.

For more information on how to do this, look here.

tracking – Should the user be defined in each Google Analytics session?

When you use the User ID feature in Google Analytics, the userId must each session be configured to link the sessions to the same user?

I see that there is a session unification option that connects the page views from before userId is defined on the same session, but could not find documentation that indicates if multiple sessions are unified for the same user without configuration userId at each session.

For example, a new user browses the site, then submits a form, after which a unique identifier is generated and userId is set.

The next day, the same user returns to the site without performing any action to uniquely identify it.

Will this second session be linked to the same user when creating a user report in Google Analytics?

c ++ – How to use a class defined in another file using the current file

I have a problem when I want to use a class defined in another file that uses the current file, where I want to use the class from the other file.
It's very ambiguous, so here's a code that will explain better:

a.cpp

#include "b.hpp"

int main()
{
    E e;
}

a.hpp

#pragma once
#include "b.hpp"

struct C
{

};

class E
{
    D d;
};

b.hpp

#pragma once
#include "a.hpp"

class D
{
    C c;
};

I wish I could create the object D in class E but I have the error:

error: 'D' does not name a type

Is there a way to do this or it is impossible?

perl / sed / awk: replaces the string template defined on multiple lines

consider this file:

cat > example_file.txt <",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)",
"",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)",
"",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)",
"",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)",
"",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)",
"",
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.462400 UTC(1567684114.4624)",
"",
"PERMISSION(3)":"756",
EOL

I want to transform these lines into:

"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.106600 UTC(1567684114.1066)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.410300 UTC(1567684114.4103)"}
"PERMISSION(3)":"756",
"ENUM.SRC.ID(4)":"756",
"ACTIVITY.DATETIME(16)":"2019-09-05 11:48:34.462400 UTC(1567684114.4624)"}
"PERMISSION(3)":"756",

You know, the equivalent of ctrl-H-ing: ,n""," with: }.
So I try:

perl -0pe 's/,n"",/}/' example_file.txt

but that does not matter.

Mg.metric geometry – Calculating the position of overlapping ovals to create an air gap of defined size

I'm trying to solve a problem of positioning five ovals in a grid so that four of them overlap, so that the fifth in the center is exposed with some margin.

I quickly drew the diagram below to illustrate what I'm trying to do. Each oval is 10 meters (or miles, depending on your preference). The center is fixed at its position. I'm trying to figure out how to calculate the position of four others so as to expose 1 m from the center of the oval. The grid is latitude and longitude.

Any help is very appreciated because it's been a long time since I've had to work with this type of calculation, and I can honestly say that I'm completely lost: /

enter the description of the image here

google – ** Purchase Manual / Not Defined (Source / Support) **

I have detected this source of traffic in my Google Analytics reports and I can not identify its origin. Manual / undefined purchase (source / support)
The website I'm talking about is made with Prestashop 1.6.1.15 and the client said he did not enter manual orders. It's a fashion ecommerce.
This traffic has a large number of transaction orders but only a few sessions. Example: 2 sessions have 30 transaction orders … so weird!

Does anyone have this situation before? I've tried to see if there was a correlation between conversions from this source, but there are different ways of payment, locations, devices, quantity, products … nothing that can help.

Thank you very much in advance!

magento2 – Magento 2 TypeError: options are not defined in firefox

After working for a few days, I noticed that this problem was in Firefox and not in Chrome.

TypeError: options are undefined

If I hide well and check in Firefox it works for the first time, for the next update to deal with this problem

Someone help with that.

enter the description of the image here

enter the description of the image here

sharepoint online – How to solve javascript: SPClientPeoplePicker is not defined in Edge (works fine in Chrome and IE)?

I just noticed that a javascript function for searching and populating people selection controls in SharePoint was not working in Edge, whereas it worked perfectly in Chrome and IE.

In Edge, an error related to the code below appears in the console log: "SPClientPeoplePicker" is not set.

    var controlName = "External";
    var ppDiv = $("(id$='ClientPeoplePicker')(title='" + controlName + "')");
    var ppEditor = ppDiv.find("(title='" + controlName + "')");
    var spPP = SPClientPeoplePicker.SPClientPeoplePickerDict(ppDiv(0).id);

    ppEditor.val(cuser);
    spPP.AddUnresolvedUserFromEditor(true);

Has anyone met this? If yes, solutions?

Number Theory – Are these two sets of integers defined by the combination disjoint?

Fix an integer $ n geq $ 8. For each integer $ i leq n / 2 $, note by $ X_i $ l & # 39; together
$$ X_i = left { frac {n-i + 1-k} {n-i + 1} binom nk binom {k-1} {i-1} ~ middle | ~~ i leq k leq ni right }. $$

The question:

Are the sets $ X_1 $ and $ X_2 $ disjoint?

The reason:

The product $ frac {n-i + 1-k} {n-i + 1} binom nk binom {k-1} {i-1} $ is the degree in the symmetric group $ S_n $ the irreducible character that corresponds to the partition $ (n-k, i, 1 ^ {k-i}) $ (this last entry means the cell $ 1 $ say again $ k-i $ times), and a guess I'm working on is moving forward substantially if I get the full range of values ​​from $ X_1 cup X_2 $ without having to worry about whether or not I have repetition by pulling something out $ X_1 $ then something $ X_2 $.

The bonus question:

What I really want to be true, is that $ X_1 $, $ X_2 $, and $ X_3 $ are disjoint in pairs, so proof that covers the 3 pairs simultaneously would be the golden rule, but I would not be surprised at all if $ X_i, X_j $ pair had something special that required individualized effort. For example, a reason $ n geq $ 8 is necessary is that sets $ X_2 $ and $ X_3 $ have corresponding partitions $ (5.2) $ and $ (4.3) $ of $ n = $ 7 both of which give the integer $ 14; they are not disjointed.

Potentially relevant information:

I gladly note that in this indexing, both $ X_1 $ and $ X_2 $ have an internal redundancy, that is, if we consider them as multisets, there would be several appearances of some integers. I only talk about enter sets, not in a given set.

My work:

The computer goes up in the $ n = $ 3000 range say that they are disjointed at least as far.