Thank you for the work you have done for Viridor, your support has been invaluable. Wish you the very best in your future endeavors.
Sunday, March 26, 2023
Monday, February 20, 2023
News Extrator
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace NewsExtractor
{
class Program
{
static void Main(string[] args)
{
NewsEntities newsEntities = new NewsEntities();
var list = newsEntities.NewsURLs;
foreach (var url in list)
{
var data = GetURLData(url.URL.Replace("200", url.Count.ToString()));
AddNews(data);
}
}
private static string GetURLData(string url)
{
Console.WriteLine(url);
WebClient client = new WebClient();
client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36)");
Stream data = client.OpenRead(url);
StreamReader reader = new StreamReader(data);
var s = reader.ReadToEnd();
data.Close();
reader.Close();
return s;
}
private static void AddNews(string fileData)
{
NewsEntities newsEntities = new NewsEntities();
var weatherForecast = JsonConvert.DeserializeObject<RootNew>(fileData);
foreach (var item in weatherForecast.data.items)
{
if (!newsEntities.News.Any(p => p.TickerTapeId == item._id))
{
News n = new News();
n.Title = item.title;
n.TickerTapeId = item._id;
n.Description = item.description;
n.NewsDate2 = item.date;
n.NewsDate = item.date.ToString();
n.Image = item.image;
n.Stocks = string.Join(",", item.stocks.Select(p => p.sid));
n.link = item.link;
newsEntities.News.Add(n);
Console.WriteLine(item.title);
}
}
newsEntities.SaveChanges();
}
}
}
Sunday, January 8, 2023
How to Remove Empty Folders Using Command Prompt
How to Remove Empty Folders Using Command Prompt
Managing your files and folders effectively is crucial for maintaining an organized and efficient system. Over time, your directories may accumulate empty folders that no longer serve a purpose. These empty folders can clutter your system and make it harder to find the files you need. Fortunately, there's a simple command you can use in the Command Prompt to remove all empty folders from a directory and its subdirectories.
In this blog post, we'll walk you through the command step-by-step and explain how it works.
Step-by-Step Guide
- Open Command Prompt:
- Press
Win + Rto open the Run dialog. - Type
cmdand pressEnterto open the Command Prompt.
- Press
- Navigate to the Desired Directory:
Use the
cdcommand to navigate to the directory where you want to remove empty folders. For example:cd C:\path\to\your\directory - Run the Command:
Use the following command to remove empty folders:
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do rd "%d"If you are running this command in a batch file, remember to double the percentage signs (
%):for /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do rd "%%d"
How the Command Works
Let's break down the command to understand how it works:
for /f "delims=" %d in ('dir /s /b /ad ^| sort /r') do rd "%d"for /f "delims=" %d: This is aforloop that processes each line of output from the command inside the parentheses.dir /s /b /ad: This part of the command lists all directories (/ad) in the current directory and all subdirectories (/s), displaying them in bare format (/b), which means no header information or summary.^| sort /r: The|symbol is used for piping the output of one command to another. Thesort /rcommand sorts the directories in reverse order. Sorting in reverse is crucial because it ensures that subdirectories are processed before their parent directories, preventing errors when trying to delete a non-empty parent directory.do rd "%d": Therdcommand is used to remove directories.%drepresents each directory path processed by theforloop. If the directory is empty, it will be removed.
Additional Tips
Run as Administrator: Sometimes, you may need administrative privileges to delete certain folders. Right-click on Command Prompt and select "Run as administrator".
Test First: It's always a good idea to test the command in a directory with a few test folders to ensure it works as expected before running it on important directories.
Backup: Make sure you have backups of your important files and directories before running bulk delete operations to avoid accidental data loss.
Conclusion
Using the Command Prompt to remove empty folders is a powerful and efficient method to keep your file system clean and organized. By understanding and utilizing this command, you can save time and maintain a clutter-free environment on your computer.
Feel free to share this guide with others who might find it helpful, and happy organizing!
By following these steps, you can effectively manage and clean up empty folders in your directories. If you have any questions or run into any issues, leave a comment below, and we'll be happy to help!
Friday, March 25, 2022
Get Questions
var x = document.getElementsByTagName("select");
var txt = "";
var i;
var j;
for (j = 0; j < x.length; j++) {
var y = x[0];
txt ='';
for (i = 1; i < y.length; i++) {
txt = txt + "</br>" + y.options[i].text;
}
console.log(txt);
var $temp = $("<div>");
$(y).append($temp);
$temp.html(txt).select();
}
Thursday, September 9, 2021
Dynamics 365 and AD groups
Dynamics 365 has some security features which integrate Dynamics 365 with AD Groups. AD Groups can be used to grant and restrict access to a Dynamics 365 environment and with AAD security teams you can automatically add users to teams.
I hate doing manual tasks (Dynamics 365 — The cost of manual deployments activities)
and if it can be automated it should, so AAD security teams offer a great way to
automate adding users and giving them security roles.
This blog post will discuss
both security groups and AAD security teams.
Microsoft Documentation
— Control user access to environments: security groups and
licenses
AD security group
The first AD security group I
recommend to setup is a group which grants people access to an environment.
Microsoft cover it here


You create an AD group and
then you go to Power Platform Admin and navigate to
environments where you will see all environments you have access to.
If you add AD group in the
security group setting, this allows users to access or see the Dynamics 365
environment if they are added to that group. This is an easy way to control
which users can access different environments.
It acts as a layer before
security roles and stops accidently giving access to users. For projects its
common for developers and consultants to have access to most of the Dynamics
365 environments accept Preproduction and Production.
Microsoft documentation
— Control user access to environments: security groups and
licenses
Group teams
Dynamics 365 lets you create
a few different types of team
·
Owner teams
·
Access Teams
·
Group teams
Owner teams are the classic
team in Dynamics and works like a user, they can own records and have security
roles.
Access teams allow record
access and give people access to a particular record, e.g. sales people working
on an opportunity
Groups teams are different
because they link an AD Group to a team in Dynamics 365 AAD team. AD groups can
be of type office or security. The office AD group can be created with users
with less privileges and as a way to create groups of users.
An AD security group will need
an IT person to create them.
Both Azure AD groups will
have an Azure AD Object Id for the group and we link that to a team in Dynamics
by putting that guid in
azureactivedirectoryobjectidazureactivedirectoryobjectid field
You can create these in
Dynamics by creating a new team and selecting the AAD Security type or AAD
Group type.


A few things to note
·
You have to put
Azure AD object ID on creation of the team
·
It will
validate the it’s a valid guid
·
You cannot
change this guid after creation
This page describes how group teams and
owner teams work in Dynamics
The picture below shows how
AD Groups work


The security gives access to
the environment
The team AD group
automatically adds a user. In the example above, you add a user into the Sales
Manager AD team and it will automatically add that user to the Sales Manager
team in Dynamics (as long as you have created the team and put in the correct
Azure AD Object ID)
If you assign the team a
security role then you don’t have to do any manual setup of the users for
security roles or field level security.
The diagram below show it
without AD groups linked with teams.


Each AD group can only work
with an Dynamics team in one Dynamics instance.
You can keep the guids the
same but you need to change the AzureID field
Why aren’t people in the Dynamics groups?
I setup up my teams, put in
the correct Azure AD Object Id for a group. The user was added to the correct
group and then………nothing.
Where was the user? why
wasn’t the user appearing in my team?
In the Microsoft documentation
The
list of team members listed in each group team only displays the user members
who have accessed the environment. This list doesn’t show all the group members
of the Azure AD group. The team member’s privileges are derived dynamically at
run-time when the team member accesses the application. The security role of
the team is not assigned directly to the team member. Since team member’s
privileges are derived dynamically at run-time, the team member’s Azure AD
group memberships are cached upon the team member’s log-in. This means
that any Azure AD group membership maintenance done on the team member in Azure
AD will not be reflected until the next time the team member logs in or when
the system refreshes the cache (after 8 hours of continuous log-in).
The members show in the team
in Dynamics 365 only when users have accessed Dynamics 365 (logged in). If the
user in the AD Group hasn’t logged in then they won’t show in the team members
in Dynamics.
Other potential gotcha’s from
Microsoft documentation
You can only create one group team for each
Azure AD group per environment, and the Azure AD ObjectId of the group team
cannot be edited once the group team is created.
Team members are maintained in each group
team at run-time and the operation is done at the database level; therefore,
the update to group team event is not available for plugin.
Data
If you have a release
pipeline, you can keep the GUIDs of the AAD security group team the same but
you have change the Azure AD Object ID to the AD group.
It’s worth doing because you
will have the teams with the same guids in each environment.
Conclusion
AD groups can be an effective
way to add security and simplify adding users to a Dynamics 365 environment.
I think all Dynamics 365
environment should have a security group, it stops accidently enabling users to
environments.
AAD security groups are good
if you have distinct security roles with no cross over. If you can do it, it
will save time adding users and is worth looking into to.
picture from here
Monday, August 2, 2021
Essential Interview Questions for MSCRM Developers
Interviewing for a developer position can be challenging, but being prepared with the right questions can make all the difference. Here’s a comprehensive list of useful interview questions to help you prepare for your next technical interview.
Friday, July 9, 2021
When will you use workflow?
Featured Post
Links
https://www.examtopics.com/discussions/microsoft/view/52755-exam-pl-600-topic-2-question-4-discussion/ https://www.examtopics.com/discussion...
-
360 ONE WAM Ltd. 3M India Ltd. ABB India Ltd. ACC Ltd. AIA Engineering Ltd. APL Apollo Tubes Ltd. AU Small Finance Bank Ltd. Aarti Drugs Ltd...
-
GST Questions and Answers Q51) How do you handle ITC on goods sent for job work? ...
-
When we created a new entity in CRM, we have to option for “ownership” as “User or Team” and “Organization”. Below are the main differences ...