-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
246 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<int> Select_the_Something_property_from_list(List<Product> list) | ||
{ | ||
return list.Select(x => x.Something); | ||
} | ||
|
||
protected override IEnumerable<Product> Order_the_list_by_the_something_property_descending(List<Product> list) | ||
{ | ||
return list.OrderByDescending(x => x.Something); | ||
} | ||
|
||
protected override IEnumerable<Product> Order_the_list_by_the_something_property(List<Product> list) | ||
{ | ||
return list.OrderBy(x => x.Something); | ||
} | ||
|
||
protected override IEnumerable<Product> Filter_the_products_where_something_is_equal_to_2_from_list(List<Product> list) | ||
{ | ||
return list.Where(x => x.Something == 2); | ||
} | ||
</pre> |