<commit_before># Lesson 2.1: Using HOCON Configuration to Configure Akka.NET
We're going to be spending most of our time in Unit 2 working with the `ChartingActor`, an actor that is responsible for actually plotting all the data on this chart:

![Pretty output](../lesson5/images/syncharting-complete-output.gif)
> NOTE: If you're following along using the eBook / .ePub, you won't see the animation. [Click here to see it](https://github.com/petabridge/akka-bootcamp/blob/master/src/Unit-2/lesson5/images/syncharting-complete-output.gif).

BUT, if you try to build and run `SystemCharting.sln` right now (in the [/DoThis/ folder](../DoThis/)) for Unit 2 right away, you'll see the following output:

![No output?](images/dothis-failed-run.png)

Well, that's not very exciting. Aren't we supposed to be building a real-time data visualization application in Unit 2? What gives?

Oh wait, there's an exception in the **Debug** window. What does it say?

> [ERROR][2/24/2015 11-48-34 AM][Thread 0010][akka://ChartActors/user/charting] Cross-thread operation not valid: Control 'sysChart' accessed from a thread other than the thread it was created on.
Cause: System.InvalidOperationException: Cross-thread operation not valid: Control 'sysChart' accessed from a thread other than the thread it was created on.

### What's wrong here?
None of the events we want to chart are getting graphed. Hmm... sounds like our events aren't getting to the UI thread. We need to find some way to dispatch and synchronize events with the UI thread so that our chart is updated!

Does this mean we have to rewrite `ChartingActor` with some evil code to manually synchronize with the UI thread?

Nope! We can relax.

**We can solve this problem using [HOCON configuration in Akka.NET](https://getakka.net/articles/concepts/configuration.html#what-is-hocon) without updating any of the code that defines `ChartingActor`.**
<commit_msg>Update README.md (#326)<commit_after># Lesson 2.1: Using HOCON Configuration to Configure Akka.NET
We're going to be spending most of our time in Unit 2 working with the `ChartingActor`, an actor that is responsible for actually plotting all the data on this chart:

![Pretty output](../lesson5/images/syncharting-complete-output.gif)
> NOTE: If you're following along using the eBook / .ePub, you won't see the animation. [Click here to see it](https://github.com/petabridge/akka-bootcamp/blob/master/src/Unit-2/lesson5/images/syncharting-complete-output.gif).

BUT, if you try to build and run `SystemCharting.sln` right now (in the [/DoThis/ folder](../DoThis/)) for Unit 2 right away, you'll see the following output:

![No output?](images/dothis-failed-run.png)

Well, that's not very exciting. Aren't we supposed to be building a real-time data visualization application in Unit 2? What gives?

Oh wait, there's an exception in the **Debug** window. What does it say?

> [ERROR][2/24/2015 11-48-34 AM][Thread 0010][akka://ChartActors/user/charting] Cross-thread operation not valid: Control 'sysChart' accessed from a thread other than the thread it was created on.
Cause: System.InvalidOperationException: Cross-thread operation not valid: Control 'sysChart' accessed from a thread other than the thread it was created on.

### What's wrong here?
None of the events we want to chart are getting graphed. Hmm... sounds like our events aren't getting to the UI thread. We need to find some way to dispatch and synchronize events with the UI thread so that our chart is updated!

Does this mean we have to rewrite `ChartingActor` with some evil code to manually synchronize with the UI thread?

Nope! We can relax.

**We can solve this problem using [HOCON configuration in Akka.NET](https://getakka.net/articles/configuration/config.html) without updating any of the code that defines `ChartingActor`.**

{'fraction_non_alphanumeric': 0.08969665271966527, 'fraction_numerical': 0.013859832635983263, 'mean_word_length': 4.608504398826979, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6247386', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1056, 'n_words': 504}