Month: June 2024
Automate prompt analysis update through VBA
I am trying to update the prompts in Analysis – which I do currently manually every month – for Excel; however, despite I am getting the value from technical name (which I guess is correct though), I can’t change it with the code bellow:
Public currentDateRange As String
Public expectedDateRange As String
Sub GetInfoFROMVariables()
Dim msg As String
currentDateRange = Application.Run(“SAPGetVariable”, “DS_1”, “ZCALMDEF”)
‘****Here the MsgBox currentDateRange retrieves the current value for ZCALMDEF, which is “2024/06 – 2024/11”.
MsgBox currentDateRange
expectedDateRange = GetNextMonthYear() & ” – ” & GetFutureMonthYear(6)
MsgBox expectedDateRange
End Sub
Function GetNextMonthYear() As String
Dim startMonth As Date
startMonth = DateAdd(“m”, 1, Date)
GetNextMonthYear = Format(startMonth, “yyyy/mm”)
End Function
Function GetFutureMonthYear(monthsAhead As Integer) As String
Dim futureDate As Date
futureDate = DateAdd(“m”, monthsAhead, Date)
GetFutureMonthYear = Format(futureDate, “yyyy/mm”)
End Function
Sub AtualizarPROMPTAnalysis()
Call GetInfoFROMVariables
If currentDateRange <> expectedDateRange Then
Application.ScreenUpdating = False
‘*****Here it does not work, neither the ARRAY or the expectedDateRange commands.
‘Application.Run “SAPSetVariable”, “DS_1”, “ZCALMDEF”, Array(GetNextMonthYear(), GetFutureMonthYear(7))
Application.Run “SAPSetVariable”, “DS_1”, “ZCALMDEF”, expectedDateRange
Application.ScreenUpdating = False
RefreshAll = Application.Run(“SAPExecuteCommand”, “Refresh”)
Application.ScreenUpdating = True
‘Here it shows normally what is expected “2024/07 – 2024/12”
MsgBox expectedDateRange
End If
‘
End Sub
Technical name is checked, also I know it is ok because I retrieved this value with MsgBox currentDateValue normally.
Thank you very much for your kindly attention and sharing your knowledge.
I am trying to update the prompts in Analysis – which I do currently manually every month – for Excel; however, despite I am getting the value from technical name (which I guess is correct though), I can’t change it with the code bellow: Public currentDateRange As String
Public expectedDateRange As String
Sub GetInfoFROMVariables()
Dim msg As String
currentDateRange = Application.Run(“SAPGetVariable”, “DS_1”, “ZCALMDEF”)
‘****Here the MsgBox currentDateRange retrieves the current value for ZCALMDEF, which is “2024/06 – 2024/11”.
MsgBox currentDateRange
expectedDateRange = GetNextMonthYear() & ” – ” & GetFutureMonthYear(6)
MsgBox expectedDateRange
End Sub
Function GetNextMonthYear() As String
Dim startMonth As Date
startMonth = DateAdd(“m”, 1, Date)
GetNextMonthYear = Format(startMonth, “yyyy/mm”)
End Function
Function GetFutureMonthYear(monthsAhead As Integer) As String
Dim futureDate As Date
futureDate = DateAdd(“m”, monthsAhead, Date)
GetFutureMonthYear = Format(futureDate, “yyyy/mm”)
End Function
Sub AtualizarPROMPTAnalysis()
Call GetInfoFROMVariables
If currentDateRange <> expectedDateRange Then
Application.ScreenUpdating = False
‘*****Here it does not work, neither the ARRAY or the expectedDateRange commands.
‘Application.Run “SAPSetVariable”, “DS_1”, “ZCALMDEF”, Array(GetNextMonthYear(), GetFutureMonthYear(7))
Application.Run “SAPSetVariable”, “DS_1”, “ZCALMDEF”, expectedDateRange
Application.ScreenUpdating = False
RefreshAll = Application.Run(“SAPExecuteCommand”, “Refresh”)
Application.ScreenUpdating = True
‘Here it shows normally what is expected “2024/07 – 2024/12”
MsgBox expectedDateRange
End If
‘
End Sub Technical name is checked, also I know it is ok because I retrieved this value with MsgBox currentDateValue normally.Thank you very much for your kindly attention and sharing your knowledge. Read More
How to Generate Smooth Transitional Trapezoidal Signal in Simulink
Hi, everyone. I want to generate a custom signal demonstrated as follow image in Simulink, I have tried the Signal Editor Block, but the generated trapezoidal signal does not have smooth transition as showed in the attached image.
I would be appreciated that someone could give me some suggestions.Hi, everyone. I want to generate a custom signal demonstrated as follow image in Simulink, I have tried the Signal Editor Block, but the generated trapezoidal signal does not have smooth transition as showed in the attached image.
I would be appreciated that someone could give me some suggestions. Hi, everyone. I want to generate a custom signal demonstrated as follow image in Simulink, I have tried the Signal Editor Block, but the generated trapezoidal signal does not have smooth transition as showed in the attached image.
I would be appreciated that someone could give me some suggestions. signal generation, trapezoidal signal, simulink MATLAB Answers — New Questions
ostをpstに変換する方法?
Advik OST PST 変換をダウンロードしてインストールします。このソフトウェアは、同じフォルダー構造でostをpst形式に変換するのに役立ちます。このソフトウェアは、すべての電子メール、連絡先、カレンダー、メモ、タスク、ost から pst までのすべてをエクスポートします。
ost pst変換の手順
advik ost pst 変換を実行します。「ファイルを追加」をクリックし、ostファイルを追加します。メールボックスフォルダーを選択します。保存オプションとして pst を選択します。変換ボタンをクリックします。
ソフトウェアは、Outlook 2016、2019、2021 用に ost を pst に変換し始めます。
Advik OST PST 変換をダウンロードしてインストールします。このソフトウェアは、同じフォルダー構造でostをpst形式に変換するのに役立ちます。このソフトウェアは、すべての電子メール、連絡先、カレンダー、メモ、タスク、ost から pst までのすべてをエクスポートします。ost pst変換の手順advik ost pst 変換を実行します。「ファイルを追加」をクリックし、ostファイルを追加します。メールボックスフォルダーを選択します。保存オプションとして pst を選択します。変換ボタンをクリックします。ソフトウェアは、Outlook 2016、2019、2021 用に ost を pst に変換し始めます。 Read More
7 Best OST to PST Converter Software for Outlook
Check out the list of best OST to PST Converter utilities in 2024. The below applications are ranked according to the perfection, accuracy and reliability. Take the help from below solutions for converting OST to PST format.
7 Best OST to PST Converter Software in 2024
Advik OST to PST ConverterXtraxtorYota OST File ConverterSystools OST to PST ConvertRecoverytools OST 2 PST WizardBitrecover OST to PST SoftwarePCVita Outlook OST Converter
Check out the list of best OST to PST Converter utilities in 2024. The below applications are ranked according to the perfection, accuracy and reliability. Take the help from below solutions for converting OST to PST format. 7 Best OST to PST Converter Software in 2024Advik OST to PST ConverterXtraxtorYota OST File ConverterSystools OST to PST ConvertRecoverytools OST 2 PST WizardBitrecover OST to PST SoftwarePCVita Outlook OST Converter Read More
List of 7 Best MBOX to PST Converter for Outlook
Looking for the best MBOX to PST Converter? Take the help from this post and find out the best one for convert mbox to pst format. After testing more than 20+ applications we found only 7 genuine tools for converting MBOX to PST. Check out the list below.
Top 7 Best MBOX to PST Converter Software
Advik MBOX to PST ConverterYota MBOX to Outlook ConverterXtraxtorSystools MBOX to PST ToolBitrecover MBOX to PST ConversionSoftaken MBOX File ConverterCorbett MBOX to PST Tool
Looking for the best MBOX to PST Converter? Take the help from this post and find out the best one for convert mbox to pst format. After testing more than 20+ applications we found only 7 genuine tools for converting MBOX to PST. Check out the list below. Top 7 Best MBOX to PST Converter SoftwareAdvik MBOX to PST ConverterYota MBOX to Outlook ConverterXtraxtorSystools MBOX to PST ToolBitrecover MBOX to PST ConversionSoftaken MBOX File ConverterCorbett MBOX to PST Tool Read More
Use Microsoft Entra to connect Azure Database for MySQL via Function App
TOC
Why we use it
Architecture
How to use it
References
Why we use it
An increasing number of security vulnerabilities are caused by sensitive information in the source code being leaked or accidentally uploaded to open repositories GitHub, leading to the exposure of a large amount of user privacy. This information includes, but is not limited to, database credentials, app keys, etc. Traditional MySQL databases use usernames and passwords for login operations, naturally leading to the inclusion of these credentials in project configuration files. Even with proper safeguards, there remain unpredictable risks, such as hacking.
This tutorial will introduce how to integrate Microsoft Entra with Azure Database for MySQL to avoid using fixed usernames and passwords. By utilizing system-assigned managed identities and user-assigned managed identities as a programmatic bridge, it becomes easier for Azure-related PaaS services (such as Function App or App Services) to communicate with the database without storing connection information in plain text.
Architecture
I will introduce each service or component and their configurations in subsequent chapters according to the order of A-E:
A: The company’s account administrator needs to create or designate a user as the database administrator. This role can only be assigned to one person within the database and is responsible for basic configuration and the creation and maintenance of other database users. It is not intended for development or actual system operations.
B: The company’s development department needs to create a Function App (or other service) as the basic unit of the business system. Programmers within this unit will write business logic (e.g., accessing the database) and deploy it here.
C: The company’s development department needs to create and manage a system-assigned managed identity for the Function App. In the future, the Function App will issue access requests to the database under its own identity.
D: The company’s security department needs to create one or more user-assigned managed identities. In the future, the Function App will issue access requests to the database under different user identities.
E: The company’s data department needs to create or maintain a database and designate Microsoft Entra as the only login method, eliminating other fixed username/password combinations.
For steps C and D, you can choose to implement one method or both, depending on your business scenarios.
How to use it
A: As this article does not dive into the detailed configuration of Microsoft Entra, it will only outline the process. The company’s account administrator needs to create or designate a user as the database administrator. In this example, we will call this user “cch,” and the account, “cch@thexxxxxxxxxxxx” will be used in subsequent steps.
B-1: In this example, we can create a Function App with any SKU/region. For the development language (stack), we choose Python as a demonstration, though other languages also support the same functionality. Since this article does not cover the detailed network configuration or other specifics of the Function App, we will use the default values for other settings. Simply click on “Review + Create,” and then click on “Create” to complete the process.
C-1: Meanwhile, in the Function App, navigate to the “Identity” option. We need to enable its system-assigned managed identity and make a note of its Object ID for use in next steps.
C-2: To get the detailed information of this system-assigned managed identity, please navigate to Microsoft Entra. Click on “Enterprise Applications,” then search for the name of your Function App in the search bar, and make sure to disable the application type filter.
After selecting this application, you will be able to obtain the application ID of the system-assigned managed identity from its page. Please make a note of this ID, as it will be used in subsequent steps.
D-1: Please open Azure Cloud Shell in the PowerShell mode and enter a command similar to the one below to create a user-assigned managed identity. You will need to change the <text> to follow your company’s naming conventions. Once the creation is successful, please note the returned values for “clientid” and “id” as these will be used in subsequent steps.
az identity create –resource-group <YOUR_RG_NAME> –name <YOUR_IDENTITY_NAME>
D-2: Staying in PowerShell mode, you will then need to use the “id” obtained in step D-1 to construct a command that will bind this user-assigned managed identity to the Function App.
az functionapp identity assign –resource-group <YOUR_RG_NAME> –name <YOUR_FUNCTION_APP_NAME> –identities <ID_IN_STEP_D1>
E-1: Create a database. During this process, you need to specify the user created in Step A as the database administrator and specify the user-assigned managed identity created in Step D as the entity that will actually operate the database. Please note that the MySQL version needs to be at least 5.7 or higher, and for the authentication method, select “Microsoft Entra authentication only.” In this mode, the username/password will no longer be used. Then, click on “Next: Networking.”
Since this article does not cover the detailed network configuration of the database, temporarily allow public access during the tutorial. Use the default values for other settings, click on “Review + Create,” and then click “Create” to finish the setup.
E-2: After the database is created, you can log in using the identity “cch@thexxxxxxxxxxxx” you’ve get from Step A which is the database administrator. Log in to the Azure portal using the “cch” account, open an Azure Cloud Shell, and switch to Bash mode. Then, enter the following command to log in to MySQL. You will need to change the <text> to follow your company’s naming conventions.
mysql -h <YOUR_DB_NAME>.mysql.database.azure.com –user <YOUR_FULL_USER_EMAIL> –enable-cleartext-plugin –password=`az account get-access-token –resource-type oss-rdbms –output tsv –query accessToken`
Here, we additionally introduce the method for logging in using a GUI-related MySQL client. In the previous command, you may notice a nested command enclosed within backticks “. This is used to get an access token for database access as the “cch” user. This token can be used as the password when logging into MySQL clients (e.g., DataGrip, HeidiSQL).
az account get-access-token –resource-type oss-rdbms –output tsv –query accessToken
Returning to the MySQL console, we will now create user accounts in MySQL for the managed identities setup from Step C and Step D. First, we will introduce the method for the user-assigned managed identity. Please enter the following command.
SET aad_auth_validate_oids_in_tenant = OFF;
CREATE AADUSER ‘<SPECIFY_A_PROPER_NAME>’ IDENTIFIED BY ‘<YOUR_CLIENT_ID_FROM_D1>’;
The purpose of these two commands is to create a MySQL user account specifically for the managed identity. You can freely name the account; in this example, I have named it “miuser”.
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON *.* TO ‘<SPECIFY_A_PROPER_NAME>’@’%’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
The purpose of the next two commands is to grant database-related operational permissions to the newly created user. This is just an example. In actual scenarios, you should follow your company’s security policies and make the necessary adjustments accordingly.
Once you are familiar with the method, you can proceed to perform the same operations for the system-assigned managed identity.
SET aad_auth_validate_oids_in_tenant = OFF;
CREATE AADUSER ‘<SPECIFY_A_PROPER_NAME>’ IDENTIFIED BY ‘<YOUR_APP_ID_FROM_C2>’;
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER ON *.* TO ‘<SPECIFY_A_PROPER_NAME>’@’%’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
For testing purposes in later steps, we will create a test database, a test table, and insert some data. Please put this data schema in the mysql console.
CREATE DATABASE test;
USE test;
CREATE TABLE test.welcome_test(
id int AUTO_INCREMENT PRIMARY KEY,
test VARCHAR(4) NOT NULL
) ENGINE=InnoDB;
INSERT INTO test.welcome_test(test) VALUES (‘asdf’);
B-2: Programmer can now deploy the code to the Function App. In this tutorial, we use Python to complete the example and utilize “Programming Model v2”. Other languages also have their respective MySQL connectors and follow the same principles.
In requirements.txt, in addition to the existing azure-functions, please add the following two packages: azure-identity and mysql-connector-python.
azure-functions
azure-identity
mysql-connector-python
In function_app.py, include the following example content:
import azure.functions as func
import logging
import mysql.connector
from mysql.connector import errorcode
import azure.identity
from azure.identity import DefaultAzureCredential
from azure.identity import ManagedIdentityCredential
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@app.route(route=”mysqltest”)
def mysqltest(req: func.HttpRequest) -> func.HttpResponse:
ret = “”
# —————————-
logging.info(‘Get token from system assigned identity’)
smi = DefaultAzureCredential()
stoken = smi.get_token(“https://ossrdbms-aad.database.windows.net”).token
stoken = str(stoken).strip()
sconn = mysql.connector.connect(**{
‘host’:’mimysql-db.mysql.database.azure.com’, # change to your server
‘user’:’smiuser’, # change to your username
‘password’:stoken,
‘auth_plugin’:’mysql_clear_password’,
‘client_flags’: [mysql.connector.ClientFlag.SSL],
‘database’:’test’ # change to your database
})
scursor = sconn.cursor()
scursor.execute(“SELECT * FROM welcome_test;”) # change to your table
srows = scursor.fetchall()
sret = “”
for srow in srows:
sret += str(srow[1])
sconn.commit()
scursor.close()
sconn.close()
# —————————-
logging.info(‘Get token from user assigned identity’)
umi = ManagedIdentityCredential(client_id=”1ddc2a7e-xxxx-xxxx-xxxx-xxxxxxxxxxxx”) # change to your client id from Step D1
utoken = umi.get_token(“https://ossrdbms-aad.database.windows.net”).token
utoken = str(utoken).strip()
uconn = mysql.connector.connect(**{
‘host’:’mimysql-db.mysql.database.azure.com’, # change to your server
‘user’:’miuser’, # change to your username
‘password’:utoken,
‘auth_plugin’:’mysql_clear_password’,
‘client_flags’: [mysql.connector.ClientFlag.SSL],
‘database’:’test’ # change to your database
})
ucursor = uconn.cursor()
ucursor.execute(“SELECT * FROM welcome_test;”) # change to your table
urows = ucursor.fetchall()
uret = “”
for urow in urows:
uret += str(urow[1])
uconn.commit()
ucursor.close()
uconn.close()
# —————————-
return func.HttpResponse(sret + uret)
Please note that the code I provided in this tutorial is only suitable for the testing phase. Its purpose is to verify usability and it is not intended for production use. Ultimately, please make the corresponding modifications based on the business functionality and security guidelines of your own environment.
Once the deployment is complete, you can proceed with testing. We can observe that the Function App will call the authentication endpoint in the background to get an access token. It will then use this token to interact with the database and subsequently print out the queried data.
An important thing in the code is the following snippet.
‘auth_plugin’:’mysql_clear_password’,
Referencing Step E-2, when “cch” used the MySQL console during the connection process, the –enable-cleartext-plugin parameter was used. This parameter means that the client can send the password to the server in clear text because the password is already in the form of an encrypted token. Unlike traditional plain-text passwords that need to be encrypted on the client side before transmission, it can be sent directly in plain text to the server. Different languages and different MySQL connectors may require similar configurations, so this should be noted carefully.
References
Active Directory authentication – Azure Database for MySQL | Microsoft Learn
Use Microsoft Entra ID – Azure Database for MySQL | Microsoft Learn
How to create users for Azure Database for MySQL | Microsoft Learn
Connect with Managed Identity – Azure Database for MySQL | Microsoft Learn
Set up Microsoft Entra authentication – Azure Database for MySQL – Flexible Server | Microsoft Learn
Azure AD authentication for Azure MySQL! (microsoft.com)
Microsoft Tech Community – Latest Blogs –Read More
Matlab is not recognizing sections %%
I am working with Matlab 2018a and for some reason Matlab stop recognizing my sections (%%). Maybe I did something after messing in Home>Preferences, but I’m not really sure. Has anyone had this problem before? I’ve look online and people say "Enable Cell Mode", but I have no idea how to do this in 2018a.
thanks in advance.I am working with Matlab 2018a and for some reason Matlab stop recognizing my sections (%%). Maybe I did something after messing in Home>Preferences, but I’m not really sure. Has anyone had this problem before? I’ve look online and people say "Enable Cell Mode", but I have no idea how to do this in 2018a.
thanks in advance. I am working with Matlab 2018a and for some reason Matlab stop recognizing my sections (%%). Maybe I did something after messing in Home>Preferences, but I’m not really sure. Has anyone had this problem before? I’ve look online and people say "Enable Cell Mode", but I have no idea how to do this in 2018a.
thanks in advance. sections MATLAB Answers — New Questions
Drawing the major and minor axis of an elliptical object in Matlab
This program currently inputs an image of a coin, thresholds it, binarizes it, and finds the major and minor axis lengths of the segmented elliptical using the regionprops function. What I want to do is output a subplot where I draw the axes used to calculate the ‘MajorAxisLength’ and ‘MinorAxisLength’ over the original image. Would really appreciate help with this.
I have appended the code for your perusal.
rgbImage = imread(coin2.jpg);
subplot(2, 3, 1);
imshow(rgbImage, []);
title(‘Original Image’);
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel < 100;
subplot(2, 3, 3);
imshow(binaryImage, []);
title(‘Binarized Image’);
labeledImage = bwlabel(binaryImage);
area_measurements = regionprops(labeledImage,’Area’);
allAreas = [area_measurements.Area];
biggestBlobIndex = find(allAreas == max(allAreas));
keeperBlobsImage = ismember(labeledImage, biggestBlobIndex);
measurements = regionprops(keeperBlobsImage,’MajorAxisLength’,’MinorAxisLength’)
% Display the original color image with outline.
subplot(2, 3, 4);
imshow(rgbImage);
hold on;
title(‘Original Color Image with Outline’, ‘FontSize’,fontSize);
boundaries = bwboundaries(keeperBlobsImage);
blobBoundary = boundaries{1};
plot(blobBoundary(:,2), blobBoundary(:,1), ‘g-‘, ‘LineWidth’, 1);
hold off;This program currently inputs an image of a coin, thresholds it, binarizes it, and finds the major and minor axis lengths of the segmented elliptical using the regionprops function. What I want to do is output a subplot where I draw the axes used to calculate the ‘MajorAxisLength’ and ‘MinorAxisLength’ over the original image. Would really appreciate help with this.
I have appended the code for your perusal.
rgbImage = imread(coin2.jpg);
subplot(2, 3, 1);
imshow(rgbImage, []);
title(‘Original Image’);
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel < 100;
subplot(2, 3, 3);
imshow(binaryImage, []);
title(‘Binarized Image’);
labeledImage = bwlabel(binaryImage);
area_measurements = regionprops(labeledImage,’Area’);
allAreas = [area_measurements.Area];
biggestBlobIndex = find(allAreas == max(allAreas));
keeperBlobsImage = ismember(labeledImage, biggestBlobIndex);
measurements = regionprops(keeperBlobsImage,’MajorAxisLength’,’MinorAxisLength’)
% Display the original color image with outline.
subplot(2, 3, 4);
imshow(rgbImage);
hold on;
title(‘Original Color Image with Outline’, ‘FontSize’,fontSize);
boundaries = bwboundaries(keeperBlobsImage);
blobBoundary = boundaries{1};
plot(blobBoundary(:,2), blobBoundary(:,1), ‘g-‘, ‘LineWidth’, 1);
hold off; This program currently inputs an image of a coin, thresholds it, binarizes it, and finds the major and minor axis lengths of the segmented elliptical using the regionprops function. What I want to do is output a subplot where I draw the axes used to calculate the ‘MajorAxisLength’ and ‘MinorAxisLength’ over the original image. Would really appreciate help with this.
I have appended the code for your perusal.
rgbImage = imread(coin2.jpg);
subplot(2, 3, 1);
imshow(rgbImage, []);
title(‘Original Image’);
redChannel = rgbImage(:, :, 1);
binaryImage = redChannel < 100;
subplot(2, 3, 3);
imshow(binaryImage, []);
title(‘Binarized Image’);
labeledImage = bwlabel(binaryImage);
area_measurements = regionprops(labeledImage,’Area’);
allAreas = [area_measurements.Area];
biggestBlobIndex = find(allAreas == max(allAreas));
keeperBlobsImage = ismember(labeledImage, biggestBlobIndex);
measurements = regionprops(keeperBlobsImage,’MajorAxisLength’,’MinorAxisLength’)
% Display the original color image with outline.
subplot(2, 3, 4);
imshow(rgbImage);
hold on;
title(‘Original Color Image with Outline’, ‘FontSize’,fontSize);
boundaries = bwboundaries(keeperBlobsImage);
blobBoundary = boundaries{1};
plot(blobBoundary(:,2), blobBoundary(:,1), ‘g-‘, ‘LineWidth’, 1);
hold off; matlab, image-processing MATLAB Answers — New Questions
How to remove trailing zeros while display any floating point number ?
format short g;
X=input (‘any>’);
%if input is 93.93
disp (X);
It display 93.930
How to disp 93.93
I can’t remove
format short g;
Bcz of another mathematical reasons and calculations…format short g;
X=input (‘any>’);
%if input is 93.93
disp (X);
It display 93.930
How to disp 93.93
I can’t remove
format short g;
Bcz of another mathematical reasons and calculations… format short g;
X=input (‘any>’);
%if input is 93.93
disp (X);
It display 93.930
How to disp 93.93
I can’t remove
format short g;
Bcz of another mathematical reasons and calculations… zeros, format MATLAB Answers — New Questions
Access to Outlook Classic
HOW CAN I ACCESS MY OUTLOOK CLASSIC MAIL ETC TO EXPORT?
YOUTUBE VIDEO FOUND IS RUBBISH.
ANY AND ALL HELP WILL BE VERY MUCH APPTRRECIATED!
MORE COUNTLESS HOURS NEEDED TO SORT OUT MICROSFT STRANGLEHOLD ONM USERS! YOU HAVE NO CHOICE – YOU WILL DO WHAT WE SAY!!!!!!!!!!!!!!
HOW CAN I ACCESS MY OUTLOOK CLASSIC MAIL ETC TO EXPORT? YOUTUBE VIDEO FOUND IS RUBBISH. ANY AND ALL HELP WILL BE VERY MUCH APPTRRECIATED! MORE COUNTLESS HOURS NEEDED TO SORT OUT MICROSFT STRANGLEHOLD ONM USERS! YOU HAVE NO CHOICE – YOU WILL DO WHAT WE SAY!!!!!!!!!!!!!! Read More
Synchronize any of the folders to the windows explorer interface.
Hello
Please i need your help on this issue.
I can edit all of the files using the Sharepoint web interface. But I can’t synchronize any of the folders to the windows explorer interface.
Hello Please i need your help on this issue. I can edit all of the files using the Sharepoint web interface. But I can’t synchronize any of the folders to the windows explorer interface. Read More
Azure PostgreSQL, Entra ID Authentication and .NET
I’m currently working on a project in which we are using Entra ID rather than a traditional Postgre username and password. This is a great way to secure your database and ensure that only the right people have access to it.
Note: For the purpose of this article, I’m going to use Entra ID to refer to a user identity, as well as a managed identity such as a service principal, as the approach is the same in this context here.
The above linked documentation covers how you would setup the Azure resource with Entra ID as the authentication mode, so I won’t go over that here (also, you can configure that when you initial create the database, or using a Bicep script), instead I want to look at how we use that in a .NET application, because when you’re connecting using Entra ID you don’t have a password to use, or at least not in the traditional sense.
For this, I’m going to use the Npgql library, which is the most popular PostgreSQL driver for .NET. It’s a great library and has a lot of features, and integrates nicely with Entity Framework Core and .NET Aspire.
What makes connecting different
Before we look at the how of connecting, we need to understand why this is a little different to using a username/password approach. When working with a PostgreSQL database that uses a username/password, you would have a connection string that looks like this:
Server=myServerAddress;Port=5432;Database=myDataBase;User Id=myUsername;Password=myPassword;
But when connecting using Entra ID, it looks like this:
Server=server-name.postgres.database.azure.com;Database=postgres;Port=5432;Username=<Entra ID>;Ssl Mode=Require;
Notice how there is no Password field in the connection string. This is because when you connect using Entra ID, you don’t have a password to use. Instead, you need to use a token that is generated by Entra.
Generating a token
When you connect to the database using Entra ID, you need to request an access token from Entra that you can use to authenticate. You can see this in action using the Azure CLI:
az account get-access-token –resource-type oss-rdbms
Which returns something like this:
{
“accessToken”: “<nope!>”,
“expiresOn”: “2024-05-31 17:52:59.000000”,
“expires_on”: 1717141979,
“subscription”: “<nope!>”,
“tenant”: “<nope!>”,
“tokenType”: “Bearer”
}
If you extract the accessToken from the JSON you can then plug that into the connection string for PostgreSQL in the Password argument and you’re good to go.
But it’s not really practical to be running the Azure CLI every time you want to connect to the database, especially since this token is only short lived (you can see the expiry date in the JSON above). Instead, we’re going to want to do this in .NET, and for that we’ll use the Azure.Identity NuGet package.
Using Azure.Identity
Azure.Identity is a library that provides a way to authenticate with Azure services using the Azure SDK, and it contains a class called DefaultAzureCredential that can be used to authenticate. This class is actually a roll-up of a number of different authentication sources, such as Managed Identity, as well as the Azure CLI, Visual Studio, and a bunch of other sources (check out the docs to see all the sources).
To use DefaultAzureCredential you need to install the Azure.Identity NuGet package:
dotnet add package Azure.Identity
Then you can use it in your code like this:
using Azure.Identity;
var credential = new DefaultAzureCredential();
var ctx = new TokenRequestContext([“https://ossrdbms-aad.database.windows.net/.default”]);
var tokenResponse = await credential.GetTokenAsync(ctx);
Console.WriteLine(tokenResponse.Token);
The important part here is that we’re providing a specific scope to the TokenRequestContext of https://ossrdbms-aad.database.windows.net/.default, which grants access to the Azure PostgreSQL Flexible Server. It’s what is being done with the az account get-access-token call and the –resource-type oss-rdbms argument. With this in C# though, we’re able to get the token and then use that to connect to the database.
Handling Token Expiry
One thing to note is that the token that is returned by DefaultAzureCredential is short lived, and will expire after a certain amount of time (24 hours service principal, 4 hours for a user token). This is fine for, say, a console app that is only running for a short period of time, but this becomes a problem if you’re using the connection string in something that is long running, like a web app, since the NpgsqlDataSourceBuilder, the type that is used to build the connection string, should be a singleton.
Thankfully, the authors of Npgsql have given us an approach to handling token refreshes in the box using a Periodic Password Provider. With this feature, we can provide a callback function to be run that will retrieve the password when a connection is opened, and then cache that password for a certain amount of time. This means that we can use the DefaultAzureCredential to get the token, and then use that token to connect to the database.
NpgsqlDataSourceBuilder dataSourceBuilder = new(builder.Configuration.GetConnectionString(“Database”));
dataSourceBuilder.UsePeriodicPasswordProvider(async (_, ct) =>
{
DefaultAzureCredential credential = new();
TokenRequestContext ctx = new([“https://ossrdbms-aad.database.windows.net/.default”]);
AccessToken tokenResponse = await credential.GetTokenAsync(ctx, ct);
return tokenResponse.Token;
}, TimeSpan.FromHours(4), TimeSpan.FromSeconds(10));
On the dataSourceBuilder we call the UsePeriodicPasswordProvider method, passing in a callback function that will get the token, and then two TimeSpan objects that represent the refresh period and the failure refresh period. The refresh period is how often the token will be refreshed, and the failure refresh period is how long to wait before trying to refresh the token again if the token retrieval fails.
Connecting it all up
Now that we know how we can retrieve a token to act as the password for our connections, let’s look at how to connect it all up for a local dev or Azure deployed app:
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
var connStr = builder.Configuration.GetConnectionString(“db”);
NpgsqlConnectionStringBuilder csb = new(connStr);
if (!string.IsNullOrEmpty(csb.Password))
{
builder.AddNpgsqlDataSource(“db”);
}
else
{
builder.AddNpgsqlDataSource(“db”, dataSourceBuilder =>
{
dataSourceBuilder.UsePeriodicPasswordProvider(async (_, ct) =>
{
DefaultAzureCredential credential = new();
TokenRequestContext ctx = new([“https://ossrdbms-aad.database.windows.net/.default”]);
AccessToken tokenResponse = await credential.GetTokenAsync(ctx, ct);
return tokenResponse.Token;
}, TimeSpan.FromHours(4), TimeSpan.FromSeconds(10));
});
}
// and the rest of your app code
Here we’re getting the connection string and creating a NpgsqlConnectionStringBuilder from it so that it gets parsed for us. If the connection string we have has a password, then we can just use that as normal, but if it doesn’t have a password, then we can use the UsePeriodicPasswordProvider method to get the token and use that as the password.
This means we can run locally against a database that uses username/password style access (since we don’t have Entra ID locally), and then deploy to Azure and use Entra ID without having to change the code.
Conclusion
When porting an app that uses PostgreSQL to using Managed Identity I was expecting that it would be quite a lot of work to manage the token retrieval and expiry, initially I thought that it’d require doing a bunch of work to discard the singleton for the NpgsqlDataSourceBuilder and then recreate it when the token expired. But thanks to the UsePeriodicPasswordProvider method, it’s actually quite easy to manage the token retrieval and expiry, and it’s all handled for you.
Microsoft Tech Community – Latest Blogs –Read More
System Requirements – x86-64 and OpenGL version
I have two questions about the system requirements listed here:
https://au.mathworks.com/support/requirements/matlab-system-requirements.html
1) How do I tell if a processor is "x86-64" type. I suspect they all are these days, but they either don’t bother putting it in the specs list or use a different term.
2) Will it work just as well with an OpenGL version greater than 3.3? EG 4.6?I have two questions about the system requirements listed here:
https://au.mathworks.com/support/requirements/matlab-system-requirements.html
1) How do I tell if a processor is "x86-64" type. I suspect they all are these days, but they either don’t bother putting it in the specs list or use a different term.
2) Will it work just as well with an OpenGL version greater than 3.3? EG 4.6? I have two questions about the system requirements listed here:
https://au.mathworks.com/support/requirements/matlab-system-requirements.html
1) How do I tell if a processor is "x86-64" type. I suspect they all are these days, but they either don’t bother putting it in the specs list or use a different term.
2) Will it work just as well with an OpenGL version greater than 3.3? EG 4.6? system requirements, x86-64, opengl MATLAB Answers — New Questions
How to report/flag a user or a ThingSpeak channel?
When I find spammers, I often tend to check their profile to see what else needs cleaned up. Occasionally there are accounts like these:
https://www.mathworks.com/matlabcentral/profile/authors/32134539
https://www.mathworks.com/matlabcentral/profile/authors/34100453
Both of these accounts had been pasting dumb exploit attempts on either the forum or FEX, which have since been deleted. In both cases though, they left behind some extra trash on ThingSpeak.
The problem is that I see no way to report content on ThingSpeak, and the Report button rarely shows up on user profile pages. For me, in Firefox, only the second profile page has one.
As far as I’m concerned, there’s no point keeping these disposed spam accounts around, so I’m not terribly concerned with reporting the ThingSpeak channels. I just want to know how to report/flag the accounts when the button won’t show up. I guess let’s start with figuring out whether I’m the only one that can’t see the button.When I find spammers, I often tend to check their profile to see what else needs cleaned up. Occasionally there are accounts like these:
https://www.mathworks.com/matlabcentral/profile/authors/32134539
https://www.mathworks.com/matlabcentral/profile/authors/34100453
Both of these accounts had been pasting dumb exploit attempts on either the forum or FEX, which have since been deleted. In both cases though, they left behind some extra trash on ThingSpeak.
The problem is that I see no way to report content on ThingSpeak, and the Report button rarely shows up on user profile pages. For me, in Firefox, only the second profile page has one.
As far as I’m concerned, there’s no point keeping these disposed spam accounts around, so I’m not terribly concerned with reporting the ThingSpeak channels. I just want to know how to report/flag the accounts when the button won’t show up. I guess let’s start with figuring out whether I’m the only one that can’t see the button. When I find spammers, I often tend to check their profile to see what else needs cleaned up. Occasionally there are accounts like these:
https://www.mathworks.com/matlabcentral/profile/authors/32134539
https://www.mathworks.com/matlabcentral/profile/authors/34100453
Both of these accounts had been pasting dumb exploit attempts on either the forum or FEX, which have since been deleted. In both cases though, they left behind some extra trash on ThingSpeak.
The problem is that I see no way to report content on ThingSpeak, and the Report button rarely shows up on user profile pages. For me, in Firefox, only the second profile page has one.
As far as I’m concerned, there’s no point keeping these disposed spam accounts around, so I’m not terribly concerned with reporting the ThingSpeak channels. I just want to know how to report/flag the accounts when the button won’t show up. I guess let’s start with figuring out whether I’m the only one that can’t see the button. meta MATLAB Answers — New Questions
Can’t Unlock Account
My wife’s Hotmail account has recently been locked (we don’t know why). She usually logs-in using her IPad which auto-logs-in but it recently asked her to answer the security questions then locked-it. I’ve also tried from my desktop Outlook and can’t get in either. The problem I think is that she has had this account over 25 years and the two security questions and meaningless to us now. It’s very frustrating as we know the password, we supply the security code (which goes to my email) but it still won’t let us in (we just get an email saying “the information you provided was not sufficient for us to validate your account ownership”). Yes I agree we should have supplied security questions which were more memorable but that’s hindsight and doesn’t help.
We have tried a number of phone-numbers and website links we’ve found online but not of them work. It’s very annoying that there isn’t a contactable support system.
Any help at all in solving this problem will be very welcome.
Thank you.
My wife’s Hotmail account has recently been locked (we don’t know why). She usually logs-in using her IPad which auto-logs-in but it recently asked her to answer the security questions then locked-it. I’ve also tried from my desktop Outlook and can’t get in either. The problem I think is that she has had this account over 25 years and the two security questions and meaningless to us now. It’s very frustrating as we know the password, we supply the security code (which goes to my email) but it still won’t let us in (we just get an email saying “the information you provided was not sufficient for us to validate your account ownership”). Yes I agree we should have supplied security questions which were more memorable but that’s hindsight and doesn’t help.We have tried a number of phone-numbers and website links we’ve found online but not of them work. It’s very annoying that there isn’t a contactable support system.Any help at all in solving this problem will be very welcome.Thank you. Read More
GROUPBY yields a #VALUE! error in the [filter_array]
GROUPBY yields a #VALUE! error in the [filter_array]
Can you help me?
GROUPBY yields a #VALUE! error in the [filter_array]Can you help me? Read More
b26100 – Creating archive – additional options – no progress bar on large operations
When compressing larger files with the new create archive options there will be no progress bar, until File Explorer really finished and writes the file to disk.
The dialogue will show “not responding” meanwhile. Only mouse cursor “busy” and taskmanager reveals that something is still going on.
When compressing larger files with the new create archive options there will be no progress bar, until File Explorer really finished and writes the file to disk.
The dialogue will show “not responding” meanwhile. Only mouse cursor “busy” and taskmanager reveals that something is still going on.
https://aka.ms/AAqogye Read More
b26100 – Feedback hub does not allow repro steps – greyed out
Problem Steps Recorder is installed in Optional Features.
In Feedback hub “repro steps” on WS 2025 b26100 is greyed out. This way it is hard to provide actionable / quality feedback. Anyone else?
I believe this is not intended. The general issue around PSR and feedback hub is appears to be unresolved for Windows Client / Server. Thank you for looking into it.
Problem Steps Recorder is installed in Optional Features.
In Feedback hub “repro steps” on WS 2025 b26100 is greyed out. This way it is hard to provide actionable / quality feedback. Anyone else?I believe this is not intended. The general issue around PSR and feedback hub is appears to be unresolved for Windows Client / Server. Thank you for looking into it.
https://techcommunity.microsoft.com/t5/windows-server-insiders/problem-steps-recorder-deprecation-what-does-this-mean-for/m-p/4022944
https://support.microsoft.com/en-us/windows/steps-recorder-deprecation-a64888d7-8482-4965-8ce3-25fb004e975f
Read More
solving 1D drift diffusion model for a semiconductor using FDTD. Can anyone rectify this error.
% Constants and parameters
q = 1.602e-19; % elementary charge
k = 1.38e-23; % Boltzmann constant
eps0 = 8.85e-12; % vacuum permittivity
epsr = 11.7; % relative permittivity of silicon
Na = 1e17; % doping concentration (p-type)
L = 1e-6; % length of the semiconductor
mu_e = 1000*1e-4; % electron mobility
mu_h = 1000*1e-4; % hole mobility
D_e = k*300*mu_e/q; % electron diffusion coefficient
D_h = k*300*mu_h/q; % hole diffusion coefficient
T = 300; % temperature
V = 0.1; % applied voltage
% Spatial and time parameters
nx = 100; % number of spatial grid points
dx = L/nx; % spatial step
dt = 1e-9; % time step
nt = 100; % number of time steps
% Initialize carrier densities and electric potential
n = zeros(nx, 1); % electron density
p = zeros(nx, 1); % hole density
phi = zeros(nx, 1); % electric potential
phi(1) = V; % boundary condition at x=0
% Simulation loop
for t = 1:nt
% Calculate electric field
E = -(phi(2:end) – phi(1:end-1))/dx;
% Calculate electron and hole densities
Jn = q*D_e*(n(3:end) – n(2:end-1))/dx – q*mu_e*E.*n(2:end-1);
Jp = q*D_h*(p(3:end) – p(2:end-1))/dx + q*mu_h*E.*p(2:end-1);
% Update carrier densities
n(2:end-1) = n(2:end-1) + dt*Na./(1+exp((phi(2:end-1)-V/2)/(k*T))) – dt*Jn;
p(2:end-1) = p(2:end-1) + dt*Na./(1+exp((V/2-phi(2:end-1))/(k*T))) – dt*Jp;
% Update electric potential
rho = q*(Na – n – p); % charge density
phi(2:end-1) = phi(2:end-1) + dt*1/(epsr*eps0)*rho(2:end-1);
end% Constants and parameters
q = 1.602e-19; % elementary charge
k = 1.38e-23; % Boltzmann constant
eps0 = 8.85e-12; % vacuum permittivity
epsr = 11.7; % relative permittivity of silicon
Na = 1e17; % doping concentration (p-type)
L = 1e-6; % length of the semiconductor
mu_e = 1000*1e-4; % electron mobility
mu_h = 1000*1e-4; % hole mobility
D_e = k*300*mu_e/q; % electron diffusion coefficient
D_h = k*300*mu_h/q; % hole diffusion coefficient
T = 300; % temperature
V = 0.1; % applied voltage
% Spatial and time parameters
nx = 100; % number of spatial grid points
dx = L/nx; % spatial step
dt = 1e-9; % time step
nt = 100; % number of time steps
% Initialize carrier densities and electric potential
n = zeros(nx, 1); % electron density
p = zeros(nx, 1); % hole density
phi = zeros(nx, 1); % electric potential
phi(1) = V; % boundary condition at x=0
% Simulation loop
for t = 1:nt
% Calculate electric field
E = -(phi(2:end) – phi(1:end-1))/dx;
% Calculate electron and hole densities
Jn = q*D_e*(n(3:end) – n(2:end-1))/dx – q*mu_e*E.*n(2:end-1);
Jp = q*D_h*(p(3:end) – p(2:end-1))/dx + q*mu_h*E.*p(2:end-1);
% Update carrier densities
n(2:end-1) = n(2:end-1) + dt*Na./(1+exp((phi(2:end-1)-V/2)/(k*T))) – dt*Jn;
p(2:end-1) = p(2:end-1) + dt*Na./(1+exp((V/2-phi(2:end-1))/(k*T))) – dt*Jp;
% Update electric potential
rho = q*(Na – n – p); % charge density
phi(2:end-1) = phi(2:end-1) + dt*1/(epsr*eps0)*rho(2:end-1);
end % Constants and parameters
q = 1.602e-19; % elementary charge
k = 1.38e-23; % Boltzmann constant
eps0 = 8.85e-12; % vacuum permittivity
epsr = 11.7; % relative permittivity of silicon
Na = 1e17; % doping concentration (p-type)
L = 1e-6; % length of the semiconductor
mu_e = 1000*1e-4; % electron mobility
mu_h = 1000*1e-4; % hole mobility
D_e = k*300*mu_e/q; % electron diffusion coefficient
D_h = k*300*mu_h/q; % hole diffusion coefficient
T = 300; % temperature
V = 0.1; % applied voltage
% Spatial and time parameters
nx = 100; % number of spatial grid points
dx = L/nx; % spatial step
dt = 1e-9; % time step
nt = 100; % number of time steps
% Initialize carrier densities and electric potential
n = zeros(nx, 1); % electron density
p = zeros(nx, 1); % hole density
phi = zeros(nx, 1); % electric potential
phi(1) = V; % boundary condition at x=0
% Simulation loop
for t = 1:nt
% Calculate electric field
E = -(phi(2:end) – phi(1:end-1))/dx;
% Calculate electron and hole densities
Jn = q*D_e*(n(3:end) – n(2:end-1))/dx – q*mu_e*E.*n(2:end-1);
Jp = q*D_h*(p(3:end) – p(2:end-1))/dx + q*mu_h*E.*p(2:end-1);
% Update carrier densities
n(2:end-1) = n(2:end-1) + dt*Na./(1+exp((phi(2:end-1)-V/2)/(k*T))) – dt*Jn;
p(2:end-1) = p(2:end-1) + dt*Na./(1+exp((V/2-phi(2:end-1))/(k*T))) – dt*Jp;
% Update electric potential
rho = q*(Na – n – p); % charge density
phi(2:end-1) = phi(2:end-1) + dt*1/(epsr*eps0)*rho(2:end-1);
end fdtd, drift diffusion model MATLAB Answers — New Questions