Skip to content

Instantly share code, notes, and snippets.

View AnsonSmith's full-sized avatar

Anson Smith AnsonSmith

  • Hattiesburg, MS
View GitHub Profile
using Morcatko.AspNetCore.JsonMergePatch.Builder;
using Newtonsoft.Json;
using Xunit;
namespace UnitTests
{
class ClassOne
{
[JsonProperty("id")]
public int Id { get; set; } = 1;
%%didn't put in all the words, but you get the gist
Words = "tools, Automation, Expertise, guidance, solutions, driven, quality, Collaborative, innovation, Passion, Expertise, innovation,collaborative, quality, Guidance, R&D, Scalable solutions, quality".
LoweredWords = [X || X<-[string:to_lower(Y)|| Y <- [Z|| Z <- string:tokens(Words,", \n")]]].
lists:reverse(lists:keysort(2,lists:usort([{A, length(lists:filter(fun(B)->B=:=A end,LoweredWords))}||A<-LoweredWords]))).
==outputs
[{"quality",3},
{"solutions",2},
{"innovation",2},
<UserControl x:Class="SimpleConductorOneActive.Views.RandomScreenView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid Background="AliceBlue">
<StackPanel Orientation="Vertical">
<Button Content="Close" HorizontalAlignment="Right" Margin="5" x:Name="CloseScreen" />
<Window x:Class="SimpleConductorOneActive.Views.ShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="550" Background="CornflowerBlue">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
public class ShellViewModel : Conductor<Screen>.Collection.OneActive
{
public void NewScreen()
{
ActivateItem(new RandomScreenViewModel());
}
}
public class ShellViewModel : Conductor<Screen>.Collection.OneActive
{
public int ScreenCount
{
get { return this.Items.Count; }
}
public ShellViewModel()
{
public class RandomScreenViewModel:Screen
{
public RandomScreenViewModel()
{
Guid id = Guid.NewGuid();
DisplayName = id.ToString();
}
private int onInitializeCalls = 0;
itemsControl.ItemTemplate = DefaultDataTemplate;
#if !SILVERLIGHT && !WP7
if (itemsControl.ItemTemplateSelector == null)
{
itemsControl.ItemTemplate = DefaultDataTemplate;
}
#else
itemsControl.ItemTemplate = DefaultDataTemplate;
#endif