## Should I use assumed value when using the spell Wish to produce a house or similar object?

So I was looking into the spell wish, and according to its description, it has the ability to produce an object up to 25,000gp of value. I was wondering if this could be used to produce a homestead, but there appears to be a debate on the cost of a house mainly due to its location. Should this be taken into consideration or just the raw material necessary to make the house and assume magic builds it?

## Autofill a cell in a list if another cell in the same list contains a certain text value

I want a cell in a SP list to automatically populate/fill-in if a certain text value is present in a column in the same list. For example the list contains two columns named: Route of Flight and Spare Parts.

The Route of Flight column is filled in by the planner with a string of text, e.g. KOKC-KLIT-KDFW-KOKC. If the Route of Flight column contains KDFW then I want the Spare Parts column to auto-populate with “NEEDED”. If the route of flight does not contain KDFW then the Spare Parts column should auto-populate with “NOT NEEDED”.

Thanks.

## LINQ to SharePoint 2016 : Value does not fall within the expected range

I have a Dev and a Production SharePoint 2016 environment. For CRUD with lists I am using LINQ to SharePoint (SPMetal) generated classes. I have a list where 27 columns are Person Type. In my dev(http://sp2016/) environment the list is in root/main site but in Prod it is in subsite (https://sp2016/leaveauto). In both environment I have increased the Resource throttling value from 8 to 50 for Lookup View field. From the list I am taking a Person’s Id value (column name: HOD) from a specific Person type column with below code

using (MyDataContext objDataContext = new MyDataContext(_webUrl))                     {                         try                         {                             int approverId = objDataContext.ApproverInfo.FirstOrDefault(x => (string.Compare(x.DeptID,deptId)==0) && (string.Compare(x.Location, location)==0)).HODId;                         }                         catch (Exception ex)                         {                             throw;                         }                     }

here, HODId is LINQ to SharePoint generated column for HOD and deptId & location values I am passing with parameter.

In Dev environment it is working fine, but in Prod it is giving below error

{System.ArgumentException: Value does not fall within the expected range.    at Microsoft.SharePoint.SPFieldMap.GetColumnNumber(String strFieldName, Boolean bThrow)    at Microsoft.SharePoint.SPListItemCollection.GetColumnNumber(String groupName, Boolean bThrowException)    at Microsoft.SharePoint.SPListItem.GetValue(SPField fld, Int32 columnNumber, Boolean bRaw, Boolean bThrowException)    at Microsoft.SharePoint.SPListItem.get_Item(String fieldName)    at Microsoft.SharePoint.Linq.PropertyMap.GetSPFieldValue(PropertyMap pm, SPListItem item, JoinPath joinPath)    at Microsoft.SharePoint.Linq.SPItemMappingInfo.MaterializeEntity[TEntity](DataContext dc, SPDataList list, SPListItem item, SPItemMappingInfo itemMappingInfo, JoinPath joinPath)    at lambda_method(Closure , SPListItem )    at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source, Func`2 predicate)    at Microsoft.SharePoint.Linq.SPLinqProvider.Execute[T](Expression expression)    at ShopSignboard.lib.Utility.FindNonFinancialApprover(String approvalStatus, String deptId, String location)}

How can I solve this problem?

## How to get a value from a column using XSLT

I’m trying to figure out how to configure a custom xslt template for use with a content query web part, specifically the content type of the list item.

I don’t know at all what I’ve doing and there aren’t really great tutorials on XSLT. If you know of one please share it.

I’ve gone into the ItemStyle.xsl file and created my own template based on the existing out of the box WithDocIcon. I started out simple. I added this near the top:

<xsl:variable name="Foo" select="'Hello world'" />

And then this down in the markup part of the template

<div class="bar">             <xsl:value-of select="$Foo" /> </div> And this wrapped the Hello world in a div on the page. So that is successful and working. But now I want my Foo variable to pull its value from the content type of the list item. I realize the single quotes inside the double quotes are what are telling the template that the select is a string. I thought maybe I could put the column name there, but that doesn’t work. <xsl:variable name="Foo" select="ContentType" /> I looked at this Microsoft documentation and the thing I figured might be what I need is OuterTemplate.GetColumnDataForUnescapedOutput? I tried implementing it like this. <xsl:variable name="Foo"> <xsl:call-template name="OuterTemplate.GetColumnDataForUnescapedOutput"> <xsl:with-param name="Name" select="'ContentType'" /> </xsl:call-template> </xsl:variable> And that didn’t work. I also tried it without the single quotes and for other columns like Title. Nothing worked. I then found this MS documentation that mentions: By default, the XSL style sheet that controls the presentation of the Content By Query Web Part renders the Title, Description, ImageUrl, and LinkUrl columns (if present) of the items that the query returns. The Web Part renders the ImageUrl column and the LinkUrl column as an image and as a hyperlink, respectively. The Content By Query Web Part uses XSL style sheets to render these columns by default. So I edited the CQWP and updated the following two properties <property name="CommonViewFields" type="string">ContentType,Text;</property> <property name="DataColumnRenames" type="string">ContentType,Description</property> This works! My understanding is the CommonViewFields is telling the webpart to get the content type and then assigning its value to the Description variable, but then I don’t have my Description anymore! I tried renaming it to my own names and that didn’t work either. So is there a way to get the Title, Description, ImageUrl, and LinkUrl as well as add my own columns? ## How to get a value from a column using XSLT I’m trying to figure out how to configure a custom xslt template for use with a content query web part, specifically the content type of the list item. I don’t know at all what I’ve doing and there aren’t really great tutorials on XSLT. If you know of one please share it. I’ve gone into the ItemStyle.xsl file and created my own template based on the existing out of the box WithDocIcon. I started out simple. I added this near the top: <xsl:variable name="Foo" select="'Hello world'" /> And then this down in the markup part of the template <div class="bar"> <xsl:value-of select="$  Foo" />         </div>

And this wrapped the Hello world in a div on the page. So that is successful and working.

But now I want my Foo variable to pull its value from the content type of the list item. I realize the single quotes inside the double quotes are what are telling the template that the select is a string. I thought maybe I could put the column name there, but that doesn’t work.

<xsl:variable name="Foo" select="ContentType" />

I looked at this Microsoft documentation and the thing I figured might be what I need is OuterTemplate.GetColumnDataForUnescapedOutput? I tried implementing it like this.

<xsl:variable name="Foo">   <xsl:call-template name="OuterTemplate.GetColumnDataForUnescapedOutput">     <xsl:with-param name="Name" select="'ContentType'" />    </xsl:call-template> </xsl:variable>

And that didn’t work. I also tried it without the single quotes and for other columns like Title. Nothing worked.

I then found this MS documentation that mentions:

By default, the XSL style sheet that controls the presentation of the Content By Query Web Part renders the Title, Description, ImageUrl, and LinkUrl columns (if present) of the items that the query returns. The Web Part renders the ImageUrl column and the LinkUrl column as an image and as a hyperlink, respectively. The Content By Query Web Part uses XSL style sheets to render these columns by default.

So I edited the CQWP and updated the following two properties

<property name="CommonViewFields" type="string">ContentType,Text;</property>     <property name="DataColumnRenames" type="string">ContentType,Description</property>

This works! My understanding is the CommonViewFields is telling the webpart to get the content type and then assigning its value to the Description variable, but then I don’t have my Description anymore! I tried renaming it to my own names and that didn’t work either.

So is there a way to get the Title, Description, ImageUrl, and LinkUrl as well as add my own columns?

## SSOM – How to set a custom property value when add webpart programmatically

I want to set a custom property value when add web part programmatically.

Who is the property of System.Web.UI.WebControls.WebParts.WebPart object ?

This is my code for add web part in page:

using (SPLimitedWebPartManager manager = oWeb.GetLimitedWebPartManager(newPage.Url, PersonalizationScope.Shared))             {                 try                 {                     string wPartURL = oWeb.Site.Url + "/_catalogs/wp/ClientViewProjects.webpart";                     XmlTextReader reader = new XmlTextReader(new StringReader(oWeb.GetFileAsString(wPartURL)));                      string err = null;                     System.Web.UI.WebControls.WebParts.WebPart wp = (System.Web.UI.WebControls.WebParts.WebPart)manager.ImportWebPart(reader, out err);                     wp.ChromeType = PartChromeType.None;                     manager.AddWebPart(wp, "Header", 0); //See the description below for how to determine Zone                     manager.SaveChanges(wp);                 }                 catch (Exception ex)                 {                     LOG_STRING += string.Format("В сайт с URL:{0}{1} {2}", oWeb.ServerRelativeUrl, ex.ToString(), Environment.NewLine);                 }                 finally                 {                     manager.Web.Dispose();                 }                  newPage.CheckIn("Checked in by Code");                 newPage.ListItem.File.Publish("Publishing major version");             }

## Is it possible too exploit CORS with double Origin value?

I found a website that has a well implemented CORS configuration, but for some reason i am able to insert 2 Origin headers in a POST request, and both of this values are reflected in the reponse.

so if i try:

Host: example.com Connection: close Origin: https://evil.com Origin: https://example.com

The response will be:

HTTP/1.1 200 OK  access-control-allow-origin: https://evil.com,https://example.com access-control-allow-credentials: true

Is there any way to set this in a payload to be able to exploit this? How could i set the origin value for both of this to exploit it?

## Is odd-numbered damage that’s halved then doubled the same value as before, or one less?

Let’s say there’s a Dust Mephit at full health that was hit by the Fireball spell and made the save. The damage on the die is low at 17, so the fire damage is halved. But, Dust Mephits are vulnerable to fire damage, so it’s doubled again. Does the rounding happen after the final total, and it stays at 17? Or does rounding down happen after each step, reducing it to 8, then double to 16?

## SharePoint Calculated field Failed to update value on all items on Large List

So this is the problem:

I have a list with around 1 million records

I added a Calculated Column, with a very simple formula:

"0" + [textfield]

and return it as number

The request returned an update conflict error but when I browsed at the list I could see that the items were getting updated from the oldest to the newest over time with the new calculated field value. but some time later it stopped leaving more than half of the items without getting their value calculated returning them as -4XXXXXXX (I think this means is a null number)

I checked the logs and found out that for 3 hours every 20 seconds the ULS kept logging the following error:

A large block of literal text was sent to sql. This can result in blocking in sql and excessive memory use on the front end. Verify that no binary parameters are being passed as literals, and consider breaking up batches into smaller components. If this request is for a SharePoint list or list item, you may be able to resolve this by reducing the number of fields.

And then Finally a request timeout error log having the same Correlation ID as the previous error

Is there a safe way to add that calculated field?

do I need to increase a timeout variable to give the calculated field enough time to calculate all the items?

how can I recalculate the remaining fields without affecting the modified by and modified date of the items ?

Thank you!

## Expected value of next CPU burst using exponential averaging

The burst time is needed for Shortest Job First (SJF) and Shortest Run Time First (SRTF) scheduling. To get the approximate burst time, we use the equation $$\tau_{n + 1} = t_n + (1 – \alpha)\tau_n$$

I want to ask whether $$\tau_{n + 1}$$ is the predicted burst time of the $$n + 1$$ th process or it is the predicted burst time of some process say p which is demanding the CPU for the $$n + 1$$ th time.