Skip to content

Commit

Permalink
doc posts migrated
Browse files Browse the repository at this point in the history
  • Loading branch information
trayburn committed Sep 11, 2019
1 parent bdbf6ec commit cf4b16c
Show file tree
Hide file tree
Showing 6 changed files with 246 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/_posts/2011-01-02-Numbers-Kihon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
layout: default
title: Solutions - Numbers Kihon
---
<pre class="brush: csharp">
protected override int Return_The_Maximum_Value_Of_Int32()
{
return int.MaxValue;
}

protected override int Return_The_Minimum_Value_Of_Int32()
{
return int.MinValue;
}

protected override int Return_The_Remainder_Of_a_Divided_By_b(int a, int b)
{
return a % b;
}

protected override double Return_The_Maximum_Value_Of_Double()
{
return double.MaxValue;
}

protected override double Return_The_Minimum_Value_Of_Double()
{
return double.MinValue;
}

protected override bool Return_True_If_a_Is_Not_A_Number(double a)
{
return double.IsNaN(a);
}

protected override bool Return_True_If_a_Is_An_Infinity(double a)
{
return double.IsInfinity(a);
}
</pre>
77 changes: 77 additions & 0 deletions docs/_posts/2011-01-19-StringKihon-Solutions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
layout: default
title: Solutions - String Kihon
---
<h1>StringKihon Solutions</h1>

<pre class="brush: csharp">
protected override string Convert_To_Uppercase(string data)
{
return data.ToUpper();
}

protected override string Convert_To_Lowercase(string data)
{
return data.ToLower();
}

protected override string Combine_Parts_Of_A_Name(string firstName, string middleName, string lastName)
{
return string.Format("{0} {1} {2}",firstName,middleName,lastName);
}

protected override string Combine_Two_Strings(string a, string b)
{
return a + b;
}

protected override int Determine_The_Length_Of_A_String(string data)
{
return data.Length;
}

protected override string Remove_All_Leading_Whitespace(string data)
{
return data.TrimStart();
}

protected override string Remove_All_Trailing_Whitespace(string data)
{
return data.TrimEnd();
}

protected override string[] Split_A_String_Into_An_Array(string input, char divider)
{
return input.Split(divider);
}

protected override string Join_An_Array_Into_A_String(string[] input, string divider)
{
return string.Join(divider, input);
}

protected override bool Return_True_If_a_Contains_b(string a, string b)
{
return a.Contains(b);
}

protected override int Determine_The_Position_Of_a_In_b(string a, string b)
{
return b.IndexOf(a);
}

protected override bool Return_True_If_a_Starts_With_b(string a, string b)
{
return a.StartsWith(b);
}

protected override bool Return_True_Is_a_Ends_With_b(string a, string b)
{
return a.EndsWith(b);
}

protected override string Return_The_Fourth_Through_Seventh_Characters_Of_Input(string input)
{
return input.Substring(3,4);
}
</pre>
26 changes: 26 additions & 0 deletions docs/_posts/2011-01-20-Console-Kihon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
layout: default
title: Solutions - Console Kihon
---
<pre class="brush: csharp">
protected override void Write_FooBar_To_The_Console(IConsoleWrapper console)
{
console.Write("FooBar");
}

protected override void WriteLine_FooBar_To_The_Console(IConsoleWrapper console)
{
console.WriteLine("FooBar");
}

protected override void Write_Foo_In_Blue_To_The_Console(IConsoleWrapper console)
{
console.ForegroundColor = ConsoleColor.Blue;
console.Write("Foo");
}

protected override object Read_Line_From_Console_And_Return_Value(IConsoleWrapper console)
{
return console.ReadLine();
}
</pre>
43 changes: 43 additions & 0 deletions docs/_posts/2011-01-22-Control-Structures-Kihon.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
layout: default
title: Solutions - Control Structures Kihon
---
<pre class="brush: csharp">
protected override void Call_Hit_On_a_If_val_Is_True_Else_Call_Hit_On_b(bool val, ITarget a, ITarget b)
{
if (val) a.Hit();
else b.Hit();
}

protected override void Call_Hit_On_a_Once_For_Each_Member_Of_list(ITarget a, List<string> list)
{
foreach (string item in list)
{
a.Hit();
}
}

protected override void Call_Hit_On_a_While_a_IsValid_Is_True(ITarget a)
{
while (a.IsValid)
{
a.Hit();
}
}

protected override void n_Times_Call_Hit_On_a(int n, ITarget a)
{
for (int i = 0; i < n; i++)
{
a.Hit();
}
}

protected override void Call_Hit_On_a_Once_And_Loop_Until_IsValid_Is_False(ITarget a)
{
do
{
a.Hit();
} while (a.IsValid);
}
</pre>
35 changes: 35 additions & 0 deletions docs/_posts/2011-02-26-SqlKihon-Solutions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
layout: default
title: Solutions - SQL Kihon
---
<pre class="brush: csharp">
protected override string Select_All_Fields_And_Rows_From_Person()
{
return "SELECT * FROM PERSON";
}

protected override string Select_All_Fields_From_Person_Joined_To_Address()
{
return "SELECT * FROM PERSON JOIN ADDRESS ON PERSON.PERSONID = ADDRESS.PERSONID";
}

protected override string Select_FirstName_From_Person_Where_LastName_Equals_Rayburn()
{
return "SELECT FIRSTNAME FROM PERSON WHERE LASTNAME='Rayburn'";
}

protected override string Select_All_Fields_From_Person_Left_Outer_Joined_To_Address()
{
return "SELECT * FROM PERSON LEFT OUTER JOIN ADDRESS ON PERSON.PERSONID = ADDRESS.PERSONID";
}

protected override string Insert_PersonId_4_Named_Mike_Johnson_Age_5_To_Person()
{
return "INSERT INTO PERSON VALUES (4,'Mike','Johnson',5)";
}

protected override string Update_All_LastNames_Rayburn_To_Johnson_In_Person()
{
return "UPDATE PERSON SET LASTNAME='Johnson' WHERE LASTNAME='Rayburn'";
}
</pre>
25 changes: 25 additions & 0 deletions docs/_posts/2011-03-26-LinqKihon-Solutions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
layout: default
title: Solutions - Linq Kihon
---
<pre class="brush: csharp">
protected override IEnumerable&lt;int&gt; Select_the_Something_property_from_list(List&lt;Product&gt; list)
{
return list.Select(x =&gt; x.Something);
}

protected override IEnumerable&lt;Product&gt; Order_the_list_by_the_something_property_descending(List&lt;Product&gt; list)
{
return list.OrderByDescending(x =&gt; x.Something);
}

protected override IEnumerable&lt;Product&gt; Order_the_list_by_the_something_property(List&lt;Product&gt; list)
{
return list.OrderBy(x =&gt; x.Something);
}

protected override IEnumerable&lt;Product&gt; Filter_the_products_where_something_is_equal_to_2_from_list(List&lt;Product&gt; list)
{
return list.Where(x =&gt; x.Something == 2);
}
</pre>

0 comments on commit cf4b16c

Please sign in to comment.