Posts

Xamarin Forms, with F#

xam-fsharp-01I wanted to give F# a “go” in a Xamarin project, but Visual Studio (at least on Windows) does not have a Xamarin Forms template for F#. This means that I will need to create it myself.
I am sure it will be possible, and I will use a C# project as a guide.I am in no way proficient in F#, but that is also because I have never really used it in a “real” project, and I would like to give it a good try.In this post, I am going to attempt to create just the outline of the project.Create a new projectIn Visual Studio, I am creating an F#, .Net Standard Class Library. This will become my Xamarin Forms library (called PCL before .Net Standard). I am naming my project Jon.FXam.I then want to add Xamarin.Forms from NuGet.Now I need to create my App “Class”, I can’t find any XAML for F#, so I will just have to try my best at coding it.Rename Library.fs to App.fs and set its content to:namespace Jon.FXam open Xamarin.Forms typeApp()=inheritApplication()It builds.Add an Android proje…

Reactive Unit Testing

Reactive Unit TestingThe problemI have done a project using Reactive Extentions, but I have not been able to figure out how to write unit tests for it.
My plan is o create a simple example I can use to try unit testing reactive code.The solutionTo start with I am creating a new solution, with two projects, one is a simple .Net Standard project, and the other an XUnit project.
Add System.Reactive to both projects, and add Microsoft.Reactive.Testing to the test project.I want to start with something simple, like a counter that will return the next value every seccond.First TestThe first test will be to make sure it starts by returning a 0.
The outline of test class is:using System.Reactive.Linq;using System.Threading.Tasks;using Jonathan.ReactiveProject;using Xunit;namespace Jonathan.ReactiveProjectTests {publicclassReactiveObjectTests{[Fact]publicasync Task Sequence_Recieves_0(){var fixture =newReactiveObject();var result =await fixture.Sequence.FirstAsync(); Assert.Equal(0…

My recipe for Kvass

I have been tweaking a personal kvass recipy. I feel it has reached the point where it can be written down, although there may still be some editing done to it.Ingrediants500g rye breadabout 5l waterraisons (optional)100g sugar10g brewers yeastYou also will need some muslin cloth.Try get 100% rye. I have tried 60% and 100%, and the pure rye bread makes it a lot better.
I don’t like it too sweet, so try this, and adjust your sugar if you need to.
For a while the only yeast I could find was instant yeast. This still works, but it seems to activate a bit quickerProcessDry the breadThe first thing you want to do is break the bread up a bit (I break each slice into qurters) and lay it out in an ovan tray. Bake the bread on about 180 until it has compltly dried out, turning it over once the top has dried out.I find that it is best to pull it out just before the bread starts to burn. If it starts to smoke it has been in a little to long, but the point just before that is purfect.You can also…