diff --git a/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.cs b/APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.cs similarity index 100% rename from IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.cs rename to APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.cs diff --git a/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.csproj b/APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.csproj similarity index 100% rename from IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.csproj rename to APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.csproj diff --git a/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.sln b/APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.sln similarity index 100% rename from IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.sln rename to APIs/IssNotifyApiWrapper/CSharp/ISS_Notify_Wrapper.sln diff --git a/IssNotifyApiWrapper/CSharp/Program.cs b/APIs/IssNotifyApiWrapper/CSharp/Program.cs similarity index 100% rename from IssNotifyApiWrapper/CSharp/Program.cs rename to APIs/IssNotifyApiWrapper/CSharp/Program.cs diff --git a/IssNotifyApiWrapper/CSharp/Properties/AssemblyInfo.cs b/APIs/IssNotifyApiWrapper/CSharp/Properties/AssemblyInfo.cs similarity index 100% rename from IssNotifyApiWrapper/CSharp/Properties/AssemblyInfo.cs rename to APIs/IssNotifyApiWrapper/CSharp/Properties/AssemblyInfo.cs diff --git a/IssNotifyApiWrapper/CSharp/packages.config b/APIs/IssNotifyApiWrapper/CSharp/packages.config similarity index 100% rename from IssNotifyApiWrapper/CSharp/packages.config rename to APIs/IssNotifyApiWrapper/CSharp/packages.config diff --git a/IssNotifyApiWrapper/Python/iss/__init__.py b/APIs/IssNotifyApiWrapper/Python/iss/__init__.py similarity index 100% rename from IssNotifyApiWrapper/Python/iss/__init__.py rename to APIs/IssNotifyApiWrapper/Python/iss/__init__.py diff --git a/IssNotifyApiWrapper/Python/iss/iss_api_wrapper.py b/APIs/IssNotifyApiWrapper/Python/iss/iss_api_wrapper.py similarity index 100% rename from IssNotifyApiWrapper/Python/iss/iss_api_wrapper.py rename to APIs/IssNotifyApiWrapper/Python/iss/iss_api_wrapper.py diff --git a/IssNotifyApiWrapper/Python/use_iss.py b/APIs/IssNotifyApiWrapper/Python/use_iss.py similarity index 100% rename from IssNotifyApiWrapper/Python/use_iss.py rename to APIs/IssNotifyApiWrapper/Python/use_iss.py diff --git a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/AmazonProductAdvertSig1.csproj b/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/AmazonProductAdvertSig1.csproj deleted file mode 100644 index c8ce092..0000000 --- a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/AmazonProductAdvertSig1.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Debug - AnyCPU - {890C4F77-AEA3-484F-BB22-9B25EEE8E0F7} - Exe - AmazonProductAdvertSig1 - AmazonProductAdvertSig1 - v4.6.1 - 512 - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Nager.AmazonProductAdvertising.1.2.1\lib\net461\Nager.AmazonProductAdvertising.dll - - - ..\packages\Nager.ArticleNumber.1.0.3\lib\net461\Nager.ArticleNumber.dll - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/App.config b/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/App.config deleted file mode 100644 index 7eb8d24..0000000 --- a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/Program.cs b/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/Program.cs deleted file mode 100644 index 5cee067..0000000 --- a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/Program.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Nager.AmazonProductAdvertising; -using Nager.AmazonProductAdvertising.Model; -using System; - -namespace AmazonProductAdvertSig1 -{ - class Program - { - static void Main(string[] args) - { - var authentication = new AmazonAuthentication - { - AccessKey = "your-access-key", - SecretKey = "your-secret-key" - }; - - var wrapper = new AmazonWrapper(authentication, AmazonEndpoint.US, "your-store-id"); - wrapper.ErrorReceived += (err) => Console.WriteLine($"Error {err.Error.Code}: {err.Error.Message}"); - wrapper.XmlReceived += (xml) => Console.WriteLine($"Received: {xml}"); - - // Search for products - //var result = wrapper.Search("raspberry pi", AmazonSearchIndex.Electronics, AmazonResponseGroup.Small); - //Console.WriteLine(result.Items.TotalResults); - - // Search for a specific item - var result = wrapper.Lookup("B07BQFX4SB"); - Console.WriteLine(result.Items.Item[0].DetailPageURL); - - Console.ReadLine(); - } - } -} diff --git a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/packages.config b/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/packages.config deleted file mode 100644 index 4de1db1..0000000 --- a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Net/AmazonProductAdvertSig1/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Python/AmazonProductAdvert.py b/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Python/AmazonProductAdvert.py deleted file mode 100644 index 489f048..0000000 --- a/AmazonProductAdvertisingApiBlogPost/AmazonProductAdvertSig-Python/AmazonProductAdvert.py +++ /dev/null @@ -1,11 +0,0 @@ -import subprocess -import sys -import bottlenose - -amazon = bottlenose.Amazon("your-access-key", "your-secret-key", "your-store-id") - -response = amazon.ItemSearch(Keywords="Raspberry Pi", SearchIndex="Electronics") - -# response = amazon.ItemLookup(ItemId="B07BQFX4SB") - -print(response) diff --git a/AsyncAndPlinq112013/AsyncAndPlinq112013.sln b/AsyncAndPlinq112013/AsyncAndPlinq112013.sln deleted file mode 100644 index e99dd14..0000000 --- a/AsyncAndPlinq112013/AsyncAndPlinq112013.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncAndPlinq112013", "AsyncAndPlinq112013\AsyncAndPlinq112013.csproj", "{22C984CC-9B52-4E39-8A73-26D613DE2B8D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {22C984CC-9B52-4E39-8A73-26D613DE2B8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22C984CC-9B52-4E39-8A73-26D613DE2B8D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22C984CC-9B52-4E39-8A73-26D613DE2B8D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22C984CC-9B52-4E39-8A73-26D613DE2B8D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/AsyncAndPlinq112013/AsyncAndPlinq112013/AsyncAndPlinq112013.csproj b/AsyncAndPlinq112013/AsyncAndPlinq112013/AsyncAndPlinq112013.csproj deleted file mode 100644 index 22374a6..0000000 --- a/AsyncAndPlinq112013/AsyncAndPlinq112013/AsyncAndPlinq112013.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - AnyCPU - {22C984CC-9B52-4E39-8A73-26D613DE2B8D} - Library - Properties - AsyncAndPlinq112013 - AsyncAndPlinq112013 - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/AsyncAndPlinq112013/AsyncAndPlinq112013/Class1.cs b/AsyncAndPlinq112013/AsyncAndPlinq112013/Class1.cs deleted file mode 100644 index 4c12f21..0000000 --- a/AsyncAndPlinq112013/AsyncAndPlinq112013/Class1.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; - -namespace AsyncAndPlinq112013 -{ - public class Class1 - { - private static readonly Stopwatch Stopwatch = new Stopwatch(); - - static void Main() - { - Stopwatch.Start(); - PLinqTest(); - Stopwatch.Stop(); - Console.WriteLine("Total execution time: {0}", - Stopwatch.ElapsedMilliseconds / 1000m); - Console.Read(); - } - - static void PLinqTest() - { - var numbers = new[] { 1, 2, 3, 4 }; - numbers.AsParallel().Select(SomeLongComputation).ToList(); - } - - static int SomeLongComputation(int n) - { - for (var i = 0; i <= 5; i++) - { - Thread.Sleep(100); - Console.WriteLine(string.Concat(n, ":", i)); - } - return -1; - } - } - - public class Class2 - { - private static readonly Stopwatch Stopwatch = new Stopwatch(); - private static CancellationToken cancellationToken; - - static void Main() - { - new Timer(x => cancellationToken - = new CancellationToken(true), "hi", 250, 10000); - Stopwatch.Start(); - PLinqTest(); - Stopwatch.Stop(); - Console.WriteLine("Total execution time: {0}", - Stopwatch.ElapsedMilliseconds / 1000m); - Console.Read(); - } - - static void PLinqTest() - { - var numbers = new[] { 1, 2, 3, 4 }; - numbers.AsParallel().WithCancellation(cancellationToken) - .Select(SomeLongComputation).ToList(); - } - - static int SomeLongComputation(int n) - { - for (var i = 0; i <= 5; i++) - { - if (cancellationToken.IsCancellationRequested) - break; - Thread.Sleep(100); - Console.WriteLine(string.Concat(n, ":", i)); - } - return -1; - } - } -} diff --git a/AsyncAndPlinq112013/AsyncAndPlinq112013/Properties/AssemblyInfo.cs b/AsyncAndPlinq112013/AsyncAndPlinq112013/Properties/AssemblyInfo.cs deleted file mode 100644 index 7991dfe..0000000 --- a/AsyncAndPlinq112013/AsyncAndPlinq112013/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AsyncAndPlinq112013")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AsyncAndPlinq112013")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8b3f07f1-05f9-4821-8784-012f142d79ac")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AsyncAndPlinq112013/README.md b/AsyncAndPlinq112013/README.md deleted file mode 100644 index 4c194d2..0000000 --- a/AsyncAndPlinq112013/README.md +++ /dev/null @@ -1,3 +0,0 @@ -ASync and PLINQ - -http://grantwinney.com/async-and-plinq/ \ No newline at end of file diff --git a/AttributesExamples/AttributesExamples.sln b/AttributesExamples/AttributesExamples.sln deleted file mode 100644 index 5d497a5..0000000 --- a/AttributesExamples/AttributesExamples.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.539 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoAttributeExamples", "DemoAttributeExamples\DemoAttributeExamples.csproj", "{4D6F0CCD-9BCA-46D2-A090-F475FC0F2F61}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AttributesExamples", "AttributesExamples\AttributesExamples.csproj", "{775B8867-D1BC-489F-A102-0647163258F9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4D6F0CCD-9BCA-46D2-A090-F475FC0F2F61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4D6F0CCD-9BCA-46D2-A090-F475FC0F2F61}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4D6F0CCD-9BCA-46D2-A090-F475FC0F2F61}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4D6F0CCD-9BCA-46D2-A090-F475FC0F2F61}.Release|Any CPU.Build.0 = Release|Any CPU - {775B8867-D1BC-489F-A102-0647163258F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {775B8867-D1BC-489F-A102-0647163258F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {775B8867-D1BC-489F-A102-0647163258F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {775B8867-D1BC-489F-A102-0647163258F9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6A3EBE4F-C96E-4C5D-AF4A-96710D41AC94} - EndGlobalSection -EndGlobal diff --git a/AttributesExamples/AttributesExamples/1-ParsingConfigurationFiles.cs b/AttributesExamples/AttributesExamples/1-ParsingConfigurationFiles.cs deleted file mode 100644 index 0182d09..0000000 --- a/AttributesExamples/AttributesExamples/1-ParsingConfigurationFiles.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Configuration; - -namespace AttributesExamples -{ - public enum Severity - { - Info = 1, - Warn = 2, - Error = 3 - } - - public class Application : ConfigurationSection - { - public static LogSettings LoggingConfig => (ConfigurationManager.GetSection("application") as Application).LogSettings; - - [ConfigurationProperty("logging", Options = ConfigurationPropertyOptions.IsRequired)] - public LogSettings LogSettings - { - get { return (LogSettings)this["logging"]; } - } - } - - public class LogSettings : ConfigurationElement - { - [ConfigurationProperty("name", IsRequired = false, DefaultValue = @"log.txt")] - [StringValidator(InvalidCharacters = @":;()!@3$%^&*'""<>", MinLength = 1, MaxLength = 32)] - public string LogName - { - get { return Convert.ToString(this["name"]); } - } - - [ConfigurationProperty("location", IsRequired = true)] - public string LogPath - { - get { return Convert.ToString(this["location"]); } - } - - [ConfigurationProperty("level", IsRequired = false, DefaultValue = Severity.Info)] - public Severity SeverityLevel - { - get { return (Severity)Enum.Parse(typeof(Severity), Convert.ToString(this["level"])); } - } - - [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = true)] - public bool LoggingEnabled - { - get { return Convert.ToBoolean(this["enabled"]); } - } - } -} diff --git a/AttributesExamples/AttributesExamples/2-UnitTesting.cs b/AttributesExamples/AttributesExamples/2-UnitTesting.cs deleted file mode 100644 index bc7497c..0000000 --- a/AttributesExamples/AttributesExamples/2-UnitTesting.cs +++ /dev/null @@ -1,50 +0,0 @@ -using NUnit.Framework; - -namespace AttributesExamples -{ - [TestFixture] - public class UnitTesting - { - Employee emp; - - [SetUp] - public void AnyNameWeWant() - { - emp = new Employee(); - } - - [TearDown] - public void SomeOtherName() - { - emp = null; - } - - [Test] - [TestCase("Lucky", "Day", "Lucky Day")] - [TestCase("Dusty", "Bottoms", "Dusty Bottoms")] - [TestCase("Ned", "Nederlander", "Ned Nederlander")] - public void GetFullName_ReturnsFullName(string firstName, string lastName, string expectedFullName) - { - emp.SetName(firstName, lastName); - - Assert.AreEqual(expectedFullName, emp.GetFullName()); - } - } - - public class Employee - { - private string firstName; - private string lastName; - - public void SetName(string firstName, string lastName) - { - this.firstName = firstName; - this.lastName = lastName; - } - - public string GetFullName() - { - return $"{firstName} {lastName}"; - } - } -} diff --git a/AttributesExamples/AttributesExamples/3-PlannedCodeObsolescence.cs b/AttributesExamples/AttributesExamples/3-PlannedCodeObsolescence.cs deleted file mode 100644 index f15d785..0000000 --- a/AttributesExamples/AttributesExamples/3-PlannedCodeObsolescence.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -namespace AttributesExamples -{ - public class PlannedCodeObsolescence - { - string firstName; - string lastName; - int age; - - [Obsolete("SetFirstName and SetLastName are more reliable and replace this method.")] - public void SetName(string name) - { - var names = name.Split(); - firstName = names[0]; - lastName = names[1]; - } - - public void SetFirstName(string first) - { - firstName = first; - } - - public void SetLastName(string last) - { - lastName = last; - } - - [Obsolete("Function renamed to SetAge in v2.4 for consistency", true)] - public void AgeSet(int age) - { - SetAge(age); - } - - public void SetAge(int age) - { - this.age = age; - } - } -} diff --git a/AttributesExamples/AttributesExamples/4-EnumAsBitField.cs b/AttributesExamples/AttributesExamples/4-EnumAsBitField.cs deleted file mode 100644 index ac53db8..0000000 --- a/AttributesExamples/AttributesExamples/4-EnumAsBitField.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace AttributesExamples -{ - [Flags] - public enum PreferredContactMethods - { - None = 0, - LandPhone = 1, - CellPhone = 2, - Email = 4, - SnailMail = 8, - Owl = 16, - FlooPowder = 32, - Text = 64, - Muggle = Email | Text | CellPhone, - Wizard = Owl | FlooPowder - } -} diff --git a/AttributesExamples/AttributesExamples/AttributesExamples.csproj b/AttributesExamples/AttributesExamples/AttributesExamples.csproj deleted file mode 100644 index af2f8b1..0000000 --- a/AttributesExamples/AttributesExamples/AttributesExamples.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - netcoreapp2.2 - - - - - - - - - - - diff --git a/AttributesExamples/DemoAttributeExamples/DemoAttributeExamples.csproj b/AttributesExamples/DemoAttributeExamples/DemoAttributeExamples.csproj deleted file mode 100644 index 968d4e3..0000000 --- a/AttributesExamples/DemoAttributeExamples/DemoAttributeExamples.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - Exe - netcoreapp2.2 - - - - - - - diff --git a/AttributesExamples/DemoAttributeExamples/Program.cs b/AttributesExamples/DemoAttributeExamples/Program.cs deleted file mode 100644 index 0028554..0000000 --- a/AttributesExamples/DemoAttributeExamples/Program.cs +++ /dev/null @@ -1,54 +0,0 @@ -using AttributesExamples; -using System; - -namespace DemoAttributeExamples -{ - class Program - { - static void Main(string[] args) - { - EnumAsBitFieldDemo(); - - Console.ReadLine(); - } - - static void ParsingConfigurationFileDemo() - { - var settings = Application.LoggingConfig; - - Console.WriteLine($"Log Name: {settings.LogName}"); - Console.WriteLine($"Log Location: {settings.LogPath}"); - Console.WriteLine($"Severity Level: {settings.SeverityLevel}"); - Console.WriteLine($"Logging {(settings.LoggingEnabled ? @"is" : @"is not")} enabled."); - } - - static void PlannedCodeObsolescenceDemo() - { - var p = new PlannedCodeObsolescence(); - - p.SetName("Tiny Tim"); - - // p.AgeSet(5); - } - - static void EnumAsBitFieldDemo() - { - var prefContactMethods = PreferredContactMethods.Email | PreferredContactMethods.FlooPowder; - - if (prefContactMethods == PreferredContactMethods.None) - Console.WriteLine("User hates people. :("); // won't print - - if (prefContactMethods.HasFlag(PreferredContactMethods.LandPhone)) - Console.WriteLine("What's a landph one? :/"); // also won't print - - if (prefContactMethods.HasFlag(PreferredContactMethods.CellPhone) - || prefContactMethods.HasFlag(PreferredContactMethods.Email)) - Console.WriteLine("Aren't we modern? :p"); // should print - - prefContactMethods |= PreferredContactMethods.Owl; - - if (prefContactMethods.HasFlag(PreferredContactMethods.Wizard)) - Console.WriteLine("You're a wizard Harry!! ~:›"); // this too - } - } -} diff --git a/AttributesExamples/DemoAttributeExamples/app.config b/AttributesExamples/DemoAttributeExamples/app.config deleted file mode 100644 index ab197eb..0000000 --- a/AttributesExamples/DemoAttributeExamples/app.config +++ /dev/null @@ -1,12 +0,0 @@ - - - -
- - - - - \ No newline at end of file diff --git a/CollectionViewSourceSample/README.md b/CollectionViewSourceSample/README.md deleted file mode 100644 index c954655..0000000 --- a/CollectionViewSourceSample/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Using the CollectionViewSource to filter results in a ListView - -http://grantwinney.com/using-a-textbox-and-collectionviewsource-to-filter-a-listview-in-wpf/ \ No newline at end of file diff --git a/DevTools/CompareInVSCode/formatted.xml b/DevTools/CompareInVSCode/formatted.xml new file mode 100644 index 0000000..ebbd360 --- /dev/null +++ b/DevTools/CompareInVSCode/formatted.xml @@ -0,0 +1,4359 @@ + + + A list of reporting services reports that have subscriptions + Anthony Duguid + 0 + + + ReportServer + None + 9c5d5e18-ddee-41b3-ae49-8d83f261caf6 + + + + + + ReportServer + + + =Parameters!ReportServerUrl.Value + + + =Parameters!all_value.Value + + + =Parameters!DeliveryExtension.Value + + + =Parameters!SubscriptionType.Value + + + =Parameters!ReportFolder.Value + + + =Parameters!ReportName.Value + + + =Parameters!StatusGroup.Value + + + =Parameters!EventStatus.Value + + + =Parameters!SubscriptionStatus.Value + + + =Parameters!LastStatus.Value + + + =Parameters!IsDisabled.Value + + + =Parameters!StartDateTime.Value + + + =Parameters!EndDateTime.Value + + + =Parameters!EmailLike.Value + + + WITH report_status AS ( SELECT tbl.* FROM (VALUES ( 'rrRenderingError', 'Failure') , ( 'rsHttpRuntimeClientDisconnectionError', 'Failure') , ( 'rsInternalError', 'Failure') , ( 'rsInvalidDataSourceCredentialSetting', 'Failure') , ( 'rsProcessingAborted', 'Failure') , ( 'rsProcessingError', 'Failure') , ( 'rsRenderingExtensionNotFound', 'Failure') , ( 'rsReportServerDatabaseError', 'Failure') , ( 'rsSuccess', 'Success') ) tbl ([StatusName], [StatusGroup]) ) , report_users AS ( SELECT [UserID] , [UserName] , [SimpleUserName] = LOWER(RIGHT([UserName], (LEN([UserName]) - CHARINDEX('\', [UserName])))) FROM [dbo].[Users] WITH(NOLOCK) ) , report_catalog AS ( SELECT c.[ItemID] , c.[CreatedById] , c.[ModifiedById] , c.[Type] , c.[Name] , c.[Description] , c.[Parameter] , [ReportCreationDate] = c.[CreationDate] , [ReportModifiedDate] = c.[ModifiedDate] , [ReportFolder] = CASE WHEN c.Path = '/' + c.Name THEN '' ELSE SUBSTRING(c.[Path], 2, Len(c.[Path])-Len(c.[Name])-2) END , [ReportPath] = c.[Path] , [UrlPath] = @ReportServerUrl + 'Reports/Pages/Folder.aspx?ItemPath=%2f' , [ReportDefinition] = CONVERT(VARCHAR(MAX),CONVERT(VARBINARY(MAX), c.[content])) FROM [dbo].[Catalog] AS c WITH (NOLOCK) WHERE 1=1 AND c.[Type] IN(2, 4) ) , subscription_days AS ( SELECT tbl.* FROM (VALUES ( 'DaysOfMonth', 1, '1') , ( 'DaysOfMonth', 2, '2') , ( 'DaysOfMonth', 4, '3') , ( 'DaysOfMonth', 8, '4') , ( 'DaysOfMonth', 16, '5') , ( 'DaysOfMonth', 32, '6') , ( 'DaysOfMonth', 64, '7') , ( 'DaysOfMonth', 128, '8') , ( 'DaysOfMonth', 256, '9') , ( 'DaysOfMonth', 512, '10') , ( 'DaysOfMonth', 1024, '11') , ( 'DaysOfMonth', 2048, '12') , ( 'DaysOfMonth', 4096, '13') , ( 'DaysOfMonth', 8192, '14') , ( 'DaysOfMonth', 16384, '15') , ( 'DaysOfMonth', 32768, '16') , ( 'DaysOfMonth', 65536, '17') , ( 'DaysOfMonth', 131072, '18') , ( 'DaysOfMonth', 262144, '19') , ( 'DaysOfMonth', 524288, '20') , ( 'DaysOfMonth', 1048576, '21') , ( 'DaysOfMonth', 2097152, '22') , ( 'DaysOfMonth', 4194304, '23') , ( 'DaysOfMonth', 8388608, '24') , ( 'DaysOfMonth', 16777216, '25') , ( 'DaysOfMonth', 33554432, '26') , ( 'DaysOfMonth', 67108864, '27') , ( 'DaysOfMonth', 134217728, '28') , ( 'DaysOfMonth', 268435456, '29') , ( 'DaysOfMonth', 536870912, '30') , ( 'DaysOfMonth', 1073741824, '31') , ( 'DaysOfMonth', 8193, '1st and 14th') , ( 'DaysOfWeek', 1, 'Sun') , ( 'DaysOfWeek', 2, 'Mon') , ( 'DaysOfWeek', 4, 'Tues') , ( 'DaysOfWeek', 8, 'Wed') , ( 'DaysOfWeek', 16, 'Thurs') , ( 'DaysOfWeek', 32, 'Fri') , ( 'DaysOfWeek', 64, 'Sat') , ( 'DaysOfWeek', 62, 'Mon - Fri') , ( 'DaysOfWeek', 10, 'Mon - Wed') , ( 'DaysOfWeek', 24, 'Wed - Thurs') , ( 'DaysOfWeek', 120, 'Wed - Sat') , ( 'DaysOfWeek', 126, 'Mon - Sat') , ( 'DaysOfWeek', 127, 'Daily') , ( 'DayOfWeek', 1, 'Sun') , ( 'DayOfWeek', 127, 'Sun') , ( 'DayOfWeek', 2, 'Mon') , ( 'DayOfWeek', 10, 'Mon') , ( 'DayOfWeek', 62, 'Mon') , ( 'DayOfWeek', 126, 'Mon') , ( 'DayOfWeek', 127, 'Mon') , ( 'DayOfWeek', 4, 'Tue') , ( 'DayOfWeek', 10, 'Tue') , ( 'DayOfWeek', 62, 'Tue') , ( 'DayOfWeek', 126, 'Tue') , ( 'DayOfWeek', 127, 'Tue') , ( 'DayOfWeek', 8, 'Wed') , ( 'DayOfWeek', 10, 'Wed') , ( 'DayOfWeek', 24, 'Wed') , ( 'DayOfWeek', 62, 'Wed') , ( 'DayOfWeek', 120, 'Wed') , ( 'DayOfWeek', 126, 'Wed') , ( 'DayOfWeek', 127, 'Wed') , ( 'DayOfWeek', 16, 'Thr') , ( 'DayOfWeek', 24, 'Thr') , ( 'DayOfWeek', 62, 'Thr') , ( 'DayOfWeek', 120, 'Thr') , ( 'DayOfWeek', 126, 'Thr') , ( 'DayOfWeek', 127, 'Thr') , ( 'DayOfWeek', 32, 'Fri') , ( 'DayOfWeek', 62, 'Fri') , ( 'DayOfWeek', 120, 'Fri') , ( 'DayOfWeek', 126, 'Fri') , ( 'DayOfWeek', 127, 'Fri') , ( 'DayOfWeek', 64, 'Sat') , ( 'DayOfWeek', 120, 'Sat') , ( 'DayOfWeek', 126, 'Sat') , ( 'DayOfWeek', 127, 'Sat') ) tbl ([GroupName], [CodeNbr], [Label]) ) , subscription_schedule AS ( SELECT [ScheduleID] , [SchDaySun] = Sun , [SchDayMon] = Mon , [SchDayTue] = Tue , [SchDayWed] = Wed , [SchDayThr] = Thr , [SchDayFri] = Fri , [SchDaySat] = Sat , [ScheduleName] , [ScheduleStartDate] , [ScheduleEndDate] , [Flags] , [RecurrenceType] , [State] , [MinutesInterval] , [DaysInterval] , [WeeksInterval] , [DaysOfWeek] , [DaysOfMonth] , [Month] , [MonthlyWeek] , [ScheduleDays] FROM ( SELECT sc.[ScheduleID] , sd.[CodeNbr] , sd.[Label] , [ScheduleName] = CASE WHEN sc.[EventType] = 'SharedSchedule' THEN sc.[name] ELSE NULL END , [ScheduleStartDate] = sc.[StartDate] , [ScheduleEndDate] = sc.[EndDate] , sc.[Flags] , sc.[RecurrenceType] , sc.[State] , sc.[MinutesInterval] , sc.[DaysInterval] , sc.[WeeksInterval] , sc.[DaysOfWeek] , sc.[DaysOfMonth] , sc.[Month] , sc.[MonthlyWeek] , [ScheduleDays] = CASE WHEN sc.[DaysOfMonth] IS NOT NULL THEN COALESCE(dom.[Label], '(' + CAST(sc.[DaysOfMonth] AS VARCHAR(20)) + ') NOT CODED') WHEN sc.[DaysOfWeek] IS NOT NULL THEN COALESCE(dow.[Label], '(' + CAST(sc.[DaysOfWeek] AS VARCHAR(20)) + ') NOT CODED') END FROM [dbo].[Schedule] sc WITH (NOLOCK) LEFT JOIN subscription_days sd ON sc.[DaysOfWeek] = sd.[CodeNbr] AND sd.[GroupName] = 'DayOfWeek' LEFT JOIN subscription_days AS dom ON sc.[DaysOfMonth] = dom.[CodeNbr] AND dom.[GroupName] = 'DaysOfMonth' LEFT JOIN subscription_days AS dow ON sc.[DaysOfWeek] = dow.[CodeNbr] AND dow.[GroupName] = 'DaysOfWeek' ) sch PIVOT ( COUNT(sch.[Label]) FOR sch.[Label] IN ([Sun], [Mon], [Tue], [Wed], [Thr], [Fri], [Sat]) ) AS pvt ) , report_subscription AS ( SELECT s.[SubscriptionID] , s.[Report_OID] , [SubscriptionDescription] = s.[Description] , s.[ExtensionSettings] , s.[EventType] , s.[OwnerID] , s.[ModifiedByID] , s.[ModifiedDate] , [RunTime] = CONVERT(VARCHAR(5), s.[LastRunTime], 8) , [LastRunDate] = CONVERT(VARCHAR(11), s.[LastRunTime], 13) , [LastRunTime] = CAST(CONVERT(CHAR(16), s.[LastRunTime], 113) AS DATETIME) , [SubscriptionType] = CASE WHEN CAST(s.[DataSettings] AS NVARCHAR(50)) IS NOT NULL THEN 'Data-Driven' ELSE 'Standard' END , s.[DeliveryExtension] , s.[MatchData] , [SubscriptionLastStatus] = s.[LastStatus] , [StatusFail] = CASE WHEN s.[LastStatus] LIKE '%Mail sent%' THEN 'N' ELSE 'Y' END , [EmailSubject] = CASE CHARINDEX('<Name>SUBJECT</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>SUBJECT</Name><Value>') + CHARINDEX('<Name>SUBJECT</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>SUBJECT</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>SUBJECT</Name><Value>') + CHARINDEX('<Name>SUBJECT</Name><Value>', s.ExtensionSettings))) END , [EmailTo] = SUBSTRING(s.ExtensionSettings, LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>TO</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', s.ExtensionSettings))) , [EmailCc] = CASE CHARINDEX('<Name>CC</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>CC</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', s.ExtensionSettings))) END , [EmailBcc] = CASE CHARINDEX('<Name>BCC</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>BCC</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', s.ExtensionSettings))) END , [EmailComment] = CASE CHARINDEX('<Name>Comment</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>Comment</Name><Value>') + CHARINDEX('<Name>Comment</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>Comment</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>Comment</Name><Value>') + CHARINDEX('<Name>Comment</Name><Value>', s.ExtensionSettings))) END , [EmailIncludeLink] = CASE CHARINDEX('<Name>IncludeLink</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>IncludeLink</Name><Value>') + CHARINDEX('<Name>IncludeLink</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>IncludeLink</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>IncludeLink</Name><Value>') + CHARINDEX('<Name>IncludeLink</Name><Value>', s.ExtensionSettings))) END , [EmailRenderFormat] = CASE CHARINDEX('<Name>RenderFormat</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>RenderFormat</Name><Value>') + CHARINDEX('<Name>RenderFormat</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>RenderFormat</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>RenderFormat</Name><Value>') + CHARINDEX('<Name>RenderFormat</Name><Value>', s.ExtensionSettings))) END , [EmailPriority] = CASE CHARINDEX('<Name>Priority</Name><Value>', s.ExtensionSettings) WHEN 0 THEN '' ELSE SUBSTRING(s.ExtensionSettings, LEN('<Name>Priority</Name><Value>') + CHARINDEX('<Name>Priority</Name><Value>', s.ExtensionSettings), CHARINDEX('</Value>', s.ExtensionSettings, CHARINDEX('<Name>Priority</Name><Value>', s.ExtensionSettings) + 1) - (LEN('<Name>Priority</Name><Value>') + CHARINDEX('<Name>Priority</Name><Value>', s.ExtensionSettings))) END , sch.[MinutesInterval] , sch.[DaysInterval] , sch.[WeeksInterval] , sch.[DaysOfWeek] , sch.[DaysOfMonth] , sch.[Month] , sch.[MonthlyWeek] , sch.[ScheduleName] , sch.[ScheduleDays] , sch.[SchDaySun] , sch.[SchDayMon] , sch.[SchDayTue] , sch.[SchDayWed] , sch.[SchDayThr] , sch.[SchDayFri] , sch.[SchDaySat] , sch.[ScheduleStartDate] , sch.[ScheduleEndDate] , sch.[Flags] , sch.[RecurrenceType] , sch.[State] , s.[LastStatus] , rs.[ScheduleID] , [IsDisabled] = CASE WHEN s.[LastStatus] = 'Disabled' THEN 1 ELSE 0 END FROM [dbo].[Subscriptions] AS s WITH (NOLOCK) LEFT JOIN [dbo].[Notifications] AS n WITH (NOLOCK) ON n.[SubscriptionID] = s.[SubscriptionID] AND s.[Report_OID] = n.[ReportID] LEFT JOIN [dbo].[ReportSchedule] AS rs WITH (NOLOCK) ON s.[SubscriptionID] = rs.[SubscriptionID] LEFT JOIN subscription_schedule AS sch ON rs.[ScheduleID] = sch.[ScheduleID] WHERE 1=1 AND (@all_value IN (@DeliveryExtension) OR s.[DeliveryExtension] IN(@DeliveryExtension)) ) SELECT c.[ItemID] , c.[Name] , c.[Description] , c.[Type] , c.[Parameter] , c.[ReportFolder] , c.[ReportPath] , [URL_ReportFolder] = c.[UrlPath] + c.[ReportFolder] + '&ViewMode=List' , [URL_Report] = @ReportServerUrl + 'Reports/report/' + c.[ReportFolder] + '%2f' + c.[Name] , [URL] = @ReportServerUrl + 'Reports/manage/catalogitem/editsubscription' + c.[ReportPath] + '?id=' + CAST(s.[SubscriptionID] AS VARCHAR(80)) , [URL2] = @ReportServerUrl + 'Reports/Pages/Report.aspx?ItemPath=' + c.[ReportPath] + '&SelectedTabId=SubscriptionsTab' , [ReportCreatedBy] = urc.[SimpleUserName] , c.[ReportCreationDate] , [ReportModifiedBy] = urm.[SimpleUserName] , c.[ReportModifiedDate] , [SubscriptionOwner] = usc.[SimpleUserName] , [SubscriptionModifiedBy] = usm.[SimpleUserName] , [SubscriptionModifiedDate] = s.[ModifiedDate] , s.[SubscriptionID] , s.[SubscriptionDescription] , s.[ExtensionSettings] , s.[EventType] , s.[EmailSubject] , s.[EmailTo] , s.[EmailCc] , s.[EmailBcc] , s.[EmailComment] , s.[EmailIncludeLink] , s.[EmailRenderFormat] , s.[EmailPriority] , s.[DeliveryExtension] , [DeliveryExtensionImage] = CASE WHEN s.[DeliveryExtension] = 'Report Server Email' THEN 'email' WHEN s.[DeliveryExtension] = 'Report Server FileShare' THEN 'folder_table' ELSE '' END , s.[SubscriptionType] , s.[SubscriptionLastStatus] , s.[StatusFail] , s.[MatchData] , s.[RunTime] , s.[LastRunDate] , s.[LastRunTime] , s.[MinutesInterval] , s.[DaysInterval] , s.[WeeksInterval] , s.[DaysOfWeek] , s.[DaysOfMonth] , s.[Month] , s.[MonthlyWeek] , [JobName] = NULL , s.[ScheduleName] , s.[ScheduleDays] , s.[SchDaySun] , s.[SchDayMon] , s.[SchDayTue] , s.[SchDayWed] , s.[SchDayThr] , s.[SchDayFri] , s.[SchDaySat] , s.[ScheduleStartDate] , s.[ScheduleEndDate] , s.[Flags] , s.[RecurrenceType] , s.[State] , [EventStatus] = el.[Status] , [EventDateTime] = el.[TimeEnd] , s.[LastStatus] , s.[ScheduleID] FROM report_catalog AS c INNER JOIN report_subscription AS s ON s.[Report_OID] = c.[ItemID] LEFT JOIN ( SELECT b.[ReportID] , b.[Status] , b.[TimeEnd] , [LastRunTime] = CAST(CONVERT(CHAR(16), b.[TimeEnd], 113) AS DATETIME) FROM [dbo].[ExecutionLog] AS b WITH (NOLOCK) INNER JOIN (SELECT [ReportID], MAX([TimeEnd]) AS [TimeEnd] FROM [dbo].[ExecutionLog] WITH (NOLOCK) GROUP BY [ReportID]) a ON b.[ReportID] = a.[ReportID] AND b.[TimeEnd] = a.[TimeEnd] GROUP BY b.[ReportID] , b.[Status] , b.[TimeEnd] ) AS el ON el.[ReportID] = c.[ItemID] LEFT JOIN report_status AS rs ON el.[Status] = rs.[StatusName] LEFT JOIN report_users AS urc ON c.[CreatedById] = urc.[UserID] LEFT JOIN report_users AS urm ON c.[ModifiedById] = urm.[UserID] LEFT JOIN report_users AS usc ON s.[OwnerID] = usc.[UserID] LEFT JOIN report_users AS usm ON s.[ModifiedByID] = usm.[UserID] WHERE 1=1 AND s.[SubscriptionType] IN(@SubscriptionType) AND (@all_value IN (@ReportFolder) OR c.[ReportFolder] IN(@ReportFolder)) AND (@all_value IN(@ReportName) OR c.[Name] IN(@ReportName)) AND (@all_value IN(@StatusGroup) OR rs.[StatusGroup] IN(@StatusGroup)) AND (@all_value IN(@EventStatus) OR el.[Status] IN(@EventStatus)) AND (@all_value IN(@SubscriptionStatus) OR s.[SubscriptionLastStatus] LIKE '%' + @SubscriptionStatus + '%') AND (@all_value IN(@LastStatus) OR s.[LastStatus] IN(@LastStatus)) AND (@IsDisabled IS NULL OR s.[IsDisabled] = @IsDisabled) --AND (@IsDisabled IS NULL OR CASE WHEN s.[ScheduleEndDate] IS NULL THEN 0 WHEN s.[ScheduleEndDate] IS NOT NULL THEN 1 END = @IsDisabled) AND (el.[TimeEnd] >= @StartDateTime OR @StartDateTime IS NULL) AND (el.[TimeEnd] <= @EndDateTime OR @EndDateTime IS NULL) AND ( (SUBSTRING(s.[ExtensionSettings], LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', s.[ExtensionSettings]), CHARINDEX('</Value>', s.[ExtensionSettings], CHARINDEX('<Name>TO</Name><Value>', s.[ExtensionSettings]) + 1) - (LEN('<Name>TO</Name><Value>') + CHARINDEX('<Name>TO</Name><Value>', s.[ExtensionSettings]))) LIKE '%' + @EmailLike + '%' OR @EmailLike IS NULL ) OR ( CASE CHARINDEX('<Name>CC</Name><Value>', s.[ExtensionSettings]) WHEN 0 THEN '' ELSE SUBSTRING(s.[ExtensionSettings], LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', s.[ExtensionSettings]), CHARINDEX('</Value>', s.[ExtensionSettings], CHARINDEX('<Name>CC</Name><Value>', s.[ExtensionSettings]) + 1) - (LEN('<Name>CC</Name><Value>') + CHARINDEX('<Name>CC</Name><Value>', s.[ExtensionSettings]))) END LIKE '%' + @EmailLike + '%' ) OR ( CASE CHARINDEX('<Name>BCC</Name><Value>', s.[ExtensionSettings]) WHEN 0 THEN '' ELSE SUBSTRING(s.[ExtensionSettings], LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', s.[ExtensionSettings]), CHARINDEX('</Value>', s.[ExtensionSettings], CHARINDEX('<Name>BCC</Name><Value>', s.[ExtensionSettings]) + 1) - (LEN('<Name>BCC</Name><Value>') + CHARINDEX('<Name>BCC</Name><Value>', s.[ExtensionSettings]))) END LIKE '%' + @EmailLike + '%') ) + true + + + + ItemID + System.Guid + + + Name + System.String + + + Description + System.String + + + Type + System.Int32 + + + Parameter + System.String + + + ReportFolder + System.String + + + ReportPath + System.String + + + URL_ReportFolder + System.String + + + URL_Report + System.String + + + URL + System.String + + + URL2 + System.String + + + ReportCreatedBy + System.String + + + ReportCreationDate + System.DateTime + + + ReportModifiedBy + System.String + + + ReportModifiedDate + System.DateTime + + + SubscriptionOwner + System.String + + + SubscriptionModifiedBy + System.String + + + SubscriptionModifiedDate + System.DateTime + + + SubscriptionID + System.Guid + + + SubscriptionDescription + System.String + + + ExtensionSettings + System.String + + + EventType + System.String + + + EmailSubject + System.String + + + EmailTo + System.String + + + EmailCc + System.String + + + EmailBcc + System.String + + + EmailComment + System.String + + + EmailIncludeLink + System.String + + + EmailRenderFormat + System.String + + + EmailPriority + System.String + + + DeliveryExtension + System.String + + + DeliveryExtensionImage + System.String + + + SubscriptionType + System.String + + + SubscriptionLastStatus + System.String + + + StatusFail + System.String + + + MatchData + System.String + + + RunTime + System.String + + + LastRunDate + System.String + + + LastRunTime + System.DateTime + + + MinutesInterval + System.Int32 + + + DaysInterval + System.Int32 + + + WeeksInterval + System.Int32 + + + DaysOfWeek + System.Int32 + + + DaysOfMonth + System.Int32 + + + Month + System.Int32 + + + MonthlyWeek + System.Int32 + + + JobName + System.Int32 + + + ScheduleName + System.String + + + ScheduleDays + System.String + + + SchDaySun + System.Int32 + + + SchDayMon + System.Int32 + + + SchDayTue + System.Int32 + + + SchDayWed + System.Int32 + + + SchDayThr + System.Int32 + + + SchDayFri + System.Int32 + + + SchDaySat + System.Int32 + + + ScheduleStartDate + System.DateTime + + + ScheduleEndDate + System.DateTime + + + Flags + System.Int32 + + + RecurrenceType + System.Int32 + + + State + System.Int32 + + + EventStatus + System.String + + + EventDateTime + System.DateTime + + + LastStatus + System.String + + + ScheduleID + System.Guid + + + + + + ReportServer + + + =Parameters!all_value.Value + + + WITH catalog_type_description AS ( SELECT tbl.* FROM (VALUES ( 1, 'Folder') , ( 2, 'Report') , ( 3, 'Resource') , ( 4, 'Linked Report') , ( 5, 'Data Source') , ( 6, 'Report Model') , ( 8, 'Shared Dataset') , ( 9, 'Report Part') ) tbl ([TypeID], [TypeDescription]) WHERE [TypeID] = 2 ) SELECT [Report_Folder] = SUBSTRING(c.[Path], 2, Len(c.[Path])-Len(c.[Name])-2) FROM [dbo].[Subscriptions] AS s WITH (NOLOCK) INNER JOIN [dbo].[Catalog] AS c WITH (NOLOCK) ON s.[Report_OID] = c.[ItemID] INNER JOIN catalog_type_description AS ctd ON ctd.[TypeID] = c.[Type] UNION SELECT @all_value ORDER BY 1 + true + + + + Report_Folder + System.Object + + + + + + ReportServer + + + =Parameters!ReportFolder.Value + + + =Parameters!all_value.Value + + + SELECT [Report_Name] = c.[Name] FROM [dbo].[Subscriptions] AS s WITH (NOLOCK) INNER JOIN [dbo].[Catalog] AS c WITH (NOLOCK) ON s.[Report_OID] = c.[ItemID] WHERE 1=1 AND c.[Type] = 2 AND (SUBSTRING(c.[Path], 2, Len(c.[Path])-Len(c.[Name])-2) IN(@ReportFolder) OR @all_value IN (@ReportFolder)) UNION SELECT @all_value ORDER BY 1 + true + + + + Report_Name + System.Object + + + + + + ReportServer + + + =Parameters!all_value.Value + + + SELECT DISTINCT [Status] FROM [dbo].[ExecutionLog] WITH (NOLOCK) UNION SELECT @all_value + true + + + + Status + System.Object + + + + + + ReportServer + + + =Parameters!StartDateTime.Value + + + =Parameters!EndDateTime.Value + + + =Parameters!all_value.Value + + + SELECT DISTINCT [s].[LastStatus] FROM [dbo].[Subscriptions] AS [s] WITH(NOLOCK) WHERE 1 = 1 AND ( [s].[LastRunTime] >= @StartDateTime OR @StartDateTime IS NULL ) AND ( [s].[LastRunTime] <= @EndDateTime OR @EndDateTime IS NULL ) UNION SELECT @all_value ORDER BY 1; + + + + LastStatus + System.Object + + + + + + ReportServer + + + =Parameters!all_value.Value + + + SELECT tbl.* FROM (VALUES ( 'Success') , ( 'Failure') ) tbl ([StatusGroup]) UNION SELECT @all_value + + + + StatusGroup + System.Object + + + + + + + + + + + + + 0.6cm + + + 6cm + + + 0.6cm + + + 6cm + + + 0.6cm + + + 0.6cm + + + 7cm + + + 4.00813cm + + + 2.5cm + + + 3cm + + + 2.5cm + + + 1.15cm + + + 1.15cm + + + 1.15cm + + + 1.15cm + + + 1.15cm + + + 1.15cm + + + 1.15cm + + + 3.25cm + + + 3.25cm + + + 9.75cm + + + 6.25cm + + + 6cm + + + 6cm + + + 10cm + + + 2.25cm + + + 2.75cm + + + 2.25cm + + + 5.02646cm + + + 3cm + + + 10.5cm + + + 2.25cm + + + 2.25cm + + + 3.25cm + + + 2.67333cm + + + 3.25cm + + + 2.77917cm + + + 3.25cm + + + 6cm + + + + + 1cm + + + + + true + true + + + + + + + + + + + + + 0.75pt + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Folder + + + + + + + + 0.75pt + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + + 0.75pt + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Name + + + + + + + + 0.75pt + + + + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + + 0.75pt + + + + + + + + + + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + + + + 0.75pt + + + + + + + + + + + + + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Description + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Delivery Extension + + + + + + + Textbox2 + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Type + + + + + + + Textbox4 + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Shared Name + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Schedule + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sun + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Mon + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Tue + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Wed + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Thu + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Fri + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Sat + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Run Time + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription End Date + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subject + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Email To + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Email Cc + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Email Bcc + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Email Comment + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Include Link + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Render Format + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Priority + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Parameters + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Last Run Status + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Status + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Owner + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Subscription Modified By + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + + =Fields!SubscriptionModifiedDate.Value + grpDetails2 + Subscriptions + + true + + + + + Subscription Modified Date + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Created By + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Created Date + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Modified By + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Report Modified Date + + + + + + + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + Schedule ID + + + + + + + Textbox1 + + 0.75pt + + =Variables!ColorTableHeaderBackground.Value + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.6cm + + + + + true + true + + + + + + + + + + 0.75pt + + + + + =Code.CandyStripe(True, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + + Embedded + folder + Clip + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ReportFolder.Value + + + + + 0.75pt + + + + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + 0.75pt + + + + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + + Embedded + =IIF(Fields!Type.Value = 2, "report", "report_link") + Clip + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Name.Value + + + + + 0.75pt + + + + + + + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + 0.75pt + + + + + + + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + + Embedded + =Fields!DeliveryExtensionImage.Value + Clip + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + + + + + + 0.75pt + + + + + + + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + + Embedded + log + Clip + + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionDescription.Value + + + + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!DeliveryExtension.Value + + + + + + + DeliveryExtension + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionType.Value + + + + + + + SubscriptionType1 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ScheduleName.Value + + + + + + + 28 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ScheduleDays.Value + + + + + + + 27 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDaySun.Value = "0", "", Fields!RunTime.Value) + + + + + + + 26 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDayMon.Value = "0", "", Fields!RunTime.Value) + + + + + + + 25 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDayTue.Value = "0", "", Fields!RunTime.Value) + + + + + + + 24 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDayWed.Value = "0", "", Fields!RunTime.Value) + + + + + + + 23 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDayThr.Value = "0", "", Fields!RunTime.Value) + + + + + + + 22 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDayFri.Value = "0", "", Fields!RunTime.Value) + + + + + + + 21 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =IIf(Fields!SchDaySat.Value = "0", "", Fields!RunTime.Value) + + + + + + + 20 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EventDateTime.Value + + + + + + + 19 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ScheduleEndDate.Value + + + + + + + 18 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailSubject.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailTo.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailCc.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailBcc.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailComment.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailIncludeLink.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailRenderFormat.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EmailPriority.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!Parameter.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!EventStatus.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionLastStatus.Value + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionOwner.Value + + + + + + + 6 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionModifiedBy.Value + + + + + + + 5 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!SubscriptionModifiedDate.Value + + + + + + + 4 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ReportCreatedBy.Value + + + + + + + 3 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ReportCreationDate.Value + + + + + + + 2 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ReportModifiedBy.Value + + + + + + + 1 + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ReportModifiedDate.Value + + + + + + + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + true + true + + + + + =Fields!ScheduleID.Value + + + + + + + ScheduleID + + 0.75pt + + =Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value) + 2pt + 2pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowParameters.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + =Not Parameters!ShowEmailDetails.Value + + + + + + + + + + + + + + + + true + After + true + true + + + + + =Fields!SubscriptionID.Value + + Detail + + + + =Fields!ReportFolder.Value + + + =Fields!Name.Value + + + =Fields!EmailSubject.Value + + + + + + Detail_Collection + Output + true + + + + Subscriptions + + Start + + 1.6cm + 137.43709cm + + 0.75pt + + Calibri + 8pt + + + + 1.6cm + + + + =IIF(IsNothing(Parameters!StartDateTime.Value) And IsNothing(Parameters!EndDateTime.Value), "", vbcrlf) + IIF(IsNothing(Parameters!StartDateTime.Value), "", "From: ") + Format(Parameters!StartDateTime.Value, Variables!FormatDateTime.Value) + IIF(IsNothing(Parameters!EndDateTime.Value), "", " To: ") + Format(Parameters!EndDateTime.Value, Variables!FormatDateTime.Value) + + + + 2pt + + + + Textbox8 + 2.75cm + 24.86472cm + + =IIF(Globals!RenderFormat.Name = "EXCELOPENXML", true, false) + + + + Middle + 25pt + 2pt + 2pt + 2pt + + + + Embedded + ssrs + FitProportional + 24.86472cm + 2.75cm + 4.30514cm + 1 + + =IIF(Globals!RenderFormat.Name = "EXCELOPENXML", true, false) + + + + + + + + 0.75pt + + + + + + + + 0.92063cm + true + true + + + true + true + true + + + + + ="© " + Variables!CompanyName.Value + " " + Year(Today).ToString + + + + 2pt + + + + + + =Variables!UrlReport.Value + + + + ="javascript:void(window.open('" + Variables!UrlReportWithParameters.Value + "','_blank'))" + + + + Open the report with the current parameters in a separate tab + + + + 2pt + + + + 0.92063cm + 21cm + + + 2pt + 2pt + 2pt + 2pt + + + + true + true + true + + + + + ="Page: " & Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString() + Environment.NewLine + "Produced By: " + Variables!UserName.Value + " @ " + Variables!ReportRunDateTime.Value + + + + 2pt + + + + 21cm + 0.92063cm + 8.16986cm + 1 + + + + + 0.75pt + + + + + + + 21cm + 29.7cm + 11in + 8.5in + 0.25cm + 0.25cm + 0.25cm + 0.25cm + 1cm + 0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Folder0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrue0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Name0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrue0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrue0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription Description0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueDelivery ExtensionTextbox20.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription TypeTextbox40.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueShared Name0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSchedule0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSun0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueMon0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueTue0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueWed0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueThu0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueFri0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSat0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription Run Time0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription End Date0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubject0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueEmail To0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueEmail Cc0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueEmail Bcc0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueEmail Comment0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueInclude Link0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueRender Format0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetruePriority0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueParameters0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueLast Run Status0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription Status0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription Owner0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSubscription Modified By0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttrue=Fields!SubscriptionModifiedDate.ValuegrpDetails2SubscriptionstrueSubscription Modified Date0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Created By0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Created Date0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Modified By0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueReport Modified Date0.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pttruetrueSchedule IDTextbox10.75pt=Variables!ColorTableHeaderBackground.ValueMiddle2pt2pt2pt2pt0.6cmtruetrue0.75pt=Code.CandyStripe(True, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)EmbeddedfolderClip2pt2pt2pt2pttruetrue=Fields!ReportFolder.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)Embedded=IIF(Fields!Type.Value = 2, "report", "report_link")Clip2pt2pt2pt2pttruetrue=Fields!Name.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)Embedded=Fields!DeliveryExtensionImage.ValueClip2pt2pt2pt2pttruetrue0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)EmbeddedlogClip2pt2pt2pt2pttruetrue=Fields!SubscriptionDescription.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!DeliveryExtension.ValueDeliveryExtension0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!SubscriptionType.ValueSubscriptionType10.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ScheduleName.Value280.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ScheduleDays.Value270.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDaySun.Value = "0", "", Fields!RunTime.Value)260.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDayMon.Value = "0", "", Fields!RunTime.Value)250.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDayTue.Value = "0", "", Fields!RunTime.Value)240.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDayWed.Value = "0", "", Fields!RunTime.Value)230.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDayThr.Value = "0", "", Fields!RunTime.Value)220.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDayFri.Value = "0", "", Fields!RunTime.Value)210.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=IIf(Fields!SchDaySat.Value = "0", "", Fields!RunTime.Value)200.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EventDateTime.Value190.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ScheduleEndDate.Value180.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailSubject.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailTo.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailCc.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailBcc.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailComment.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailIncludeLink.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailRenderFormat.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EmailPriority.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!Parameter.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!EventStatus.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!SubscriptionLastStatus.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!SubscriptionOwner.Value60.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!SubscriptionModifiedBy.Value50.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!SubscriptionModifiedDate.Value40.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ReportCreatedBy.Value30.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ReportCreationDate.Value20.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ReportModifiedBy.Value10.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ReportModifiedDate.Value0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pttruetrue=Fields!ScheduleID.ValueScheduleID0.75pt=Code.CandyStripe(False, Variables!ColorCandyStripeEvenRow.Value, Variables!ColorCandyStripeOddRow.Value)2pt2pt2pt2pt=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowParameters.Value=Not Parameters!ShowEmailDetails.Value=Not Parameters!ShowEmailDetails.ValuetrueAftertruetrue=Fields!SubscriptionID.ValueDetail=Fields!ReportFolder.Value=Fields!Name.Value=Fields!EmailSubject.ValueDetail_CollectionOutputtrueSubscriptionsStart1.6cm137.43709cm0.75ptCalibri8pt1.6cm =IIF(IsNothing(Parameters!StartDateTime.Value) And IsNothing(Parameters!EndDateTime.Value), "", vbcrlf) + IIF(IsNothing(Parameters!StartDateTime.Value), "", "From: ") + Format(Parameters!StartDateTime.Value, Variables!FormatDateTime.Value) + IIF(IsNothing(Parameters!EndDateTime.Value), "", " To: ") + Format(Parameters!EndDateTime.Value, Variables!FormatDateTime.Value) 2ptTextbox82.75cm24.86472cm=IIF(Globals!RenderFormat.Name = "EXCELOPENXML", true, false)Middle25pt2pt2pt2ptEmbeddedssrsFitProportional24.86472cm2.75cm4.30514cm1=IIF(Globals!RenderFormat.Name = "EXCELOPENXML", true, false)0.75pt0.92063cmtruetruetruetruetrue="© " + Variables!CompanyName.Value + " " + Year(Today).ToString2pt=Variables!UrlReport.Value="javascript:void(window.open('" + Variables!UrlReportWithParameters.Value + "','_blank'))"Open the report with the current parameters in a separate tab2pt0.92063cm21cm2pt2pt2pt2pttruetruetrue ="Page: " & Globals!PageNumber.ToString() + " of " + Globals!TotalPages.ToString() + Environment.NewLine + "Produced By: " + Variables!UserName.Value + " @ " + Variables!ReportRunDateTime.Value 2pt21cm0.92063cm8.16986cm10.75pt21cm29.7cm11in8.5in0.25cm0.25cm0.25cm0.25cm1cm + + + + + + + + + + + + + + + +

"...We have located the enemy fleet under the command of Admiral Kompüter, + but do not yet have visual contact. We suggest the best course of action is to fire + at random into their vicinity and listen for the impact of the shells...

+

...Our intelligence sources indicate the composition of the enemy fleet is the same + as our own, and has likewise been forced to resort to the same tactics as ourselves. In accordance with + the rules of war, fire will be exchanged one shell at a time and vessels lost will be announced + immediately...

+

...As per your orders you have been placed directly in command of the fleet's guns. Select the target + location by clicking in the left-hand grid above. The right hand grid shows the status of our own fleet. + Information as to the remaining strength of the enemy will be relayed directly to your status bar...

+

...We believe this battle will not be over until one or other fleet is sunk in it's entirety. Our + gunners + await your commands. We're counting on you, Sir..."

+ + + +

+

+ Free JavaScripts provided
+ by The JavaScript Source +
+
+

+ + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSBattleship/battleship 2 - copilot.htm b/Languages/JavaScript/LegacyGames/LegacyJSBattleship/battleship 2 - copilot.htm new file mode 100644 index 0000000..626652d --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSBattleship/battleship 2 - copilot.htm @@ -0,0 +1,406 @@ + + + + + + Battleship (Modern JS) + + + + +

+

Battleship

+
+
+
COMPUTER'S FLEET
+
+
+
+
PLAYER'S FLEET
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 1 - original.txt b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 1 - original.txt new file mode 100644 index 0000000..f5c253b --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 1 - original.txt @@ -0,0 +1,359 @@ + + + + + +
+
+ +
+
+ + + + + + + + + + + + + + + + + +
+BREAK OUT
+
+Ball: +Time: +
+
+
+ + + +

+Free JavaScripts provided
+by The JavaScript Source
+

+ + + + diff --git a/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 2 - copilot.html b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 2 - copilot.html new file mode 100644 index 0000000..46c2f39 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 2 - copilot.html @@ -0,0 +1,293 @@ + + + diff --git a/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 3 - final.htm b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 3 - final.htm new file mode 100644 index 0000000..31140e1 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSBreakout/breakout 3 - final.htm @@ -0,0 +1,291 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc0.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc0.gif new file mode 100644 index 0000000..fb16fe7 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc0.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc1.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc1.gif new file mode 100644 index 0000000..25aecd6 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc1.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc10.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc10.gif new file mode 100644 index 0000000..774c5e2 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc10.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc11.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc11.gif new file mode 100644 index 0000000..0c856fd Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc11.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc12.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc12.gif new file mode 100644 index 0000000..c19faf2 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc12.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc13.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc13.gif new file mode 100644 index 0000000..f12c968 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc13.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc14.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc14.gif new file mode 100644 index 0000000..139ccad Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc14.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc15.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc15.gif new file mode 100644 index 0000000..5bc0ce5 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc15.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc16.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc16.gif new file mode 100644 index 0000000..c5cbd92 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc16.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc17.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc17.gif new file mode 100644 index 0000000..0a10cbf Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc17.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc18.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc18.gif new file mode 100644 index 0000000..a3dceaa Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc18.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc2.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc2.gif new file mode 100644 index 0000000..541c5c0 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc2.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc3.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc3.gif new file mode 100644 index 0000000..3297e76 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc3.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc4.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc4.gif new file mode 100644 index 0000000..a36628a Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc4.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc5.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc5.gif new file mode 100644 index 0000000..bc6f9dd Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc5.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc6.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc6.gif new file mode 100644 index 0000000..1517c56 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc6.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc7.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc7.gif new file mode 100644 index 0000000..98873e1 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc7.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc8.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc8.gif new file mode 100644 index 0000000..d9f2008 Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc8.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc9.gif b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc9.gif new file mode 100644 index 0000000..721c37a Binary files /dev/null and b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/conc9.gif differ diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 1 - original.txt b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 1 - original.txt new file mode 100644 index 0000000..86917ac --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 1 - original.txt @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + +

+

Concentration

+
+ + +
+

+ +
+
+ +

+Free JavaScripts provided
+by The JavaScript Source
+

+ + + + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 2 - copilot.html b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 2 - copilot.html new file mode 100644 index 0000000..eceb041 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 2 - copilot.html @@ -0,0 +1,155 @@ + + + + +Concentration + + + + + +

Concentration

+ +
0:00
+
+ + + + + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 3 - final.html b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 3 - final.html new file mode 100644 index 0000000..659b67d --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSConcentration/concentration 3 - final.html @@ -0,0 +1,179 @@ + + + + + + + + + +
+
+ +
+
+ + + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 1 - original.txt b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 1 - original.txt new file mode 100644 index 0000000..768161e --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 1 - original.txt @@ -0,0 +1,360 @@ + + + + + +
+
+ +
+
+ + + + + + + + + + + + +
+ + +
+
+
+ + + +
+
+
+ + +
+ + +
+ +
+
+
+ + + + +

+Free JavaScripts provided
+by The JavaScript Source
+

+ + + + + +Source: https://web.archive.org/web/20000815215258/http://javascript.internet.com/games/maze.html \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 2 - copilot.htm b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 2 - copilot.htm new file mode 100644 index 0000000..d698e52 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 2 - copilot.htm @@ -0,0 +1,357 @@ + + + + + + +

+

+        
+ + +
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 3 - final.htm b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 3 - final.htm new file mode 100644 index 0000000..fff2988 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSMaze/js maze 3 - final.htm @@ -0,0 +1,398 @@ + + +
+

+    

+
+ + + +
+ + +
+
+ + \ No newline at end of file diff --git a/Languages/JavaScript/LegacyGames/LegacyJSMaze/readme.md b/Languages/JavaScript/LegacyGames/LegacyJSMaze/readme.md new file mode 100644 index 0000000..57195e5 --- /dev/null +++ b/Languages/JavaScript/LegacyGames/LegacyJSMaze/readme.md @@ -0,0 +1 @@ +[Bringing a 25 year old JS maze back to life · Grant Winney](https://grantwinney.com/old-js-maze-game/) diff --git a/Misc/ChromeExtensionSamples/01 Hello World/helloworld.js b/Misc/ChromeExtensionSamples/01 Hello World/helloworld.js new file mode 100644 index 0000000..a15c6ab --- /dev/null +++ b/Misc/ChromeExtensionSamples/01 Hello World/helloworld.js @@ -0,0 +1,3 @@ +chrome.browserAction.onClicked.addListener(function(tab) { + alert('HELLOOOOO WORLD!!'); +}); diff --git a/Misc/ChromeExtensionSamples/01 Hello World/manifest.json b/Misc/ChromeExtensionSamples/01 Hello World/manifest.json new file mode 100644 index 0000000..af92382 --- /dev/null +++ b/Misc/ChromeExtensionSamples/01 Hello World/manifest.json @@ -0,0 +1,10 @@ +{ + "name": "My First Extension", + "version": "1.0", + "manifest_version": 2, + + "background": { + "scripts": ["helloworld.js"] + }, + "browser_action": {} +} diff --git a/Misc/ChromeExtensionSamples/02 Try a Popup/manifest.json b/Misc/ChromeExtensionSamples/02 Try a Popup/manifest.json new file mode 100644 index 0000000..d43236c --- /dev/null +++ b/Misc/ChromeExtensionSamples/02 Try a Popup/manifest.json @@ -0,0 +1,9 @@ +{ + "name": "My Second Extension", + "version": "1.0", + "manifest_version": 2, + + "browser_action": { + "default_popup": "popup.html" + } +} diff --git a/Misc/ChromeExtensionSamples/02 Try a Popup/popup.html b/Misc/ChromeExtensionSamples/02 Try a Popup/popup.html new file mode 100644 index 0000000..09d69fb --- /dev/null +++ b/Misc/ChromeExtensionSamples/02 Try a Popup/popup.html @@ -0,0 +1 @@ +

HELLO WORLD!!

diff --git a/Misc/ChromeExtensionSamples/03 Popup - Send Email/manifest.json b/Misc/ChromeExtensionSamples/03 Popup - Send Email/manifest.json new file mode 100644 index 0000000..a3d3201 --- /dev/null +++ b/Misc/ChromeExtensionSamples/03 Popup - Send Email/manifest.json @@ -0,0 +1,9 @@ +{ + "name": "My Second Second Extension", + "version": "1.0", + "manifest_version": 2, + + "browser_action": { + "default_popup": "popup.html" + } +} diff --git a/Misc/ChromeExtensionSamples/03 Popup - Send Email/popup.html b/Misc/ChromeExtensionSamples/03 Popup - Send Email/popup.html new file mode 100644 index 0000000..b25eb64 --- /dev/null +++ b/Misc/ChromeExtensionSamples/03 Popup - Send Email/popup.html @@ -0,0 +1,13 @@ + + + + + +

Email Someone!

+

(not as sophisticated as it sounds...)

+

Email:

+

Subject:

+

Body:

+

+ + diff --git a/Misc/ChromeExtensionSamples/03 Popup - Send Email/script.js b/Misc/ChromeExtensionSamples/03 Popup - Send Email/script.js new file mode 100644 index 0000000..4bbb18f --- /dev/null +++ b/Misc/ChromeExtensionSamples/03 Popup - Send Email/script.js @@ -0,0 +1,8 @@ +window.addEventListener('load', function load(event) { + document.getElementById('send').onclick = function() { + var email = document.getElementById('emailAddress').value; + var subject = document.getElementById('emailSubject').value; + var body = encodeURIComponent(document.getElementById('emailBody').value); + window.open(`mailto:${email}?subject=${subject}&body=${body}`); + }; +}); diff --git a/Misc/ChromeExtensionSamples/04 Popup - Buttons/manifest.json b/Misc/ChromeExtensionSamples/04 Popup - Buttons/manifest.json new file mode 100644 index 0000000..1df1463 --- /dev/null +++ b/Misc/ChromeExtensionSamples/04 Popup - Buttons/manifest.json @@ -0,0 +1,13 @@ +{ + "name": "Button it up!", + "version": "1.0", + "manifest_version": 2, + + "browser_action": { + "default_popup": "popup.html" + }, + + "permissions": [ + "activeTab" + ] +} diff --git a/Misc/ChromeExtensionSamples/04 Popup - Buttons/popup.html b/Misc/ChromeExtensionSamples/04 Popup - Buttons/popup.html new file mode 100644 index 0000000..5831f38 --- /dev/null +++ b/Misc/ChromeExtensionSamples/04 Popup - Buttons/popup.html @@ -0,0 +1,10 @@ + + + + + +

+

+

+ + diff --git a/Misc/ChromeExtensionSamples/04 Popup - Buttons/script.js b/Misc/ChromeExtensionSamples/04 Popup - Buttons/script.js new file mode 100644 index 0000000..c400816 --- /dev/null +++ b/Misc/ChromeExtensionSamples/04 Popup - Buttons/script.js @@ -0,0 +1,9 @@ +window.addEventListener('load', function load(event) { + ['khaki','lightblue','palegreen'].forEach(function(color) { + document.getElementById(color).onclick = function() { + chrome.tabs.query({"active":true, "lastFocusedWindow":true}, function(tabs) { + chrome.tabs.insertCSS(tabs[0].id, {'code':`html,body,div,p{background:${color}!important}`}) + }); + }; + }); +}); diff --git a/Misc/ChromeExtensionSamples/05 Options/manifest.json b/Misc/ChromeExtensionSamples/05 Options/manifest.json new file mode 100644 index 0000000..04070d0 --- /dev/null +++ b/Misc/ChromeExtensionSamples/05 Options/manifest.json @@ -0,0 +1,11 @@ +{ + "name": "Options Please", + "version": "1.0", + "manifest_version": 2, + + "options_page": "options.html", + + "permissions": [ + "storage" + ] +} diff --git a/Misc/ChromeExtensionSamples/05 Options/options.html b/Misc/ChromeExtensionSamples/05 Options/options.html new file mode 100644 index 0000000..c35e907 --- /dev/null +++ b/Misc/ChromeExtensionSamples/05 Options/options.html @@ -0,0 +1,5 @@ + +
+

Enter your name:

+ +
diff --git a/Misc/ChromeExtensionSamples/05 Options/script.js b/Misc/ChromeExtensionSamples/05 Options/script.js new file mode 100644 index 0000000..90b1e09 --- /dev/null +++ b/Misc/ChromeExtensionSamples/05 Options/script.js @@ -0,0 +1,10 @@ +window.addEventListener('load', function load(event) { + chrome.storage.local.get('name', function(result) { + if (result != undefined && result.name != undefined) { + document.getElementById('name').value = result.name; + } + }); + document.getElementById('save').onclick = function() { + chrome.storage.local.set({'name': document.getElementById('name').value}); + }; +}); diff --git a/Misc/ChromeExtensionSamples/README.md b/Misc/ChromeExtensionSamples/README.md new file mode 100644 index 0000000..48f68cf --- /dev/null +++ b/Misc/ChromeExtensionSamples/README.md @@ -0,0 +1,9 @@ +# Simple Chrome Extension Samples + +We all have our favorite web browser with our favorite extensions loaded, but have you ever considered writing your own? You've probably had at least one idea for something that it'd be nice to have, but there's nothing out there that quite does what you're looking for. + +As technology becomes more and more a part of our everyday lives, it's useful to understand how to manipulate it to suit our individual needs. These days, knowing at least a little coding is like learning word processing or writing a basic html page was 15 years ago. It's becoming a basic computer skill. + +In the past few months I've created a couple extensions to suit my own needs - unpolished but functional - and threw them in the Chrome Web Store just in case someone out there found them useful. + +[Here's what I've learned](https://grantwinney.com/making-your-first-chrome-extension/). diff --git a/GetKnownFolders/CPlusPlus/CPlusPlus.sln b/Misc/GetKnownFolders/CPlusPlus/CPlusPlus.sln similarity index 100% rename from GetKnownFolders/CPlusPlus/CPlusPlus.sln rename to Misc/GetKnownFolders/CPlusPlus/CPlusPlus.sln diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp similarity index 100% rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.cpp diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj similarity index 100% rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj diff --git a/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters b/Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters similarity index 100% rename from GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters rename to Misc/GetKnownFolders/CPlusPlus/ConsoleApplication1/ConsoleApplication1.vcxproj.filters diff --git a/GetKnownFolders/CSharp/CSharp.sln b/Misc/GetKnownFolders/CSharp/CSharp.sln similarity index 100% rename from GetKnownFolders/CSharp/CSharp.sln rename to Misc/GetKnownFolders/CSharp/CSharp.sln diff --git a/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj b/Misc/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj similarity index 100% rename from GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj rename to Misc/GetKnownFolders/CSharp/GetKnownFolder/GetKnownFolder.csproj diff --git a/GetKnownFolders/CSharp/GetKnownFolder/Program.cs b/Misc/GetKnownFolders/CSharp/GetKnownFolder/Program.cs similarity index 100% rename from GetKnownFolders/CSharp/GetKnownFolder/Program.cs rename to Misc/GetKnownFolders/CSharp/GetKnownFolder/Program.cs diff --git a/GetKnownFolders/Python/GetKnownFolders.py b/Misc/GetKnownFolders/Python/GetKnownFolders.py similarity index 100% rename from GetKnownFolders/Python/GetKnownFolders.py rename to Misc/GetKnownFolders/Python/GetKnownFolders.py diff --git a/Misc/TweetRandomFeedItem/README.md b/Misc/TweetRandomFeedItem/README.md new file mode 100644 index 0000000..a205160 --- /dev/null +++ b/Misc/TweetRandomFeedItem/README.md @@ -0,0 +1,40 @@ +# Tweet a Random RSS Feed Item + +***Using [AWS Lambda](https://aws.amazon.com/lambda/) and [Tweetinvi](https://github.com/linvi/tweetinvi)*** + +This project is a slight modification of [my last one](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomPostFromAGhostBlog), replacing reading posts via the Ghost API to a more general parsing of RSS feeds. I wanted to create something that would work for *any* blog... or anything else that generates an RSS feed. + +## Usage + +This is a C# console you can run from AWS Lambda. Schedule it to run as often as you like using Lambda's [cron scheduling](https://docs.aws.amazon.com/lambda/latest/dg/tutorial-scheduled-events-schedule-expressions.html) capabilities. + +If you'd like to read more about it, [I wrote a blog post about it too](https://grantwinney.com/using-aws-lambda-to-tweet-random-posts-from-an-rss-feed/). + +### Getting the code + +1. Clone this repo: `git clone https://github.com/grantwinney/BlogCodeSamples.git` +2. Find the project under "Misc/TweetRandomFeedItem" and build it, either in Visual Studio or at the command line. +3. Find the `bin` directory on disk, and drill down until you get to the assemblies (dll files). Most likely: `bin/Debug/netcoreapp2.0` +4. Zip up the contents of the inner-most directory, but not the directory itself. _(e.g. just select all the files_ inside _`netcoreapp2.0`.)_ + +### Setting up AWS Lambda + +Now you need to create a new AWS Lambda job. [Check this out](https://victoria.dev/archive/running-a-free-twitter-bot-on-aws-lambda/#setting-up-aws-lambda) for a brief intro to setting up a job. + +1. Create a new function and choose `C# (.NET Core 2.0)` for the runtime. _(this may change as new versions are released)_ +2. The name of the function, and the role it makes you create, don't matter. +3. Upload the zip file you created above. +4. Set the handler as `TweetRandomFeedItem::TweetRandomFeedItem.Program::Main` +5. Under "Basic settings", decrease the memory to 128MB and increase the timeout to a minute. For me, it generally takes about 15-20 seconds to run, and uses less than 100MB of memory. You may have to play with the settings a bit. +6. Set the following environment variables: + +#### Environment Variables + +I use quite a few environment variables, so credentials and other settings can easily be changed between runs, without having to recompile the code and upload it again. + +| Field | Required | Description | +| ------------- |:-------------:| -----| +| `RSS_URI` | Yes | The RSS feed to read in, like: `https://grantwinney.com/rss/` | +| `RSS_ITEM_RETRIEVAL_LIMIT` | No | Specify the number of posts you want to retrieve.

If you omit this, or leave the value empty, the app will read the entire RSS feed. | +| `TWITTER_CONSUMER_KEY`
`TWITTER_CONSUMER_SECRET`
`TWITTER_USER_ACCESS_TOKEN`
`TWITTER_USER_ACCESS_TOKEN_SECRET` | Yes | These values all come from your Twitter account. You need to create a new app to get these values, which allows you to post tweets. | +| `TWITTER_MAX_TAG_COUNT` | No | Although tag spamming is somewhat prevalent on Facebook, and even more-so on Instagram, I don't see a lot of it on Twitter. If you tend to use a lot of tags for posts on your blog, then you can limit how many of those transfer to your tweet.

If you omit this, or leave the value empty, the app will use the first 3 tags. | diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln new file mode 100644 index 0000000..365b549 --- /dev/null +++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem\TweetRandomFeedItem.csproj", "{A65ED552-1655-436F-B2F5-C41F35DE00F3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs new file mode 100644 index 0000000..afde505 --- /dev/null +++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Helper.cs @@ -0,0 +1,24 @@ +using System; +namespace TweetRandomFeedItem +{ + public class Helper + { + public static T GetEnv(string environmentVariable) + { + try + { + return (T)Convert.ChangeType(Environment.GetEnvironmentVariable(environmentVariable), typeof(T)); + } + catch (ArgumentNullException) + { + Console.WriteLine($"The environment variable {environmentVariable} is required and missing."); + throw; + } + } + + public static T GetEnv(string environmentVariable, string defaultValue) + { + return (T)Convert.ChangeType(Environment.GetEnvironmentVariable(environmentVariable) ?? defaultValue, typeof(T)); + } + } +} diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs new file mode 100644 index 0000000..cf14f3a --- /dev/null +++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/Program.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using System.Threading.Tasks; +using System.Xml; +using Microsoft.SyndicationFeed; +using Microsoft.SyndicationFeed.Rss; +using Tweetinvi; + +namespace TweetRandomFeedItem +{ + class Program + { + const string DEFAULT_MAX_TAG_COUNT = "3"; + const int TWITTER_URL_SIZE = 23; + const int MAX_TWEET_LENGTH = 280; + + static Random random = new Random(); + + public static async void Main() + { + var message = CreateMessageFromRandomFeedItem(); + + await SendTweet(message); + + Console.WriteLine($"Tweeted message:\r\n\r\n{message}"); + } + + static string CreateMessageFromRandomFeedItem() + { + var ghostUri = Helper.GetEnv("RSS_URI"); + var maxTagCount = Helper.GetEnv("TWITTER_MAX_TAG_COUNT", DEFAULT_MAX_TAG_COUNT); + var maxItemsToRead = Helper.GetEnv("RSS_ITEM_RETRIEVAL_LIMIT", Int32.MaxValue.ToString()); + + var pattern = new Regex("[- ]"); + var entries = new List(); + + using (var xmlReader = XmlReader.Create(ghostUri)) + { + var feedReader = new RssFeedReader(xmlReader); + + var itemsRead = 0; + while (feedReader.Read().Result && itemsRead < maxItemsToRead) + { + if (feedReader.ElementType == SyndicationElementType.Item) + { + entries.Add(feedReader.ReadItem().Result); + itemsRead++; + } + } + } + + var selectedEntry = entries[random.Next(0, entries.Count - 1)]; + + var remainingSpaceForTags = MAX_TWEET_LENGTH - (selectedEntry.Title.Length + 1 + TWITTER_URL_SIZE); + + var tags = selectedEntry.Categories.Take(maxTagCount).Select(x => $"#{pattern.Replace(x.Name, "_").Replace("#", "sharp").Replace(".", "dot")}"); + + var tagsFlat = ""; + foreach (var t in tags) + { + if ($"{tagsFlat} {t}".Length > remainingSpaceForTags) + break; + + tagsFlat += $" {t}"; + } + + return $"{selectedEntry.Title}{tagsFlat}\r\n{selectedEntry.Links.ToList()[0].Uri}"; + } + + static async Task SendTweet(string message) + { + var consumerKey = Helper.GetEnv("TWITTER_CONSUMER_KEY"); + var consumerSecret = Helper.GetEnv("TWITTER_CONSUMER_SECRET"); + var userAccessToken = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN"); + var userAccessTokenSecret = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN_SECRET"); + + var userClient = new TwitterClient(consumerKey, consumerSecret, userAccessToken, userAccessTokenSecret); + + await userClient.Tweets.PublishTweetAsync(message); + + Console.WriteLine($"Tweeted message:\r\n{message}\r\n"); + } + } +} diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj new file mode 100644 index 0000000..901ac4b --- /dev/null +++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.csproj @@ -0,0 +1,20 @@ + + + + Exe + netcoreapp2.0 + + + + true + + + + + + + + + + + diff --git a/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln new file mode 100644 index 0000000..92f7f4e --- /dev/null +++ b/Misc/TweetRandomFeedItem/TweetRandomFeedItem/TweetRandomFeedItem.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2017 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem.csproj", "{E5CCB899-06D3-4062-98B4-9BAA87B08322}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Misc/TweetRandomPostFromAGhostBlog/README.md b/Misc/TweetRandomPostFromAGhostBlog/README.md new file mode 100644 index 0000000..49403e7 --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/README.md @@ -0,0 +1,5 @@ +# Tweet a Random Post from a Ghost Blog + +Instead of repeating everything here, you can read all the details of how to use this and the libraries it depends on here: + +[Using AWS Lambda to tweet random posts from a Ghost blog](https://grantwinney.com/using-aws-lambda-and-tweetinvi-to-tweet-a-random-ghost-blog-post/) diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln new file mode 100644 index 0000000..88f781d --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30517.126 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TweetRandomFeedItem", "TweetRandomFeedItem\TweetRandomFeedItem.csproj", "{A65ED552-1655-436F-B2F5-C41F35DE00F3}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItemTests", "TweetRandomFeedItemTests\TweetRandomFeedItemTests.csproj", "{E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A65ED552-1655-436F-B2F5-C41F35DE00F3}.Release|Any CPU.Build.0 = Release|Any CPU + {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E74EA8AD-34AD-488B-8D56-9A5B3D7DA940}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {55609BE2-7144-430D-A555-6E134855C7F0} + EndGlobalSection +EndGlobal diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs new file mode 100644 index 0000000..4075300 --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Helper.cs @@ -0,0 +1,57 @@ +using System; +using System.Text.RegularExpressions; + +namespace TweetRandomFeedItem +{ + public class Helper + { + static readonly Regex invalidChars = new("[- ]"); + + public static string SanitizeTagName(string tag) + { + return $"#{invalidChars.Replace(tag, "").Replace("#", "sharp").Replace(".", "dot")}"; + } + + public static T GetEnv(string environmentVariable) + { + try + { + return ConvertVariableType(environmentVariable, Environment.GetEnvironmentVariable(environmentVariable)); + } + catch (ArgumentNullException) + { + Console.WriteLine($"The environment variable {environmentVariable} is missing."); + throw; + } + } + + public static T GetEnv(string environmentVariable, string defaultValue) + { + try + { + return ConvertVariableType(environmentVariable, Environment.GetEnvironmentVariable(environmentVariable), defaultValue); + } + catch (ArgumentNullException) + { + Console.WriteLine($"The environment variable {environmentVariable} is missing."); + throw; + } + } + + public static T ConvertVariableType(string variableKey, string variableValue, string defaultValue = null) + { + if (string.IsNullOrEmpty(variableValue)) + { + if (defaultValue != null) + { + Console.WriteLine($"The environment variable {variableKey} returned a null value. Using default value of '{defaultValue}' instead."); + return (T)Convert.ChangeType(defaultValue, typeof(T)); + } + else + Console.WriteLine($"The environment variable {variableKey} returned a null value."); + } + + return (T)Convert.ChangeType(variableValue, typeof(T)); + } + } +} diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs new file mode 100644 index 0000000..efd48b8 --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/Program.cs @@ -0,0 +1,164 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using GhostSharp; +using GhostSharp.Entities; +using GhostSharp.Enums; +using GhostSharp.QueryParams; +using Newtonsoft.Json; +using Tweetinvi; +using Tweetinvi.Core.Web; +using Tweetinvi.Models; + +namespace TweetRandomFeedItem +{ + class Program + { + private const int TWITTER_URL_SIZE = 23; + private const int MAX_TWEET_LENGTH = 280; + + private static readonly string API_URL = Helper.GetEnv("API_URL"); + private static readonly string ADMIN_API_KEY = Helper.GetEnv("ADMIN_API_KEY"); + private static readonly string TWITTER_CONSUMER_KEY = Helper.GetEnv("TWITTER_CONSUMER_KEY"); + private static readonly string TWITTER_CONSUMER_SECRET = Helper.GetEnv("TWITTER_CONSUMER_SECRET"); + private static readonly string TWITTER_USER_ACCESS_TOKEN = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN"); + private static readonly string TWITTER_USER_ACCESS_TOKEN_SECRET = Helper.GetEnv("TWITTER_USER_ACCESS_TOKEN_SECRET"); + private static readonly string[] TAGS_TO_TWEET = Helper.GetEnv("TAGS_TO_TWEET", "").Split(','); + private static readonly string[] TAGS_TO_REMOVE = Helper.GetEnv("TAGS_TO_REMOVE", "").Split(','); + private static readonly int POST_RETRIEVAL_LIMIT = Helper.GetEnv("POST_RETRIEVAL_LIMIT", "9999999"); + private static readonly int TWITTER_MAX_TAG_COUNT = Helper.GetEnv("TWITTER_MAX_TAG_COUNT", "3"); + private static readonly bool FACTOR_IN_AGE_OF_POST = Helper.GetEnv("FACTOR_IN_AGE_OF_POST", "false"); + + static readonly Random rnd = new Random(); + static readonly GhostAdminAPI api = new GhostAdminAPI(API_URL, ADMIN_API_KEY); + + public static async Task Main() + { + var allPosts = api.GetPosts(new PostQueryParams + { + Limit = POST_RETRIEVAL_LIMIT, + Fields = (FACTOR_IN_AGE_OF_POST ? PostFields.Id | PostFields.PublishedAt : PostFields.Id) | PostFields.Status, + }).Posts.Where(p => p.Status == "published").ToList(); + + if (!allPosts.Any()) + { + Console.WriteLine("No posts! Nothing to tweet..."); + return; + } + + await SendTweet(CreateMessage(PickRandomPost(allPosts))); + } + + static Post PickRandomPost(List posts) + { + var selectedIds = new HashSet(); + + while (true) + { + string randomPostId = ""; + do + { + randomPostId = FACTOR_IN_AGE_OF_POST + ? GetRandomPostIdWeightedOnAge(posts) + : posts[rnd.Next(0, posts.Count())].Id; + } + while (selectedIds.Contains(randomPostId)); + + selectedIds.Add(randomPostId); + + var randomPost = api.GetPostById(randomPostId); + + if (!TAGS_TO_TWEET.Any() || randomPost.Tags.Select(tag => tag.Slug).Intersect(TAGS_TO_TWEET).Any()) + return randomPost; + } + } + + static string GetRandomPostIdWeightedOnAge(List posts) + { + var earliestPublishDate = posts.Last().PublishedAt; + + var postsCount = posts.Count(); + var postIdsAndPubWeights = posts.Select((p, i) => Tuple.Create(posts[i].Id, ((posts[i].PublishedAt ?? DateTime.MinValue) - earliestPublishDate).Value.Days * (postsCount - i))); + var totalPubWeights = postIdsAndPubWeights.Sum(p => p.Item2); + var randomPubWeight = rnd.Next(0, totalPubWeights); + + foreach (var p in postIdsAndPubWeights) + { + if (randomPubWeight <= p.Item2) + return p.Item1; + + randomPubWeight -= p.Item2; + } + + return null; // req to compile, but won't happen unless there are no posts + } + + static string CreateMessage(Post post) + { + var captionSources = new List { post.TwitterDescription, post.MetaDescription, post.Title }; + + var caption = captionSources.First(cs => !string.IsNullOrWhiteSpace(cs)); + + var remainingSpaceForTags = MAX_TWEET_LENGTH - (caption.Length + 1 + TWITTER_URL_SIZE); + + var tags = post.Tags.Where(x => !TAGS_TO_REMOVE.Contains(x.Slug)) + .Take(TWITTER_MAX_TAG_COUNT) + .Select(t => Helper.SanitizeTagName(t.Name)); + + var tagsFlat = ""; + foreach (var t in tags) + { + if ($"{tagsFlat} {t}".Length > remainingSpaceForTags) + break; + + tagsFlat += $" {t}"; + } + + return $"{caption}{tagsFlat}\r\n{post.Url}"; + } + + static async Task SendTweet(string message) + { + var client = new TwitterClient(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET, TWITTER_USER_ACCESS_TOKEN, TWITTER_USER_ACCESS_TOKEN_SECRET); + + //await userClient.Tweets.PublishTweetAsync(message); + + // The TweetInvi library seems to be abandoned and PublishTweetAsync isn't working correctly, + // but someone posted a workaround: https://github.com/linvi/tweetinvi/issues/1147#issuecomment-1173174302 + var result = await client.Execute.AdvanceRequestAsync( + (ITwitterRequest request) => + { + var jsonBody = client.Json.Serialize(new TweetV2PostRequest { Text = message }); + + var content = new StringContent(jsonBody, Encoding.UTF8, "application/json"); + + request.Query.Url = "https://api.twitter.com/2/tweets"; + request.Query.HttpMethod = Tweetinvi.Models.HttpMethod.POST; + request.Query.HttpContent = content; + } + ); + + if (result.Response.IsSuccessStatusCode) + Console.WriteLine($"Tweeted message:\r\n{message}\r\n"); + else + Console.WriteLine($"Error posting tweet: {result.Content}\r\n\r\nOriginal tweet: {message}"); + } + } + + /// + /// There are a lot more fields according to: + /// https://developer.twitter.com/en/docs/twitter-api/tweets/manage-tweets/api-reference/post-tweets + /// but these are the ones we care about for our use case. + /// + public class TweetV2PostRequest + { + /// + /// The text of the tweet to post. + /// + [JsonProperty("text")] + public string Text { get; set; } = string.Empty; + } +} diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj new file mode 100644 index 0000000..fdabc1e --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.csproj @@ -0,0 +1,17 @@ + + + + Exe + net6.0 + + + + true + + + + + + + + diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln new file mode 100644 index 0000000..92f7f4e --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItem/TweetRandomFeedItem.sln @@ -0,0 +1,17 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2017 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetRandomFeedItem", "TweetRandomFeedItem.csproj", "{E5CCB899-06D3-4062-98B4-9BAA87B08322}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5CCB899-06D3-4062-98B4-9BAA87B08322}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs new file mode 100644 index 0000000..7ca5f8a --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/HelperTests.cs @@ -0,0 +1,44 @@ +using NUnit.Framework; +using TweetRandomFeedItem; + +namespace TweetRandomFeedItemTests +{ + public class Tests + { + [Test] + [TestCase("c#", "#csharp")] + [TestCase(".net", "#dotnet")] + [TestCase("testing-123", "#testing123")] + [TestCase("testing 123 456", "#testing123456")] + [TestCase("1-2 3", "#123")] + public void SanitizeTagName_ReplacesInvalidCharacters(string input, string expectedOutput) + { + Assert.AreEqual(expectedOutput, Helper.SanitizeTagName(input)); + } + + [Test] + [TestCase("phone#", "#phonesharp")] + [TestCase("this.that", "#thisdotthat")] + public void SanitizeTagName_MightHaveUnintendedEffects(string input, string expectedOutput) + { + Assert.AreEqual(expectedOutput, Helper.SanitizeTagName(input)); + } + + [Test] + [TestCase("programming")] + [TestCase("csharp_8")] + public void SanitizeTagName_LeavesValidTagsAlone(string tagName) + { + Assert.AreEqual($"#{tagName}", Helper.SanitizeTagName(tagName)); + } + + [Test] + [TestCase(null, "9999999", 9999999)] + [TestCase("", "9999999", 9999999)] + [TestCase("3", "9999999", 3)] + public void ConvertVariableType_ConvertsStringsToNumbers(string variableValue, string defaultValue, int expectedResult) + { + Assert.AreEqual(expectedResult, Helper.ConvertVariableType("n/a", variableValue, defaultValue)); + } + } +} \ No newline at end of file diff --git a/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj new file mode 100644 index 0000000..c255cf7 --- /dev/null +++ b/Misc/TweetRandomPostFromAGhostBlog/TweetRandomFeedItemTests/TweetRandomFeedItemTests.csproj @@ -0,0 +1,19 @@ + + + + net6.0 + + false + + + + + + + + + + + + + diff --git a/WindowsXPVisualStudio/VB4.0/Form1.frm b/Misc/WindowsXPVisualStudio/VB4.0/Form1.frm similarity index 100% rename from WindowsXPVisualStudio/VB4.0/Form1.frm rename to Misc/WindowsXPVisualStudio/VB4.0/Form1.frm diff --git a/WindowsXPVisualStudio/VB4.0/Form1.frx b/Misc/WindowsXPVisualStudio/VB4.0/Form1.frx similarity index 100% rename from WindowsXPVisualStudio/VB4.0/Form1.frx rename to Misc/WindowsXPVisualStudio/VB4.0/Form1.frx diff --git a/WindowsXPVisualStudio/VB4.0/Project1.vbp b/Misc/WindowsXPVisualStudio/VB4.0/Project1.vbp similarity index 100% rename from WindowsXPVisualStudio/VB4.0/Project1.vbp rename to Misc/WindowsXPVisualStudio/VB4.0/Project1.vbp diff --git a/WindowsXPVisualStudio/VB4.0/untitled.rpt b/Misc/WindowsXPVisualStudio/VB4.0/untitled.rpt similarity index 100% rename from WindowsXPVisualStudio/VB4.0/untitled.rpt rename to Misc/WindowsXPVisualStudio/VB4.0/untitled.rpt diff --git a/WindowsXPVisualStudio/VB6.0/Module1.bas b/Misc/WindowsXPVisualStudio/VB6.0/Module1.bas similarity index 100% rename from WindowsXPVisualStudio/VB6.0/Module1.bas rename to Misc/WindowsXPVisualStudio/VB6.0/Module1.bas diff --git a/WindowsXPVisualStudio/VB6.0/Project1.RES b/Misc/WindowsXPVisualStudio/VB6.0/Project1.RES similarity index 100% rename from WindowsXPVisualStudio/VB6.0/Project1.RES rename to Misc/WindowsXPVisualStudio/VB6.0/Project1.RES diff --git a/WindowsXPVisualStudio/VB6.0/Project1.vbp b/Misc/WindowsXPVisualStudio/VB6.0/Project1.vbp similarity index 100% rename from WindowsXPVisualStudio/VB6.0/Project1.vbp rename to Misc/WindowsXPVisualStudio/VB6.0/Project1.vbp diff --git a/WindowsXPVisualStudio/VB6.0/frmAbout.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frm similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmAbout.frm rename to Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frm diff --git a/WindowsXPVisualStudio/VB6.0/frmAbout.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frx similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmAbout.frx rename to Misc/WindowsXPVisualStudio/VB6.0/frmAbout.frx diff --git a/WindowsXPVisualStudio/VB6.0/frmBrowser.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frm similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmBrowser.frm rename to Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frm diff --git a/WindowsXPVisualStudio/VB6.0/frmBrowser.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frx similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmBrowser.frx rename to Misc/WindowsXPVisualStudio/VB6.0/frmBrowser.frx diff --git a/WindowsXPVisualStudio/VB6.0/frmDocument.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frm similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmDocument.frm rename to Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frm diff --git a/WindowsXPVisualStudio/VB6.0/frmDocument.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frx similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmDocument.frx rename to Misc/WindowsXPVisualStudio/VB6.0/frmDocument.frx diff --git a/WindowsXPVisualStudio/VB6.0/frmMain.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmMain.frm similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmMain.frm rename to Misc/WindowsXPVisualStudio/VB6.0/frmMain.frm diff --git a/WindowsXPVisualStudio/VB6.0/frmMain.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmMain.frx similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmMain.frx rename to Misc/WindowsXPVisualStudio/VB6.0/frmMain.frx diff --git a/WindowsXPVisualStudio/VB6.0/frmSplash.frm b/Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frm similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmSplash.frm rename to Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frm diff --git a/WindowsXPVisualStudio/VB6.0/frmSplash.frx b/Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frx similarity index 100% rename from WindowsXPVisualStudio/VB6.0/frmSplash.frx rename to Misc/WindowsXPVisualStudio/VB6.0/frmSplash.frx diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln similarity index 100% rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1.sln diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb similarity index 100% rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/AssemblyInfo.vb diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx similarity index 100% rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.resx diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb similarity index 100% rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/Form1.vb diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj b/Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj similarity index 100% rename from WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj rename to Misc/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1.sln diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/App.xaml.cs diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/MainWindow.xaml.cs diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/AssemblyInfo.cs diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.Designer.cs diff --git a/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.Designer.cs diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/Properties/Settings.settings diff --git a/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj b/Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj similarity index 100% rename from WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj rename to Misc/WindowsXPVisualStudio/VS2010/WpfApplication1/WpfApplication1/WpfApplication1.csproj diff --git a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj b/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj deleted file mode 100644 index 0019e85..0000000 --- a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/ObsoleteAttributeOnInterfaces.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Debug - AnyCPU - {484E2C46-3024-4E03-8390-F80B54707048} - Exe - Properties - ObsoleteAttributeOnInterfaces - ObsoleteAttributeOnInterfaces - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs b/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs deleted file mode 100644 index 4c40469..0000000 --- a/ObsoleteAttributeOnInterfaces022015/ObsoleteAttributeOnInterfaces/Program.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; - -namespace ObsoleteAttributeOnInterfaces -{ - public static class Program - { - public static void Main() - { - ISampleClass sc1 = new SampleClass(); - sc1.SomeOldMethod(); - - ISampleClass sc2 = new SampleClass2(); - sc2.SomeOldMethod(); - - ISampleClass sc3 = new SampleClass3(); - sc3.SomeOldMethod(); - - - - SampleClass sc = new SampleClass(); - sc.SomeOldMethod(); - - } - } - - public interface ISampleClass - { - void SomeOldMethod(); - } - - public class SampleClass : ISampleClass - { - [Obsolete("This is the old way. No one uses it anymore. Shame on you!!", true)] - public void SomeOldMethod() - { - // This is old. I should probably remove and refactor, but I'm too scared. - } - } - - public class SampleClass2 : ISampleClass - { - public void SomeOldMethod() - { - // Old, but not obsolete. - } - } - - public class SampleClass3 : ISampleClass - { - public void SomeOldMethod() - { - // Why mess with perfection? - } - } -} diff --git a/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs b/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs deleted file mode 100644 index 07a7fbb..0000000 --- a/PassingDataBetweenForms/1_PushingDataBackToParentForm/Form2.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PushingDataBackToParentForm -{ - public partial class Form2 : Form - { - private Form1 form1; - - public Form2(Form1 form1) - { - InitializeComponent(); - this.form1 = form1; - } - - private void btnSaveInput_Click(object sender, EventArgs e) - { - form1.SetName(txtName.Text); - - int age; - if (int.TryParse(txtAge.Text, out age)) - form1.Age = age; - - this.Close(); - } - } -} diff --git a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs b/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs deleted file mode 100644 index 5d5259d..0000000 --- a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/DetailForm.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PushingDataBackToOneOfMultipleForms -{ - public partial class DetailForm : Form - { - private StudentForm studentForm; - private EmployeeForm employeeForm; - private SomeClass someClass; - - public DetailForm(StudentForm form) - { - InitializeComponent(); - studentForm = form; - } - - public DetailForm(EmployeeForm form) - { - InitializeComponent(); - employeeForm = form; - } - - public DetailForm(SomeClass someClass) - { - InitializeComponent(); - this.someClass = someClass; - } - - private void btnSaveInput_Click(object sender, EventArgs e) - { - if (studentForm != null) - studentForm.SetStudentName(txtName.Text); - else if (employeeForm != null) - employeeForm.EmployeeName = txtName.Text; - else if (someClass != null) - someClass.Name = txtName.Text; - - this.Close(); - } - } -} diff --git a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs b/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs deleted file mode 100644 index 1d00854..0000000 --- a/PassingDataBetweenForms/2_PushingDataBackToOneOfMultipleForms/SomeClass.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace PushingDataBackToOneOfMultipleForms -{ - public class SomeClass - { - public void SomeMethod() - { - using (var detailForm = new DetailForm(this)) - { - detailForm.ShowDialog(); - } - } - - public string Name { get; set; } - } -} diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user b/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user deleted file mode 100644 index a4a6cdf..0000000 --- a/PassingDataBetweenForms/3_PullingDataFromChildForm/3_PullingDataFromChildForm.csproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - ProjectFiles - - \ No newline at end of file diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs deleted file mode 100644 index 3d12347..0000000 --- a/PassingDataBetweenForms/3_PullingDataFromChildForm/DetailForm.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PullingDataFromChildForm -{ - public partial class DetailForm : Form - { - public DetailForm() - { - InitializeComponent(); - } - - public string Name - { - get { return txtName.Text; } - } - - public int Age - { - get - { - int result; - Int32.TryParse(txtAge.Text, out result); - return result; - } - } - - // Even this could be removed, if you set this button as the Accept - // button on the Form, or set a DialogResult value on the button - private void btnSaveInput_Click(object sender, EventArgs e) - { - this.Close(); - } - } -} diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs deleted file mode 100644 index b0a1136..0000000 --- a/PassingDataBetweenForms/3_PullingDataFromChildForm/EmployeeForm.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PullingDataFromChildForm -{ - public partial class EmployeeForm : Form - { - public EmployeeForm() - { - InitializeComponent(); - } - - private void btnGetUserInput_Click(object sender, EventArgs e) - { - using (var detailForm = new DetailForm()) - { - detailForm.ShowDialog(); - - EmployeeName = detailForm.Name; - } - } - - public string EmployeeName - { - set { lblName.Text = value; } - } - } -} diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs deleted file mode 100644 index c24569d..0000000 --- a/PassingDataBetweenForms/3_PullingDataFromChildForm/SomeClass.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace PullingDataFromChildForm -{ - public class SomeClass - { - public void SomeMethod() - { - using (var detailForm = new DetailForm()) - { - detailForm.ShowDialog(); - - Name = detailForm.Name; - Age = detailForm.Age; - } - } - - public string Name { get; set; } - - public int Age { get; set; } - } -} diff --git a/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs b/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs deleted file mode 100644 index bd35054..0000000 --- a/PassingDataBetweenForms/3_PullingDataFromChildForm/StudentForm.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace PullingDataFromChildForm -{ - public partial class StudentForm : Form - { - public StudentForm() - { - InitializeComponent(); - } - - private void btnGetUserInput_Click(object sender, EventArgs e) - { - using (var detailForm = new DetailForm()) - { - detailForm.ShowDialog(); - - SetStudentName(detailForm.Name); - } - } - - public void SetStudentName(string name) - { - lblStudentName.Text = name; - } - } -} diff --git a/PassingDataBetweenForms/README.md b/PassingDataBetweenForms/README.md deleted file mode 100644 index 871025c..0000000 --- a/PassingDataBetweenForms/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Passing data between two Forms in WinForms - -http://grantwinney.com/passing-data-between-two-forms-in-winforms/ \ No newline at end of file diff --git a/README.md b/README.md index 29e68c6..029be5e 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,56 @@ -# My Blog Code Samples - -This repository contains some of the (usually lengthier) code samples from my blog posts. I also tend to host shorter snippets on [Gist](https://gist.github.com/grantwinney) and [JsFiddle](https://jsfiddle.net/user/grantwinney/fiddles/), and embed them into posts. - -The following list of blog posts includes a link to the part of the repo with the relevant code for that post. - -* [A sample C# app for generating and verifying TOTP 2FA codes](https://grantwinney.com/a-sample-csharp-app-for-generating-and-verifying-totp-2fa-codes/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/2FAQrCode) -* [An explanation of implicit and explicit conversion in C#](https://grantwinney.com/an-explanation-of-implicit-and-explicit-conversion-in-c/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ImplicitExplicitOperators022015) -* [An extension method for passing a column name to SqlDataReader.GetFieldValue in C#](https://grantwinney.com/an-extension-method-for-passing-a-column-name-to-sqldatareader-getfieldvalue-in-c/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/SqlDataReaderGetFieldValueByName) -* [Async and PLINQ](https://grantwinney.com/async-and-plinq/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AsyncAndPlinq112013) -* [Cool markdown tricks for GitHub](https://grantwinney.com/cool-markdown-tricks-for-github/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/GitHubTipsTricks) -* [Discover where the ISS is, where it will be, and who's on it with the ISS Notify API](https://grantwinney.com/day-11-iss-notify-api/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/IssNotifyApiWrapper) -* [How do I convert my code from C# to VB.NET (or from VB.NET to C#)?](https://grantwinney.com/how-do-i-convert-my-code-from-c-to-vb-net-or-vice-versa/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/CSharpAndVbNetTogether) -* [How to use an application config file with a .NET Standard app and NUnit 3)](https://grantwinney.com/how-to-use-an-app-config-file-with-a-net-standard-app-and-nunit-3/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ReadingConfigFile) -* [Keep your EUnit teardown logic as simple as possible!](https://grantwinney.com/keep-your-eunit-teardown-logic-as-simple/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/MeckTeardownTest) -* [Keep the plumbing out of my living room](https://grantwinney.com/keep-the-plumbing-out-of-my-living-room/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/GetKnownFolders) -* [What is mocking a dependency?)](https://grantwinney.com/what-is-mocking-a-dependency/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/MockingDependencies) -* [Passing data between two Forms in WinForms](https://grantwinney.com/passing-data-between-two-forms-in-winforms/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/PassingDataBetweenForms) -* [Practical Examples of C# Attributes](https://grantwinney.com/5-examples-of-attributes-in-c-and-why-youll-want-to-make-your-own/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AttributesExamples) -* [Querying Amazon's product details with the Amazon Product Advertising API](https://grantwinney.com/querying-amazon-product-details-with-the-amazon-product-advertising-api/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/AmazonProductAdvertisingApiBlogPost) -* [Running Windows XP in VirtualBox](https://grantwinney.com/running-windows-xp-in-virtualbox/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/WindowsXPVisualStudio) -* [The effect of the Obsolete attribute on a class is ignored when there's an interface involved](https://grantwinney.com/the-effect-of-the-obsolete-attribute-on-a-class-is-ignored-when-theres-an-interface-involved/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/ObsoleteAttributeOnInterfaces022015) -* [A briefly longish tour of Visual Studio for Mac](https://grantwinney.com/a-brief-tour-of-visual-studio-for-mac/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/TourVisualStudioForMac) -* [Using a TextBox and CollectionViewSource to Filter a ListView in WPF](https://grantwinney.com/using-a-textbox-and-collectionviewsource-to-filter-a-listview-in-wpf/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/CollectionViewSourceSample) -* [Using Annotations to Assist ReSharper in Analyzing Your Code](https://grantwinney.com/using-annotations-to-help-resharper-analyze-your-code/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/UsingAnnotationsToAssistReSharper) -* [What's a word cloud and how do I make one?](https://grantwinney.com/whats-a-word-cloud-and-how-do-i-make-one/)[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/WordCloud) -* [When an assert isn't assertive enough (or using the wrong macro in an EUnit test)](https://grantwinney.com/when-an-assert-isnt-assertive-enough/) -[💾](https://github.com/grantwinney/BlogCodeSamples/tree/master/EUnitAssertProblem) +# Code Samples - Grant's Blog + +This repository contains some code samples from [my blog posts](https://grantwinney.com). I sometimes upload code to separate repos (like for [C# / .NET](https://github.com/grantwinney/CSharpDotNetExamples) and [WinForms](https://github.com/grantwinney/Surviving-WinForms)), or to [Gist](https://gist.github.com/grantwinney) or [JsFiddle](https://jsfiddle.net/user/grantwinney/fiddles/) for shorter snippets. + +The list below has a link to each blog post, followed by the relevant code for that post. + +# APIs + +* Discover where the ISS is, where it will be, and who's on it with the ISS Notify API ([blog](https://grantwinney.com/what-is-iss-notify-api/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/APIs/IssNotifyApiWrapper)) + +# Dev Tools + +* Can I compare files using VS Code? ([blog](https://grantwinney.com/how-to-compare-files-using-vs-code/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/CompareInVSCode)) +* Cool markdown tricks for GitHub ([blog](https://grantwinney.com/cool-markdown-tricks-for-github/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/GitHubTipsTricks)) +* Why doesn't VS 2022 show my WinForms UI at design time? ([blog](http://grantwinney.com/why-doesnt-vs2022-show-my-winforms-ui/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/WinFormsDesignerInVS2022)) +* What is a Git alias? ([blog](https://grantwinney.com/what-is-a-git-alias-and-how-do-i-use-it/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/DevTools/GitAliasTemplate)) + +# Frameworks + +## ASP.NET Core + +* Similar endpoints, swagger pages, and a DevOps fail ([blog](https://grantwinney.com/similar-endpoints-swagger-pages-and-a-devops-fail), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/AspNetCore/MinimalAPIWithSimilarEndpoints)) + +## WinForms + +* Passing Data Between Forms in WinForms ([blog](https://grantwinney.com/passing-data-between-two-forms-in-winforms/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/WinForms/PassingDataBetweenForms)) + +## WPF + +* Filtering a ListView in WPF Using a TextBox and CollectionViewSource ([blog](https://grantwinney.com/wpf-filtering-listview-using-textbox-and-collectionviewsource/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Frameworks/WPF/CollectionViewSourceSample)) + +# Languages + +## C# + +* An Extension Method to Pass a Column Name to SqlDataReader.GetFieldValue ([blog](https://grantwinney.com/csharp-extension-method-to-pass-column-name-to-getfieldvalue/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/SqlDataReaderGetFieldValueByName)) +* How do I convert my code from C# to VB.NET (or from VB.NET to C#)? ([blog](https://grantwinney.com/how-do-i-convert-my-code-from-c-to-vb-net-or-vice-versa/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/CSharpAndVbNetTogether)) +* How to generate and verify TOTP 2FA codes (in C#) ([blog](https://grantwinney.com/a-sample-csharp-app-for-generating-and-verifying-totp-2fa-codes/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/2FAQrCode)) +* Obsolete Attribute on a Class is Ignored When an Interface is Involved ([blog](https://grantwinney.com/csharp-obsolete-attribute-on-class-ignored-when-interface-is-involved/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/ObsoleteAttributeOnInterfaces)) +* Using an application config file with a .NET Standard app and NUnit 3 ([blog](https://grantwinney.com/how-to-use-an-app-config-file-with-a-net-standard-app-and-nunit-3/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/ReadingConfigFile)) +* What is mocking a dependency? ([blog](https://grantwinney.com/what-is-mocking-a-dependency/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/MockingDependencies)) +* What is the NUnit constraint model and should you use it? ([blog](https://grantwinney.com/5-reasons-to-use-nunits-constraint-model), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/CSharp/NUnitConstraintModel)) + +## Erlang + +* Calculate Easter and other holidays in Erlang ([blog](https://grantwinney.com/how-to-calculate-easter-and-other-holidays-in-erlang/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/CalculateHolidays)) +* Keep your EUnit teardown logic as simple as possible! ([blog](https://grantwinney.com/keep-your-eunit-teardown-logic-as-simple/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/MeckTeardownTest)) +* Modify a config file in Erlang ([blog](https://grantwinney.com/how-to-modify-a-config-file-in-erlang/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Languages/Erlang/ConfigFileModifier)) + +# Misc + +* Creating Your First Chrome Extension ([blog](https://grantwinney.com/making-your-first-chrome-extension/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/ChromeExtensionSamples)) +* Running Windows XP in VirtualBox ([blog](https://grantwinney.com/running-windows-xp-in-virtualbox/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/WindowsXPVisualStudio)) +* Tweet random posts from a Ghost blog using AWS Lambda ([blog](https://grantwinney.com/using-aws-lambda-and-tweetinvi-to-tweet-a-random-ghost-blog-post/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomPostFromAGhostBlog)) +* Tweet random blog posts from an RSS feed using AWS Lambda ([blog](https://grantwinney.com/using-aws-lambda-to-tweet-random-posts-from-an-rss-feed/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/TweetRandomFeedItem)) +* Where should I store application data in Windows? ([blog](https://grantwinney.com/where-should-i-store-app-data-in-windows/), [code](https://github.com/grantwinney/BlogCodeSamples/tree/master/Misc/GetKnownFolders)) diff --git a/SqlDataReaderGetFieldValueByName/README.md b/SqlDataReaderGetFieldValueByName/README.md deleted file mode 100644 index 539604f..0000000 --- a/SqlDataReaderGetFieldValueByName/README.md +++ /dev/null @@ -1,3 +0,0 @@ -An extension method for passing a column name to SqlDataReader.GetFieldValue in C# - -http://grantwinney.com/an-extension-method-for-passing-a-column-name-to-sqldatareader-getfieldvalue-in-c/ \ No newline at end of file diff --git a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj b/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj deleted file mode 100644 index 72a2345..0000000 --- a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Debug - AnyCPU - {09DFC1D5-1CA7-411B-AC3C-483337207244} - Library - Properties - SqlDataReaderGetFieldValueByName - SqlDataReaderGetFieldValueByName - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs b/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs deleted file mode 100644 index fd18649..0000000 --- a/SqlDataReaderGetFieldValueByName/SqlDataReaderGetFieldValueByName/StudentDataAccess.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Data.SqlClient; - -namespace SqlDataReaderGetFieldValueByName -{ - public class StudentDataAccess - { - public void GetStudents() - { - using (var conn = new SqlConnection("yourConnectionString")) - { - using (var cmd = new SqlCommand("SELECT name, age FROM students", conn)) - { - conn.Open(); - - using (var dr = cmd.ExecuteReader()) - { - var name = dr.GetFieldValue("name"); - - var age = dr.GetFieldValue("age"); - } - } - } - } - } - - public static class SqlReaderExtensions - { - /// - /// Gets the value of the specified column as a type, given the column name. - /// - /// The expected type of the column being retrieved. - /// The reader from which to retrieve the column. - /// The name of the column to be retrieved. - /// The returned type object. - public static T GetFieldValue(this SqlDataReader reader, string columnName) - { - return reader.GetFieldValue(reader.GetOrdinal(columnName)); - } - } -} diff --git a/TourVisualStudioForMac/LICENSE b/TourVisualStudioForMac/LICENSE deleted file mode 100644 index 00c19c7..0000000 --- a/TourVisualStudioForMac/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Grant Winney - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/TourVisualStudioForMac/README.md b/TourVisualStudioForMac/README.md deleted file mode 100644 index d650cb1..0000000 --- a/TourVisualStudioForMac/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# A Tour of Visual Studio for Mac - -[A briefly longish tour of Visual Studio for Mac](https://grantwinney.com/a-brief-tour-of-visual-studio-for-mac/) diff --git a/TourVisualStudioForMac/vs4mac_console1/.gitignore b/TourVisualStudioForMac/vs4mac_console1/.gitignore deleted file mode 100644 index 13d2fde..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# Autosave files -*~ - -# build -[Oo]bj/ -[Bb]in/ -packages/ -TestResults/ - -# globs -Makefile.in -*.DS_Store -*.sln.cache -*.suo -*.cache -*.pidb -*.userprefs -*.usertasks -config.log -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.user -*.tar.gz -tarballs/ -test-results/ -Thumbs.db - -# Mac bundle stuff -*.dmg -*.app - -# resharper -*_Resharper.* -*.Resharper - -# dotCover -*.dotCover diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln deleted file mode 100644 index 1b9c0d6..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4mac_console1", "vs4mac_console1\vs4mac_console1.csproj", "{C165BFE1-47DF-46F6-9B75-704F8421BCEC}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4C6A3649-33D6-4099-8274-A22F19647CA6}" - ProjectSection(SolutionItems) = preProject - vs4mac_console1.sln = vs4mac_console1.sln - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Debug|x86.ActiveCfg = Debug|x86 - {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Debug|x86.Build.0 = Debug|x86 - {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Release|x86.ActiveCfg = Release|x86 - {C165BFE1-47DF-46F6-9B75-704F8421BCEC}.Release|x86.Build.0 = Release|x86 - EndGlobalSection -EndGlobal diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs deleted file mode 100644 index 73899d1..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using vs4mac_dotnet_standard_library; - -namespace vs4mac_console1 -{ - class MainClass - { - public static void Main(string[] args) - { - var randomNumber = Magicmatics.GimmeRandomNumber(); - - Console.WriteLine($"Hello World! Your random number is: {randomNumber}"); - } - } -} diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs deleted file mode 100644 index e028123..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// Information about this assembly is defined by the following attributes. -// Change them to the values specific to your project. - -[assembly: AssemblyTitle("vs4mac_console1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("${AuthorCopyright}")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". -// The form "{Major}.{Minor}.*" will automatically update the build and revision, -// and "{Major}.{Minor}.{Build}.*" will update just the revision. - -[assembly: AssemblyVersion("1.0.*")] - -// The following attributes are used to specify the signing key for the assembly, -// if desired. See the Mono documentation for more information about signing. - -//[assembly: AssemblyDelaySign(false)] -//[assembly: AssemblyKeyFile("")] diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config deleted file mode 100644 index 8707561..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/packages.config +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj b/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj deleted file mode 100644 index 7b022cf..0000000 --- a/TourVisualStudioForMac/vs4mac_console1/vs4mac_console1/vs4mac_console1.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - x86 - {C165BFE1-47DF-46F6-9B75-704F8421BCEC} - Exe - vs4mac_console1 - vs4mac_console1 - v4.6.1 - - - true - full - false - bin\Debug - DEBUG; - prompt - 4 - true - x86 - - - true - bin\Release - prompt - 4 - true - x86 - - - - - ..\..\vs4mac_dotnet_standard_library\vs4mac_dotnet_standard_library\bin\Debug\netstandard1.4\vs4mac_dotnet_standard_library.dll - - - ..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll - - - - ..\packages\System.AppContext.4.3.0\lib\net46\System.AppContext.dll - - - - ..\packages\System.Console.4.3.0\lib\net46\System.Console.dll - - - ..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll - - - ..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll - - - ..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll - - - ..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll - - - - ..\packages\System.IO.FileSystem.Primitives.4.3.0\lib\net46\System.IO.FileSystem.Primitives.dll - - - ..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll - - - ..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll - - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - - - - ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll - - - ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll - - - ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll - - - ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll - - - ..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll - - - ..\packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll - - - - - - - - - - - - - \ No newline at end of file diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore deleted file mode 100644 index 13d2fde..0000000 --- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -# Autosave files -*~ - -# build -[Oo]bj/ -[Bb]in/ -packages/ -TestResults/ - -# globs -Makefile.in -*.DS_Store -*.sln.cache -*.suo -*.cache -*.pidb -*.userprefs -*.usertasks -config.log -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.user -*.tar.gz -tarballs/ -test-results/ -Thumbs.db - -# Mac bundle stuff -*.dmg -*.app - -# resharper -*_Resharper.* -*.Resharper - -# dotCover -*.dotCover diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll deleted file mode 100644 index 09cbcfb..0000000 Binary files a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.dll and /dev/null differ diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln deleted file mode 100644 index 01f32dc..0000000 --- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.sln +++ /dev/null @@ -1,17 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4mac_dotnet_standard_library", "vs4mac_dotnet_standard_library\vs4mac_dotnet_standard_library.csproj", "{7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A55E168-AC52-4D7D-8212-B69D3C4CBEBC}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection -EndGlobal diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs deleted file mode 100644 index c17ac7b..0000000 --- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/Class1.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace vs4mac_dotnet_standard_library -{ - public static class Magicmatics - { - public static int GimmeRandomNumber() - { - return 4; // chosen by fair dice roll. - // guaranteed to be random. - } - } -} diff --git a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj b/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj deleted file mode 100644 index b290d67..0000000 --- a/TourVisualStudioForMac/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library/vs4mac_dotnet_standard_library.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard1.4 - - - diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln deleted file mode 100644 index 47f3c4b..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4win_console1_netcore", "vs4win_console1_netcore\vs4win_console1_netcore.csproj", "{843A2581-1FF2-4740-B824-D3D67409E42C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {843A2581-1FF2-4740-B824-D3D67409E42C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {843A2581-1FF2-4740-B824-D3D67409E42C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {843A2581-1FF2-4740-B824-D3D67409E42C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {843A2581-1FF2-4740-B824-D3D67409E42C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs deleted file mode 100644 index 7a8ce2f..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace vs4win_console1_netcore -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - Console.WriteLine("\r\nPress any key to continue..."); - Console.ReadLine(); - } - } -} \ No newline at end of file diff --git a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj b/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj deleted file mode 100644 index 6d25f41..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netcore/vs4win_console1_netcore/vs4win_console1_netcore.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - - Exe - netcoreapp1.1 - - - \ No newline at end of file diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln deleted file mode 100644 index b55f6cb..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.6 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "vs4win_console1_netframework", "vs4win_console1_netframework\vs4win_console1_netframework.csproj", "{E48F58FD-13C7-465C-8242-81AE3F68F003}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E48F58FD-13C7-465C-8242-81AE3F68F003}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E48F58FD-13C7-465C-8242-81AE3F68F003}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E48F58FD-13C7-465C-8242-81AE3F68F003}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E48F58FD-13C7-465C-8242-81AE3F68F003}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config deleted file mode 100644 index 88fa402..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs b/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs deleted file mode 100644 index f81ce96..0000000 --- a/TourVisualStudioForMac/vs4win_console1_netframework/vs4win_console1_netframework/Program.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using vs4mac_dotnet_standard_library; - -namespace vs4win_console1_netframework -{ - class Program - { - static void Main(string[] args) - { - var randomNumber = Magicmatics.GimmeRandomNumber(); - - Console.WriteLine($"Hello World! Your random number is: {randomNumber}"); - Console.WriteLine("\r\nPress any key to continue..."); - Console.ReadLine(); - } - } -} diff --git a/UsingAnnotationsToAssistReSharper/README.md b/UsingAnnotationsToAssistReSharper/README.md deleted file mode 100644 index 23569a1..0000000 --- a/UsingAnnotationsToAssistReSharper/README.md +++ /dev/null @@ -1,3 +0,0 @@ -ReSharper / Annotations sample - -http://grantwinney.com/using-annotations-to-help-resharper-analyze-your-code/ \ No newline at end of file diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln deleted file mode 100644 index 843adca..0000000 --- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UsingAnnotationsToAssistReSharper", "UsingAnnotationsToAssistReSharper\UsingAnnotationsToAssistReSharper.csproj", "{112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs deleted file mode 100644 index e140973..0000000 --- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Annotations.cs +++ /dev/null @@ -1,624 +0,0 @@ -using System; - -#pragma warning disable 1591 -// ReSharper disable UnusedMember.Global -// ReSharper disable UnusedParameter.Local -// ReSharper disable MemberCanBePrivate.Global -// ReSharper disable UnusedAutoPropertyAccessor.Global -// ReSharper disable IntroduceOptionalParameters.Global -// ReSharper disable MemberCanBeProtected.Global -// ReSharper disable InconsistentNaming - -namespace JetBrains.Annotations -{ - /// - /// Indicates that the value of the marked element could be null sometimes, - /// so the check for null is necessary before its usage - /// - /// - /// [CanBeNull] public object Test() { return null; } - /// public void UseTest() { - /// var p = Test(); - /// var s = p.ToString(); // Warning: Possible 'System.NullReferenceException' - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | - AttributeTargets.Property | AttributeTargets.Delegate | - AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class CanBeNullAttribute : Attribute { } - - /// - /// Indicates that the value of the marked element could never be null - /// - /// - /// [NotNull] public object Foo() { - /// return null; // Warning: Possible 'null' assignment - /// } - /// - [AttributeUsage( - AttributeTargets.Method | AttributeTargets.Parameter | - AttributeTargets.Property | AttributeTargets.Delegate | - AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class NotNullAttribute : Attribute { } - - /// - /// Indicates that the marked method builds string by format pattern and (optional) arguments. - /// Parameter, which contains format string, should be given in constructor. The format string - /// should be in -like form - /// - /// - /// [StringFormatMethod("message")] - /// public void ShowError(string message, params object[] args) { /* do something */ } - /// public void Foo() { - /// ShowError("Failed: {0}"); // Warning: Non-existing argument in format string - /// } - /// - [AttributeUsage( - AttributeTargets.Constructor | AttributeTargets.Method, - AllowMultiple = false, Inherited = true)] - public sealed class StringFormatMethodAttribute : Attribute - { - /// - /// Specifies which parameter of an annotated method should be treated as format-string - /// - public StringFormatMethodAttribute(string formatParameterName) - { - FormatParameterName = formatParameterName; - } - - public string FormatParameterName { get; private set; } - } - - /// - /// Indicates that the function argument should be string literal and match one - /// of the parameters of the caller function. For example, ReSharper annotates - /// the parameter of - /// - /// - /// public void Foo(string param) { - /// if (param == null) - /// throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol - /// } - /// - [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] - public sealed class InvokerParameterNameAttribute : Attribute { } - - /// - /// Indicates that the method is contained in a type that implements - /// interface - /// and this method is used to notify that some property value changed - /// - /// - /// The method should be non-static and conform to one of the supported signatures: - /// - /// NotifyChanged(string) - /// NotifyChanged(params string[]) - /// NotifyChanged{T}(Expression{Func{T}}) - /// NotifyChanged{T,U}(Expression{Func{T,U}}) - /// SetProperty{T}(ref T, T, string) - /// - /// - /// - /// public class Foo : INotifyPropertyChanged { - /// public event PropertyChangedEventHandler PropertyChanged; - /// [NotifyPropertyChangedInvocator] - /// protected virtual void NotifyChanged(string propertyName) { ... } - /// - /// private string _name; - /// public string Name { - /// get { return _name; } - /// set { _name = value; NotifyChanged("LastName"); /* Warning */ } - /// } - /// } - /// - /// Examples of generated notifications: - /// - /// NotifyChanged("Property") - /// NotifyChanged(() => Property) - /// NotifyChanged((VM x) => x.Property) - /// SetProperty(ref myField, value, "Property") - /// - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] - public sealed class NotifyPropertyChangedInvocatorAttribute : Attribute - { - public NotifyPropertyChangedInvocatorAttribute() { } - public NotifyPropertyChangedInvocatorAttribute(string parameterName) - { - ParameterName = parameterName; - } - - public string ParameterName { get; private set; } - } - - /// - /// Describes dependency between method input and output - /// - /// - ///

Function Definition Table syntax:

- /// - /// FDT ::= FDTRow [;FDTRow]* - /// FDTRow ::= Input => Output | Output <= Input - /// Input ::= ParameterName: Value [, Input]* - /// Output ::= [ParameterName: Value]* {halt|stop|void|nothing|Value} - /// Value ::= true | false | null | notnull | canbenull - /// - /// If method has single input parameter, it's name could be omitted.
- /// Using halt (or void/nothing, which is the same) - /// for method output means that the methos doesn't return normally.
- /// canbenull annotation is only applicable for output parameters.
- /// You can use multiple [ContractAnnotation] for each FDT row, - /// or use single attribute with rows separated by semicolon.
- ///
- /// - /// - /// [ContractAnnotation("=> halt")] - /// public void TerminationMethod() - /// - /// - /// [ContractAnnotation("halt <= condition: false")] - /// public void Assert(bool condition, string text) // regular assertion method - /// - /// - /// [ContractAnnotation("s:null => true")] - /// public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty() - /// - /// - /// // A method that returns null if the parameter is null, and not null if the parameter is not null - /// [ContractAnnotation("null => null; notnull => notnull")] - /// public object Transform(object data) - /// - /// - /// [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")] - /// public bool TryParse(string s, out Person result) - /// - /// - [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)] - public sealed class ContractAnnotationAttribute : Attribute - { - public ContractAnnotationAttribute([NotNull] string contract) - : this(contract, false) { } - - public ContractAnnotationAttribute([NotNull] string contract, bool forceFullStates) - { - Contract = contract; - ForceFullStates = forceFullStates; - } - - public string Contract { get; private set; } - public bool ForceFullStates { get; private set; } - } - - /// - /// Indicates that marked element should be localized or not - /// - /// - /// [LocalizationRequiredAttribute(true)] - /// public class Foo { - /// private string str = "my string"; // Warning: Localizable string - /// } - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public sealed class LocalizationRequiredAttribute : Attribute - { - public LocalizationRequiredAttribute() : this(true) { } - public LocalizationRequiredAttribute(bool required) - { - Required = required; - } - - public bool Required { get; private set; } - } - - /// - /// Indicates that the value of the marked type (or its derivatives) - /// cannot be compared using '==' or '!=' operators and Equals() - /// should be used instead. However, using '==' or '!=' for comparison - /// with null is always permitted. - /// - /// - /// [CannotApplyEqualityOperator] - /// class NoEquality { } - /// class UsesNoEquality { - /// public void Test() { - /// var ca1 = new NoEquality(); - /// var ca2 = new NoEquality(); - /// if (ca1 != null) { // OK - /// bool condition = ca1 == ca2; // Warning - /// } - /// } - /// } - /// - [AttributeUsage( - AttributeTargets.Interface | AttributeTargets.Class | - AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] - public sealed class CannotApplyEqualityOperatorAttribute : Attribute { } - - /// - /// When applied to a target attribute, specifies a requirement for any type marked - /// with the target attribute to implement or inherit specific type or types. - /// - /// - /// [BaseTypeRequired(typeof(IComponent)] // Specify requirement - /// public class ComponentAttribute : Attribute { } - /// [Component] // ComponentAttribute requires implementing IComponent interface - /// public class MyComponent : IComponent { } - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] - [BaseTypeRequired(typeof(Attribute))] - public sealed class BaseTypeRequiredAttribute : Attribute - { - public BaseTypeRequiredAttribute([NotNull] Type baseType) - { - BaseType = baseType; - } - - [NotNull] - public Type BaseType { get; private set; } - } - - /// - /// Indicates that the marked symbol is used implicitly - /// (e.g. via reflection, in external library), so this symbol - /// will not be marked as unused (as well as by other usage inspections) - /// - [AttributeUsage(AttributeTargets.All, AllowMultiple = false, Inherited = true)] - public sealed class UsedImplicitlyAttribute : Attribute - { - public UsedImplicitlyAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public UsedImplicitlyAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public UsedImplicitlyAttribute( - ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - public ImplicitUseKindFlags UseKindFlags { get; private set; } - public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - /// - /// Should be used on attributes and causes ReSharper - /// to not mark symbols marked with such attributes as unused - /// (as well as by other usage inspections) - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public sealed class MeansImplicitUseAttribute : Attribute - { - public MeansImplicitUseAttribute() - : this(ImplicitUseKindFlags.Default, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseKindFlags useKindFlags) - : this(useKindFlags, ImplicitUseTargetFlags.Default) { } - - public MeansImplicitUseAttribute(ImplicitUseTargetFlags targetFlags) - : this(ImplicitUseKindFlags.Default, targetFlags) { } - - public MeansImplicitUseAttribute( - ImplicitUseKindFlags useKindFlags, ImplicitUseTargetFlags targetFlags) - { - UseKindFlags = useKindFlags; - TargetFlags = targetFlags; - } - - [UsedImplicitly] - public ImplicitUseKindFlags UseKindFlags { get; private set; } - [UsedImplicitly] - public ImplicitUseTargetFlags TargetFlags { get; private set; } - } - - [Flags] - public enum ImplicitUseKindFlags - { - Default = Access | Assign | InstantiatedWithFixedConstructorSignature, - /// Only entity marked with attribute considered used - Access = 1, - /// Indicates implicit assignment to a member - Assign = 2, - /// - /// Indicates implicit instantiation of a type with fixed constructor signature. - /// That means any unused constructor parameters won't be reported as such. - /// - InstantiatedWithFixedConstructorSignature = 4, - /// Indicates implicit instantiation of a type - InstantiatedNoFixedConstructorSignature = 8, - } - - /// - /// Specify what is considered used implicitly - /// when marked with - /// or - /// - [Flags] - public enum ImplicitUseTargetFlags - { - Default = Itself, - Itself = 1, - /// Members of entity marked with attribute are considered used - Members = 2, - /// Entity marked with attribute and all its members considered used - WithMembers = Itself | Members - } - - /// - /// This attribute is intended to mark publicly available API - /// which should not be removed and so is treated as used - /// - [MeansImplicitUse] - public sealed class PublicAPIAttribute : Attribute - { - public PublicAPIAttribute() { } - public PublicAPIAttribute([NotNull] string comment) - { - Comment = comment; - } - - [NotNull] - public string Comment { get; private set; } - } - - /// - /// Tells code analysis engine if the parameter is completely handled - /// when the invoked method is on stack. If the parameter is a delegate, - /// indicates that delegate is executed while the method is executed. - /// If the parameter is an enumerable, indicates that it is enumerated - /// while the method is executed - /// - [AttributeUsage(AttributeTargets.Parameter, Inherited = true)] - public sealed class InstantHandleAttribute : Attribute { } - - /// - /// Indicates that a method does not make any observable state changes. - /// The same as System.Diagnostics.Contracts.PureAttribute - /// - /// - /// [Pure] private int Multiply(int x, int y) { return x * y; } - /// public void Foo() { - /// const int a = 2, b = 2; - /// Multiply(a, b); // Waring: Return value of pure method is not used - /// } - /// - [AttributeUsage(AttributeTargets.Method, Inherited = true)] - public sealed class PureAttribute : Attribute { } - - /// - /// Indicates that a parameter is a path to a file or a folder - /// within a web project. Path can be relative or absolute, - /// starting from web root (~) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public class PathReferenceAttribute : Attribute - { - public PathReferenceAttribute() { } - public PathReferenceAttribute([PathReference] string basePath) - { - BasePath = basePath; - } - - [NotNull] - public string BasePath { get; private set; } - } - - // ASP.NET MVC attributes - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaMasterLocationFormatAttribute : Attribute - { - public AspMvcAreaMasterLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaPartialViewLocationFormatAttribute : Attribute - { - public AspMvcAreaPartialViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcAreaViewLocationFormatAttribute : Attribute - { - public AspMvcAreaViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcMasterLocationFormatAttribute : Attribute - { - public AspMvcMasterLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcPartialViewLocationFormatAttribute : Attribute - { - public AspMvcPartialViewLocationFormatAttribute(string format) { } - } - - [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] - public sealed class AspMvcViewLocationFormatAttribute : Attribute - { - public AspMvcViewLocationFormatAttribute(string format) { } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC action. If applied to a method, the MVC action name is calculated - /// implicitly from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcActionAttribute : Attribute - { - public AspMvcActionAttribute() { } - public AspMvcActionAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] - public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC area. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcAreaAttribute : PathReferenceAttribute - { - public AspMvcAreaAttribute() { } - public AspMvcAreaAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] - public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that - /// the parameter is an MVC controller. If applied to a method, - /// the MVC controller name is calculated implicitly from the context. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.ChildActionExtensions.RenderAction(HtmlHelper, String, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcControllerAttribute : Attribute - { - public AspMvcControllerAttribute() { } - public AspMvcControllerAttribute([NotNull] string anonymousProperty) - { - AnonymousProperty = anonymousProperty; - } - - [NotNull] - public string AnonymousProperty { get; private set; } - } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC Master. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(String, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcMasterAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC model type. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(String, Object) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcModelTypeAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that - /// the parameter is an MVC partial view. If applied to a method, - /// the MVC partial view name is calculated implicitly from the context. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.RenderPartialExtensions.RenderPartial(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcPartialViewAttribute : PathReferenceAttribute { } - - /// - /// ASP.NET MVC attribute. Allows disabling all inspections - /// for MVC views within a class or a method. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] - public sealed class AspMvcSupressViewErrorAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC display template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.DisplayExtensions.DisplayForModel(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcDisplayTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC editor template. - /// Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Html.EditorExtensions.EditorForModel(HtmlHelper, String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcEditorTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. Indicates that a parameter is an MVC template. - /// Use this attribute for custom wrappers similar to - /// System.ComponentModel.DataAnnotations.UIHintAttribute(System.String) - /// - [AttributeUsage(AttributeTargets.Parameter)] - public sealed class AspMvcTemplateAttribute : Attribute { } - - /// - /// ASP.NET MVC attribute. If applied to a parameter, indicates that the parameter - /// is an MVC view. If applied to a method, the MVC view name is calculated implicitly - /// from the context. Use this attribute for custom wrappers similar to - /// System.Web.Mvc.Controller.View(Object) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method)] - public sealed class AspMvcViewAttribute : PathReferenceAttribute { } - - /// - /// ASP.NET MVC attribute. When applied to a parameter of an attribute, - /// indicates that this parameter is an MVC action name - /// - /// - /// [ActionName("Foo")] - /// public ActionResult Login(string returnUrl) { - /// ViewBag.ReturnUrl = Url.Action("Foo"); // OK - /// return RedirectToAction("Bar"); // Error: Cannot resolve action - /// } - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)] - public sealed class AspMvcActionSelectorAttribute : Attribute { } - - [AttributeUsage( - AttributeTargets.Parameter | AttributeTargets.Property | - AttributeTargets.Field, Inherited = true)] - public sealed class HtmlElementAttributesAttribute : Attribute - { - public HtmlElementAttributesAttribute() { } - public HtmlElementAttributesAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] - public string Name { get; private set; } - } - - [AttributeUsage( - AttributeTargets.Parameter | AttributeTargets.Field | - AttributeTargets.Property, Inherited = true)] - public sealed class HtmlAttributeValueAttribute : Attribute - { - public HtmlAttributeValueAttribute([NotNull] string name) - { - Name = name; - } - - [NotNull] - public string Name { get; private set; } - } - - // Razor attributes - - /// - /// Razor attribute. Indicates that a parameter or a method is a Razor section. - /// Use this attribute for custom wrappers similar to - /// System.Web.WebPages.WebPageBase.RenderSection(String) - /// - [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Method, Inherited = true)] - public sealed class RazorSectionAttribute : Attribute { } -} \ No newline at end of file diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/MainClass.cs b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/MainClass.cs deleted file mode 100644 index ee1b7d6..0000000 --- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/MainClass.cs +++ /dev/null @@ -1,286 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using JetBrains.Annotations; - -namespace UsingAnnotationsToAssistReSharper -{ - public class MainClass - { - /* RESHARPER AND OPTIMISTIC ANALYSIS */ - - // ReSharper’s analysis detects that “name” will always be null, and underlines it to warn that - // accessing the “Length” property will possibly throw an exception. In this case, we know it will. - private int ReSharperAnalyzesStringAsNull_ALWAYS() - { - string name = null; - - if (false) - name = ""; - - return name.Length; - } - - // ReSharper’s analysis detects that name will never be null, so no underline. - // (It also grays out the first initialization, as it’s never used). - private int ReSharperAnalyzesStringAsNull_NEVER() - { - string name = null; - - if (true) - name = ""; - - return name.Length; - } - - // Now I’ll remove part of the code to a separate method. - // Obviously, a NullReferenceException will still be thrown, but ReSharper no longer warns us. - private int ShowName() - { - return GetName().Length; - } - - private string GetName() - { - return null; - } - - /* GET A CLUE! */ - - // ReSharper can’t determine whether the method could possibly return null, but we can give it a nudge nudge wink wink, - // using some special attributes from JetBrains (also referred to as “annotations” or “contracts”). - private int ShowName2() - { - return GetNameCouldBeNull().Length; - } - - [CanBeNull] - private string GetNameCouldBeNull() - { - return null; - } - - // Here’s another example, where the annotation has been applied to a parameter. - // Again, ReSharper doesn’t know whether or not “myString” could possibly be null, so it optimistically assumes it won’t be. - // But we can annotate the parameter to hint to ReSharper that “myString” may very well be null. - private int GetStringLength([CanBeNull] string myString) - { - return myString.Length; - } - - // Here’s the NotNull attribute in action. Accessing the value of a nullable int, - // without first checking whether or not it has a value, will throw an exception, and ReSharper is warning us. - private void Calculate() - { - var product1 = MultiplyByTwo(10).Value; // Expect 20 :p - - var product2 = MultiplyByTwoCantPossiblyReturnNull(10).Value; - } - - private int? MultiplyByTwo(int number) - { - return number * 2; - } - - // By marking the called method with the NotNull attribute, we are telling ReSharper that the method will never return a null, - // so the warning is unnecessary. (Silly example, as you’d change the return value in the signature instead, but it demonstrates the usage.) - [NotNull] - private int? MultiplyByTwoCantPossiblyReturnNull(int number) - { - return number * 2; - } - - /* USING ANNOTATIONS */ - - // NHibernate’s NullableDictionary class allows null keys, but ReSharper wants to warn us that the key CAN'T be null (untrue): - public class NullableDictionary : IDictionary - where TKey : class - { - private TValue _nullvalue; - private bool _gotNullvalue; - private readonly Dictionary _dict; - - public bool TryGetValue(TKey key, out TValue value) - { - if (key == null) - { - if (_gotNullvalue) - { - value = _nullvalue; - return true; - } - else - { - value = default(TValue); - return false; - } - } - else - { - return _dict.TryGetValue(key, out value); - } - } - - #region Ignore - public bool ContainsKey(TKey key) - { - throw new NotImplementedException(); - } - - public void Add(TKey key, TValue value) - { - throw new NotImplementedException(); - } - - public bool Remove(TKey key) - { - throw new NotImplementedException(); - } - - public TValue this[TKey key] - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public ICollection Keys { get; private set; } - public ICollection Values { get; private set; } - - public IEnumerator> GetEnumerator() - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void Clear() - { - throw new NotImplementedException(); - } - - public bool Contains(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - public bool Remove(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public int Count { get; private set; } - public bool IsReadOnly { get; private set; } - #endregion Ignore - } - - // Adding a [CanBeNull] attribute to the key parameter informs ReSharper that the key COULD be null: - public class NullableDictionary2 : IDictionary - where TKey : class - { - private TValue _nullvalue; - private bool _gotNullvalue; - private readonly Dictionary _dict; - - public bool TryGetValue([CanBeNull] TKey key, out TValue value) - { - if (key == null) - { - if (_gotNullvalue) - { - value = _nullvalue; - return true; - } - else - { - value = default(TValue); - return false; - } - } - else - { - return _dict.TryGetValue(key, out value); - } - } - - #region Ignore - public bool ContainsKey(TKey key) - { - throw new NotImplementedException(); - } - - public void Add(TKey key, TValue value) - { - throw new NotImplementedException(); - } - - public bool Remove(TKey key) - { - throw new NotImplementedException(); - } - - public TValue this[TKey key] - { - get { throw new NotImplementedException(); } - set { throw new NotImplementedException(); } - } - - public ICollection Keys { get; private set; } - public ICollection Values { get; private set; } - - public IEnumerator> GetEnumerator() - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Add(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void Clear() - { - throw new NotImplementedException(); - } - - public bool Contains(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - throw new NotImplementedException(); - } - - public bool Remove(KeyValuePair item) - { - throw new NotImplementedException(); - } - - public int Count { get; private set; } - public bool IsReadOnly { get; private set; } - #endregion Ignore - } - } -} diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Properties/AssemblyInfo.cs b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Properties/AssemblyInfo.cs deleted file mode 100644 index 4a979b7..0000000 --- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("UsingAnnotationsToAssistReSharper")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("UsingAnnotationsToAssistReSharper")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2d1650b8-51db-43bc-8478-644514d0f6ac")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.csproj b/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.csproj deleted file mode 100644 index f623c5f..0000000 --- a/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper/UsingAnnotationsToAssistReSharper.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Debug - AnyCPU - {112D4EA9-AC3D-40CB-B9DF-857C9C48E6D9} - Library - Properties - UsingAnnotationsToAssistReSharper - UsingAnnotationsToAssistReSharper - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WindowsXPVisualStudio/VB6.0/MSSCCPRJ.SCC b/WindowsXPVisualStudio/VB6.0/MSSCCPRJ.SCC deleted file mode 100644 index 1d6a7fa..0000000 --- a/WindowsXPVisualStudio/VB6.0/MSSCCPRJ.SCC +++ /dev/null @@ -1,5 +0,0 @@ -[SCC] -SCC=This is a source code control file -[Project1.vbp] -SCC_Project_Name=this project is not under source code control -SCC_Aux_Path= diff --git a/WindowsXPVisualStudio/VB6.0/Project1.vbw b/WindowsXPVisualStudio/VB6.0/Project1.vbw deleted file mode 100644 index 84f628f..0000000 --- a/WindowsXPVisualStudio/VB6.0/Project1.vbw +++ /dev/null @@ -1,6 +0,0 @@ -Module1 = 44, 44, 440, 487, C -frmMain = 42, 264, 693, 830, CI, 527, 369, 886, 705, C -frmSplash = 0, 0, 0, 0, C, 10, 12, 573, 395, C -frmAbout = 0, 0, 0, 0, C, 15, 430, 453, 752, C -frmDocument = 0, 0, 0, 0, C, 548, 25, 825, 282, C -frmBrowser = 0, 0, 0, 0, C, 298, 311, 772, 742, C diff --git a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj.user b/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj.user deleted file mode 100644 index 10882b4..0000000 --- a/WindowsXPVisualStudio/VS2003/WindowsApplication1/WindowsApplication1/WindowsApplication1.vbproj.user +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - diff --git a/WordCloud/.idea/WordCloud.iml b/WordCloud/.idea/WordCloud.iml deleted file mode 100644 index 27fe331..0000000 --- a/WordCloud/.idea/WordCloud.iml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/WordCloud/.idea/inspectionProfiles/profiles_settings.xml b/WordCloud/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/WordCloud/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/WordCloud/.idea/misc.xml b/WordCloud/.idea/misc.xml deleted file mode 100644 index 09fc79b..0000000 --- a/WordCloud/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/WordCloud/.idea/modules.xml b/WordCloud/.idea/modules.xml deleted file mode 100644 index 226f7e0..0000000 --- a/WordCloud/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/WordCloud/.idea/vcs.xml b/WordCloud/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/WordCloud/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/WordCloud/WordCloud.py b/WordCloud/WordCloud.py deleted file mode 100644 index 2f49d97..0000000 --- a/WordCloud/WordCloud.py +++ /dev/null @@ -1,42 +0,0 @@ -import random -from tkinter import * # use Tkinter for Python2 -window = Tk() -window.title("Welcome to LikeGeeks app") -window.geometry('800x480') - -mid_h = 320 -mid_v = 240 - -results = { - 'Back-end Dev': 55.2, - 'Full-stack Dev': 54.9, - 'Front-end Dev': 37.1, - 'Desktop / Enterprise': 23.9, - 'Mobile Dev': 19.2, - 'DevOps': 12.1, - 'DB Admin': 11.6, - 'Designer': 10.8, - 'System Admin': 10.6, - 'Embedded Apps': 9.6, - 'Data / Business Analyst': 8.2, - 'Data Scientist / Machine Learning': 8.1, - 'QA / Tester': 8, - 'Data Engineer': 7.6, - 'Academic Researcher': 7.2, - 'Educator': 5.9, - 'Gaming / Graphics': 5.6, - 'Engineering Manager': 5.5, - 'Product Manager': 5.1, - 'Scientist': 4.2 -} - -def rnd_pos(): - return 1 if random.random() < 0.5 else -1 - -for dev_type, percentage in results.items(): - start_pos = int(165-(percentage*3)) - color = '#%02x%02x%02x' % (50+start_pos, 50+start_pos, 255) - lbl = Label(window, text=dev_type, font=("Arial", int(percentage)), fg=color) - lbl.place(x=mid_h-(start_pos*rnd_pos()), y=mid_v-(start_pos*rnd_pos())) - -window.mainloop()