SELECT Program.PackageID,
Package.Name 'Package',
Program.ProgramName 'Type',
Program.CommandLine,
Program.Comment,
Program.Description,
Package.PkgSourcePath
FROM [v_Program] as Program
LEFT JOIN v_Package as Package on Package.PackageID = Program.PackageID
WHERE Program.ProgramName <> '*'
Order by Package.Name
Microsoft has a new method for downloading Office, Visio, and Project from VLSC. To configure and perform deployments of volume licensed versions of Office 2019, and newer, including Project and Visio, you use the Office Deployment Tool (ODT). The standalone Office Customization Tool (OCT) that you previously used for Windows Installer (MSI) is no longer used.
Download ODT from here – which contains setup.exe and 3 XML files.
Run Only – If you already have the downloaded files, and just want to install
setup /configure Configuration.xml
….Office suite or Office app will install
All Options
setup.exe ?
Office Deployment Tool
SETUP [mode] [path]
SETUP /download [path to configuration file]
SETUP /configure [path to configuration file]
SETUP /packager [path to configuration file] [output path]
SETUP /customize [path to configuration file]
SETUP /help
/download Downloads files to create an Office installation source
/configure Adds, removes, or configures an Office installation
/packager Produces an Office App-V package from an Office installation source
/customize Applies settings for Office applications
/help Displays this message
Previous Office Installation
Caveat: I had to remove Office 2016 (or Office 2019) before installation would begin.
In addition to Click-to-Run, the following are some other changes that you need to be aware of:
Office 2019/O365 is supported on Windows 10, but isn’t supported on Windows 7 or Windows 8.1. For more information, review the system requirements.
Instead of downloading the installation files from the Volume Licensing Service Center (VLSC), you use the Office Deployment Tool to download the installation files directly from the Office Content Delivery Network (CDN) on the internet.
When you install Office 2019/O365, all apps are installed by default. But, you can configure the Office Deployment Tool to exclude certain apps from being installed.
Office 2019/O365 is installed on the system drive, which is usually the C:\ drive. The installation location can’t be changed.
Updates to Office 2019/O365, such as security updates and bug fixes, can be configured to be automatically downloaded and installed from the Office CDN. Individual downloads for each security update or bug fix aren’t available.
Search for a specific number in an array and return its position (if it exists). I’ve added looping, messaging, and concatenation (MSG1 + RES1), just to demonstrate some assembly functionality.
MSG is the relative message. The $ at the end of MSGs means terminate message. 10,13 is a carriage return.
TRY is the loop.
ABOV is checking whether the first operand is above or equal to second operand.
GOOD means it found the specified number in the array.
NOPE means it did not find the specified number in the array.
If you haven’t already done so, you’re eventually going to come across JSON files. JSON, or JavaScript Object Notation, is one of the most common file types for working with web APIs. On first glance, a JSON file can sometimes look like a mess, especially when dealing with large files (talking about you, Google preference file)—but, there is order to the chaos. In PowerShell, there are built-in cmdlets to handle the formatting. You can convert to and convert from JSON quite easily.
Here’s an example
$normalizedData = ""$jsonData = ""$data = ""# data - this could be read from a text file$data = [PSCustomObject] @{
FirstName = "Eddie";
LastName = "Jackson";
Zip = "12345";
Mobile = "111-222-3333";
}
# this will convert to json format$jsonData = ConvertTo-Json$dataclear-hostWrite-Host"[ Show Json Data ]`n"$jsonDataWrite-Host"`n`n"# this will convert json format to powershell formatWrite-Host"`n[ Show Normalized Data ]"$normalizedData = ConvertFrom-Json$jsonData# | ft -HideTableHeaders$normalizedData$normalizedData = ""$jsonData = ""$data = ""
The following VBScript finds all occurrences of a word, or a pattern using a regular expression. A regular expression specifies what kind of pattern to match, and can be any string of characters and/or numbers. In my example, “\w+” will look for one word at a time using spaces (whitespace, specifically). The whitespace acts as a delimiter between words, thus…I can determine how many words there are, and where each word begins, which is commonly called an index. An index value can be useful in managing elements in arrays and lists.
But, more importantly, I could easily search for a specific word or words, a pattern of special characters, or even more complex text, like programming code in a web page. Based upon what is being scanned and returned by the regular expression, I could then perform a function on the data. It’s very powerful, to say the least.
Option ExplicitDim txtSource, thePattern, objMatchPattern, Match, Matches, count
txtSource ="The man in the moon is very far away"
thePattern ="\w+" ' you can change this part
count =0'Create the regular expression.Set objMatchPattern =New RegExp
objMatchPattern.Pattern = thePattern
objMatchPattern.IgnoreCase =False
objMatchPattern.Global =True'Perform the search.Set Matches = objMatchPattern.Execute(txtSource)
'Iterate through the Matches collection.ForEach Match in Matches
msgbox Match.FirstIndex &" "& Match.Value
count = count + 1
Next
msgbox "total count: "& count
'clear sessionset txtSource =Nothingset thePattern =Nothingset objMatchPattern =Nothingset Match =Nothingset Matches =Nothing'The Index and Word Output:' 0 The' 4 man' 8 in' 11 the' 15 moon' 20 is' 23 very' 28 far' 32 away' total count: 9
I created this simple batch file to demonstrate a learning bot. You will help build its knowledge base data in the file named speech.txt. Just copy the below code into a script like AI.cmd, and run it.
@echooffsetBotName=Chatty
title AI %BotName%1.0 - Learner Bot
color 0b
rem Create the speech file if not existif not exist speech.txt echo.>speech.txt
Echo Start up a conversation with %BotName%echo.
:STARTset /p text="You: ":: DYNAMIC QUESTIONS THAT PULL REALTIME INFORMATIONif /i "%text%"=="What time is it?"goto:TIMEif /i "%text%"=="What is the time?"goto:TIMEif /i "%text%"=="What is the date?"goto:DATE:: OUR SPEECH FILEfor /f "tokens=1,* delims={"%%a in (speech.txt) do (
if /i "%text%"=="%%a" (
echo.
echo%BotName%: %%becho.
goto:START
)
)
echo.
echo%BotName%: I don't know what that means.
set /p answer=%BotName%: How should this be answered '%text%'?
echo%text%{%answer%>>speech.txt
echo%BotName%: Thanks!
echo.
goto:START:TIMEecho.
echo%BotName%: The time is %TIME%echo.
goto:START:DATEecho.
echo%BotName%: The date is %DATE%echo.
goto:START
This is a simple neural net written in C#. I’ve documented it for ease of understanding. But, it basically shows you the before training output and after training output (using an internal dataset). The point of this example is to demonstrate how neural nets fundamentally work, which is by neurons forming connections during training. These connections influence output. Something to note, normally these datasets have to be huge for the output to be accurate. When I say huge, I mean 100s of gigabytes or even terabytes of data.
In large-scale neural nets, you have inputs (the question, or what you’re looking for), many hidden layers (the trained dataset), and then the output (the answer).
In the below example, the question is, Which shoe is best? The dataset is based upon quality, price, availability, and customer ratings, and the output is the answer.
An example of a simple neural network
now, on to the C# example…
Screenshot
You can see that the weighted values in the output change after training. This is because new connections have formed, and the deep learning aspect of neural nets has altered the output.
C# Code
using System;
using System.Collections.Generic; // list
using System.Data; // table data
using System.Linq;
using System.Diagnostics; // stopwatch
using ConsoleTableExt; // console table
/// <notes>
/// run this package import https://www.nuget.org/packages/ConsoleTableExt/2.0.1
/// </notes>
namespace NeuralNet1
{
class NeuralNetSample1
{
static void Main()
{
Stopwatch stopwatch = new Stopwatch();
NetworkModel model = new NetworkModel();
model.Layers.Add(new NeuralLayer(2, 0.1, "INPUT"));
model.Layers.Add(new NeuralLayer(1, 0.1, "OUTPUT"));
// show before model
model.Build();
Console.WriteLine("{{ BEFORE TRAINING }}");
model.Print();
Console.WriteLine();
// available datasets
Dataset data1 = new Dataset(4);
data1.Add(0, 0);
data1.Add(0, 1);
data1.Add(1, 0);
data1.Add(1, 1);
Dataset data2 = new Dataset(4);
data2.Add(0);
data2.Add(0);
data2.Add(0);
data2.Add(1);
// perform training
// start the clock
stopwatch.Start();
model.Train(data1, data2, iterations: 10, learningRate: 0.1);
// stop the clock
stopwatch.Stop();
Console.WriteLine();
// show after model
Console.WriteLine("\n{{ AFTER TRAINING }}");
model.Print();
// elapsed time
Console.WriteLine("\nTime elapsed: {0}", stopwatch.Elapsed);
// wait for any key
Console.ReadKey();
}
}
class Pulse
{
public double Value { get; set; }
}
class Dendrite
{
public Dendrite()
{
InputPulse = new Pulse();
}
public Pulse InputPulse { get; set; }
public double SynapticWeight { get; set; }
public bool Learnable { get; set; } = true;
}
class Neuron
{
public List<Dendrite> Dendrites { get; set; }
public Pulse OutputPulse { get; set; }
public Neuron()
{
Dendrites = new List<Dendrite>();
OutputPulse = new Pulse();
}
public void Fire()
{
OutputPulse.Value = Sum();
OutputPulse.Value = Activation(OutputPulse.Value);
}
public void UpdateWeights(double new_weights)
{
foreach (var terminal in Dendrites)
{
terminal.SynapticWeight = new_weights;
}
}
private double Sum()
{
double computeValue = 0.0f;
foreach (var d in Dendrites)
{
computeValue += d.InputPulse.Value * d.SynapticWeight;
}
return computeValue;
}
private double Activation(double input)
{
double threshold = 1;
return input <= threshold ? 0 : threshold;
}
}
class NeuralLayer
{
public List<Neuron> Neurons { get; set; }
public string Name { get; set; }
public double Weight { get; set; }
public NeuralLayer(int count, double initialWeight, string name = "")
{
Neurons = new List<Neuron>();
for (int i = 0; i < count; i++)
{
Neurons.Add(new Neuron());
}
Weight = initialWeight;
Name = name;
}
public void Optimize(double learningRate, double delta)
{
Weight += learningRate * delta;
foreach (var neuron in Neurons)
{
neuron.UpdateWeights(Weight);
}
}
public void Forward()
{
foreach (var neuron in Neurons)
{
neuron.Fire();
}
}
public void Log()
{
Console.WriteLine("{0}, Weight: {1}", Name, Weight);
}
}
class NetworkModel
{
public List<NeuralLayer> Layers { get; set; }
public NetworkModel()
{
Layers = new List<NeuralLayer>();
}
public void AddLayer(NeuralLayer layer)
{
int dendriteCount = 1;
if (Layers.Count > 0)
{
dendriteCount = Layers.Last().Neurons.Count;
}
foreach (var element in layer.Neurons)
{
for (int i = 0; i < dendriteCount; i++) { element.Dendrites.Add(new Dendrite()); } } } public void Build() { int i = 0; foreach (var layer in Layers) { if (i >= Layers.Count - 1)
{
break;
}
var nextLayer = Layers[i + 1];
CreateNetwork(layer, nextLayer);
i++;
}
}
public void Train(Dataset data1, Dataset data2, int iterations, double learningRate = 0.1)
{
int epoch = 1;
while (iterations >= epoch)
{
// get input
var inputLayer = Layers[0];
List<double> outputs = new List<double>();
// loop through input
for (int i = 0; i < data1.Data.Length; i++)
{
// layer 1
for (int j = 0; j < data1.Data[i].Length; j++) { inputLayer.Neurons[j].OutputPulse.Value = data1.Data[i][j]; } // fire neurons and collect output ComputeOutput(); outputs.Add(Layers.Last().Neurons.First().OutputPulse.Value); } // Check the accuracy score against data2 with output double accuracySum = 0; int y_counter = 0; outputs.ForEach((x) => {
if (x == data2.Data[y_counter].First())
{
accuracySum++;
}
y_counter++;
});
// optimize weights
OptimizeWeights(accuracySum / y_counter);
// output accuracy data
Console.WriteLine("Epoch: {0}, Accuracy: {1} %", epoch, (accuracySum / y_counter) * 100);
epoch++;
}
}
public void Print()
{
DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Columns.Add("Neurons");
dt.Columns.Add("Weight");
foreach (var element in Layers)
{
DataRow row = dt.NewRow();
row[0] = element.Name;
row[1] = element.Neurons.Count;
row[2] = element.Weight;
dt.Rows.Add(row);
}
ConsoleTableBuilder builder = ConsoleTableBuilder.From(dt);
builder.ExportAndWrite();
}
private void ComputeOutput()
{
bool first = true;
foreach (var layer in Layers)
{
// do not use Input Layer
if (first)
{
first = false;
continue;
}
layer.Forward();
}
}
private void OptimizeWeights(double accuracy)
{
float lr = 0.1f;
//if 100%, skip
if (accuracy == 1)
{
return;
}
if (accuracy > 1)
{
lr = -lr;
}
// weights are updated
foreach (var layer in Layers)
{
layer.Optimize(lr, 1);
}
}
private void CreateNetwork(NeuralLayer connectingFrom, NeuralLayer connectingTo)
{
foreach (var from in connectingFrom.Neurons)
{
from.Dendrites = new List<Dendrite>();
from.Dendrites.Add(new Dendrite());
}
foreach (var to in connectingTo.Neurons)
{
to.Dendrites = new List<Dendrite>();
foreach (var from in connectingFrom.Neurons)
{
to.Dendrites.Add(new Dendrite() { InputPulse = from.OutputPulse, SynapticWeight = connectingTo.Weight });
}
}
}
}
class Dataset
{
public double[][] Data { get; set; }
int counter = 0;
public Dataset(int rows)
{
Data = new double[rows][];
}
public void Add(params double[] rec)
{
Data[counter] = rec;
counter++;
}
}
}