Create a trigger to insert into a view from an existing table

I have a table (Inventory) with below specifications:

Inventory :

([ProductID] [numeric](18, 3) NULL, [RegionID] [numeric](18, 3) NULL, [ShopCode] [int] NULL, [QTY] [float] NULL, [OLAPDate] [varchar](6) NULL, [Price] [float] NULL, [ID] [bigint] IDENTITY(1,1) NOT NULL PRIMARY KEY) 

And I have created a view on it to add a column (HaveQTY) following the below code:

CREATE VIEW V_Inventory_HaveQTY AS SELECT ID, HaveQTY = CASE                     WHEN QTY > 1 THEN 1                     ELSE 0                     END  FROM Inventory 

To finally create the below table:

SELECT I.ProductID, I.RegionID, I.OLAPDate, (100* (1.0*SUM(V.HaveQTY))/(COUNT(V.HaveQTY))) AS NoQTYStores INTO Inventory_NoQTYStores FROM Inventory  I INNER JOIN      V_Inventory_HaveQTY V ON I.ID = V.ID GROUP BY I.ProductID, I.RegionID, I.OLAPDate 

I monthly add new records to Inventory table via bcp utility and want to create a trigger to add these new records to the destination table (Inventory_NoQTYStores) via V_Inventory_HaveQTY view.

I am very new to writing triggers and not sure if I am writing it right. So I get the help from this answer and create the first trigger to insert the new records into V_Inventory_HaveQTY view:

CREATE TRIGGER Update_V_Inventory_HaveQTY ON Inventory AFTER INSERT AS  BEGIN     INSERT INTO V_Inventory_HaveQTY(         ID,         HaveQTY         )     SELECT ID, HaveQTY = CASE                     WHEN QTYMojoodi > 1 THEN 1                     ELSE 0                     END    FROM Inventory END; 

When I add a record manually to the Inventory table to check the trigger, however, I get the below error :

Msg 4406, Level 16, State 1, Procedure Update_V_Inventory_HaveQTY, Line 6 [Batch Start Line 35] Update or insert of view or function ‘V_Inventory_HaveQTY’ failed because it contains a derived or constant field.

Any help would be appreciated.

How to execute an existing notebook with Wolfram Engine?

[My related question: mwe-for-compiling-functions-into-standalone-dll-and-calling-them-in-python – here I am exploring an alternative]

I have downloaded, installed and activated the wolfram engine (12.0) on Windows, and I have installed the WolframClient in my Python environment.

In python I execute

from wolframclient.language import wl from wolframclient.evaluation import WolframLanguageSession kernelLoc = 'C:\Program Files\Wolfram Research\Wolfram Engine\12.0\WolframKernel.exe' session = WolframLanguageSession(kernelLoc) session.evaluate(wl.StringReverse('abc')) 

and the result is ‘cba’ proving that the integration is working.

I have a workbook that contains all my (valid) compilable functions.

Question: how do I load & evaluate that notebook and call the compiled functions? (I could use a package file instead if that would help)

I have not (yet) found the answer by reference to the Wolfram Client documentation

Side issue: I recall that setting up my MMA 11.0.1.0 to work with Visual Studio 2017 for C compilation was… tricky. Does the Wolfram Engine have independent setup and if so how do I apply the working config for compilation from MMA to WE? Of course, if I can load the required notebook and it just works then this becomes redundant, but… expect the not-to-be-unexpected is my motto for development.

What is the best way to modify existing creatures to make new ones?

I’ve been looking everywhere and just cannot find a way to create new animals. Yes I know the DM guide has a section on giving monsters powers and CR and stats but there is no statistic guideline for how to make something go from normal to giant or to add one or two stat changes.

For instance. in the Monster Manual owls are CR 0, 1d4-1 HP, 11 AC, with a +3 to perception, stealth, and to hit.

Meanwhile, the Giant owl has 12 AC (how?) 3d10+3 HP (I know d10 comes from Large size, but why three of them? its CR is 1/4. what makes it level 3?) All of it’s stats go up by leaps and bounds, even Int and Cha increased, and it’s perception increases to +5 even though it’s wisdom and proficiency havent increased enough to give it points, and it’s talons go from 1 damage to 2d6+1. I’m fine with this if there is a way to determine it based on how you change an animal, but can’t seem to find any solid rules for this, as they don’t follow the DM guide’s tables at all.

The animal in question I’m trying to make at the moment is a Gorilla, since “Ape” in the handbook is more like a chimpanzee stats wise, and “Giant Ape” is literally king kong.

So, What is the best way, or rules-given way, to modify an animal or monster?

XSS and Content Security Policy, and existing CSS

I have done the first development of a website and deployment. Scanning the server with an online security evaluation tool I was recommended that I add a Content security Policy to the website, and I understand that this can help with XSS. But I read that this will disable inline CSS styles.

I have used inline CSS freely all over the website. Did not know this was a bad thing. (eg: div style=”width:100%;”). If I was to find and transfer all inline CSS to file it would take too long.

However I am only taking input from user in 3 pages. One is a feedback form that stores data on server only. One is a contact form that does not store data only send an email(collects user email address). The comments page takes comment input, stores the data, it retrieves and displays entries that have been cleared by admin. The other pages are mostly displaying static content.

I’m assuming comments page is the priority (is this right?). Would it work if I put CSP declarations (? default-src: https:) to the above three pages only (and remove inline CSS). and the others have inline enabled (? default-src: https: ‘unsafe-inline’) ?

How to prompt existing customers to change their email

I’m looking for some UX examples to how other companies have handled this situation:

Scenario: Devs are using an old password encrypting method (sha1) I believe and need to change it to a more secure encryption.

What they did: When users logged in they just encrypted their password with the new encryption and the users didn’t know a thing.

The only problem is we have a number of users who aren’t frequent users who will only login periodically.

Devs want to clear all the passwords and require users to reset their passwords.

Problem: We don’t want to alert them to the fact that there are security issues as we hold alot of important data in their accounts of users customers.

When that happens users would attempt to login and just get hit with a message saying there login details are incorrect.

The initial approach was….users will eventually just click on forgotten password after being told ‘invalid credentials’

However, this just feels wrong and we’ve tried to think of various flows but due to dev contraints we have to stick with them having to click on the forgotten password. (not the best solution but need to make the most out of this)

My question is… what message would make sense in asking them to reset their password that doesn’t alert to security issues?

Additionally are there any existing companies that have handled randomly asking users to reset their passwords?

SharePoint 2010 Setting Max Versions on Existing List

I’ve got a SP2010 list that’s had no cap limit set to the versions. I want to reduce the number of versions kept to 10 so I set the “Keep the following number of versions” option to 10. It looks like SP doesn’t go ahead and remove all the extra versions on the list items. For example, a list item has 24 versions – still has 24 versions after making this change.

What’s the best way to clean up a list and remove all versions over the past 10 versions?

Online survey method: Redesigning existing website for an agency

The situation is that our customers usually hears about our services from others in the city or country rather than finding us through our website. But as our website feels outdated and the provided services have expanded, we want to redesign it. But before that we want to make an online survey, to give to our clients, so they can fill them out. But my questions is:

What would be more valuable to understand, what they think about our current website, what to change, what to include etc. or ask questions that are highly related to the services we provide, like:

What first comes to your mind when thinking about our services? What do you like least/most about our services? And many similar about the services itself…

Or maybe ask both?

Online survey method: Redesigning existing website for an agency

The situation is that our customers usually hears about our services from others in the city or country rather than finding us through our website. But as our website feels outdated and the provided services have expanded, we want to redesign it. But before that we want to make an online survey, to give to our clients, so they can fill them out. But my questions is:

What would be more valuable to understand, what they think about our current website, what to change, what to include etc. or ask questions that are highly related to the services we provide, like:

What first comes to your mind when thinking about our services? What do you like least/most about our services? And many similar about the services itself…

Or maybe ask both?

Search Result by filter does not find an existing and crawled document

This is related to SP 2013 On-Premises. We have a custom Search Page and we use Keyword-Query to filter the Result. The related document which cannot be found by that page has at least two meta data fields assigned (both managed metadata) and can be found by regular search and also by Search-API, like so:

https://company.com/_api/search/query?Querytext=’PRDBGerKlasse:”306″‘&RowLimit=’10’&SelectProperties=’Title,Path,PRDBGerKlasse,PRDBGerTyp,PRDBGerArt’

The document has “306” for PRDBGerKlasse and “TypeA 300” for PRDBGerTyp. When we then call the page by https://company.com/search/pages/prdb.aspx#k=PRDBGerTyp%3aTypeA%20300

the document is not in the search Result. If we call the page without the filter, the document can be found.

What could cause such issue?

Please note that we added the item 306 two weeks ago to the relevant Term-Set. Could that be an issue with the crawler even if the document can be found by regular search?