text:
Q: Using Jackson XmlMapper to serialize to an XML DOM I know it's possible to serialize directly to a String using XmlMapper.writeValueAsString(), but I would like to serialize a DOM tree.  Either a new Document or, preferably, serialize directly to an existing DOM Node.  Can this be done with Jackson?

A: I think I found the solution by using an XMLStreamWriter.
Try the following snippet:
XMLOutputFactory factory = XMLOutputFactory.newInstance();
factory.createXMLStreamWriter(new DOMResult(yourNode));

XmlMapper mapper = new XmlMapper();
ToXmlGenerator xmlGenerator = mapper .getFactory().createGenerator(sw);
mapper.writerFor(YourClass.class).writeValue(xmlGenerator, yourInstance);


text:
Q: Averaging list of lists python numpy I have to find mean of each list in a list of lists.
I am using numpy.
I tried
numpy.mean(a, axis=1)

It works fine when all lists are equal in length.
In my case each list may be of different length. It is giving
IndexError: `tuple index out of range`

Code to reproduce
import numpy
data = numpy.array([[1,2,3], [4,6]])
print(numpy.mean(data, axis=1))

Desired output
[ 2.  5.]

A: This code snippet could work:
data_mean = [numpy.mean(lst, axis=0) for lst in data]

A: Will this work for you?
numpy.mean([numpy.mean(list, axis=1) for list in lists], axis=1)

A: You could loop in the lists:
import numpy

data = numpy.array([[1, 2, 3], [4, 6]])
means = []
for row in data:
    means.append(numpy.mean(row))

print(means)

redpajama_set_name: RedPajamaStackExchange


text:
Q: Double Paging - What does the root/outer page table contain? I've read three different OS reference books (Stallings, Tanenbaum and Silberschatz) but none of them, from what I've understood, clearly indicates the content type of the outer page in a double paging scheme. In general, the outer page table makes us "find" the inner page table. But does it contain a raw physical address or something else ?
I'm currently following a OS university course, and for an exercise I have to calculate the size (bytes) of an outer page table of 16 elements, the only way I see for an outer page table to make us find an inner page table is to give us a physical address (in this case a physical address is 12 bits long), so I deduct a outer page table is 16*(12+1) bits long (+1 is for validity bit), but the correction states the size is actually 16*(4+1) because the outer page return the number of the page table (I frankly don't know how the number of the page would allow us to retrieve it in any way and I couldn't get a meaningful explanation).

A: I got an answer from a university Professor : There is several ways to do it, in my exercise it was proposed that the outer page table would be an "array of array", it's simple to implement but unrealistic as an array of array can be too big to be stored effectively. So a more realistic way to do this is by storing physical address pointers to the inner page tables. As the OS can't predict where these addresses will be stored beforehand, it has to use the system reserved memory that will be fixed in advance (the "low memory", I don't know the correct terminology in English for this), and thus it will be able to use raw physical addresses.


text:
Q: Common Table Expression - how to use result in PostGIS Function I want to use the result (foo) of a CTE as a function parameter (foo.geom) in a PostGIS funtion (ST_DWithin()).
WITH foo AS (
    SELECT geom FROM bar WHERE name = 'cat'
) SELECT name FROM whatever
    WHERE ST_DWithin(
            geom,
            foo.geom,
            10
    );

I get

Missing entry in FROM for table foo

And it highlights foo.geom.
Why is that? How would I use the result of
SELECT geom FROM bar WHERE name = 'cat'

in the query
SELECT name FROM whatever
    WHERE ST_DWithin(
            geom,
            POINT(lng lat),
            10
    );

?

A: You'll need to join foo in your main select statement's from clause in order for it's columns to be visible in the where clause.
It looks like you're expecting a single row in the foo CTE, so I expect you'd use a cross or lateral join.
WITH foo AS (
    SELECT geom FROM bar WHERE name = 'cat'
)
SELECT name
FROM whatever
     cross join foo
WHERE ST_DWithin(
            geom,
            foo.geom,
            10
    );

A: Your foo CTE was not referenced in the main query. My guess is you want to join with it.

WITH foo AS (
    SELECT geom FROM bar WHERE name = 'cat'
)
SELECT we.name
FROM whatever we
JOIN foo ON (ST_DWithin( we.geom, foo.geom, 10))
        ;


text:
Q: LINQ - Return Value From Field With A Max Value if No Rows Found I have a table like this...
ID   Description  LowThreshold   HighThreshold
1    BAD          0.0            .69
2    MEETS        .70            .89
3    GOOD         .90            2

The object here is to write a LINQ query that will select the right Description based on a given decimal. For instance .75 is between .70 and .89, so it would return "MEETS". BUT, the kicker is, if the Number is higher than all the ranges, automatically return the Description for the record with the highest HighThreshold. So, if I pass in 5, I should get "GOOD" returned.
I have this so far, but it errors out with scores higher than 2, obviously:
private string GetEvaluationDescription (decimal score)
{
      string evaluationText = myContext.PerformanceRanges.Where
                        (e =>
                              e.LowThreshold <= score
                              &&
                              e.HighThreshold >= score
                        )
                        .Select(eval => eval.Description).First().ToString();
}

I'd like to accomplish this with just this one query, but my imagination isn't getting me there. I attempted what I found in this post but couldn't get it to work

A: What about this:
var range = myContext.PerformanceRanges
            .SingleOrDefault(e=>e.LowThreshold <= score && e.HighThreshold >= score)??
            PerformanceRanges.Single(
                                      e=>e.HighThreshold == PerformanceRanges
                                                            .Max(p=> p.HighThreshold)
                                    );

string evaluationText = range.Description;

The range query will select the element that matches with the Thereshold ranges, and if the value is greater (the first query will return null), it will select the greatest range.

A: What about this:
  string evaluationText = myContext.PerformanceRanges.Where
                    (e =>
                          (e.LowThreshold <= score
                          &&
                          e.HighThreshold >= score) ||
                         (e.HighThreshold ==
                            myContext.PerformanceRanges.Max (
                                  x => x.HighThreshold)
                            && score > e.HighThreshold )
                    )
                    .Select(eval => eval.Description).First().ToString();


text:
Q: Use of "unlike" while comparing two things, followed by a comma and "in something else" I am wondering, which one is correct:

Unlike in something, in something else it is easy to...
Unlike something, in something else it is easy to...

My instinct tells me both versions could be correct, but I just want to be sure. Plus, I guess the preposition does not matter here, it could be "on", "at" and so on. Does conjunction matter though? E.g. could we replace Unlike with While or any other conjunction used for comparison?
Also, does it matter if we add anything after the phrase?

Unlike in something, where this acts this way, in something else it is easy to...
Unlike something, where this acts this way, in something else it is easy to...

In here, since the parentheses might be pretty long, seems for me it is proper to remind the reader that we are comparing some items. Am i right?

A: Use unlike x when you compare something directly to x.

Unlike rats, bats have wings.

This means bats are different from rats because bats have wings. Rats and bats are compared directly.
Use unlike in x when x forms the context of your discussion, and you compare something with an aspect of x.

Unlike in running, you need to time your breathing carefully when swimming.

This means breathing while running and breathing while swimming are managed differently; it does not compare swimming with running directly.

A: The "unlike" is of no relevance here; what matters is the clause that the something is the object of. For example:

Unlike with biscuits, which get soft as time goes on, in the cake world you will find that hardness indicates something has been sitting around for a long time.

So your example "Unlike something, where this acts this way" is incorrect, as "something where this" doesn't work. It either needs to be "somewhere where this" or "in something where this".


text:
Q: Any way to convert Realm database file in to sqlite? I have realm database (.realm) from an existing application, which has more than 400k records.
I dug my head in to this for more than 3-4 hours, but I couldn't find any fruitful results towards converting a .realm file in to a sqlite file.

A: Any data conversion so far has been done manually. People have converted from Core Data to Realm by grabbing the objects from Core Data and then saving them to a Realm.
I imagine your best bet will be similar here. Grab each object from the Realm and then convert it to the tables/rows/and columns in sqlite. Then you can take that file anywhere.

A: You can open the realm file in Realm Browser & there you have the option to convert the file in to CSV ( File => Export => CSV ). Then you can import that CSV file to mysql database.
If you want sqlite more specifically, You can import tables separately to your sqlite db through SQLiteBrowser . Create or open your database file and select the specific table you want , then you can import table from CSV.

A: I'm not at home with this, but I found this link hopefully it can help.


text:
Q: Is there any way to completely remove the focus border of a wxTextCtrl object on OSX? I am building a project in OSX (Yosemite) with wxWidgets 3.0.2.
I can remove a blue border around the wxTextCtrl window by using wxBORDER_NONE. But when I put it in a sizer, it has a 3 pixel grey border that I just can't get rid of. What's the point of having 2 borders, one of which cannot be removed? Surely people want to customise more than that?
Is there any possible way to remove it? I don't really want to hack at the wx source, but I will if I have to.
Or is there another way of controlling layout without using sizers, than might cause the border not to appear?

Update: It seems to be the focus highlight border. I don't want it.

Is there any way of disabling the border around the focused UI object? It's so frustrating because it is such a minor thing, but my program is useless if can't remove it.

A: In case someone else stumbles into this post, this answer is for the updated question:

Update: It seems to be the focus highlight border. I don't want it.
Is there any way of disabling the border around the focused UI object?

Using wxWidgets APIs, NO, there is no way to remove it, since it's a behavior of the native NSTextField class. I was only able to remove it by editing the wx source itself to set the focusRingType property of the underlying NSTextField object to NSFocusRingTypeNone:

File: core/textctrl.mm
Func: wxWidgetImpl::CreateTextControl
NSTextField* v = nil;
if ( style & wxTE_PASSWORD )
    v = [[wxNSSecureTextField alloc] initWithFrame:r];
else
    v = [[wxNSTextField alloc] initWithFrame:r];

...

// remove glow/border when textfield gets focused
[v setFocusRingType:NSFocusRingTypeNone];

I've also set BORDER_NONE on my wxTextCtrl.
Of course, this sort of changes the standard OS X look-and-feel, so maybe that's why this wasn't exposed as a wxTextCtrl API? Or it breaks something else? But so far it's working OK on my end. Plus, my app needs to have its own custom theme that doesn't go well with the glow border.
I'm using wxWidgets 3.1.0 (cloned from their repo) and OS X 10.12.

A: This worked for me -on Windows-:
First --> bind the EVT_SET_FOCUS to a styling method.
Second --> reset the fg and bg colours to your original design.
Python code:
button_1.Bind(wx.EVT_SET_FOCUS, focus_without_border)
def focus_without_border(evt=None):
    element = evt.GetEventObject()
    element.SetForegroundColour( wx.Colour( 241, 241, 241 ) )
    element.SetBackgroundColour( wx.Colour( 40, 41, 42 ) )


text:
Q: customize deserialization sample in C#? I am looking for a sample, which could let me deserialize an XML stream encoded in UTF-8 into a field of a class. More specifically, I have a class like,
class Foo
{
    string abc;
    byte[] bcd;
}

and abc maps to XML element "Abc" and bcd maps to XML element "Bcd", and I want to get the stream for bcd and retrieve bytes (from XML stream for related element "Bcd" directly) to manipulate manually/in a customized way.
I am looking for a sample, but failed, could anyone help to point me to a related sample or wrote some pseudo code?
Edit: the XML is SOAP reaponse from server, in the response there is one response XML element (element Bcd in my sample) which is encoded by UTF-8 from server side, but since Http Web Services will use base64 at client side, so each time I receive such "bytes" at client side and the automatically generated web services proxy will throw exception says invalid XML element in base64 encoding. So, I am thinking about how to overwrite the default using base64 encoding to decode the bytes, and this is why I ask this question. If there could be a way to accept stream or something similar represents the on-wire bytes of the related response elements (Bcd in my sample) and let me manipulate, it will be so great!
thanks in advance,
George

A: IXmlSerializable is one option (but not much fun), but it feels like in this case properties offer most of what is wanted without extra work:
[Serializable]
public class Foo
{
    public string Abc {get;set;}
    private byte[] bcd;
    public byte[] Bcd {
        get {return bcd;}
        set {/* your code (with `value`) here */ }
    }
}

Re the wire format (base64 etc); have you tried just running it through xsd.exe? It might surprise you and get it right... but yes; within IXmlSerializable you will have your choice of ReadContentAsBase64, ReadContentAsBinHex, etc. But it is very ugly; something like (for a simple version):
[Serializable]
public class Foo : IXmlSerializable
{
    public Foo() { }
    public Foo(string abc, byte[] bcd)
    {
        Abc = abc;
        Bcd = bcd;
    }
    public string Abc { get; private set; }
    public byte[] Bcd { get; private set; }

    XmlSchema IXmlSerializable.GetSchema()
    {
        return null;
    }

    void IXmlSerializable.WriteXml(System.Xml.XmlWriter writer)
    {
        if (Abc != null)
        {
            writer.WriteElementString("Abc", Abc);
        }
        if (Bcd != null)
        {
            writer.WriteStartElement("Bcd");
            writer.WriteBase64(Bcd, 0, Bcd.Length);
            writer.WriteEndElement();
        }
    }
    void IXmlSerializable.ReadXml(System.Xml.XmlReader reader)
    {
        reader.ReadStartElement();
        reader.ReadStartElement("Abc");
        Abc = reader.ReadString();
        reader.ReadEndElement();
        reader.ReadStartElement("Bcd");
        MemoryStream ms = null;
        byte[] buffer = new byte[256];
        int bytesRead;
        while ((bytesRead = reader.ReadContentAsBase64(
            buffer, 0, buffer.Length)) > 0)
        {
            if (ms == null) ms = new MemoryStream(bytesRead);
            ms.Write(buffer, 0, bytesRead);
        }
        if (ms != null) Bcd = ms.ToArray();
        reader.ReadEndElement();
    }
}


text:
Q: Identical Android apps with different package names I have two Android apps that are identical except for the package name. This question has been asked before, and the recommendation was to refactor the package name as required, but I do not regard this as satisfactory. To my mind putting all the code in a source library would be preferable, but is there a better solution?

A: Putting the shared code in a Library Project is the recommended approach. See http://developer.android.com/guide/developing/projects/projects-eclipse.html#SettingUpLibraryProject

A: I take it the question is "How to I build both apps without duplication?"  An easy answer: have your build system perform the duplication and package alteration for you.  And one way to accomplish this even if you're used to letting Eclipse or ant handle everything in ways opaque to you:

*

*make a temporary copy of your entire repository, with the original building only one of your apps.

*make all the changes to the copy that will cause it to build your second app.

*create a single .patch that expresses these changes.

*have your build system perform step #1, apply the patch from step #3, and then reinvoke itself in the copy.  "have your build system" means, write a script, add a target to a makefile (even if you normally avoid makefiles), add a target to ant, extend Eclipse, whatever.


text:
Q: Change default width of gnome-terminal and terminator windows Only a short question but is it possible to set the default width (and height) of terminal sessions in gnome-terminal and terminator?
I find I always resize the window once it pops up so and given how much I use terminator it makes sense (IMO) to alter the default and save myself some time later on.

A: Terminator does allow you setting up a default size. :)
Just open the file ~/.config/terminator/config with your favorite editor.
You should have a section titled [layouts]. You only need to add a line within the sub-section named [[[window0]]] belonging to the [[default]] section. My configuration file, for instance, looks like this:
[global_config]
  enabled_plugins = CustomCommandsMenu, InactivityWatch, ActivityWatch, TerminalShot, LaunchpadCodeURLHandler, LaunchpadBugURLHandler
[keybindings]
[profiles]
  [[default]]
    scrollbar_position = hidden
    visible_bell = True
    scrollback_lines = 1000000
    foreground_color = "#ffffff"
    copy_on_selection = True
    background_color = "#300a24"
[layouts]
  [[default]]
    [[[child1]]]
      type = Terminal
      parent = window0
      profile = default
    [[[window0]]]
      type = Window
      parent = ""
      profile = None
      size = 900, 600
[plugins]

The relevant part is only the line starting with "size", of course.

A: I don't know about terminator, but in gnome-terminal there's an option under the profile settings to set the starting dimensions to any number of rows and columns you want, specifically Edit->Profile Preferences.

A: Hey. Assuming that you're calling up terminal from a panel menu or launcher icon, you can just change the instructions in that launcher to included desired geometry.
For example, I have a launcher for gnome-terminal on my gnome-panel which opens up to 80x40. Right click -> properties: command - set to "gnome-terminal (or terminator, whatever) --geometry=80x40"
Useful?

A: In terminator the GUI option for size is not there.
A simple way to set up this is --
First open terminator and set the window size according to your need and comfort.
Right click and go to preference and then to layout.
Click on the terminal name  under window and then save the layout.
Thats it, It will open the terminator in the same size, as you have set up, next time you open it.

A: try this for gnome-terminal:
go to edit >> profile preferences
look down:
default size: 80 (you want to increase this)
colums: 24: (you want to increase this too!)
sorry if that are not the "right labels", i'm using ubuntu in spanish

A: Example: gnome-terminal --geometry=80x40+100+200
To make it always keep that setting:
sudo -H gedit /usr/share/vte/termcap/xterm

Locate something simliar to:
:co#80:it#8:li#24:\

co is column number and li is row number. Adjust as you like.
Thanks to https://superuser.com/questions/226167/open-terminal-on-start-in-a-specific-place-and-size

A: This has disappeared in the latest version of gnome-terminal, 2.30.2-0ubuntu1. My installation of 10.04 LTS picked up the new gnome-terminal package yesterday, and it no longer obeys the geometry settings in the profile.
The fields for setting the default size have disappeared from the options dialog. The option remains set in gconf, however (at /apps/gnome-terminal/profiles/Default/default_size_columns and default_size_rows).
There's a bug report here:
https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/647156

A: Accepted answer shows how to launch terminus in a specific size.
If you want to launch it fullscreen or maximized the following option is simpler.
[global_config]
  window_state = maximise
  window_state = fullscreen


text:
Q: SQL statement error Incorrect syntax near the keyword 'WHERE' I am getting this error when I call the AND SQL statement:

Incorrect syntax near the keyword 'WHERE'

What am I doing wrong?
public static dsCustomer RetrieveMultipleCustomers(int CustID = 0, string CustLast = null, string CustPhone = null, string CustEmail = null)
{
    dsCustomer DS;
    OleDbConnection connection = Connection();
    OleDbDataAdapter sqlDA;
    bool blnSubSelect = false;
    string strSubSelect = "Select * from Customer";
    if (CustID != 0)
    {
        strSubSelect = strSubSelect + " where CustID = " + CustID;
        blnSubSelect = true;
    }
    else
    {
        if (CustLast != null)
        {
            strSubSelect = strSubSelect + " where CustLast ='" + CustLast + "'";
            blnSubSelect = true;
        }
        if (CustPhone !=null && CustEmail==null && CustLast==null)
        {
            strSubSelect = strSubSelect + " where CustPhone ='" + CustPhone + "'";
        }

        if (CustEmail != null && CustPhone == null && CustLast ==null)
        {
            strSubSelect = strSubSelect + " where CustEmail = '" + CustEmail + "'";
        }

        if (CustLast != null && CustPhone != null && CustEmail ==null)
        {
            strSubSelect = strSubSelect + " WHERE CustLast ='"+CustLast+"' AND CustPhone ='"+CustPhone+"'";
        }
    }
}

A: You can use "AND" to add these sql by this way:
    public static dsCustomer RetrieveMultipleCustomers(int CustID = 0, string CustLast = null, string CustPhone = null, string CustEmail = null)
    {
        dsCustomer DS;
        OleDbConnection connection = Connection();
        OleDbDataAdapter sqlDA;
        bool blnSubSelect = false;
        string strSubSelect = "Select * from Customer where 1=1 ";
        if (CustID != 0)
        {
            strSubSelect = strSubSelect + " AND CustID = " + CustID;
            blnSubSelect = true;
        }
        else
        {
            if (CustLast != null)
            {
                strSubSelect = strSubSelect + " AND CustLast ='" + CustLast + "'";
                blnSubSelect = true;
            }
            if (CustPhone != null && CustEmail == null && CustLast == null)
            {
                strSubSelect = strSubSelect + " AND CustPhone ='" + CustPhone + "'";
            }

            if (CustEmail != null && CustPhone == null && CustLast == null)
            {
                strSubSelect = strSubSelect + " AND CustEmail = '" + CustEmail + "'";
            }

            if (CustLast != null && CustPhone != null && CustEmail == null)
            {
                strSubSelect = strSubSelect + " AND CustLast ='" + CustLast + "' AND CustPhone ='" + CustPhone + "'";
            }

        }
    }


text:
Q: why does my code not work when I simply add "export" in front of my class? Typescript code:
export class GridObject {
  constructor() {
    alert("hello from GridObject constructor!");
  }
}

var go = new GridObject();

I'm calling the compiled js from my HTML. When I remove "export", the alert shows up, and it doesn't when I have "export".
The following is the entire compiled js when using export
"use strict";
exports.__esModule = true;
var GridObject = /** @class */ (function () {
  function GridObject() {
    alert("hello from GridObject constructor!");
  }
  return GridObject;
}());
exports.GridObject = GridObject;
var go = new GridObject();

removing export from the TS removes the following 3 lines from the JS
"use strict";
exports.__esModule = true;

exports.GridObject = GridObject;

My HTML calls this script like this:
<script src="GridObject.js"></script>

I tried adding type="module" but that didn't work either.


text:
Q: Calculating p-values from a tbl_merge object? I have been using the R function gtsummary, but have now run into a problem with variables existing in subsets of each other. I have two screening tests that can independently be positive of one another which has created an issue with using by = with tbl_summary. This lead me to create two separate tables and combine them with the tbl_merge function.
However, I would like to calculate p-values for differences between the tests. Is there any way to do this with an object in the table_merge format or to extract information from it and calculate the statistics I need?
Per request, I post a code example from the mtcars database.
Example code ------------------------------------------------------------
data(mtcars)

mtcars_tab <- mtcars %>%
  mutate(
    drat_4 = ifelse(drat >= 4, 1, 0),
    wtp_3 = ifelse(wt >= 3, 1, 0),
    testp = ifelse(drat_4 == 1 | wtp_3 == 1, 1, 0)) %>%
  select(testp,vs,am)

tab <-
  tbl_summary(mtcars_tab,
              missing = "no",
              by = testp
              ) %>%
  add_p

tab

Table 1
What I would like is the table to split into one column where drat_4 is positive and another column where wtp_3 is positive, but I'm having a hard time with this since they are overlapping. Additionally, I would then compare the variables for the positive cases of drat_4 and wtp_3 and add p-values to the table. Sorry if this is confusing. I'll try to clarify!
Would really appreciate your help with this!

A: I think the code example solves your problem. You'll need to supplement the code with a proper comparison of the two columns that takes into account that the two groups are not mutually exclusive.
library(gtsummary)
library(tidyverse)
packageVersion("gtsummary")
#> [1] '1.4.0.9004'

mtcars_tab <-
  mtcars %>%
  mutate(
    drat_4 = ifelse(drat >= 4, 1, 0),
    wtp_3 = ifelse(wt >= 3, 1, 0)
  ) %>%
  select(drat_4, wtp_3, cyl, mpg)

with(mtcars_tab, table(drat_4, wtp_3))
#>       wtp_3
#> drat_4  0  1
#>      0  6 19
#>      1  6  1

# table among drat_4 test positive
tbl1 <-
  mtcars_tab %>%
  filter(drat_4 == 1) %>%
  tbl_summary(
    missing = "no",
    type = mpg ~ "continuous",
    include = -c(drat_4, wtp_3)
  )

# table among wtp_3 test positive
tbl2 <-
  mtcars_tab %>%
  filter(wtp_3 == 1) %>%
  tbl_summary(
    missing = "no",
    type = mpg ~ "continuous",
    include = -c(drat_4, wtp_3)
  )

# create a table with the variable and the p.value
tbl_with_pvalue <-
  tibble(
    variable = c("cyl", "mpg"),
    row_type = "label",
    # you'll need to write a proper function here to get the p-values from an approrate test
    p.value = c(0.033, 0.044)
  )

tbl_final <-
  # merge the two tables
  tbl_merge(list(tbl1, tbl2)) %>%
  # add a pvalue comparing the two columns
  modify_table_body(
    ~.x %>%
      dplyr::left_join(
        tbl_with_pvalue,
         by = c("variable", "row_type")
      )
  ) %>%
  # add header for new pvalue column
  modify_header(p.value ~ "**p-value**") %>%
  # add a formatting function for p-value
  modify_fmt_fun(p.value ~ style_pvalue)

Created on 2021-05-06 by the reprex package (v2.0.0)


text:
Q: XML Document Validation Error targetNamespace parameter I have a schema with the following attributes:
<xs:schema id="FooFile"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://Foostandards.com"
    elementFormDefault="qualified"
    xmlns="http://Foostandards.com">

I have an XDocument constructor with the following attributes on the root tag (FooFile).
XDocument Foo2Xml = new XDocument(
    new XDeclaration("1.0", "utf-8", "yes"),
    new XComment("Foo2 file specifications implemented in xml"),
        new XElement("FooFile",
        new XAttribute(XNamespace.Xmlns + "xsi", "http://Foostandards.com"),
        new XAttribute(xsi + "schemaLocation", "http://Foostandards.com FooFile.xsd"), etc

I get the following error logged when I run the XDocument Validate method:

"The targetNamespace parameter '' should be the same value as the
  targetNamespace 'http://Foostandards.com' of the schema."

I have the targetNamespace parameter in the Schema and I can't find info that tells me that it even belongs in the XML document attributes (or how to code it).

A: I figured it out. The error had nothing to do with the schema or the XDocument parameters. It was the Add method to the SchemaSet object that had a null value for the targetNamespace parameter.
My code:
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add("", XmlReader.Create(new StringReader(xsd)));

Where xsd is a string representation of my schema. Note the "" as the first parameter of the Add method.
Code should have been:
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add("http://Foostandards.com", XmlReader.Create(new StringReader(xsd)));

A: While adding the XmlSchemaSet, we have to put the "targetNamespace" from the XSD file. Here is the below line of code.
XSD file:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:tns="XXX" elementFormDefault="qualified"
       targetNamespace="XXX" xmlns:xs="http://www.w3.org/2001/XMLSchema">

C# Code:
var schema = new XmlSchemaSet();
schema.Add("XXX", "XSD file path");

Where XXX : targetNamespace from XSD file

A: I ran into the same problem only after I added more than one XSD files into the XmlSchemaSet object.  It is strange that the VB console app seemed to work fine but in my ASP.NET app it threw an odd error stating the root element was not declared.  Some other forum threads suggested to add the targetNamespace and the associated xmlns attributes in the XSD file.  After adding those attributes to all my XSD files, I still ran into the same problem until I saw this forum describing exactly issue of having a "" in the first parameter when adding XSD into the XmlSchemaSet object.  By adding that parameter matching the targetNamespace in my XSD file, the exception was cleared.

A: Use null for the targetNamespace property — according to Add method documentation — the first parameter should be: The schema targetNamespace property, or null to use the targetNamespace specified in the schema.
So, the code from your answer could be written shortly this way:
XmlSchemaSet schemas = new XmlSchemaSet();
schemas.Add(null, XmlReader.Create(new StringReader(xsd)));


text:
Q: Questions about instance variables and declaring their properties If I declare instance variables and objects in my header between brackets with "IBOutlet" in front of them, do I have to set the objects properties?
Also does this mean they are private? What does it mean for them to BE private???

A: If you do @property and @synthesize you do not have to declare variables. The .h file is an api for a class so declaring anything inside it, has an intension to be public rather than private.
To declare IBOutlet private, you need to create a category,
@interface YourViewController ()

@property (nonatomic, retain) IBOutlet UILabel *label;

@end

Above code will be inside .m file.
Hope this will help

A: You just have to declare variables of an object as IBOutlets (assuming you are hooking them up using Interface Builder). They don't have to be properties unless you have a reason to make them a property (i.e. you want the variable to be accessible by other objects). A private property can't be accessed by an external object.

A: No,It is not necessary to set properties for IBOutlets, Just declaring them would be enough
for eg:
 IBOutlet UIbutton *btn;

If you want the variables to be private then you will have to declare it in this form
@interface myclass:NSObject
{
   @private
   int var1;
}

Instance variables declared as private in a class can be accessed only by an instance of the class.


text:
Q: Install Visual SourceSafe I'm in the process of getting Visual SourceSafe installed on a few Window 10 computers.  I have installed on a few machines successfully but a few of the computers I'm receiving the following error " A problem has been encountered while loading the setup components.  Cancelling setup." I have attached the logs below.  Any assistance would be greatly appreciated.
[05/24/19,13:34:11] Setup.exe:
[05/24/19,13:34:11] Setup.exe: ========== Logging started ==========
[05/24/19,13:34:11] Setup.exe: =====================================
[05/24/19,13:34:11] Setup.exe: GetGlobalCustomProperty({481CEF9F-033A-11D3-ACE2-00C04F8EEBA1})
[05/24/19,13:34:11] Setup.exe: GetGlobalCustomProperty(B51015E7-26A5-4c8f-B871-26ABA9BEFB65)
[05/24/19,13:34:11] Setup.exe: Command line parameters:
[05/24/19,13:34:11] Setup.exe: entering ISetupManager::RunIntro()
[05/24/19,13:34:11] Setup.exe: LoadSetupDatabase()
[05/24/19,13:34:11] Setup.exe: CSetupManager::LoadSetupDatabase() - set InstalledFrom property to \\sditapsn01\SDITAP89\Applications\Licensed Software\VisualSourceSafe2005
[05/24/19,13:34:11] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:11] Setup.exe: CSetupManager::LoadSuiteInfo() - we are in SP mode - no suiteinfo.dll is supported
[05/24/19,13:34:11] Setup.exe: Product Name:Microsoft Visual SourceSafe 2005 - English
[05/24/19,13:34:11] Setup.exe: ISetupManager::RunIntro() : LoadSuiteRequirements
[05/24/19,13:34:11] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:11] Setup.exe: ISetupManager::RunIntro() : CheckSuiteBlocks
[05/24/19,13:34:11] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:11] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:11] Setup.exe: ISetupManager::RunIntro() : LoadCommandLineMgr
[05/24/19,13:34:11] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:11] Setup.exe: ISetupManager::LoadCommandLineMgr() completed
[05/24/19,13:34:11] Setup.exe: ISetupManager::RunIntro() : LoadSetupLog
[05/24/19,13:34:11] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:11] Setup.exe: ISetupManager::LoadSetupLog() completed
[05/24/19,13:34:11] UTILS::RunNGENAction: Started
[05/24/19,13:34:11] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue pause"
[05/24/19,13:34:12] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:12] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue pause"
[05/24/19,13:34:12] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:12] Setup.exe: ISetupManager::RunIntro() : LoadManagers
[05/24/19,13:34:12] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:12] Setup.exe: inside ISetupManager::LoadUIManager()
[05/24/19,13:34:12] vs70uimgr: Entering InitializeModule() method.
[05/24/19,13:34:12] Setup.exe: CSetupManager::CopyTempFiles() - Installing setup files...
[05/24/19,13:34:12] Setup.exe: CSetupManager::InstallSetupFiles() starting
[05/24/19,13:34:12] Setup.exe: GetGlobalCustomProperty({39E467CB-8962-4AD8-99F9-864AFF183FD4})
[05/24/19,13:34:12] vs70uimgr: Entering ShowSmallProgress() method.
[05/24/19,13:34:13] Setup.exe: CSetupManager::CopyTempFiles() - Successfuly copied files to temp; rerunning Setup...
[05/24/19,13:34:14] Setup.exe: CSetupManager::CopyTempFiles() - Finished Rerunning Setup...
[05/24/19,13:34:14] Setup.exe: UnloadSuiteComponents()
[05/24/19,13:34:14] UTILS::RunNGENAction: Started
[05/24/19,13:34:14] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue continue"
[05/24/19,13:34:15] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:15] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue continue"
[05/24/19,13:34:15] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:15] Setup.exe: GetGlobalCustomProperty(AA4EEF91-FB37-4135-9B73-484B75DDAA42)
[05/24/19,13:34:25] Setup.exe:
[05/24/19,13:34:25] Setup.exe: ========== Logging started ==========
[05/24/19,13:34:25] Setup.exe: =====================================
[05/24/19,13:34:25] Setup.exe: GetGlobalCustomProperty({481CEF9F-033A-11D3-ACE2-00C04F8EEBA1})
[05/24/19,13:34:25] Setup.exe: GetGlobalCustomProperty(B51015E7-26A5-4c8f-B871-26ABA9BEFB65)
[05/24/19,13:34:25] Setup.exe: Command line parameters: /CreatedTemp /NoExclude /InstalledFrom "\\sditapsn01\SDITAP89\Applications\Licensed Software\VisualSourceSafe2005"
[05/24/19,13:34:25] Setup.exe: entering ISetupManager::RunIntro()
[05/24/19,13:34:25] Setup.exe: LoadSetupDatabase()
[05/24/19,13:34:25] Setup.exe: CSetupManager::LoadSetupDatabase() - set InstalledFrom property to C:\temp\SIT15659.tmp
[05/24/19,13:34:25] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:25] Setup.exe: CSetupManager::LoadSuiteInfo() - we are in SP mode - no suiteinfo.dll is supported
[05/24/19,13:34:25] Setup.exe: Product Name:Microsoft Visual SourceSafe 2005 - English
[05/24/19,13:34:25] Setup.exe: CSetupManager::RunIntro() - Initializing Progress Dialog Thread
[05/24/19,13:34:25] Setup.exe: CSetupManager::RunIntro() - Waiting for Initialization event...
[05/24/19,13:34:25] Setup.exe: CCoreEngine-Proc() - Setting loading init Event...
[05/24/19,13:34:25] Setup.exe: CCoreEngine-Proc() - Finished Setting loading init Event
[05/24/19,13:34:25] Setup.exe: CCoreEngine-Proc() - Entering Main Message Loop...
[05/24/19,13:34:25] Setup.exe: CSetupManager::RunIntro() - Initializing Progress Bar
[05/24/19,13:34:25] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:25] Setup.exe: ISetupManager::RunIntro() : LoadSuiteRequirements
[05/24/19,13:34:25] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:25] Setup.exe: ISetupManager::RunIntro() : CheckSuiteBlocks
[05/24/19,13:34:25] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:25] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:25] Setup.exe: ISetupManager::RunIntro() : LoadCommandLineMgr
[05/24/19,13:34:25] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:25] Setup.exe: ISetupManager::LoadCommandLineMgr() completed
[05/24/19,13:34:25] Setup.exe: ISetupManager::RunIntro() : LoadSetupLog
[05/24/19,13:34:25] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:25] Setup.exe: GetGlobalCustomProperty({1B3F6DC3-205F-11D3-A824-00C04FB1799F})
[05/24/19,13:34:25] Setup.exe: GetGlobalCustomProperty({383F0141-C682-4665-A69B-756E719C968D})
[05/24/19,13:34:25] Setup.exe: ISetupManager::LoadSetupLog() completed
[05/24/19,13:34:26] UTILS::RunNGENAction: Started
[05/24/19,13:34:26] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue pause"
[05/24/19,13:34:26] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:26] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue pause"
[05/24/19,13:34:27] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:27] Setup.exe: ISetupManager::RunIntro() : LoadManagers
[05/24/19,13:34:27] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:27] Setup.exe: inside ISetupManager::LoadDependencyMgr()
[05/24/19,13:34:27] Setup.exe: inside ISetupManager::LoadCDInfoMgr()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: inside ISetupManager::LoadDiskInfoMgr()
[05/24/19,13:34:27] Setup.exe: inside ISetupManager::LoadUIManager()
[05/24/19,13:34:27] vs70uimgr: Entering InitializeModule() method.
[05/24/19,13:34:27] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:27] Setup.exe: ISetupManager::RunIntro() : LoadDatabaseValues
[05/24/19,13:34:27] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:27] Setup.exe: GetCustomProperties()
[05/24/19,13:34:27] Setup.exe: get_CustomProperties()
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({2C320A80-183E-4F7E-8832-66A0F5756221})
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({B8A13F14-4BDE-4EC4-A53C-8E51FBB8261F})
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({AA62DF98-3F2C-11D3-887B-00C04F8ECDD6})
[05/24/19,13:34:28] Setup.exe: GetCustomProperties()
[05/24/19,13:34:28] Setup.exe: get_CustomProperties()
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,13:34:28] Setup.exe: GetGlobalCustomProperty({E0875D42-A33D-4C64-81C9-167795F29CA4})
[05/24/19,13:34:28] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:28] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:28] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:28] MSITOSIT: ***ERRORLOG EVENT*** : CRootComponent::SetManager() - MsiGetActiveDatabase returned an invalid handle
[05/24/19,13:34:28] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] MSITOSIT: ***ERRORLOG EVENT*** : ERROR processed; exception was thrown for retail build
    Developer Comment:  MsiGetActiveDatabase returned an invalid handle
    Build Time:  Thu Dec 11 15:04:18 2003
    DWORD:  0
[05/24/19,13:34:29] Setup.exe: GetCustomProperties()
[05/24/19,13:34:29] Setup.exe: get_CustomProperties()
[05/24/19,13:34:29] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,13:34:29] Setup.exe: MoveLoadProgress()
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[05/24/19,13:34:29] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:29] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunIntro() - Failed to Load Database Values
[05/24/19,13:34:29] vs70uimgr: Entering DisplayMessage() method.
[05/24/19,13:34:29] Setup.exe: CCoreEngine-Proc() - Finished Main Message Loop
[05/24/19,13:34:29] vs70uimgr: DisplayMessage_START:A problem has been encountered while loading the setup components. Canceling setup.
[05/24/19,13:34:31] vs70uimgr: DisplayMessage_END:A problem has been encountered while loading the setup components. Canceling setup.
[05/24/19,13:34:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,13:34:31] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunLoadSetup() - Failed to Run the Intro
[05/24/19,13:34:31] Setup.exe: UnloadSuiteComponents()
[05/24/19,13:34:31] UTILS::RunNGENAction: Started
[05/24/19,13:34:31] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue continue"
[05/24/19,13:34:32] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:32] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue continue"
[05/24/19,13:34:32] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,13:34:32] Setup.exe: GetGlobalCustomProperty(AA4EEF91-FB37-4135-9B73-484B75DDAA42)
[05/24/19,14:04:12] Setup.exe:
[05/24/19,14:04:12] Setup.exe: ========== Logging started ==========
[05/24/19,14:04:12] Setup.exe: =====================================
[05/24/19,14:04:12] Setup.exe: GetGlobalCustomProperty({481CEF9F-033A-11D3-ACE2-00C04F8EEBA1})
[05/24/19,14:04:12] Setup.exe: GetGlobalCustomProperty(B51015E7-26A5-4c8f-B871-26ABA9BEFB65)
[05/24/19,14:04:12] Setup.exe: Command line parameters:
[05/24/19,14:04:12] Setup.exe: entering ISetupManager::RunIntro()
[05/24/19,14:04:12] Setup.exe: LoadSetupDatabase()
[05/24/19,14:04:12] Setup.exe: CSetupManager::LoadSetupDatabase() - set InstalledFrom property to \\sditapsn01\SDITAP89\Applications\Licensed Software\VisualSourceSafe2005
[05/24/19,14:04:12] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:12] Setup.exe: CSetupManager::LoadSuiteInfo() - we are in SP mode - no suiteinfo.dll is supported
[05/24/19,14:04:12] Setup.exe: Product Name:Microsoft Visual SourceSafe 2005 - English
[05/24/19,14:04:13] Setup.exe: ISetupManager::RunIntro() : LoadSuiteRequirements
[05/24/19,14:04:13] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:13] Setup.exe: ISetupManager::RunIntro() : CheckSuiteBlocks
[05/24/19,14:04:13] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:13] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:13] Setup.exe: ISetupManager::RunIntro() : LoadCommandLineMgr
[05/24/19,14:04:13] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:13] Setup.exe: ISetupManager::LoadCommandLineMgr() completed
[05/24/19,14:04:13] Setup.exe: ISetupManager::RunIntro() : LoadSetupLog
[05/24/19,14:04:13] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:13] Setup.exe: ISetupManager::LoadSetupLog() completed
[05/24/19,14:04:13] UTILS::RunNGENAction: Started
[05/24/19,14:04:13] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue pause"
[05/24/19,14:04:13] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:13] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue pause"
[05/24/19,14:04:14] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:14] Setup.exe: ISetupManager::RunIntro() : LoadManagers
[05/24/19,14:04:14] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:14] Setup.exe: inside ISetupManager::LoadUIManager()
[05/24/19,14:04:14] vs70uimgr: Entering InitializeModule() method.
[05/24/19,14:04:14] Setup.exe: CSetupManager::CopyTempFiles() - Installing setup files...
[05/24/19,14:04:14] Setup.exe: CSetupManager::InstallSetupFiles() starting
[05/24/19,14:04:14] Setup.exe: GetGlobalCustomProperty({39E467CB-8962-4AD8-99F9-864AFF183FD4})
[05/24/19,14:04:14] vs70uimgr: Entering ShowSmallProgress() method.
[05/24/19,14:04:15] Setup.exe: CSetupManager::CopyTempFiles() - Successfuly copied files to temp; rerunning Setup...
[05/24/19,14:04:16] Setup.exe: CSetupManager::CopyTempFiles() - Finished Rerunning Setup...
[05/24/19,14:04:16] Setup.exe: UnloadSuiteComponents()
[05/24/19,14:04:16] UTILS::RunNGENAction: Started
[05/24/19,14:04:16] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue continue"
[05/24/19,14:04:17] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:17] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue continue"
[05/24/19,14:04:17] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:17] Setup.exe: GetGlobalCustomProperty(AA4EEF91-FB37-4135-9B73-484B75DDAA42)
[05/24/19,14:04:27] Setup.exe:
[05/24/19,14:04:27] Setup.exe: ========== Logging started ==========
[05/24/19,14:04:27] Setup.exe: =====================================
[05/24/19,14:04:27] Setup.exe: GetGlobalCustomProperty({481CEF9F-033A-11D3-ACE2-00C04F8EEBA1})
[05/24/19,14:04:27] Setup.exe: GetGlobalCustomProperty(B51015E7-26A5-4c8f-B871-26ABA9BEFB65)
[05/24/19,14:04:27] Setup.exe: Command line parameters: /CreatedTemp /NoExclude /InstalledFrom "\\sditapsn01\SDITAP89\Applications\Licensed Software\VisualSourceSafe2005"
[05/24/19,14:04:27] Setup.exe: entering ISetupManager::RunIntro()
[05/24/19,14:04:27] Setup.exe: LoadSetupDatabase()
[05/24/19,14:04:27] Setup.exe: CSetupManager::LoadSetupDatabase() - set InstalledFrom property to C:\temp\SIT21544.tmp
[05/24/19,14:04:27] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:27] Setup.exe: CSetupManager::LoadSuiteInfo() - we are in SP mode - no suiteinfo.dll is supported
[05/24/19,14:04:27] Setup.exe: Product Name:Microsoft Visual SourceSafe 2005 - English
[05/24/19,14:04:27] Setup.exe: CSetupManager::RunIntro() - Initializing Progress Dialog Thread
[05/24/19,14:04:27] Setup.exe: CSetupManager::RunIntro() - Waiting for Initialization event...
[05/24/19,14:04:27] Setup.exe: CCoreEngine-Proc() - Setting loading init Event...
[05/24/19,14:04:27] Setup.exe: CSetupManager::RunIntro() - Finished Waiting for Initialization event
[05/24/19,14:04:27] Setup.exe: CCoreEngine-Proc() - Entering Main Message Loop...
[05/24/19,14:04:27] Setup.exe: CSetupManager::RunIntro() - Initializing Progress Bar
[05/24/19,14:04:27] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:27] Setup.exe: ISetupManager::RunIntro() : LoadSuiteRequirements
[05/24/19,14:04:27] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:27] Setup.exe: ISetupManager::RunIntro() : CheckSuiteBlocks
[05/24/19,14:04:27] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:28] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:28] Setup.exe: ISetupManager::RunIntro() : LoadCommandLineMgr
[05/24/19,14:04:28] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:28] Setup.exe: ISetupManager::LoadCommandLineMgr() completed
[05/24/19,14:04:28] Setup.exe: ISetupManager::RunIntro() : LoadSetupLog
[05/24/19,14:04:28] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:28] Setup.exe: GetGlobalCustomProperty({1B3F6DC3-205F-11D3-A824-00C04FB1799F})
[05/24/19,14:04:28] Setup.exe: GetGlobalCustomProperty({383F0141-C682-4665-A69B-756E719C968D})
[05/24/19,14:04:28] Setup.exe: ISetupManager::LoadSetupLog() completed
[05/24/19,14:04:28] UTILS::RunNGENAction: Started
[05/24/19,14:04:28] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue pause"
[05/24/19,14:04:28] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:28] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue pause"
[05/24/19,14:04:29] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:04:29] Setup.exe: ISetupManager::RunIntro() : LoadManagers
[05/24/19,14:04:29] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:29] Setup.exe: inside ISetupManager::LoadDependencyMgr()
[05/24/19,14:04:29] Setup.exe: inside ISetupManager::LoadCDInfoMgr()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: inside ISetupManager::LoadDiskInfoMgr()
[05/24/19,14:04:29] Setup.exe: inside ISetupManager::LoadUIManager()
[05/24/19,14:04:29] vs70uimgr: Entering InitializeModule() method.
[05/24/19,14:04:29] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:29] Setup.exe: ISetupManager::RunIntro() : LoadDatabaseValues
[05/24/19,14:04:29] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:29] Setup.exe: GetCustomProperties()
[05/24/19,14:04:29] Setup.exe: get_CustomProperties()
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({2C320A80-183E-4F7E-8832-66A0F5756221})
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({B8A13F14-4BDE-4EC4-A53C-8E51FBB8261F})
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({AA62DF98-3F2C-11D3-887B-00C04F8ECDD6})
[05/24/19,14:04:30] Setup.exe: GetCustomProperties()
[05/24/19,14:04:30] Setup.exe: get_CustomProperties()
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,14:04:30] Setup.exe: GetGlobalCustomProperty({E0875D42-A33D-4C64-81C9-167795F29CA4})
[05/24/19,14:04:30] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:30] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:30] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:30] MSITOSIT: ***ERRORLOG EVENT*** : CRootComponent::SetManager() - MsiGetActiveDatabase returned an invalid handle
[05/24/19,14:04:30] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] MSITOSIT: ***ERRORLOG EVENT*** : ERROR processed; exception was thrown for retail build
    Developer Comment:  MsiGetActiveDatabase returned an invalid handle
    Build Time:  Thu Dec 11 15:04:18 2003
    DWORD:  0
[05/24/19,14:04:31] Setup.exe: GetCustomProperties()
[05/24/19,14:04:31] Setup.exe: get_CustomProperties()
[05/24/19,14:04:31] Setup.exe: GetGlobalCustomProperty({8297A38B-6431-4F1D-9F6E-C3D371CEA383})
[05/24/19,14:04:31] Setup.exe: MoveLoadProgress()
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[05/24/19,14:04:31] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:04:31] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunIntro() - Failed to Load Database Values
[05/24/19,14:04:31] vs70uimgr: Entering DisplayMessage() method.
[05/24/19,14:04:31] vs70uimgr: DisplayMessage_START:A problem has been encountered while loading the setup components. Canceling setup.
[05/24/19,14:04:31] Setup.exe: CCoreEngine-Proc() - Finished Main Message Loop
[05/24/19,14:25:35] vs70uimgr: DisplayMessage_END:A problem has been encountered while loading the setup components. Canceling setup.
[05/24/19,14:25:35] Setup.exe: AddGlobalCustomProperty
[05/24/19,14:25:35] setup.exe: ***ERRORLOG EVENT*** : CSetupManager::RunLoadSetup() - Failed to Run the Intro
[05/24/19,14:25:35] Setup.exe: UnloadSuiteComponents()
[05/24/19,14:25:35] UTILS::RunNGENAction: Started
[05/24/19,14:25:35] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ngen.exe queue continue"
[05/24/19,14:25:36] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:25:36] UTILS::RunNGENAction: starting "C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\ngen.exe queue continue"
[05/24/19,14:25:36] UTILS::RunNGENAction: ngen.exe returned 0
[05/24/19,14:25:36] Setup.exe: GetGlobalCustomProperty(AA4EEF91-FB37-4135-9B73-484B75DDAA42)

[05/24/19,13:34:28] MSITOSIT: [2] CRootComponent::SetManager() - MsiGetActiveDatabase returned an invalid handle
[05/24/19,13:34:29] MSITOSIT: [2] ERROR processed; exception was thrown for retail build
    Developer Comment:  MsiGetActiveDatabase returned an invalid handle
    Build Time:  Thu Dec 11 15:04:18 2003
    DWORD:  0
[05/24/19,13:34:29] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[05/24/19,13:34:29] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[05/24/19,13:34:29] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[05/24/19,13:34:29] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[05/24/19,13:34:29] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[05/24/19,13:34:29] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[05/24/19,13:34:31] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro
[05/24/19,14:04:30] MSITOSIT: [2] CRootComponent::SetManager() - MsiGetActiveDatabase returned an invalid handle
[05/24/19,14:04:30] MSITOSIT: [2] ERROR processed; exception was thrown for retail build
    Developer Comment:  MsiGetActiveDatabase returned an invalid handle
    Build Time:  Thu Dec 11 15:04:18 2003
    DWORD:  0
[05/24/19,14:04:31] setup.exe: [2] ISetupModule::SetManager() failed in ISetupManager::LoadSetupObjectGuid() : vs_setup.dll
[05/24/19,14:04:31] setup.exe: [2] CSetupManager::LoadSetupObjectname() - Failed in call to LoadSetupObjectGuid() for strName:  in file: vs_setup.dll
[05/24/19,14:04:31] setup.exe: [0] LoadComponent(), LoadSetupObjectName failure: vs_setup.dll
[05/24/19,14:04:31] setup.exe: [0] LoadComponent failed in ISetupManager::LoadComponentsFromDBObject(): vs_setup.dll
[05/24/19,14:04:31] setup.exe: [2] CSetupManager::LoadDatabaseValues() - Failed in call to LoadComponentsFroMDBObjects()
[05/24/19,14:04:31] setup.exe: [2] CSetupManager::RunIntro() - Failed to Load Database Values
[05/24/19,14:25:35] setup.exe: [2] CSetupManager::RunLoadSetup() - Failed to Run the Intro

A: This product hasn't been used since 2005 and was never good to begin with.
This specific error was a known bug for VisualStudio 2005 setup (which this was a part of).
I would suggest using ANYTHING else but VSS.  Microsoft wouldn't even use it back in the day...  but I am not here to judge.. just help you.
To get you around the problem, try this:
Solution:  Change USER variables of both TEMP and TMP to point to something valid like C:\TEMP.  C:\TEMP must exist and be read/write by ALL users.
You should be able to open a command prompt (as Administrator) and set the TEMP and TMP variables there. After that, be sure to use that same cmd.exe instance to launch setup.
You might need to actually set the user environment variables in windows temporarily if the MSI installer is somehow reading them directly (but I doubt it).


text:
Q: matrix derivation Given
$$
\mathbf{Z}=\mathbf{A}\mathbf{H}\mathbf{W}
$$
where $\mathbf{Z}\in\mathbb{R}^{V\times d_n}$, $\mathbf{A}\in\mathbb{R}^{V\times V}$, $\mathbf{H}\in\mathbb{R}^{V\times d_{n-1}}$, and $\mathbf{W}\in\mathbb{R}^{d_{n-1}\times d_n}$, what is the matrix representation of
$$\frac{\partial \mathbf{Z}}{\partial \mathbf{H}}$$
? My understanding is that it should be $\mathbf{A}\mathbf{W}$, but their dimensions don't match.

A: $
\def\bbR#1{{\mathbb R}^{#1}}
\def\e{\varepsilon}
\def\o{{\tt1}}\def\p{\partial}
\def\LR#1{\left(#1\right)}
\def\op#1{\operatorname{#1}}
\def\trace#1{\op{Tr}\LR{#1}}
\def\qiq{\quad\implies\quad}
\def\grad#1#2{\frac{\p #1}{\p #2}}
\def\c#1{\color{red}{#1}}
\def\gradLR#1#2{\LR{\grad{#1}{#2}}}
\def\H{H_{kl}}\def\Z{Z_{ij}}
$Rename the dimensioning variables $\:(V,d_{n},d_{n-1})\to(m,n,p)$
and introduce the Cartesian basis vectors
$\big\{e_k\in\bbR{m}|\,f_k\in\bbR{n}|\,g_k\in\bbR{p}\big\}$
The gradient of the matrix $H$ with respect to its own components is
$$\eqalign{
\grad{H}{\H} = e_kg_l^T \\
}$$
which can be used to calculate the component-wise gradients of $Z$
$$\eqalign{
Z &= AHW \qiq
\grad{Z}{\H} &= A\,e_kg_l^TW \\
}$$
The fully indexed gradient is found by extracting the $(i,j)$ components
$$\eqalign{
\grad{\Z}{\H}
 &= \grad{(e_i^TZf_j)}{\H}
 &= e_i^T\LR{Ae_kg_l^TW}f_j
 &= A_{ik}W_{lj} \\
}$$

Another technique is to use a Kronecker product $(\otimes)$
to flatten $(Z,H)$ into vectors $(z,h)$
before calculating the gradient
$$\eqalign{
z &= {\rm vec}(Z) = \LR{W^T\otimes A}h \qiq
\grad zh &= \LR{W^T\otimes A} \\
}$$

A: You may be confused about how to define $\partial \mathbf{Z}/\partial \mathbf{H}$.
One reasonable definition is the tensor whose $(i,j,k,\ell)$-th entry is the derivative of $Z_{i,\ell}$ with respect to $H_{j,k}$.
Next, note that $$Z_{i,\ell}=\sum_{j,k}A_{i,j}H_{j,k}W_{k,\ell}.$$
It follows that $(\partial Z_{i, \ell}/\partial H_{j, k})=A_{i,j}W_{k,\ell}$.
Or, more succinctly, using the outer product,
$$
\frac{\partial \mathbf{Z}}{\partial \mathbf{H}}
=\boxed{\mathbf{A}\otimes \mathbf{W}}.
$$

A: The total differential $DZ(H; {-})$ of a function $Z(H)$ is the best linear approximation of $Z$ at $H$. But $Z$ is already linear, so
$$
  DZ(H; K) = AKW.
$$
$K$ has the same dimensions as $H$. In index notation, writing matrices as $(1,1)$-tensors gives
$$
  DZ(H)^{ij}_{kl} = A^i_lW^j_k.
$$
The RHS is just the tensor product of $A$ and $W$, so we could write
$$
  DZ(H) = A\otimes W,
$$
but the problem with this notation (and the index notation) is that it isn't clear how $DZ(H)$ is supposed to be used.


text:
Q: Is there a good way to diagnose spring bean/service creation problem? My project uses spring and spring-dm for bean/service configuration. When I try to import an old project which also use spring for DI, bean will not be created.
An example to make clear,
I first define a url-alias in spring-appContext.xml
<bean name="xxxx" class="XRegistry" init-method="init">
    <property name="webRoot" value="/WebContent"></property>
    <property name="alias" value="/test"></property>
    <property name="cAliasPattern" value="/test/*.do" />
    <property name="conConfigFile" value="ddd.xml"/>
</bean>

in ddd.xml, I define some controller bean with url like /test/abc.do
No errors occur when launching as OSGi framework in eclipse.
But when I try to access the URL(/test/abc.do),"Unknown OSGi URL:" is met.
The problem really confuses me is I am not clear where to start. My bundle has depended on spring bundles and have appContext.xml and dispatcher.xml. Just a normal spring usage scenario.
As spring looks like black box to me, I can only try some other possible reasons I can think, but haven't fixed it till now. Is somebody know how to moniter the spring startup process or helpful logs?
Thanks.
Edit when using spring-dm, you need to create a new fragment including log4j.properties to enable logging. This can help u to track spring startuping error.
As I explain in the 1st answer, the root cause is found, two choice,

*

*For those bundles exist in both workspace and target platform, increase the bundle's version in current workspace. When error happens , you should also look into the dependency bundles

*Remove the high version bundles in target platform.

A: Have you tried setting the log level for the spring framework to debug?
E.g.
log4j.rootLogger=WARN, stdout
[...]
log4j.logger.org.springframework=DEBUG

This is always my first starting point when trying to diagnose problems with bean creation.


text:
Q: Sitecore 8 XP ContentSearch: Exclude path from Indexing I'm having trouble with Sitecore Indexing of the general indexes "sitecore_master_index", "sitecore_web_index", which take forever because the crawler/indexer checks all items in the database.
I imported thousands of products with a whole lot of specifications and literally have hundreds of thousands of items in the product repository.
If I could exclude the path from indexing it wouldn't have to check a million items for template exclusion.
FOLLOWUP
I implemented a custom-crawler that excludes a list of paths from being indexed:
<index id="sitecore_web_index" type="Sitecore.ContentSearch.SolrProvider.SwitchOnRebuildSolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
  <param desc="name">$(id)</param>
  <param desc="core">sitecore_web_index</param>
  <param desc="rebuildcore">sitecore_web_index_sec</param>
  <param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
  <configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
  <strategies hint="list:AddStrategy">
    <strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/onPublishEndAsync" />
  </strategies>
  <locations hint="list:AddCrawler">
    <crawler type="Sitecore.ContentSearch.Utilities.Crawler.ExcludePathsItemCrawler, Sitecore.ContentSearch.Utilities">
      <Database>web</Database>
      <Root>/sitecore</Root>
      <ExcludeItemsList hint="list">
        <ProductRepository>/sitecore/content/Product Repository</ProductRepository>
      </ExcludeItemsList>
    </crawler>
  </locations>
</index>

In addition I activated SwitchOnSolrRebuildIndex as it's awesome ootb functionality, cheers SC.
using System.Collections.Generic;
using System.Linq;
using Sitecore.ContentSearch;
using Sitecore.Diagnostics;

namespace Sitecore.ContentSearch.Utilities.Crawler
{
  public class ExcludePathsItemCrawler : SitecoreItemCrawler
  {
    private readonly List<string> excludeItemsList = new List<string>();
    public List<string> ExcludeItemsList
    {
      get
      {
        return excludeItemsList;
      }
    }

    protected override bool IsExcludedFromIndex(SitecoreIndexableItem indexable, bool checkLocation = false)
    {
      Assert.ArgumentNotNull(indexable, "item");
      if (ExcludeItemsList.Any(path => indexable.AbsolutePath.StartsWith(path)))
      {
        return true;
      }
      return base.IsExcludedFromIndex(indexable, checkLocation);
    }
  }
}

A: You can override SitecoreItemCrawler class which is used by the index you want to change:
<locations hint="list:AddCrawler">
  <crawler type="Sitecore.ContentSearch.SitecoreItemCrawler, Sitecore.ContentSearch">
    <Database>master</Database>
    <Root>/sitecore</Root>
  </crawler>
</locations>

You can then add your own parameters, e.g. ExcludeTree or even a list of ExcludedBranches.
And in the implementation of the class just override method
public override bool IsExcludedFromIndex(IIndexable indexable)

and check whether it is under excluded node.

A: When importing large amounts of data you should try disabling the indexing of data temporarily otherwise you'll run into issues with a crawler that can't keep up.
There's a great post here on disabling the index while importing data - it's for Lucene but I'm sure you can do the same with Solr,
http://intothecore.cassidy.dk/2010/09/disabling-lucene-indexes.html
Another option could be to store your products in a separate Sitecore database rather than in the master db.
Another post from into the core:
http://intothecore.cassidy.dk/2009/05/working-with-multiple-content-databases.html


text:
Q: VBA: not all Outlook Emails show up I wrote a small piece of code, that checks an additional inbox (besides my main-adress in Outlook) for E-Mails.
The problem shows up, when using the code on a pc, where only the additional inbox is added to outlook (as the main inbox). Obviously, the code can't retrieve all Emails, only the older ones. That's awkward, because the path to the subfolders and even the emails seem to be found, but not the newer ones. I can see them in Outlook with no problem.
Does anyone have an idea, why this is happening? As I told, the same code works with no problem on a PC with an Outlook-Installation, with another main-inbox and the inbox that needs to be checked as additional one.
That's the code I use to access Outlook and the Emails:
Dim objFolder As Outlook.Folder
Dim objOL As Outlook.Application
Set objOL = CreateObject("Outlook.Application")
Set objFolder = objOL.GetNamespace("MAPI").Folders.Item("test@test.de").Folders.Item("Posteingang").Folders.Item("Subfolder-Name").Folders.Item("Subfolder-Name-2")
With objFolder.Items(1)
...

A: I had this same issue: in my case the emails were in microsoft exchange but were not downloaded to the local outlook.
If you can refresh the outlook it should resolve the problem

A: Why are you always retrieving the first item in the Items collection? Would you not want to loop through the items?
set objItems = objFolder.Items
objItems.Sort "[ReceivedTime]"
'now objItems is sorted

A: I have found that changing the cache mode setting in Outlook helps with this problem of emails being in Microsoft Exchange not being accessed thru Excel VBA, especially Step (3) below.
https://support.microsoft.com/en-us/office/turn-on-cached-exchange-mode-7885af08-9a60-4ec3-850a-e221c1ed0c1c

*

*Click File > Account Settings > Account Settings.

*Click the Exchange or Microsoft 365, and then click Change.

*Under Offline Settings, check Use Cached Exchange Mode.
(If you're a Microsoft 365 subscriber with semi-annual updates, under Offline Settings, check Use Cached Exchange Mode to download email to an Outlook data file.


text:
Q: Migrations do not follow timestamp order I am working with Laravel 5.4 trying to run my migrations. I have read that the order of execution follows the timestamps of the migration files. But this is not the case, as I receive the following error:
SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
(SQL: alter table `aplicantes` add constraint `aplicantes_pais_id
_foreign` foreign key (`pais_id`) references `pais` (`id`))

These are my migrations files:
2014_01_01_100004_create_pais_table.php
2014_01_01_100005_create_departamentos_table.php
2014_01_01_100006_create_aplicantes_table.php

And this is where migration complains:
class CreateAplicantesTable extends Migration
{
    /**
    * Run the migrations.
    *
    * @return void
    */
    public function up()
    {
        Schema::create('aplicantes', function (Blueprint $table) {
            $table->increments('id');
            $table->string('nombre');
            $table->unsignedInteger('pais_id');
            $table->foreign('pais_id')->references('id')->on('pais');
            $table->timestamps();
        });
    }
}

This is my Pais migration:
public function up()
{
    Schema::create('pais', function (Blueprint $table) {
        $table->increments('id');
        $table->string('nombre');
        $table->timestamps();
    });
}

When I inspect the database, only the aplicantes table is created, which is the third in the order. I guess that is why the migration fails because the aplicantes table is being created first, which references a table that does not exist yet.
EDIT:
I have updated my migrations, creating an individual file for the foreign keys of every table. I'm getting an error when migrate:refresh, an access violation while dropping a foreign key, and I presume it's because of the same reason: migration is performing in alphabetical order, not by the timestamp.
UPDATE:
I had to rename every migrations file and now it seems working. Seems that migrate only care about days field in the naming convention of the migration files, not the seconds, as I was working with.
Despite that I see a correct order of migrate in migrations table, it complains of dropping foreign keys when I have my migration file like this:
class AddAplicantesForeignKey extends Migration
{
/**
 * Run the migrations.
 *
 * @return void
 */
public function up()
{
    Schema::table('aplicantes', function (Blueprint $table) {
        $table->foreign('pais_id')->references('id')->on('pais')->onDelete('cascade');
    });
}

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::table('aplicantes', function(Blueprint $table)
    {
        $table->dropForeign('pais_id');
    });
}

}
I manage to disable the complains by turn off the foreign key constraints check in my migration create table:
public function down()
{
    DB::statement('SET FOREIGN_KEY_CHECKS = 0');
    Schema::dropIfExists('aplicantes');
}

I am not happy with this solution, but it seems to only be working this way.


text:
Q: How to remove a parenthesized part at the end of a string? I have stock list values like this
VALANTINE (BY ECK) DAMIER STONE(XL)
SARIYER (BY ECK) MNV1983(XL7)

I want to update stocks list values to this
VALANTINE (BY ECK) DAMIER STONE
SARIYER (BY ECK) MNV1983

How can I remove the parenthesized part at the end of the string?

A: In Firebird 2.5, you can do something like:
case when val similar to ('%\(%\)') escape '\'
  then substring(val from 1 for char_length(val) - position('(' in reverse(val)))
  else val
end

This does the following:

*

*Check with similar to if the string ends with a parenthesized part, if not, it returns the value as is.

*If it does, it will use substring to return the part without the last parenthesized part.

*

*It uses char_length to get the original string length,

*It uses reverse to reverse the string (e.g. A (B) C (D) becomes )D( C )B( A,

*It uses position to find the opening parenthesis (() in the reversed string (this is the last opening parentheses in the original string),

*It then uses that position to calculate the length for the substring result.

In Firebird 3.0 and later you can also use the regular expression substring variant:
coalesce(substring(val similar '\"%\"\(%\)' escape '\'), val)

This does the following:

*

*With the regular expression substring, extract the part before the final parenthesized part

*As the previous step returns null if there is no parenthesized part, it uses coalesce to return the original value for that case

See this fiddle: https://dbfiddle.uk/?rdbms=firebird_3.0&fiddle=9499aa7c90634fc4f5957879c512155c


text:
Q: GET request using postman vs using node-fetch To install the package use these commands:
npm install node-fetch@2.6.1
npm install --save-dev @types/node-fetch@2.x

I am trying to get a Json file using the following code:
import fetch from "node-fetch";

async function getjson(){
const response = await fetch('https://www.carrefour.es/electronica/television/ofertas-en-televisores-y-accesorios/cat4167531/c', {method: 'GET',
headers:{
  Accept: 'application/json'
}
}).catch(e => {console.error('request failed:' , e)});

const result = ( response) ? await response.json(): null;
console.log('start');
console.log(result);
}
getjson();

but instead of returning the expected json file, it returns the following error
reason: Parse Error: Invalid header value char
    at ClientRequest.<anonymous> (/home/shengxing/Documents/proyectos/bot/node_modules/node-fetch/lib/index.js:1461:11)
    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketOnData (_http_client.js:481:9)
    at TLSSocket.emit (events.js:314:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:272:9)
    at TLSSocket.Readable.push (_stream_readable.js:213:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:188:23) {
  type: 'system',
  errno: 'HPE_INVALID_HEADER_TOKEN',
  code: 'HPE_INVALID_HEADER_TOKEN'
}

When I use Postman, it returns the expected json file, what was I doing wrong?
Can anyone shed some light on this question please?


text:
Q: how to EXEC a multiline SELECT? The following exec is generating this exception:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '
with
cte_rag as
(select
 rc.RagColumnId
,rc.RagId
,rc.Header
,rc.FormElementId
,rc.BaseObjectColumnName
,b.BaseObjectTy'.

Completion time: 2021-11-29T12:58:41.5681063-06:00

Here's the full sql:
declare @sql nvarchar(max)
set @sql = '''
with
cte_rag as
(select
 rc.RagColumnId
,rc.RagId
,rc.Header
,rc.FormElementId
,rc.BaseObjectColumnName
,b.BaseObjectTypeId
,b.BaseObjectTypeName
,b.TableName
from rag.rags r
join rag.RagColumns rc
on r.RagId = rc.ragid
join rag.BaseObjectTypes b
on r.BaseObjectTypeId = b.BaseObjectTypeId
),
cte_scalar_data (projectid,formdataid,formlementid,displayvalue) as (
SELECT
    p.ProjectId,
    fd.formdataid,
    t.FormElementId,
    (CASE
            WHEN t.FormDataAdapterId IS NOT NULL
            THEN dbo.GetFormDataAdapterValue(t.FormDataAdapterId, se.Value)
            ELSE
                ISNULL(
                CASE WHEN t.FormElementTypeId IN (4,5)
                THEN
                    dbo.GetOptionCaption(t.FormElementId, se.Value)
                ELSE
                    CASE WHEN t.FormElementTypeId = 3
                    THEN
                        FORMAT(CONVERT([datetime], se.Value), ''yyyy-MM-dd'')
                    ELSE
                        CASE WHEN t.FormElementTypeId = 7
                        THEN
                            se.Value2
                        ELSE
                            se.Value
                        END
                    END
                END, t.OptionCaption)
        END) AS DisplayValue
FROM
    Projects p
    INNER JOIN FormData fd ON fd.ObjectId = p.ProjectId
    INNER JOIN
    (SELECT
        e.FormId,
        e.FormElementId,
        e.FormElementTypeId,
        e.Name,
        e.Title,
        da.FormDataAdapterId,
        e.Title AS ValueName,
        o.Caption AS OptionCaption,
        e.PermanentName
    FROM
        FormElements e
        LEFT JOIN FormElementDataAdapters da ON e.FormElementId = da.FormElementId
        LEFT JOIN FormElementOptions o ON o.FormElementId = e.FormElementId AND o.IsDefault = 1
    WHERE e.FormElementId IS NOT NULL AND e.FormElementTypeId IN (1,3,4,5,7) ) t
    ON t.FormId = fd.FormId
    LEFT JOIN FormScalarElementsData se ON fd.FormDataId = se.FormDataId AND t.FormElementId = se.FormElementId
)

select r.header
      ,r.FormElementId
      ,r.BaseObjectColumnName
      ,r.BaseObjectTypeName
      ,fe.FormId
      ,fd.ObjectId
      ,p.projectid
      ,c.cipid
      ,fd.FormDataId
      ,cs.displayvalue
from cte_rag r
left join formelements fe
on fe.FormElementId = r.FormElementId
left join formdata fd
on fd.FormId = fe.FormId
left join dbo.projects p
on fd.objectid = p.projectid
left join dbo.cips c
on fd.objectid = c.CipId
left join cte_scalar_data cs
on      cs.formdataid = fd.FormDataId
    and cs.formlementid = r.FormElementId
    and cs.projectid = p.ProjectId
    '''

    exec(@sql)

What am I doing wrong? How do we run this exec command?

A: Your SQL has too many quotes added at the start and end, you don't need to encase the dynamic SQL in its own quotes, remove the ''' at the start and end, just simply do
set @sql = '
with
cte_rag as...
...
and cs.projectid = p.ProjectId
'


text:
Q: How to set a specific region time zone to correctly count the time between two events using the Date() object I want to build a webpage with some JavaScript which will count the days, hours, minutes and seconds between two events (now and LastTime). My issue is: I'm using this line var now = new Date().getTime(); to get the present time, and it looks like this method uses your machine settings to get the now variable, which is undesired because if a person outside my region access the page, the counter won't show the real time past since my JavaScript is getting theirs time zone.
I found some piece of code on the internet that actually gets the time from a given region, but I'm struggling to integrate into my code.
var now = new Date().toLocaleString("pt-BR", {timeZone: "America/Sao_Paulo"});
now = new Date(now);

Time past since the last event:

What I want is my now variable to get a especific region time ('America/New_York' for example) and make the counter do right math wherever region my page is accessed. Here's some codepen to make it easier.
Thanks in advance.

A: You can use moment.js functions for all your problems.

*

*If your event times in any specific timezone(s), first of all convert them to utc value. moment.utc()

*When user connect to your page, get his/her time in utc. moment.valueOf()

*Calculate duration between 2 dates. moment.duration, moment.diff

*Format duration how do you want. duration-format


text:
Q: Why does JAGS require at least two chains to calculate DIC? I'm trying to understand how JAGS calculates deviance and the Deviance Information Criterion (DIC).
The dic.samples function in rjags in R throws an error if you have only one chain.
stop("2 or more parallel chains required")

The formula for calculating DIC involves calculating the expected deviance and the deviance at the expected values of the parameters in the model. I imagine such estimates could be obtained from a single chain (albeit there might sometimes be convergence issues that can only be identified with more than one chain).
The manual states that:

The pD monitor estimates the contribution to the effective number of
  parameters (pD) [3] from an observed stochastic node by comparing the
  deviance deviance across multiple chains [1]. It is created by using
  the option type(pD). If the model has only one chain then a pD monitor
  cannot be defined.

So my question is:

*

*Why does JAGS require at least two chains to calculate DIC?

*Or more specifically, why does the pD monitor require two chains?

A: There are a number of different ways to calculate pD - the method that JAGS uses is described by Martyn Plummer in the Discussion to the 'Bayesian measures of model complexity and fit' paper:
http://onlinelibrary.wiley.com/doi/10.1111/1467-9868.00353/abstract
Get the PDF and then do a search for 'Plummer' - the first result gives the details of the calculation used in JAGS.


text:
Q: Using *ngFor with specific column design What is the way to make 4 divs under parent that repeated n times? For example:

{{item.name}}

{{item.name}}

{{item.name}}

{{item.name}}

{{item.name}}

{{item.name}}

{{item.name}}

{{item.name}}

The output should be:
[1] [2] [3] [4]
[5] [6] [7] [8]

A: You will have to implement a function that transforms the one-dimensional array into a two dimensional array, such that you can use two *ngFor loops.
Please see this Stackblitz with a working example.
Relevant code:
HTML:

{{item}}

TS:
items = ['item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7', 'item8']

getGroupedItems() {
    let grouped = [];
    for (let i = 0; i < this.items.length; i++) {
      const j = Math.floor(i / 4);
      if (i % 4 == 0) {
        grouped[j] = []
      }
      grouped[j].push(this.items[i]);
    }
    return grouped;
  }


text:
Q: Good freeware clone of the VMS editor EDT for unix or the pc? I would like to have the same editor available on all of the platforms I frequent.
Emacs and Vi are not desired solutions.

A: There is nu/TPU which is more like EVE/TPU, and also JED, I've never found anything better than either of these.
I used to be the world's biggest fan of VMS and EVE/EDT/TPU - you're probably going to -1 me for saying this but why not get edt mode for emacs. There is a lot to be said for emacs in terms of speed and facilities and it is worth taking the time to learn enough to turn it into your editor of choice, which I think is why us folks who like emacs like it - because we can customise it to do what we want...
Currently I'm using Xemacs - customised to my keystrokes some of which came from EDT.

A: http://sourceforge.net/projects/edt-text-editor/


text:
Q: Extend comment "magic links" syntax to allow arbitrary link text The magic links are awesome.
How much more awesome would it be to be able to make a comment linking to one of the URLs covered by a magic link, but with custom text?
Since the square-bracket link type isn't included in the mini-markdown used for comments, it could be stolen for this purpose.
Comment text like

Please [add that information][edit] to the body
of your post rather than using comments.

or

Please [include the shortest possible amount of code that
demonstrates the problem you see][mcve].

would convert to

Please [add that information](http://{SITE}.stackexchange.com/posts/{ID}/edit)
to the body of your post rather than using comments.

and

Please [include the shortest possible amount of code that
demonstrates the problem you see](http://stackoverflow.com/help/mcve).

for example.


text:
Q: Why reactor does not process each element concurrently? What I expect is reactor will create threads for each emitted element, meaning elements 1, 2, 3, 4, 5 from the source should be handled concurrently. But it's not true from my demo code output, but I don't know why. Could someone take a look and explain to me for two things:

*

*Why does reactor in my demo code handles elements in synchronize fashion?

*How to make reactor handles each element concurrent?

Though the reactor chain in my below demo code is async to the main thread, each element from source flux emits in a synchronized way.
Here is my demo code
        System.out.println("main thread start ...");

        Flux.range(1,5)
                .flatMap(num->{
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    return Mono.just(num);
                }).flatMap(num-> Mono.just(num*10) )
                .subscribeOn(Schedulers.boundedElastic())
                .subscribe(res-> System.out.println("Thread name:" + Thread.currentThread().getName()+" value:" + res));

        System.out.println("main thread sleep a little");
        Thread.sleep(4000);
        System.out.println("main thread end ...");

Here is the output
        Output:
            main thread start ...
            main thread sleep a little
            0. element: 0
            1. element: 1
            main thread end ...
            2. element: 2

A: Your code is not really implemented in a reactive way especially for wrapping non-reactive code. Consider slightly reworked example
@Test
void concurrent() {
    Flux<Integer> stream = Flux.range(1, 50)
            .flatMap(this::process)
            .flatMap(num -> Mono.just(num * 10));

    StepVerifier.create(stream)
            .expectNextCount(50)
            .verifyComplete();
}

private Mono<Integer> process(int num) {
    return Mono.fromCallable(() -> {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return num;
    })
    .log()
    .subscribeOn(Schedulers.boundedElastic());
}

If you run it, you would see that execution is happening on multiple threads with concurrency of Queues.SMALL_BUFFER_SIZE
22:54:26.066  [boundedElastic-50] INFO [r.M.L.50] - | request(32)
22:54:27.038  [boundedElastic-6] INFO [r.M.L.6] - | onNext(6)
22:54:27.038  [boundedElastic-11] INFO [r.M.L.11] - | onNext(11)
22:54:27.038  [boundedElastic-2] INFO [r.M.L.2] - | onNext(2)
22:54:27.038  [boundedElastic-9] INFO [r.M.L.9] - | onNext(9)
22:54:27.038  [boundedElastic-3] INFO [r.M.L.3] - | onNext(3)
22:54:27.040  [boundedElastic-13] INFO [r.M.L.13] - | onNext(13)
22:54:27.040  [boundedElastic-7] INFO [r.M.L.7] - | onNext(7)
22:54:27.040  [boundedElastic-20] INFO [r.M.L.20] - | onNext(20)
22:54:27.041  [boundedElastic-6] INFO [r.M.L.6] - | onComplete()
22:54:27.041  [boundedElastic-13] INFO [r.M.L.13] - | onComplete()
22:54:27.043  [boundedElastic-2] INFO [r.M.L.2] - | onComplete()
22:54:27.043  [boundedElastic-3] INFO [r.M.L.3] - | onComplete()
22:54:27.043  [boundedElastic-20] INFO [r.M.L.20] - | onComplete()
22:54:27.043  [boundedElastic-11] INFO [r.M.L.11] - | onComplete()
22:54:27.043  [boundedElastic-7] INFO [r.M.L.7] - | onComplete()
22:54:27.044  [boundedElastic-9] INFO [r.M.L.9] - | onComplete()
22:54:27.045  [boundedElastic-1] INFO [r.M.L.1] - | onNext(1)
22:54:27.045  [boundedElastic-5] INFO [r.M.L.5] - | onNext(5)
22:54:27.045  [boundedElastic-15] INFO [r.M.L.15] - | onNext(15)
22:54:27.045  [boundedElastic-1] INFO [r.M.L.1] - | onComplete()
22:54:27.045  [boundedElastic-15] INFO [r.M.L.15] - | onComplete()

Also, you could check Flight of the Flux 3 - Hopping Threads and Schedulers for more detailed explanation and more examples.


text:
Q: Permissions for folders containing temporary files I am working on a project that allows a user to generate some results. These results are written to a tmp directory and offered as a download to the user. Another process also reads generated XML from that tmp directory to display some values, and a Perl script also scans and loops through that XML file. The XML file and the results file are unique per session.
I also write away user statistics to a logs directory. It contains two files, gen-xml.txt, input.txt. On each user query some information is appended to each file.
I figured that I'd set permissions to 777, but this post got me worried. Does this result in a security issue, and if so, how can I remedy that without losing functionality?

A: If you need read-only access to the generated files, a 644 permission to the files should do it.
This will give the owner of the file a read-write access, but read-only permissions to everybody else.
Here is an excellent tutorial on how Linux permissions work


text:
Q: pom.xml file is missing when import maven project in eclipse pom.xml file is not shown when import maven project
process is like
1.Open Eclipse
2.Click File > Import
3.Type Maven
4.Select Existing Maven Projects
5.Click Next
6.Click Browse and select the folder that is the root of the Maven project (probably contains the pom.xml file)
but pom.xml is not shown is not shown
the screenshots are below
pom.xml is not shown

but actually the file exist the same path

A: Your're selecting a folder so individual files will not be shown


text:
Q: Updating biblatex First of all, I need to say I am new to both LaTeX and to Linux. I am using ubuntu 14.04. And I have to update my version of biblatex.
I know it has been described before, e.g. in this question. But I have a few questions about the answers given and also I am not sure if that process is still the same.
So as far as I understand I have to download the latest version of biblatexfirst. This can be done on SourceForge. Is this an official LaTeX site ?
Anyways, how would I have to replace the version, I mean, I don't know what version is the latest.
Then, in the answer provided in the link I have given, there is the line: /usr/local/texlive/2012/texmf-dist
I have checked, my texlive version can be found under /usr/share/texlive/texmf-dist
So am I right to assume I just need to replace the /localby /shareand leave out the year ?

A: It is not the greatest idea to manually update biblatex and Biber.
And it is truly a terrible idea to update only one of the two manually, as that will almost inevitably lead to version conflicts between the two.
Updating biblatex and Biber manually can lead to version conflicts with packages that require biblatex (mostly custom styles - last year biblatex received an update that broke many styles to a point that they couldn't be used any more) or with packages that biblatex requires (most of these are stable, so this is less likely to happen, but not impossible).
Ideally you would only update your packages via your TeX distribution (tlmgr or the MikTeX Update wizard). Some TeX live distributions that are packaged on Linux don't allow for updating with tlmgr and rely instead on (often rather old) versions of packages in their official repository.
You can install a vanilla TeX live that lets you use tlmgr and gets updates from CTAN directly instead of the outdated repositories of your Linux distro. See How to install "vanilla" TeXLive on Debian or Ubuntu?
If you really, really must update your packages manually, the general procedure from the answer you linked to should still be valid.
There are a few points though

*

*Make sure to actually download the current version of biblatex and Biber. Check in the documentation that the versions you downloaded are actually compatible. (At the time of writing this biblatex is at 3.7, Biber at version 2.7.)

*The correct place for biblatex is your local tree Where do I place my own .sty or .cls files, to make them available to all my .tex files? You had better not overwrite /usr/share content.

*SourceForge is not an 'official' LaTeX site. But the biblatex/Biber maintainer updates it with the newest release and development versions when they come available, so the release versions you find there are in a way official. You can get 'really official' package versions on CTAN. biblatex is at https://www.ctan.org/pkg/biblatex and Biber can be found at https://www.ctan.org/tex-archive/biblio/biber


text:
Q: Problem with Claims in ASP.NET Core (user still have some claim after updating database) I'm learning asp.net core and I'm stuck. I'll try to explain somehow.
Problem is with user claim.
When I log in into website, user have, let's say Create and Delete Claim and all working.
But when THAT user changes that HE cannot Delete something, after updating database HE still can.
In database Delete is gone (which is good).
Authorization is checked by authorization attribute:
[Authorize(Policy="DeletePolicy")]

I found something what may help.
ClaimsPrincipal User

property still have both claims (Create and Delete), but when I check DB:
await userManager.GetClaimsAsync("user_id")

I get only Create Claim which is good.
My question is: what precisely is that ClaimsPrincipal User property and why is not updated automatically?
Do I need to update User's Claims manually?

A: Claims are embedded in authentication cookie. It's like a snapshot of user's claims at a moment when user was signed in. Instead of putting all claims into cookie you can create ExtraClaimsMiddleware and put it after authentication middleware:
public class ExtraClaimsMiddleware
{
    private readonly RequestDelegate _next;

    public ExtraClaimsMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task InvokeAsync(HttpContext context,
        YourDb db)
    {
        //get additional claims for the current user from database, cache it if you want
        var userId =  context.User.FindFirstValue(ClaimTypes.NameIdentifier);
        var extraClaims = await db.GetExtraClaimsAsync(userId);
        foreach (var claim in extraClaims)
        {
            context.User.Identities.First().AddClaim(new Claim(claim.ClaimType, claim.ClaimValue));
        }

        await _next(context);
    }
}

public static class ExtraClaimsMiddlewareExtensions
{
    public static IApplicationBuilder UseExtraClaims(this IApplicationBuilder builder)
    {
        return builder.UseMiddleware<ExtraClaimsMiddleware>();
    }
}

Then in Startup.cs:
app.UseAuthentication();
app.UseExtraClaims();

A: I am not sure if I understand your problem correctly but I guess it can be solved with the SignInManager Class.
After you deleted the claim from the database you should be able to use the "RefreshSignInAsync"-Method to update the user´s cookie.