Errata page for my book F# Applied
🙋♂️
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
const statusMessagesReducer = (state = [], action) => { | |
if (action.type === "ADD_STATUS") { | |
return state.concat(action.statusMessage); | |
} | |
return state; | |
}; | |
const notificationsReducer = (state = [], action) => { | |
if (action.type === "ADD_NOTIFICATION") { | |
return state.concat(action.notification); |
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
'.source.fsharp': | |
'F# NUnit Test': | |
'prefix': 'test' | |
'body': """ | |
[<Test>] | |
let ``$1`` () = | |
$2 | |
""" |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<Student> students = new List<Student>(); | |
// Populate Students List here | |
Student[] studentsSortedByName = students.ToArray(); |
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
hasFever (Celsius 10.5) | |
hasFever (Fahrenheit 22.5) |
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
using System.ComponentModel.DataAnnotations; | |
namespace UsingAjaxForms.Models | |
{ | |
public class PersonalDetail | |
{ | |
[Required] | |
public string Name { get; set; } | |
[Required] | |
public string Email { get; set; } |
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
namespace DelegatesAndEvents | |
{ | |
class EvilSubscriber | |
{ | |
WeatherStation weatherStation; | |
public void EvilMessage(int temperature) | |
{ | |
Console.WriteLine("The temperature is " + (temperature * 100)); | |
} |
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
public string GreetMe() | |
{ | |
System.Threading.Thread.Sleep(2000); | |
return "Hello ASP.NET MVC3 Ajax !!"; | |
} |
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
public class HomeController : Controller | |
{ | |
public ActionResult Index() | |
{ | |
return View(); | |
} | |
} |
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
private void btnAttack_Click(object sender, EventArgs e) | |
{ | |
weapon.Attack(); | |
} |