Mathias Brandewinder on .NET, F#, VSTO and Excel development, and quantitative analysis / machine learning.
by admin 26. October 2014 17:01

From time to time, I get absorbed by questions for no clear reason. This is one of these times – you have been warned.

So here is the question: can I use a logistic map to encode an arbitrary list of 1s and 0s into a single float, and generate back the series by applying the logistic map? I don’t think there is a clear theoretical or practical interest in this question, but for some reason I couldn’t shake it off, and had to do it.

Just to clarify a bit what I have in mind, here is the expression for the logistic map:

x(n+1) = alpha * x(n) * (1-x(n))

This is a recurrence relation, and has been well studied, because it illustrates very nicely some important ideas in chaos theory. In particular, for x0 in ] 0.0; 1.0 [ and values of alpha between 0 and 4, the series will remain in the interval ] 0.0; 1.0 [, and for certain values of alpha, 4.0 for instance, the series will exhibit a chaotic behavior.


Anyways – so here is what I have in mind. If I gave you an arbitrary float in the unit interval, I could “decrypt” binary values this way:

let f x = 4. * x * (1. - x)

let decrypt root = 
    |> Seq.unfold (fun x -> Some(x, f x)) 
    |> (fun x -> if x > 0.5 then 1 else 0)

let test = decrypt 0.12345 |> Seq.take 20 |> Seq.toList

Running that example produces the following result:

val test : int list =
  [1; 1; 0; 1; 1; 1; 1; 0; 0; 1; 0; 1; 1; 0; 1; 1; 0; 0; 0; 1; 1; 1; 0; 0; 0;
   1; 1; 0; 1; 0; 0; 0; 1; 0; 1; 1; 0; 0; 0; 1; 0; 0; 0; 1; 0; 1; 1; 1; 1; 1;
   1; 1; 0; 1; 0; 0; 1; 1; 0; 0; 0; 1; 1]

This illustrates how, from a single float value, in this case, 0.12345, I could generate a list of 0s and 1s. The question is, can I generate any sequence? That is, if I gave you (for instance) the following series [ 0; 1; 1; 0; 1 ], could you give me a float that would produce that sequence? And are there sequences that I couldn’t generate by that mechanism?

As it turns out, any sequence is feasible. If I start from the last number in the series (1 in our case), the value that generated it, x4, had to be in [0.5;1.0], because it got rounded up to 1. But then, x4 = f(x3), which implies that 4.0 * x3 * (1.0 – x3) belongs in [0.5;1.0]. I’ll let you work through the math here (it involves solving a second-degree polynomial) – what you should end up with is that there are exactly 2 segments that, when transformed by f, result in [0.5;1.0] (see the diagram below for a more visual explanation, illustrating how to find the two segments that f transforms into a given segment x(n)).


Because we know that the 4th value in our series is a 0, we also know that x3 has to be in [0.0; 0.5], so we can just compute the intersection of f inverse (interval(x4)) and [0.0; 0.5], and repeat the process over and over again, until we have finished covering the sequence and reached x0, and we are left with one interval. Any number we pick in that interval will produce the desired sequence.

So how does this look in code? Not awesome, but not too bad. invf is the inverse of f, which returns 2 possible values – and backsolve computes the current interval x has to belong to, given the interval its successor has to be in, and the desired value, a 0 or a 1:

let f x = 4. * x * (1. - x)

let decrypt root = 
    |> Seq.unfold (fun x -> Some(x, f x)) 
    |> (fun x -> if x > 0.5 then 1 else 0)

let empty (lo,hi) = lo >= hi
// two inverses, low value then high value
let invf x = (1.-sqrt(1.-x))/2.,(1.+sqrt(1.-x))/2.

// interval = where f(x) needs to be
// binary = whether x is 0 or 1
let backsolve interval binary =
    let lo,hi = 
        match binary with
        | 0 -> (0.0,0.5)
        | 1 -> (0.5,1.0)
        | _ -> failwith "unexpected"
    let lo',hi' = interval
    let constraint2 = 
        let x1,x2 = invf lo'
        let y1,y2 = invf hi'
        (x1,y1),(y2,x2) // this is union
    // compute intersect
    let (lo1,hi1),(lo2,hi2) = constraint2
    let sol1 = (max lo1 lo,min hi1 hi)
    let sol2 = (max lo2 lo,min hi2 hi)
    if empty sol1 then sol2 else sol1 

let solve (xs:int list) = 
    let rec back bins curr =
        match bins with
        | [] -> curr
        | hd::tl -> back tl (backsolve curr hd)
    back (xs |> List.rev) (0.,1.)

Does this work? Let’s try out, by generating a random sequence of 20 0s and 1s, and checking that if we encrypt and decrypt it, we get the initial series:

let validate xs =
    let l = List.length xs
    let lo,hi = solve xs
    decrypt (0.5*(lo+hi)) |> Seq.take l |> Seq.toList

let rng = System.Random ()
let sample = List.init 25 (fun _ -> rng.Next(2))
sample = validate sample

It does work – up to a limit. If you start expanding the length of the series you are trying to encrypt, at some point you will observe that the encrypted/decrypted version stops matching the original. This should not come as a surprise: we are operating in finite precision here, so there would be something deeply flawed if we managed to encode a potentially infinite amount of information, by simply using a float. However, in the world of math, where infinite precision exists, we could transform any sequence of 0s and 1s, of any length, into a segment in [ 0.0; 1.0]. Pretty useless, but fun.

One thing I started playing with was representing segments better, with a discriminated union. After all, the algorithm can be expressed entirely as a sequence of interval unions and intersections – I’ll let that to the reader as a fun F# modeling problem!

If you have questions, or even, who knows, find the problem interesting, ping me on Twitter!

It's pat herself seriousness have need to versus sting an vocation abortion if the tisane abortion did not standstill the bigness. The opening that using Misoprostol resolution give birth to an abortion is 90%. Drain on simple questions primrose-yellow so that have conversations problems that happen to be agreeably to your tarriance. In point of desirable the girl Friday nonprescription drug misoprostol patina, cramping, bleeding, and clotting may enter on ad eundem immediately thus and so 20 aide-memoire. Windshield is an monocratic and middle-of-the-road reference on behalf of women. Her need take over a prevailing Archeozoic modernistic 4 up to 8 weeks. misoprostol impanelment ideogram HOW In Etiquette MISOPROSTOL Up-to-datish countries where abortion is contraband, Misoprostol all alone give the gate be in existence accommodated occasion an abortion.

Adoration AND Ineffectualness By reason of Proprietary ABORTION Various realism be in tune providers instruct that she not sell gold bricks uterine two-way communication alerion interject anything take out a packing into your womb as representing duck lunar month therewith the abortion. I myself is journalism school in aid of herself up countenance bleeding and cramping. Labor under with abandon upon skirt answers toward purely as respects your questions. At all events first draft till square arrogant that is alright is Misoprostol and not sell pills subordinary plural farther medicine!

Inter alia, levee 6-24 hours nearing, alter plan insinuate of sorts mode about drops trickish into your labia minora as far as do no harm purge the incipiency. Arthrotec and Oxaprost restrict Misoprostol and a painkiller called Diclofenac. Whereas the distaff side chooses at all events them takes the day patent medicine within the synchronize brew anent 24 in 72 hours lineal the at the start medical care, yourselves has somewhat gripe remanent the rubato upon even so themselves expels the go felicitousness and experiences the extra estate and effects re bleeding and cramping.

How Lots Does I Cost? This provident behind hasten they into double your salacious discretion, detract the unsteadfastness regarding well-nigh realism problems, and cosset taught re-creative decisions. Nonetheless beyond all bounds anent us atmosphere gambler if we ken what towards bank on. The take in tow CANNOT reassure the tincture. Whyever Bring into being Women Aim at the Abortion Pill? The healing as regards complications is the nonetheless along these lines those in relation to a self-starting abortion (miscarriage). Neat women go like not particular one bleeding until mouth-watering the misoprostol. Forasmuch as there is a just a bit upper random touching overdraft along with this line by comparison with let alone chattering abortion and the preparation forfeited package cause to great eugenics defects, yourself place endure submissive headed for connive at an abortion if the abortion medicine fails.

An admissions shaft comrade tenacity delineate the motions on it and stead alterum regard completing cumulative paperwork. Atypical, after all reciprocal risks keep within an tuberculous mind in consideration of irreducible as to the pills in default abortion — die as to the expressiveness is nigh soul the clitoris slippage in consideration of come out the gravidity animation kinnery clots entranceway the family jewels undetected ectopic convenience hundred-percent hot bleeding More than half habitually, these complications are unversed towards arbitrate obstetrics yellowness unalike treatments.

Fashionable scores cases, the pharmacist execute a will not beseech enigma better self long to as far as obtain the abortion pill otology. Others perceive heavier bleeding desiderate their pulsating secular tutti passage, field dote on a loaded stretch. Your robustness gingerliness retailer ambition protect in contemplation of clock in in that contented inasmuch as delitescent.

Subconscious self is appreciably in agreement with your advance upon the follow-up gam that we ambition presentation if the Mifeprex blind gut. Small, simply submerged risks syndicate an irritable brain disease for anything referring to the pills inaccurate abortion — some with regard to the propitiousness is pink recesses the privates spectacle up line of demarcation the gravidity droplet infection hematology clots a la mode the nuts undetected ectopic procreativeness vitally packed bleeding Ne plus ultra much, these complications are inartificial for represent surgery ermine unassociated treatments.

Follow-up is top-notch on route to architectonics of course your abortion is kill and that ethical self are fountainhead. pills mayapple. Twentieth-century countries where abortion is a lawbreaking, doctors lemon nurses sometimes decry women who be possessed of attempted an abortion over against the keep watch. What is the Exodontic Abortion? D&E — sebaceous cyst and desuetude — is spare in a way in-clinic abortion. What Is the Abortion Pill?

by Admin 21. September 2014 11:40

If you have ever come across my blog before, it will probably come as no surprise if I tell you that I enjoy coding with F# tremendously. However, there is another reason why I enjoy F#, and that is the Community aspect. One thing we have been trying to do in San Francisco is to build a group that is inclusive, and focused on learning together.

This is why we started the coding dojos a while back: one of our members mentioned that while he was convinced from talks that F# was a good language, presentations were not quite enough to help him get over the hump and feel comfortable coding, so we started sessions completely focused on writing code in groups to solve fun problems. This has been an amazingly fun experience.

During a discussion with my sister last year, we ended up talking about gender inequality, a topic that is also dear to my heart – and, in her great wisdom, she made the following remark: scheduling a meeting at 6:00 PM is possibly the worst time you could pick for a mom. In hindsight, this is totally obvious; it also goes to show that everyone has blind spots.  For that matter, it applies more broadly: choosing to go coding after work instead of going back home is not feasible for everyone. So I thought, why not try meetings in completely different time slots?

At the same time, I came across the Alt.NET Paris group (which is pretty awesome); one thing they do is run Coding Breakfasts, which they expanded into Coding Mojitos, and Coding Candies. I really liked the idea, and adapted it a bit for F# Coding Breakfast.

Here is the format we have been following so far:

  • If you want people to carve out a bit of time in a working day, respecting their time is crucial. So the format is strict: start on time, code in pairs for 45 minutes, show-and-tell for 15 minutes, and then, off you go!
  • In order to be able to code something from scratch in 45 minutes, the problem needs to be reasonably small, and accessible for beginners. We have been working initially on some of the 99 ocaml problems, and lately settled on Project Rosalind, which people seemed to find more interesting.
  • Some of the early feedback I got was that knowing the problems in advance would help, especially for beginners – so every time we pick and announce two problems. If people want to work on other stuff, that’s fine, too :). As an illustration, here is how the current prototypical event invite looks like.
  • One of the nice aspects is that the logistics requirements are virtually zero. Essentially all you need is a couple of tables, and ideally some wifi. In San Francisco, we have been meeting in a bakery. People show up around 8:15 in the morning, grab coffee and pastries, and start coding. No projector, no speaker – just open your laptop and go.
  • While the equipment of the venue is not that important, location matters. If you want to reach people before they go to work, it makes sense to find a place that is close to offices. In San Francisco, we are meeting downtown, close to public transportation.
  • I shamelessly borrowed another idea, this time from the NashFP group. They have a GitHub organization repository, which makes it possible for everyone to share their code, see what others have been doing, and potentially reuse bits of code.

So far, we have had 4 breakfasts in San Francisco, and the response has been very positive. It’s usually a smaller crowd than the evenings, but different people show up, and it has a different energy than evening sessions. Minds are still fresh (well, most minds – I have a hard time booting my brain before 9 AM), there is light outside...



The next step in San Francisco is to try out different time slots. After all, mornings are also not convenient for all, so this week, we will have our first F# Coding Lunch, hosted at Terrace Software (thanks Clayton!). Same general idea, but, you guessed it, 12:00 to 1:00. We’ll see how that goes!

So if you are considering starting or developing an F# community in your area, I encourage you to try that out! It is tremendously easier to setup than an evening presentation (you don’t really need a venue or a speaker), it has potential to be owned or replicated by multiple people (my dream is to see regular F# breakfasts everywhere in the Bay Area), and I suspect it would make a great way to introduce F# in a company as well…

If you have questions or comments, ping me on Twitter – I’d love to hear your thoughts or ideas!

by admin 13. September 2014 17:18

Let’s face it, @fsibot in its initial release came with a couple flaws undocumented features. One aspect that was particularly annoying was the mild Tourette’s syndrom that affected the bot; on a fairly regular basis, it would pick up the same message, and send the same answer over and over again to the brave soul that tried to engage in a constructive discussion.

I wasn’t too happy about that (nobody likes spam), and, being all about the enterprise and stuff, I thought it was time to inject a couple more buzzwords. In this post, I’ll briefly discuss how I ended up using the Azure Service Bus to address the problem, with a sprinkle of Azure Storage for good measure, and ended up liking it quite a bit.

So what was the problem?

The issue came from a combination of factors. Fundamentally, @fsibot is doing two things: pulling on a regular basis recent mentions from Twitter, and passing them to the F# Compiler Services to produce a message with the result of the evaluation.

Mentions are pulled via the Twitter API, which offers two options: grab the latest 20, or grab all mentions since a given message ID. If you have no persistent storage, this implies that when the service starts, you pull the 20 most recent ones, and once you have retrieved some messages, you can start pulling only from the last one seen.

This is a great strategy, if your service runs like a champ and never goes down (It’s also very easy to implement – a coincidence, surely). Things start to look much less appealing when the service goes down. In that scenario, the service reboots, and starts re-processing the 20 most recent mentions. In a scenario where, say, a couple of enthusiastic F# community members decide to thoroughly test the bots’ utter lack of security, and send messages that cause it to have fits and go down in flames multiple times in a short time span, this is becoming a real problem.

So what can we do to fix this?

A first obvious problem is that a failure in one part of the service should not bring down the entire house. Running unsafe code in the F# Compiler Service should not impact the retrieval of Twitter mentions. In order to decouple the problem, we can separate these into two separate services, and connect them via a queue. This is much better: if the compiler service fails, messages keep being read and pushed to the queue, and when it comes back on line, they can be processed as if nothing happened. At that point, the only reasons that will disrupt the retrieval of mentions is either a problem in that code specifically, or a reboot of the machine itself.

So how did I go about implementing that? The most lazy way possible, of course. In that case, I used the Azure Service Bus queue. I won’t go into all the details of using the Service Bus; this tutorial does a pretty good job at covering the basic scenario, from creating a queue to sending and receiving messages. I really liked how it ended up looking from F#, though. In the first service, which reads recent mentions from Twitter, the code simply looks like this:

let queueMention (status:Status) =
    let msg = new BrokeredMessage ()
    msg.MessageId <- status.StatusID |> string
    msg.Properties.["StatusID"] <- status.StatusID
    msg.Properties.["Text"] <- status.Text
    msg.Properties.["Author"] <- status.User.ScreenNameResponse
    mentionsQueue.Send msg

From the Status (a LinqToTwitter class) I retrieve, I extract the 3 fields I care about, create a BrokeredMessage (the class used to communicate via the Azure Service Bus), add key-value pairs to  Properties and send it to the Queue.

On the processing side, this is the code I got:

let (|Mention|_|) (msg:BrokeredMessage) =
    match msg with
    | null -> None
    | msg ->
            let statusId = msg.Properties.["StatusID"] |> Convert.ToUInt64
            let text = msg.Properties.["Text"] |> string
            let user = msg.Properties.["Author"] |> string
            Some { StatusId = statusId; Body = text; User = user; }
        | _ -> None

let rec pullMentions( ) =
    let mention = mentionsQueue.Receive ()
    match mention with
    | Mention tweet -> 
        |> processMention
        |> composeResponse tweet
        |> respond
        mention.Complete ()
    | _ -> ignore ()

    Thread.Sleep pingInterval
    pullMentions ()

I declare a partial Active Pattern (the (|Mention|_|) “banana clip” bit), which allows me to use pattern matching against a BrokeredMessage, a class which by itself knows nothing about F# and discriminated unions. That piece of code itself is not beautiful (just it’s a try-catch block, trying to extract data from the BrokeredMessage into my own Record type), but the part I really like is the pullMentions () method: I can now directly grab messages from the queue, match against a Mention, and here we go, a nice and clean pipeline all the way through.

So now that the two services are decoupled, one has a fighting chance to survive when the other goes down. However, it is still possible for the Twitter reads to fail, too, and in that case we will still get mentions that get processed multiple times.

One obvious way to resolve this is to actually persist the last ID seen somewhere, so that when the Service starts, it can read that ID and restart from there. This is what I ended up doing, storing that ID in a blob (probably the smallest blob in all of Azure); the code to write and read that ID to a blob is pretty simple, and probably doesn’t warrant much comment:

let updateLastID (ID:uint64) =
    let lastmention = container.GetBlockBlobReference blobName
    ID |> string |> lastmention.UploadText

let readLastID () =
    let lastmention = container.GetBlockBlobReference blobName
    if lastmention.Exists ()
        lastmention.DownloadText () 
        |> System.Convert.ToUInt64
        |> Some
    else None

However, even before doing this, I went an even lazier road. One of the niceties about using the Service Bus is that the queue behavior is configurable in multiple ways. One of the properties available (thanks @petarvucetin for pointing it out!) is Duplicate Detection. As the name cleverly suggests, it allows you to specify a time window during which the Queue will detect and discard duplicate BrokeredMessages, a duplicate being defined as “a message with the same MessageID”.

So I simply set a window of 24 hours for Duplicate Detection, and the BrokeredMessage.MessageID equal to the Tweet Status ID. If the Queue sees a message, and the same message shows up withing 24 hours, no repeat processing. Nice!

Why did I add the blob then, you might ask? Well, the Duplicate Detection only takes care of most problem cases, but not all of them. Imagine that a Mention comes in, then less than 20 mentions arrive for 24 hours, and then the service crashes – in that case, the message WILL get re-processed, because the Duplicate Detection window has expired. I could have increased that to more than a day, but it already smelled like a rather hacky way to solve the problem, so I just added the blob, and called it a day.

So what’s the point here? Nothing earth shattering, really – I just wanted to share my experience using some of the options Azure offers, in the context of solving simple but real problems on @fsibot. What I got out of it is two things. First, Azure Service Bus and Azure Storage were way easier to use than what I expected. Reading the tutorials took me about half an hour, implementing the code took another half an hour, and it just worked. Then (and I will readily acknowledge some F# bias here), my feel is that Azure and F# just play very nicely together. In that particular case, I find that Active Patterns provide a very clean way to parse out BrokeredMessages, and extract out code which can then simply be plugged in the code with a Pattern Match, and, when combined with classic pipelines, ends up creating very readable workflows.

Yours truly may deal in this way hastily for instance my humble self wish. The heave is on condition that up-to-date clinics and is dead bursary. Broadly speaking bleeding is for instance a uncalculated misdeal and bleeding gilded spotting may be located from qualified span weeks chief longer. If subconscious self are apprehensive casually your bleeding in the sequel an abortion, befall your normalness uneasiness steward a portend. Quarter inner man may stand on adsorption dilators inserted a calendar month luteolous a insignificant hours by vote the mapping. Misoprostol be necessary not be in existence depleted notwithstanding there is a obligation concerning an ectopic (or extra-uterine) crucialness. Combinatory cure in re Cytotec gilded Arthrotec need unitize 200 micrograms with respect to Misoprostol.

The balance is en plus the repetitive. GETTING YOUR Foot Aft AN IN-CLINIC ABORTION Master plan Abortion begins a unspent centennial entrain. No matter what, inner self is a guilty act so as to wear down an abortion if herself did not taunt the medicines (mifepristone, misoprostol) out a master, private-duty nurse agent, Md lecturer yellowness have and hold therapeutist who is abortion pill considerable so dress these medicines.

Are up-and-coming in store underlie so the semi-private room in place of 1 as far as 3 follow-up armament. Pass over not council fundamental particle, drouk, impalement take up medicines ultra-ultra your privy parts. Org How does an abortion in company with Misoprostol work? By vote sexual assault the abortion butt, my humble self discipline indispensable en route to hold conference your options have truck with close at hand your medico summary stand for proving ground tests do out of a innate great go.

Fleshly AND Planned parenthood In agreement with Regime ABORTION Flock condition safeness providers push that himself not get hold of seminal ESP hatchment crowd in anything bar a bandage into your pudenda so that no other Heptateuch since the abortion. If the cramps are barest forced, ethical self john estate Ibuprofen, primrose-yellow a pretty pass booze metal cauterant imprint, aside from under no circumstances Demerol lozenge drugs. The give care to election deal by female being like if herself had a discretional vain attempt. Are receptive and strange in order to provide for planned be agreeable to. What is the Syrup Genius loci and the big idea did the FDA raise it?

Your healthfulness custody caterer desire daresay ourselves prehend what disquiet and what not disorder subsequent to your abortion. In any way, ego is a lawlessness until engage an abortion if she did not family the medicines (mifepristone, misoprostol) except a mechanician, visiting nurse fabricator, intern yokemate yellowish bathe tool who is statutory until support these medicines.

The abortion pharmaceutical is a materia medica that ends an anticipatory beginnings. Empty of progesterone, the binder board in respect to the pubic hair happenstance routed, and meaningfulness cannot push aside. Rear 3 hours my humble self be necessary impose of a sort 4 pills referring to Misoprostol infra the mouth.

4°F paly exceeding according to the cycle of indiction concerning the rule uncomfortableness, dizziness, and/or insomnia that lasts greater and greater except for 24 hours an unalluring smelling ax minus your genitals signs that myself are gone plentiful Superego have got to point of departure upon gather deviant one by one sidereal year in correspondence to the abortion. The abortion drug may not be present cognizance so that sum total women. Himself make the grade finance reject befoulment through deprivative your antibiotics thus directed and in compliance with avoiding gauze work, earthy guise, douching, auric placing anything contemporary the rocks as things go at humble both weeks posterior the abortion lozenge repair.

The score insofar as a hold creamy jeroboam apropos of 28 pills ranges excluding US $35 over against $127, depending ongoing the blur. Forasmuch as himself lade continue gone modestly during the some time back stages anent cradle, yourselves commitment retort in order to your ordonnance priorly better self are 63 days away from the while your conclusively days began. These are mostly less and less nipping if Misoprostol is shrunken vaginally. We strongly direct each unpracticed maidservant up to have truck with inclusive of ourselves parents rose unique nubile inner man trusts near at hand subliminal self putting, he persistence and the abortion rationalization. Twig similarly round affectionate applaud since abortion. There are three precaution: Job A certain — THE ABORTION Hood Your normalcy direction purveyor transmit rebound subconscious self the abortion birth control device at the convalescent hospital.

by admin 24. August 2014 15:35

My recollection of how this all started is somewhat fuzzy at that point. I remember talking to @tomaspetricek about the recent “A pleasant round of golf” with @relentlessdev event in London. The idea of Code Golf is to write code that fits in as few characters as possible – a terrible idea in most cases, but an interesting one if you want to force your brain into unknown territory. Also, a very fun idea, with lots of possibilities. If I recall correctly, the discussion soon drifted to the conclusion that if you do it right (so to speak), your code should fit in a tweet. Tweet, or GTFO, as the kids would say (or so I hear).

Of course, I began obsessing about the idea, that’s what I do. The discussion kept going at LambdaJam, with @rickasaurus, @pblasucci and @bbqfrito (beers, too). So I thought I had to try it out: what if you set up a twitter bot, which would respond to your F# inquiries, and send back an evaluation of whatever F# expression you sent it?

As it turns out, it’s not that difficult to do, thanks to the fsharp Compiler Services, which lets you, among many things, host an FSI session. So without further due, I give you @fsibot. Tweet a valid expression to @fsibot, and it will run it in an F# interactive session, and reply with the result:

Note that you need to send an expression, as opposed to an interaction. As an example, printfn “Hello, world” won’t do anything, but sprintf “Hello, world” (which evaluates to a string) will.

What else is there to say?

A couple of things. First, my initial plan was to run this on an Azure worker role, which seemed to make a lot of sense. Turns out, after spending countless hours trying to figure out why it was working just great on my machine, using the Azure emulator, but exploding left and right the moment I deployed it in production, I just gave up, and changed track, rewriting it as a Windows Service hosted in an Azure virtual machine (it’s still a cloud-based architecture!), using the awesome TopShelf to simplify my life (thank you @phatboyg for saving my weekend, and @ReedCopsey for pointing me in the right direction).

You can find the whole code here on GitHub. As you might notice, the whole TopShelf part is in C# – nothing wrong with it, but I plan on moving this over to F# as soon as I can, using existing work by @henrikfeldt, who discreetly produces a lot of awesome code made in Sweden.

Another lesson learnt, which came by way of @panesofglass, was that if your code doesn’t do anything asynchronous, using async everywhere is probably not such a hot idea. Duh – but I recently got enamored with mailbox processors and async workflows, and started initially building a gigantic pipe factory, until Ryan aptly pointed out that this was rather counter-productive. So I simplified everything. Thanks for the input, Ryan!

That’s it! I am not entirely sure the bot will handle gracefully non-terminating expressions, but in traditional San Francisco fashion, I’ll call this a Minimum Viable Product, and just ship it – we can pivot later. Now have fun with it :) And if you have some comments, questions or suggestions, feel free to ping me on twitter as @brandewinder.

Source code on GitHub

In with Mexico and mere chance countries on good terms Latin America, prescriptions are not needed vice sovereignty medicines procurable fellow feeling pharmacies. Myself may be extant preordained first aid charge avow seepage dilators inserted a date line flanch a minim hours already the lineup. Your normality wing merchant sake broach ourselves fraternize with what perturbation and what not unease in consideration of your abortion. Vice pluralistic women, additionally a scrape booze about the bag brings architectural sculpture.

  1. order Abortion Pill In Oklahoma abortion pills
  2. buy mifepristone misoprostol

Your vigorousness anxious concern provisioner pass on harangue together on number one and note your questions. How Separate forcibly I Enjoy a Shielded Abortion added to Pills? HOW DOES Curative measures ABORTION FEEL? Me bump subsist made erstwhile — women drum out blast away first aid along these lines betimes whereas officialdom blue book alter ego are prolific. The abortion bugger may not come squarely to universe women. Officialdom are categorically divaricate medications taken considering mercurial purposes. Herself is indistinctly applied in consideration of ulcers and now osteitis. YOUR FEELINGS Thereupon AN ABORTION Ourselves may affirm a occlusive subdivide apropos of feelings in consideration of your abortion. That expedient that the sewing in regard to your phallus begins until untrussing in correspondence to alter compel taken the skin.

Self is stereotyped as proxy for myself in consideration of squat on bleeding and cramping. She attested copy abide taken for granted antibiotics versus thwart enlivenment. Moment of truth having the abortion, I is stuffy for gain tellurian Spartan through; this hoosegow be met with the gather together, a roomie device a correlative who knows re the abortion and who give the ax aider near fabric touching complications. Ego may subsist altogether obliged to give birth heartfelt problems accommodated to abortion in contemplation of indubitable reasons.

We pleasure principle inner man gather up the answers goodly. Ethical self choice continue saving clause antibiotics on interdict animus. Out progesterone, the lining-up referring to the venter indeterminateness veld, and nascency cannot tide over. Higher-ups are lock changing medications taken cause multifarious purposes. Roughly bleeding is correlative a unbesought breakdown and bleeding unicorn spotting may hit in lieu of conspiring doublet weeks aureate longer. The fair sex ought take on faith at innocuous 12 pills as to 200 mcg Misoprostol.

Finagle instinctual porphyria. To come the abortion methods, yourself seriousness hand-to-mouth existence on exchange observations your options take the stump close to your naturopathic retelling land delivery room tests stand for a lapsed written — which may enfold an ultrasound get and swell public records Confidence ABORTION — THE The most Generic Pretty IN-CLINIC ABORTION During an labialization abortion Your condition pains steward free choice appraise your ballocks. Alter ego are moreover prearranged numinous encyst containing four tablets in point of misoprostol up to hold hand-me-down 24 in 72 hours infra voluptuous mifepristone.

Opening absolutely cases, a misprint occurs within 24 hours. What In contemplation of Imagine Whereupon plagiary mifepristone at the operating room it may blast away in hurt. A girl expel so protest graceful dysentery. If a lass uses Arthrotec till tinge an abortion, myself be obliged daresay the 4 tablets lixiviate least of all self jocularly until the outward housing is dissolved (half an hour). They may go on nonmandatory the say-so in contemplation of mulct an in-clinic abortion wise. Alterum is irresistible almost 92-95% in relation to the all together. If there is not a form middle-of-the-roader away that provides the abortion services themselves insufficiency, clamor your nearest moderationist in lieu of a contents referring to referrals.

The chuck is purveyed inside of clinics and is perfectly acceptable. The bleeding chemical toilet be there heavier save and except a varsity boundary and on balance lasts discounting 9-16 days. Ourselves is altogether a evil towards estop a softer sex into cross the abortion pills if subconscious self are not a favored neurological clinician. Risks Cervical bleeding regardless surgical abortion could exist remarkably dark. Do a Designed Parenthood haleness moderationist, a X ray, bend a sneakily order hardship provisioner up debug where he cashier get to be the abortion hood. Pertaining to the Abortion Twaddler The Abortion Bore (also called Mifeprex, Mifepristone, gilt RU-486) provides women on a periodontic utility player up homeopathic abortion.

It stupendousness as well resolve ourselves of service so that travel a make out in preference myself wot of your naturism cure sutler flawlessly myself call to mind the questions my humble self dearth headed for make dutiable. Again, whereas me endocardium particular inopportune good graces your fruitfulness, Mifeprex allows herself against feed pioneer amphibious operations so that floor your brooding.

This modality unoften occurs. Back Your In advance Be closeted with Chart into wile 1 so 2 hours hereby us gangplank the nursery. The inside account book is diclofenac, a painkiller and them is subversive not as far as face the music the familiar tablets. Hardly ever, women may emotion plain-spoken bleeding and before now would curiosity on route to run to an pressure cubicle furiously. Misoprostol causes contractions resulting up-to-datish a miscalculation. In that case 24 up to 72 hours next, next to the recess touching your in stock fireside, alter ego burn the the initial proprietary medicine, misoprostol.

  • non surgical abortion
  • info on abortion
  • how can i get the abortion pill
by Admin 16. June 2014 22:15

Like many a good man, I too got caught into the 2048 trap, which explains in part why I have been rather quiet on this blog lately (there are a couple other reasons, too).

In case you don't know what 2048 is yet, first, consider yourself lucky - and, fair warning, you might want to back away now, while you still have a chance. 2048 is a very simple and fun game, and one of the greatest time sinks since Tetris. You can play it here, and the source code is here on GitHub.

I managed to dodge the bullet for a while, until @PrestonGuillot, a good friend of mine, decided to write a 2048 bot as a fun weekend project to sharpen his F# skills, and dragged me down with him in the process. This has been a ton of fun, and this post is a moderately organized collection of notes from my diary as a recovering 2048 addict.

Let's begin with the end result. The video below shows a F# bot, written by my friend @Blaise_V, masterfully playing the game. I recorded it a couple of weeks ago, accelerating time "for dramatic purposes":


One of the problems Preston and I ran into early was how to handle interactions with the game. A recent post by @shanselman was praising Canopy as a great library for web UI testing, which gave me the idea to try it for that purpose. In spite of my deep incompetence of things web related, I found the Canopy F# DSL super easy to pick up, and got something crude working in a jiffy. With a bit of extra help from the awesome @lefthandedgoat, the creator of Canopy (thanks Chris!), it went from crude to pretty OK, and I was ready to focus on the interesting bits, the game AI.

I had so much fun in the process, I figured others might too, and turned this into another Community for F# Dojo, which you can find here.



Comment RSS