Month: August 2024
Microsoft Withdraws Copilot Catch Up Feature
Copilot Catch Up Fails to Impress
On August 28. 2024, Microsoft posted a revision to message center notification MC799636 (Microsoft 365 roadmap item 388746) to announce their decision to completely roll back their deployment of the new “catch up” feature for Copilot for Microsoft 365 and Teams. The roll back operation will start on September 2. Previously, the feature was supposed to reach general availability in early August 2024.
According to Microsoft, the deployment had reached 50% of users. These are eligible accounts with Copilot for Microsoft 365 licenses. Given that many large enterprises have committed to Copilot for Microsoft 365, the number of affected users might be in the low several million range.
The Black Box of Card Determination
The blurb for the Copilot catch up feature says that it “helps users [to] take action on important updates.” In other words, Copilot had found something it deemed of interest to the signed-in user and brought the item to their attention in a series of cards that rotated through a carousel. In my case, the feature only turned up a couple of days ago. Figure 1 shows what I see. The three cards cover a Word document (chapter 2 for the Office 365 for IT Pros eBook), a calendar invitation, and a Loop workspace.
Figure 1: Copilot catch up
Like many elements of artificial intelligence, the process to determine what cards to display is a black box. Looking at the cards chosen by Copilot, I can see the logic of selecting the Word document because it’s a reminder that its content has changed, and I need to review the updates. The meeting is probably there because it happens later today. To help me prepare, Copilot found an email sent about a Teams service outage which frankly is of zero relevance to the meeting. The sole connection is that the word Teams appears in the subject for both the meeting invitation and email. The selection reminds me of “I must find something” instead of “I must find something useful.” I can’t account for why Copilot chose the Loop workspace because nothing has happened in it for months. Perhaps Copilot Catch Up wanted to be diverse in its choice of application sources.
I don’t think I shall miss the carousel. It seems like a modern take on the many ways that Office apps suggest documents to users or the way that the now-deprecated Delve highlights documents to users. The Viva Insights for email feature available in Outlook clients is another example of how Microsoft seeks to extract value from user data to highlight “things to do.”
Automatic Document Summaries by Copilot for Microsoft 365
The list key points link on the card for the Word document (Figure 2) appears to do what I expect to see when Microsoft deploys message center notification MC871010 (Microsoft 365 roadmap item 399921), scheduled for late August. This update promises that Copilot “will generate a summary in the window at the top of the Word document.”
MC866152 (23 August 2024) also covers the same ground for Microsoft Copilot (the version that doesn’t use the Graph).
I have some problems with the idea of generating automatic summaries because I fear it might slow down the opening of large documents based on the current performance in the Copilot chat app. It seems like a terrific demo feature that works well for 2-page documents. I can’t imagine how it will cope with the 1,300 pages of the Office 365 for IT Pros eBook source file. MC866452 says that the summary window can be collapsed to hide it. There’s no detail about what I really want to do, which is to disable automatic summaries for all Word documents.
Copilot Can’t do Everything
Figuring out what features will really be interesting and useful is an aspect of software engineering that is often very difficult. Sometimes I think Microsoft tries too hard, tries to be too clever, or utterly fails to understand how people outside Microsoft work. Applying artificial intelligence to as many aspects of Microsoft 365 as possible is madness, even if it keeps senior management happy.
The truth is that not every idea discussed around a conference table in Redmond or virtually in a Teams call is valuable. Sometimes it takes exposure in the harsh light of reality to figure out what works and what doesn’t. The demise of Copilot catch up is a reminder to us all that just because a new feature appears, its value needs to be assessed in terms of how it contributes to the success of the business.
So much change, all the time. It’s a challenge to stay abreast of all the updates Microsoft makes across the Microsoft 365 ecosystem. Subscribe to the Office 365 for IT Pros eBook to receive monthly insights into what happens, why it happens, and what new features and capabilities mean for your tenant.
Using symbolic solver, I seem to not be able to get a system of equations that give me a desired answer. Does a solution not exist?
syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx
syms Rp Rx Rn positive
Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));
equ1=Vp==(V1+V2)-Ison*Rn;
Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));
equ2=Vn==(V1+V2)-Isop*Rp;
Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));
equ3= Vpx==V1+Rx*Isox;
[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);
simplify(Rn)
simplify(Rp)
simplify(Rx)
Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer?syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx
syms Rp Rx Rn positive
Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));
equ1=Vp==(V1+V2)-Ison*Rn;
Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));
equ2=Vn==(V1+V2)-Isop*Rp;
Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));
equ3= Vpx==V1+Rx*Isox;
[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);
simplify(Rn)
simplify(Rp)
simplify(Rx)
Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer? syms V1 V2 Vp Vn Vxp Vxn Vpx Vnx
syms Rp Rx Rn positive
Ison=((Vp/((Rp*68220)/(Rp+68220)))-(Vxp/((Rx*68220)/(Rx+68220))));
equ1=Vp==(V1+V2)-Ison*Rn;
Isop=((Vn/((Rn*68220)/(Rn+68220)))-(Vxn/((Rx*68220)/(Rx+68220))));
equ2=Vn==(V1+V2)-Isop*Rp;
Isox=((Vnx/((Rn*68220)/(Rn+68220)))-(Vpx/((Rp*68220)/(Rp+68220))));
equ3= Vpx==V1+Rx*Isox;
[Rn, Rp, Rx] = solve([equ1, equ2,equ3],[Rn , Rp, Rx]);
simplify(Rn)
simplify(Rp)
simplify(Rx)
Rn=vpa(subs(Rn,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rp=vpa(subs(Rp,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
Rx=vpa(subs(Rx,{V1,V2,Vp,Vn,Vxp,Vxn,Vpx,Vnx},{270,270,144.56868,147.38892,125.43132,122.61108,268.58987,271.41013}))
So I am trying to find values for Rn,Rx and Rp. I have three equations and three unknowns. When I use solve to find symbolic equation, I get equations for each variable. But when I sub real values in, I get an answer that is wrong or doesnt make sense. Adding assume doesnt seem to change anything and the return conditions is the same as the equations. The real values of Rn, Rp and Rx should be 2e6,1.5e6 and 700k. If you were to put these values in the original equations, you can verify that these values are correct. How do I get a system of equations that will give me the desired answer? solve, symbolic MATLAB Answers — New Questions
filtfilt provides excessive transient
I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.
% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
% check stability
assert(isstable(bp),’Unstable filter’);
% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
x = randn(2^20,1);
y = filtfilt(bp,x);
% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient
y2 = flipud(filter(bp,flipud(filter(bp,x))));
% compare effects
figure; semilogy(abs(y-y2));
As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.
Where is the problem? Have I missed some recommendations or hints in the function’s help?I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.
% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
% check stability
assert(isstable(bp),’Unstable filter’);
% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
x = randn(2^20,1);
y = filtfilt(bp,x);
% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient
y2 = flipud(filter(bp,flipud(filter(bp,x))));
% compare effects
figure; semilogy(abs(y-y2));
As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.
Where is the problem? Have I missed some recommendations or hints in the function’s help? I observed that ‘filtfilt’ suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a ‘home-made’ version of zerophase filtering based on ‘filter’. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the ‘filter’ function.
% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)
bp = designfilt(‘bandpassiir’, ‘StopbandFrequency1’, 50, ‘PassbandFrequency1’, 250,…
‘PassbandFrequency2’, 3600, ‘StopbandFrequency2’, 3700, ‘StopbandAttenuation1’, 30,…
‘PassbandRipple’, 0.1, ‘StopbandAttenuation2’, 30, ‘SampleRate’, 8000, ‘DesignMethod’, ‘cheby2’);
% check stability
assert(isstable(bp),’Unstable filter’);
% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
x = randn(2^20,1);
y = filtfilt(bp,x);
% apply ‘home-made’ filtfilt to the same input; output signal shows a more accptable transient
y2 = flipud(filter(bp,flipud(filter(bp,x))));
% compare effects
figure; semilogy(abs(y-y2));
As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.
Where is the problem? Have I missed some recommendations or hints in the function’s help? filtfilt, numerical stability, transient effects MATLAB Answers — New Questions
Reading Bytes from Arduino to MATLAB
I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)
I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.
Arduino IDE code:
#include <SPI.h>
const int CS_SiPM_pot = 34;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); //Starting
delay(1000);
SPI.begin();
pinMode(CS_SiPM_pot, OUTPUT);
}
void loop() {
for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57
{
digitalWrite(CS_SiPM_pot, LOW); //LOW
delay(10); //10
SPI.transfer(d_pot2);
digitalWrite(CS_SiPM_pot, HIGH);
// put your main code here, to run repeatedly:
float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };
for (int i = 0; i < 4; i++) {
byte *byteData = (byte *)&newTmp[i];
Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes
delay(10);
}
}
}
MATLAB code:
esp = serialport(‘COM5’,152000);
%%
flush(esp)
% Read 16 bytes of data (4 floats * 4 bytes per float)
numBytes = 16;
data = read(esp, numBytes, ‘uint8’);
% Convert each 4-byte sequence to a float
float1 = typecast(data(1:4)), ‘single’);
float2 = typecast(data(5:8), ‘single’);
float3 = typecast(data(9:12), ‘single’);
float4 = typecast(data(13:16), ‘single’);
disp([float1, float2, float3, float4]);
% Convert the bytes back to float values
floatValues = typecast(uint8(data), ‘single’);
% Display the result
disp(‘Float values:’);
disp(floatValues);
disp(‘Raw bytes received:’);
disp(data); % Print the raw bytes
Results from MATLAB:
Float1: 0 0 0 0 0 0 0 0
Float2: 0 3.7480 0 0 0 0 0 0
Float3: 0 2.1250 0 3.7480 0 0 0 0
Float4: 0 0 0 0 0 3.7480 0 0
data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)
I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.
Arduino IDE code:
#include <SPI.h>
const int CS_SiPM_pot = 34;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); //Starting
delay(1000);
SPI.begin();
pinMode(CS_SiPM_pot, OUTPUT);
}
void loop() {
for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57
{
digitalWrite(CS_SiPM_pot, LOW); //LOW
delay(10); //10
SPI.transfer(d_pot2);
digitalWrite(CS_SiPM_pot, HIGH);
// put your main code here, to run repeatedly:
float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };
for (int i = 0; i < 4; i++) {
byte *byteData = (byte *)&newTmp[i];
Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes
delay(10);
}
}
}
MATLAB code:
esp = serialport(‘COM5’,152000);
%%
flush(esp)
% Read 16 bytes of data (4 floats * 4 bytes per float)
numBytes = 16;
data = read(esp, numBytes, ‘uint8’);
% Convert each 4-byte sequence to a float
float1 = typecast(data(1:4)), ‘single’);
float2 = typecast(data(5:8), ‘single’);
float3 = typecast(data(9:12), ‘single’);
float4 = typecast(data(13:16), ‘single’);
disp([float1, float2, float3, float4]);
% Convert the bytes back to float values
floatValues = typecast(uint8(data), ‘single’);
% Display the result
disp(‘Float values:’);
disp(floatValues);
disp(‘Raw bytes received:’);
disp(data); % Print the raw bytes
Results from MATLAB:
Float1: 0 0 0 0 0 0 0 0
Float2: 0 3.7480 0 0 0 0 0 0
Float3: 0 2.1250 0 3.7480 0 0 0 0
Float4: 0 0 0 0 0 3.7480 0 0
data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0 I’ve been trying to read data from ESP32S-Dev module to MATLAB sending over the data in bytes to make the transmission quicker. As seen below, I convert float data into bytes and then write the data. MATLAB sees the data and then creates a 1×8 array for each float value instead of just 1 value for each float. I’ve tried other methods, shown in 2nd part of MATLAB code, and it creates 1 value for each float but their wildly off (7-34 orders of magnitude)
I’ve tried different baud rates and even asked for help from the almighty ChatGPT but have not been able to crack the code. Any thoughts.
Arduino IDE code:
#include <SPI.h>
const int CS_SiPM_pot = 34;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200); //Starting
delay(1000);
SPI.begin();
pinMode(CS_SiPM_pot, OUTPUT);
}
void loop() {
for (int d_pot2 = 55; d_pot2 <= 55; d_pot2 = d_pot2 + 1) //57
{
digitalWrite(CS_SiPM_pot, LOW); //LOW
delay(10); //10
SPI.transfer(d_pot2);
digitalWrite(CS_SiPM_pot, HIGH);
// put your main code here, to run repeatedly:
float newTmp[4] = { 01.00, 02.00, 03.00, 04.00 };
for (int i = 0; i < 4; i++) {
byte *byteData = (byte *)&newTmp[i];
Serial.write(byteData, sizeof(float)); // Send each float as 4 bytes
delay(10);
}
}
}
MATLAB code:
esp = serialport(‘COM5’,152000);
%%
flush(esp)
% Read 16 bytes of data (4 floats * 4 bytes per float)
numBytes = 16;
data = read(esp, numBytes, ‘uint8’);
% Convert each 4-byte sequence to a float
float1 = typecast(data(1:4)), ‘single’);
float2 = typecast(data(5:8), ‘single’);
float3 = typecast(data(9:12), ‘single’);
float4 = typecast(data(13:16), ‘single’);
disp([float1, float2, float3, float4]);
% Convert the bytes back to float values
floatValues = typecast(uint8(data), ‘single’);
% Display the result
disp(‘Float values:’);
disp(floatValues);
disp(‘Raw bytes received:’);
disp(data); % Print the raw bytes
Results from MATLAB:
Float1: 0 0 0 0 0 0 0 0
Float2: 0 3.7480 0 0 0 0 0 0
Float3: 0 2.1250 0 3.7480 0 0 0 0
Float4: 0 0 0 0 0 3.7480 0 0
data: 0 0 0 0 255 0 0 0 3 255 0 0 0 0 255 0 arduino, esp32, matlab, serialport, float-to-bytes MATLAB Answers — New Questions
When the orientation of the object changed, how to measure the force on each support point?
Thank you for your interest in my question.
If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,
and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.
Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.
As the box rotates, the coordinate frame of the corner also rotates.
If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,
how should we apply force to each point so that the box stays still?Thank you for your interest in my question.
If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,
and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.
Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.
As the box rotates, the coordinate frame of the corner also rotates.
If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,
how should we apply force to each point so that the box stays still? Thank you for your interest in my question.
If we assume that there is a box with x, y, z-axis lengths of [1, 0.5, 0.2] (m) , weight is m=100kg,
and set the center point as the origin frame. At this time, if we support the force of m*g/4 at each of the four points [0.5, 0.25, -0.1], [0.5, -0.25, -0.1], [-0.5, -0.25, -0.1], [-0.5, 0.25, -0.1], the object will stay statically.
Then, if the box rotates 30 degrees about the x-axis, I can’t measure the force applied at the four corners of the box.
As the box rotates, the coordinate frame of the corner also rotates.
If the box rotates 45 degrees for y-axis after rotating 30 degree for the x-axis,
how should we apply force to each point so that the box stays still? force, gravity compensation MATLAB Answers — New Questions
Hi! I created a bad script a long time ago (months) and it has essentially destroyed my Matlab Online. I cannot run any other script without that old error occurring
The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.
Help? I am so confused
Script I am running:
%% Problem 1
k1 = 10;
k2 = 5;
k3 = 8;
k4 = 10;
k5 = 20;
L1 = [1 0 0 0;
0 1 0 0]
Error Message:
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to
reduce operands to logical scalar values.
Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)
editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);
Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)
action.UpdateActionState();
Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)
this.updateActionStates();
Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)
this.enableListenersAndUpdateActionStates();
Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)
this.ActionDataService.initActionStates();
Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)
ActionManager.initActions(startPath, classType);
Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)
builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), …The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.
Help? I am so confused
Script I am running:
%% Problem 1
k1 = 10;
k2 = 5;
k3 = 8;
k4 = 10;
k5 = 20;
L1 = [1 0 0 0;
0 1 0 0]
Error Message:
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to
reduce operands to logical scalar values.
Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)
editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);
Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)
action.UpdateActionState();
Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)
this.updateActionStates();
Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)
this.enableListenersAndUpdateActionStates();
Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)
this.ActionDataService.initActionStates();
Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)
ActionManager.initActions(startPath, classType);
Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)
builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), … The Summery is essentially it. I created a script four months ago and accidentially used the wrong syntax (&&) and it has corrupted my Matlab Online. I can run scripts with only comments, but as soon as I add anything else I get the errors back.
Help? I am so confused
Script I am running:
%% Problem 1
k1 = 10;
k2 = 5;
k3 = 8;
k4 = 10;
k5 = 20;
L1 = [1 0 0 0;
0 1 0 0]
Error Message:
Operands to the logical AND (&&) and OR (||) operators must be convertible to logical scalar values. Use the ANY or ALL functions to
reduce operands to logical scalar values.
Error in internal.matlab.variableeditor.Actions.struct.EditActionBase/UpdateActionState (line 33)
editable = height(sRows) == 1 && (sRows(2)-sRows(1)+1 == 1);
Error in internal.matlab.variableeditor.VEActionDataService/updateActionStates (line 138)
action.UpdateActionState();
Error in internal.matlab.variableeditor.VEActionDataService/enableListenersAndUpdateActionStates (line 84)
this.updateActionStates();
Error in internal.matlab.variableeditor.VEActionDataService/initActionStates (line 54)
this.enableListenersAndUpdateActionStates();
Error in internal.matlab.datatoolsservices.actiondataservice.ActionManager/initActions (line 55)
this.ActionDataService.initActionStates();
Error in internal.matlab.variableeditor.peer.RemoteManager/callInitActionOnIdle (line 376)
ActionManager.initActions(startPath, classType);
Error in internal.matlab.variableeditor.peer.RemoteManager>@()this.callInitActionOnIdle(actionNamespace,startPath,classType,ActionManager) (line 121)
builtin(‘_dtcallback’, @() this.callInitActionOnIdle(actionNamespace, startPath, classType, ActionManager), … help, persistent error, have i broken matlab? MATLAB Answers — New Questions
Inconsistent Results Referencing Nested Subreport Property
I have placed several subreports in an unbound report’s Report Header. Each subreport has two subreports. I’m trying to get the value of the Top property of the first of these sub-subreports, but I’m getting inconsistent results. The reference I’m (currently) using in the OnLoad event of the main report is:
intSubSubTop = Me.Controls(strSub1).Report.Controls(strSubSub1).Top
This works perfectly when I switch from Design View to Print View, but I get a runtime error (2455: the expression “has an invalid reference to the property Form/Report”) when I open the report from the navigation pane. What’s the difference between these two actions?
I’ve tried different variations to no avail. What do I need to do to make it work consistently?
I’m using Access 2010 on Windows 10 Pro
I have placed several subreports in an unbound report’s Report Header. Each subreport has two subreports. I’m trying to get the value of the Top property of the first of these sub-subreports, but I’m getting inconsistent results. The reference I’m (currently) using in the OnLoad event of the main report is:intSubSubTop = Me.Controls(strSub1).Report.Controls(strSubSub1).Top This works perfectly when I switch from Design View to Print View, but I get a runtime error (2455: the expression “has an invalid reference to the property Form/Report”) when I open the report from the navigation pane. What’s the difference between these two actions? I’ve tried different variations to no avail. What do I need to do to make it work consistently? I’m using Access 2010 on Windows 10 Pro Read More
HTML file to PDF file, deal with base64,svg picture problem solution.
HTML file to PDF file, error when processing base64,svg imagesHTML file to PDF file, error when processing base64,svg images HTML file to PDF file, error when processing base64,svg images html, simulink, pdf MATLAB Answers — New Questions
Include rows containing specific value
I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.
newData=[Data(find(Data.Biology == 0.456, :))]I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.
newData=[Data(find(Data.Biology == 0.456, :))] I have a 1400*9 table (1400 rows and 9 columns) in MATLAB workspace. Each column has a different name. I want to select rows containing specific value. For example, how can I create a new table containig all rows with value of 0.456 in the column named "Biology"? I tried to use following code, but it gave error.
newData=[Data(find(Data.Biology == 0.456, :))] table, find MATLAB Answers — New Questions
Force saved figure to use a specific number of pixels
I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.
It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid.I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.
It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid. I am saving different maps, I need to compare some specific pixels, but Matlab somehow adds a line at the bottom (3 pixels) for example when I save my image, which kills everything I try to do later. Is there any method to force exportgraphics to use X pixels horizontally and Y vertically (I mean height and width)? Or when I call my figure to be X and Y dimensions? Force it not to add this line. I tried exportgraphics/export_fig they both fail at it.
It is not random, as only some specific files get the line added and always even if I try to replot, I still did not figure out why this happens, my data have the same resolution/grid. image-processing, exportgraphics MATLAB Answers — New Questions
Working in Excel with live on MATLAB
On matlab, I am going to import an Excel file and work on it live in real time.
If I change the value in Excel, I want to reflect it in real time in MATLAB.
However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.
Is there a way to solve this?On matlab, I am going to import an Excel file and work on it live in real time.
If I change the value in Excel, I want to reflect it in real time in MATLAB.
However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.
Is there a way to solve this? On matlab, I am going to import an Excel file and work on it live in real time.
If I change the value in Excel, I want to reflect it in real time in MATLAB.
However, as far as I know, if you modify it without saving the Excel, it cannot be applied in MATLAB right away.
Is there a way to solve this? excel, live MATLAB Answers — New Questions
SSMS 19 and 20 connection delay or timeout
I connect to one Azure SQL database hosted on “site”.database.windows.net. Ever since installing SSMS 19 and continuing with 20 I have a problem where the database connection seems to timeout or drop. When this happens SSMS hangs for 5 minutes. It happens after I open an Edit connection and let it idle View connections don’t cause the problem. I can go back to 18 and the problem doesn’t happen. It seems like the connection drops and then takes 300 seconds to timeout and retry. Then it works again until it idles again. It is super frustrating.
I connect to one Azure SQL database hosted on “site”.database.windows.net. Ever since installing SSMS 19 and continuing with 20 I have a problem where the database connection seems to timeout or drop. When this happens SSMS hangs for 5 minutes. It happens after I open an Edit connection and let it idle View connections don’t cause the problem. I can go back to 18 and the problem doesn’t happen. It seems like the connection drops and then takes 300 seconds to timeout and retry. Then it works again until it idles again. It is super frustrating. Read More
Planner – My tasks page
The My tasks page in Planner is lacking basic features such as the ability to group by Tag or group by bucket – could a ‘grouping’ function by added to the My Tasks screen please?
The My tasks page in Planner is lacking basic features such as the ability to group by Tag or group by bucket – could a ‘grouping’ function by added to the My Tasks screen please? Read More
Maximize Efficiency with AI: Join “Meet Copilot in Loop” – Part 4
Hello Copilot Community,
You’re invited to join us for Part 4 of the Microsoft Loop | 5-Part Learning Series, titled “Meet Copilot in Loop” with Jenna Hong and Oby Omu. This session is tailor-made for those looking to supercharge their productivity through innovative AI integration.
Event Details:
Date: Wednesday, September 4th, 2024
Time: 10:00 AM to 10:30 AM PDT
What You’ll Gain:
Automated Content Creation: Learn how AI can kickstart your projects by generating initial content, freeing up your time for strategic endeavors.
Team Synchronization: Experience how a Loop-powered assistant can keep your projects on track and your team aligned, reducing miscommunications and improving project flow.
Meeting Optimization: Discover tools that transform your Microsoft Teams meetings, making them more efficient through automated summaries and quick information retrieval.
Why This Matters: Your engagement in this series not only enhances your skill set but also contributes to the development of Copilot in Loop. The insights you provide help shape the tool to better meet your needs.
Your Input Matters: We encourage you to engage actively by asking questions and sharing comments on the event page now. Your insights are invaluable and will be addressed during our live discussion, helping shape the evolution of Copilot in Loop.
RSVP here to join us and start the conversation!
Looking forward to your participation and insights as we explore these groundbreaking tools together!
Until we meet again! Stay curious and connected.
Sarah Gilbert, Your Copilot Community Navigator
Hello Copilot Community,
You’re invited to join us for Part 4 of the Microsoft Loop | 5-Part Learning Series, titled “Meet Copilot in Loop” with Jenna Hong and Oby Omu. This session is tailor-made for those looking to supercharge their productivity through innovative AI integration.
Event Details:
Date: Wednesday, September 4th, 2024
Time: 10:00 AM to 10:30 AM PDT
What You’ll Gain:
Automated Content Creation: Learn how AI can kickstart your projects by generating initial content, freeing up your time for strategic endeavors.
Team Synchronization: Experience how a Loop-powered assistant can keep your projects on track and your team aligned, reducing miscommunications and improving project flow.
Meeting Optimization: Discover tools that transform your Microsoft Teams meetings, making them more efficient through automated summaries and quick information retrieval.
Why This Matters: Your engagement in this series not only enhances your skill set but also contributes to the development of Copilot in Loop. The insights you provide help shape the tool to better meet your needs.
Your Input Matters: We encourage you to engage actively by asking questions and sharing comments on the event page now. Your insights are invaluable and will be addressed during our live discussion, helping shape the evolution of Copilot in Loop.
RSVP here to join us and start the conversation!
Looking forward to your participation and insights as we explore these groundbreaking tools together!
Until we meet again! Stay curious and connected.
Sarah Gilbert, Your Copilot Community Navigator Read More
How to Filter Empty Text and Image Columns in SharePoint List?
Hi Everyone,
I’m working with a SharePoint list and trying to filter out items where certain columns, specifically a Text column and an Image column, haven’t been filled in (i.e., they are empty or null).
However, I’m running into some challenges:
I don’t want to make these fields required.I know that Power Automate could be used to address this, but I’m looking for a solution directly within SharePoint.I tried creating a custom view, but the filter options for Text and Image columns are limited to “contains” or “begins with.” Using “starts with” or “contains” with a blank or zero value didn’t work.I also attempted creating a calculated column to check if the Text column is filled, but calculated columns don’t seem to work with Text or Image columns.
Does anyone have any suggestions or workarounds that might help?
Thanks in advance!
Hi Everyone,I’m working with a SharePoint list and trying to filter out items where certain columns, specifically a Text column and an Image column, haven’t been filled in (i.e., they are empty or null).However, I’m running into some challenges:I don’t want to make these fields required.I know that Power Automate could be used to address this, but I’m looking for a solution directly within SharePoint.I tried creating a custom view, but the filter options for Text and Image columns are limited to “contains” or “begins with.” Using “starts with” or “contains” with a blank or zero value didn’t work.I also attempted creating a calculated column to check if the Text column is filled, but calculated columns don’t seem to work with Text or Image columns.Does anyone have any suggestions or workarounds that might help?Thanks in advance! Read More
Managing Multiple M365 Administrator Accounts with Microsoft Authenticator Backup
Hello Tech Community,
I am looking for some advice on how to efficiently manage and back up multiple M365 Administrator accounts using the Microsoft Authenticator app. As an IT Support professional working with multiple clients, I have a dedicated Global Administrator account for each client, and all accounts are secured with Multi-Factor Authentication (MFA) using Microsoft Authenticator.
Setting up each Global Admin account with the Authenticator app is fairly straightforward, but I’ve run into an issue when trying to transfer these accounts to a new smartphone. While the Microsoft Authenticator app does transfer accounts to the new device, it seems that MFA will no longer work unless you scan a new QR code for each account. However, logging into these Global Admin accounts to obtain the new QR code is not feasible since MFA is required, creating a bit of a catch-22.
I’d prefer not to resort to other authentication methods (SMS, email, etc.) for these Global Admin accounts, as it adds unnecessary complexity and potential vulnerabilities. Has anyone found a reliable solution for seamlessly backing up and transferring these MFA-enabled Global Admin accounts to a new phone without needing to re-authenticate via QR code? Any insights or best practices would be greatly appreciated!
Hello Tech Community, I am looking for some advice on how to efficiently manage and back up multiple M365 Administrator accounts using the Microsoft Authenticator app. As an IT Support professional working with multiple clients, I have a dedicated Global Administrator account for each client, and all accounts are secured with Multi-Factor Authentication (MFA) using Microsoft Authenticator. Setting up each Global Admin account with the Authenticator app is fairly straightforward, but I’ve run into an issue when trying to transfer these accounts to a new smartphone. While the Microsoft Authenticator app does transfer accounts to the new device, it seems that MFA will no longer work unless you scan a new QR code for each account. However, logging into these Global Admin accounts to obtain the new QR code is not feasible since MFA is required, creating a bit of a catch-22. I’d prefer not to resort to other authentication methods (SMS, email, etc.) for these Global Admin accounts, as it adds unnecessary complexity and potential vulnerabilities. Has anyone found a reliable solution for seamlessly backing up and transferring these MFA-enabled Global Admin accounts to a new phone without needing to re-authenticate via QR code? Any insights or best practices would be greatly appreciated! Read More
Application Pool Does Not Recycle at Defined Conditions
Have you ever wondered why the Application Pool sometimes fails to recycle according to the specified conditions, such as regular time intervals or specific schedules? There can be various reasons behind this unexpected behavior. In this article, we will explore the most common causes of this issue.
Problem
For the context of this discussion, we have set the recycling condition to occur every 60 minutes. Ideally, the Application Pool should recycle automatically at these regular intervals.
We can confirm the recycling event in the system event logs. As illustrated in the image below, there is an event from the WAS source indicating that the worker process with the process ID ‘<process id of the w3wp.exe>’, serving the application pool ‘<application pool name>’, has requested a recycle because it reached its allowed processing time limit.
However, in some cases, this event may not appear, or the Application Pool does not recycle at the scheduled time or under the specified conditions. The most common reason for this is that the worker process may have already shut down due to inactivity or other factors. To verify this, check the advanced settings of the Application Pool and review the Idle Time-out setting.
Now, look for events from the WAS source to see if there is an entry stating, “A worker process with process ID ‘<process id>’ serving application pool ‘<application pool name>’ was shut down due to inactivity. Application Pool timeout configuration was set to 20 minutes. A new worker process will be started when needed.”
You should also verify if there were no requests made between the time the application pool shut down and the scheduled recycle time. This will confirm that no worker process was running to service requests during that period. You can check this by reviewing the IIS logs. While I won’t go into detail here, analyzing IIS logs could be a separate topic for discussion.
Cause
In summary, if no worker process is running, the recycling conditions for regular intervals or specific times won’t trigger a recycle of the application pool.
Conclusion
In conclusion, understanding why an Application Pool may not recycle according to its defined conditions requires a comprehensive review of several factors. Various issues can prevent this from happening as expected. The most common cause is the shutdown of the worker process due to inactivity, which can result in the application pool not recycling at the scheduled time.
By checking the system event logs for relevant events and verifying the Idle Time-out settings in the Application Pool’s advanced settings, you can identify whether inactivity or other issues are affecting the recycling process. Additionally, reviewing IIS logs to confirm that no requests were made between the shutdown and scheduled recycle time will help ensure that no worker process was available to handle requests.
Ultimately, if no worker process is running, the application pool’s recycling conditions will not be triggered, thus preventing the recycle from occurring. Addressing these issues and ensuring proper configuration can help maintain the reliability and performance of your application pool.
Microsoft Tech Community – Latest Blogs –Read More
How to fix Failed to Load API Definition error in SwaggerUI when hosting an ASP.NET Core API in IIS
When hosting an ASP.NET Core API, it’s not uncommon to encounter the “Failed to load API definition” error in SwaggerUI. This article will explore the reasons behind this error and provide steps to resolve it.
Problem
You have an ASP.NET Core API with Swagger OpenAPI, and used the following code snippet to add and configure Swagger middleware.
//adding swagger middleware
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
//enable the middleware for serving the generated JSON document and the Swagger UI,
app.UseSwagger();
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint(“/swagger/v1/swagger.json”, “DemoAPI v1”);
});
After deploying the application in IIS as a site, everything works fine, and Swagger UI functions correctly. However, when the same application is deployed under an existing site as an application, you start encountering the “Failed to load API definition” error. In the example below, the API is hosted under the “ExceptionLab” site and is listening on port 82.
Browsing the Swagger endpoint of the API results in the “Failed to load API definition” error.
Cause
The root cause of this issue lies in the Swagger Endpoint definition. If you inspect it in the developer console, you’ll see a 404 error indicating that /swagger/v1/swagger.json was not found.
The Swagger UI is correctly pointing to localhost:82/API, but the page is trying to retrieve the swagger.json from the parent site, which causes the error.
Solution
Resolving this issue is straightforward. You need to update the Swagger endpoint definition. You can either remove the SwaggerEndpoint entirely and allow the application to determine the correct URL automatically (though this removes customization options), or you can update the endpoint as follows:
app.UseSwaggerUI(c =>
{
c.SwaggerEndpoint(“../swagger/v1/swagger.json”, “DemoAPI v1”);
});
Add two extra dots “..” at the beginning of the path, as shown in the example above. This adjustment should resolve the “Failed to load API definition” error by accurately pointing to the swagger.json file, ensuring that SwaggerUI loads correctly.
Microsoft Tech Community – Latest Blogs –Read More
Application Initialization in IIS
Introduction
While many customers know that application takes a little time after they are pushed with new set of code/release but are not aware of mitigating this to make the application highly available and reliable. Usually, Web applications often face challenges related to slow startup times, especially when deployed in environments where resources are allocated dynamically or when applications are not frequently accessed. Microsoft introduced the Application Initialization feature in IIS 8.0 to address this issue. This feature ensures that your applications are always ready to serve requests, providing a smoother and faster user experience. Let’s look at this in more detail.
Let’s figure out what the Application Initialization is:
Application Initialization is a feature in Internet Information Services (IIS) that preloads applications before they receive any traffic. This preloading helps to avoid delays that typically occur when the first user accesses the application, particularly after a restart or deployment. By proactively warming up your application, you can minimize the wait time for users, leading to improved performance and user satisfaction.
Let’s review it’s properties now:
PreloadEnabled Setting –
The PreloadEnabled setting is important in enabling the Application Initialization feature. When set to true, IIS will automatically start the application and keep it in a ready state, even if there is no incoming traffic.
This feature is particularly useful for applications with heavy startup processes, such as those requiring multiple service initializations or database connections.
Warm-Up Requests
IIS allows administrators to configure warm-up requests that simulate user access to the application. This means that specific pages or endpoints can be requested to ensure that all necessary components are loaded and initialized.
For flexibility, these warm-up requests are customizable, allowing administrators to define which URLs should be accessed during the initialization process.
Custom Initialization Actions
Application Initialization supports custom initialization actions, enabling you to perform specific tasks during the application startup. These actions can include preloading dependencies, running scripts, or executing other startup logic to ensure the application is fully operational when accessed.
By utilizing custom actions, you can further optimize the startup process, ensuring that critical components are ready before users interact with the application.
We will now review Benefits of Application Initialization
Improved User Experience
Consider you have an application which is highly available and can accommodate frequent changes. This may lead to high response time whenever a new deployment goes in. To improve the user experience, enabling application Initialization, users will no longer have to wait for the application to start up. Instead, they experience near-instantaneous responses, which is crucial for maintaining high levels of user satisfaction.
Increased Reliability
By ensuring that the application is fully loaded and operational before handling requests, you reduce the risk of errors or delays caused by uninitialized components. This leads to a more stable and reliable application.
Better Resource Management
Application Initialization allows for better resource management by keeping applications ready without consuming excessive resources. This balance between readiness and resource utilization is key in maintaining optimal server performance.
Configuring Application Initialization in IIS
To configure Application Initialization, you’ll need to modify the applicationHost.config/website’s web.config file or use the IIS Manager UI:
1. Enable the Feature
In IIS Manager, navigate to the desired application, and open the “Application Initialization” feature. Set the Preload Enabled option to True.
2. Configure Warm-Up URLs
Define specific URLs to be accessed during the warm-up phase. These URLs should be selected based on the components that need to be initialized.
3. Add Custom Initialization Actions
If your application requires additional startup logic, you can add custom initialization actions by editing the configuration file or using the IIS Manager.
Refer the screenshot, where I am trying to set it up in the web.config.
Please note that the changes can be made to Applicationhost.config by just selectin it from the dropdown. The benefit of this moving to Applicationhost.config is when you are having the continuous deployment and your web.config is also updated then this setting would not be affected at all.
The detail description of all these settings can be found here.
Application Initialization <applicationInitialization> | Microsoft Learn
In addition to application initialization, you can enable the initialization process to start whenever the application pool is started. You do so by setting the preLoadEnabled attribute in the <application> element to “true”. For this to occur, the start mode in the <applicationPool> element must be set to AlwaysRunning.
IIS 8.0 Application Initialization | Microsoft Learn
What we learnt:
Application Initialization in IIS is a powerful tool that enhances the user experience by ensuring that applications are always ready to handle requests. By preloading applications and allowing for custom warm-up actions, this feature minimizes delays and improves the overall performance of web applications. Whether you’re managing a high-traffic site or an internal application, enabling Application Initialization is a step towards better reliability and user satisfaction.
Microsoft Tech Community – Latest Blogs –Read More
Fetching Windows Auth User ID Issue in Python Flask Application on IIS with HttpPlatformHandler
Problem : Deploying Python Flask applications on IIS can be a smooth process, but occasionally, issues arise that require careful troubleshooting. One such issue involves the failure of a Flask application to retrieve the Windows Authentication user ID when using the HttpPlatformHandler. Please note that retrieving the user details was successful using WFastCGI but not with HttpPlatformHandler. Let’s see how we can fetch the user details in such scenario.
Few Pointers :
Move to HttpPlateFormHandlers form WFastCGI: WFastCGI is no longer maintained. Refer to this.
Configure Python web apps for IIS – Visual Studio (Windows) | Microsoft Learn
Configuration Adjustment:
A key step was enabling the ForwardWindowsAuthToken option in the HttpPlatformHandler configuration. This setting forwards the Windows Authentication token to the application, allowing it to be accessed and processed within the code.
Code Implementation:
After adjusting the configuration, you can update the Flask application code to fetch the Windows Authentication user ID. The following code snippet demonstrates how this was done:
from flask import Flask, request, render_template
import os
import win32api
import win32security
def create_app():
app = Flask(__name__)
@app.route(“/”)
def hello_world():
s_vars = request.environ
user = os.environ.get(‘USERNAME’)
handle_str = request.headers[‘x-iis-windowsauthtoken’]
handle = int(handle_str,16)
win32security.ImpersonateLoggedOnUser(handle)
user1 = win32api.GetUserName()
win32api.CloseHandle(handle)
return f”Hello World!: {user1}”
return app
This code snippet demonstrates how to use the win32api and win32security modules to impersonate the logged-on user and retrieve their username. The important element here is the x-iis-windowsauthtoken header, which contains the Windows Authentication token passed on by the HttpPlatformHandler.
Ensure Dependencies:
Please ensure that the pywin32 package is installed, as it provides the necessary functionality to interact with Windows APIs within the Python environment.
For further information, refer to the following resources:
Configure Web Apps for IIS in Python
HttpPlatformHandler Configuration Reference
Microsoft Tech Community – Latest Blogs –Read More