quick import from wordpress
This commit is contained in:
parent
291998d462
commit
63f9168258
24
_posts/2017-03-01-hello-world.md
Normal file
24
_posts/2017-03-01-hello-world.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
ID: 24
|
||||
post_title: Hello, world!
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/01/hello-world/
|
||||
published: true
|
||||
post_date: 2017-03-01 09:05:29
|
||||
---
|
||||
I decided to participate in <a href="http://dajsiepoznac.pl/" target="_blank">GetNoticed</a>. Short story even shorter, it's about writing OpenSource code and blog about it (and IT).
|
||||
|
||||
I chose to make a port of old game - The Settlers II in Elixir. Being more specific I will focus only (or mainly) on backend. Why?
|
||||
<ul>
|
||||
<li>I've never made any "serious" app in Elixir/Erlang/F# any other functional language - this seems like a good opportunity</li>
|
||||
<li>I feel like this is the good way of learning Elixir itself</li>
|
||||
<li>Creating backend only will force me to solve some challenging design problems</li>
|
||||
<li>UI will be easily changeable, so anyone can make their own version of game. Imagine The Settlers 2 in space, or Stone Age!</li>
|
||||
<li>I feel like there's not enough "nice" code in the GameDev world. One project won't make a difference, but won't hurt as well</li>
|
||||
<li>It's a scary challenge</li>
|
||||
<li>I love this game</li>
|
||||
</ul>
|
||||
I will deep dive into details with next posts. Also, expect at least one commit per week! Here's <a href="https://github.com/Dreat/OpenSettlersII">repository </a>for the project on GitHub for you to follow.
|
||||
32
_posts/2017-03-08-opensettlersii-0.md
Normal file
32
_posts/2017-03-08-opensettlersii-0.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
ID: 41
|
||||
post_title: 'OpenSettlersII #0'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/08/opensettlersii-0/
|
||||
published: true
|
||||
post_date: 2017-03-08 07:00:08
|
||||
---
|
||||
<strong>This is the first post in series about OpenSettlersII aka GetNoticed! project.</strong>
|
||||
|
||||
<em>I will always link commit(s) and describe what's happening.</em>
|
||||
|
||||
First I'll talk a bit about Elixir itself and why I picked it up from all available functional languages.
|
||||
|
||||
It all started over 30 years ago with the creation of Erlang. It's a functional language which main purpose was telecoms. In this world high availability, scalability and all of this good stuff was needed. While I was talking with a friend, who worked with switches back in the day, he told me that "nine nines*" was the thing everybody talked about. And in optimistic scenario, Erlang delivered that. How? "Let it crash". You fire up many processes (elrang's, not OS') and in a case of failure - you let process fail, die and restart. All without system even noticing it. There are processes which main job is to supervise others (hence the name "supervisor"). Should any process fail, supervisors will restart it, possibly providing some data. Worth noting that you can do all sorts of app in Erlang, not only telecom related ones.
|
||||
|
||||
After Erlang came OTP. Long story short it's a framework that helps building applications with all the goodness described.
|
||||
|
||||
And then comes Elixir. Known Rubyist, Jose Valim, found that Ruby doesn't satisfy his needs anymore. Around same time he came across Erlang and OTP. That resulted in language with nicer syntax than Erlang, really friendly and open community with some additional features/sugars. What's really worth mentioning is the fact that Elixir itself is mostly written in Elixir, as it has elastic and pleasant metaprogramming.
|
||||
|
||||
<strong>Now back to OpenSettlersII</strong>
|
||||
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/019b2f9e48ee35340a177cadd732bab477d189e6"><span lang="pl">First Commit.</span></a>
|
||||
|
||||
This is just a simple project initialization, but it shows the tools Elixir is shipped with. Mix handles creating projects, handling deps, running tests, compiling etc. I just created new, empty, configurable project (please, take a while to look at already existing place to write tests! <3).
|
||||
|
||||
Next commits will be more interesting, I promise.
|
||||
|
||||
<em>*we're talking about 99.9999999% availability/uptime here</em>
|
||||
36
_posts/2017-03-12-chicago-vs-london-tdd.md
Normal file
36
_posts/2017-03-12-chicago-vs-london-tdd.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
ID: 50
|
||||
post_title: Chicago vs London TDD
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/12/chicago-vs-london-tdd/
|
||||
published: true
|
||||
post_date: 2017-03-12 22:04:29
|
||||
---
|
||||
Somewhere near my very beggining of my software engineering journey, as a fresh Junior, I happened to talk with a collegue of mine. I remember him saying:
|
||||
<p style="text-align: center;">So, when someone says [during the interview]
|
||||
<em> -I know TDD!</em>
|
||||
I ask:
|
||||
<em> -So tell me the difference between Chicago and London style.</em></p>
|
||||
This happened to be The Great Filter, as many people didn't know that. Luckily this wasn't my interview as I didn't know either. So, naturally, I did some googling.
|
||||
|
||||
It turns out, that it's not rocket science at all.
|
||||
Let's say we're testing the metods talking with DB (using some injectable context, of course)
|
||||
Chicago style focuses on results. So here you check, if result that you get back is the same as expected.
|
||||
London style focuses on behavior. So here you mock the context and then validate if methods you need to call were called defined number of times.
|
||||
<blockquote>Chicago style focuses on <strong>results</strong>. London style focuses on <strong>behavior</strong>.</blockquote>
|
||||
So, it's easy, right? Also - you can also mock in Chicago style, and by getting the results you want test behavior, right? And why is it that important?
|
||||
|
||||
I'll start with second question. If you start mocking around and check for results, your setup/arrange parts tend to grow and be more and more complicated. Also, if you want to test results, you have to provide some sensible data. This makes testing more cumbersome than needed and results in greater reluctancy in writing them. In my opinion those kind of tests work best with integration/end-to-end tests and also with unit testing, were you have no "complex" (or maybe any?) side effects. Pure functions are great example - for same input, always same output, without any side effects. It's very easy to write those tests and arrange part will be small, if almost not existent.
|
||||
|
||||
When you verify behavior, you don't care about carefully setting up mock, populating data, thinking about complex relations. You just want to know that system behaves in a way yout want it to behave. Databases, messaging systems, IO operations etc are fine places. You have other kinds of tests to check if your system is working correctly with those alive elements. Here you want to check if you handle them correctly.
|
||||
|
||||
It's easy, yeah. Don't seem that important. But it's really easy to forget London style and check for result everywhere. Writing tests starts to be painful, they take more time and, out of nowhere, you're dug under pile of complexity.
|
||||
"But I did unit testing, why is this happening?!"
|
||||
Because maybe there's more to writing tests than just Assert.AreEqual(expected, actual) ;)
|
||||
|
||||
|
||||
|
||||
PS: Both ways are equally important and have their own purpose. Don't just focus only on one and you should be fine.
|
||||
32
_posts/2017-03-17-introduction-to-integration.md
Normal file
32
_posts/2017-03-17-introduction-to-integration.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
ID: 58
|
||||
post_title: Introduction to integration
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/17/introduction-to-integration/
|
||||
published: true
|
||||
post_date: 2017-03-17 07:00:26
|
||||
---
|
||||
I started to get more into integration and integration patterns. There are few reasons:
|
||||
<ul>
|
||||
<li>Open Settlers II will be created with integration with possible UI integration in mind</li>
|
||||
<li>It will be helpful in my daily job</li>
|
||||
<li>I feel that it's an important topic in software engineering</li>
|
||||
</ul>
|
||||
Having this set up, let's briefly talk about some integration methods.
|
||||
<h4>File transfer</h4>
|
||||
We want two (or more) applications to exchange data. We can use simplest solution - write it to file for others to read. (Almost?) every language non-esoteric lanuage has some file read/write function built in. It is also easy to do no matter what environment you're working with. Coupling is not so tight as application devs can (should?) agree on common file format(s) to work with. Changes in code won't change the communication as long as output file is the same. With json it's easier than ever. Even with third party apps it's still trivial to consume messages from software we don't have influence on.
|
||||
|
||||
There are also some downsides, too. There is a lot of work with deciding on file structure, file processing. Not too mention storage place, naming conventions, delivering file (if one app doesn't have rights to output location of other), times of reading/writing (and what will happen if one reads while the other writes). But it all is nothing compared to one big problem. Changes propagate slowly (one system can produce file overnight, after "collection" of other). Desynchronization is common and it's easy for corrupted data be spread before any validation (if it's even possible).
|
||||
<h4>Shared database</h4>
|
||||
Shared database is a remedy for the synchronization problem. All data is in one central database, so information propagates instantly. Databases also have transaction mechanism to prevent some reading/writing-while-writing errors. You also don't need to worry about different file formats.
|
||||
|
||||
But it also comes with a price. It's difficult to design a shared database. Usually tables are designed to fit different applications and are a pain to work with. Worse if we're talking enterprise level solutions and some critial app - its needs will be put higher, making work for others harder. After creating database design there's a tendency to leave it as it is - changes can be hard to follow. Another problem is third-party software. It will usually work with its own design and it may change with newer verions. Database itself can become a perfomance bottleneck
|
||||
<h4>Remote Procedure Invocation</h4>
|
||||
Sometimes sharing data is not enough, because data changes may require actions in different applications. Think changing address at goverment service - there are a lot of adustments and documents to be generated. Apps maintain integrity of data it owns. It also can modify it without affecting other appliactions. Multiple interfaces to CRUD data can be created (e.g. few methods to update data, depending on caller), which can prevent semantic dissonance and enforces encapsulation.
|
||||
|
||||
It may loosen the coupling, but it's still quite tight. In particular doing things in particular order can lead to muddy mess. While developers know how to write procedures (it's what we do all the time, right?) and it may seem like a good thing it's actually not so good. It's easy to forget that we're not calling local procedure and that it will take more time or can fail due to multiple reasons. Due to this thinking also quite tight coupling arises (as stated before).
|
||||
|
||||
As always, there's always a tradeoff. But do we have the best approach here? Or can we do even better? I'll address these questions in <a href="http://dreat.info/2017/03/26/integration-series-messaging/">the next post in series</a>.
|
||||
39
_posts/2017-03-23-opensettlersii-1.md
Normal file
39
_posts/2017-03-23-opensettlersii-1.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
ID: 64
|
||||
post_title: 'OpenSettlersII #1'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/23/opensettlersii-1/
|
||||
published: true
|
||||
post_date: 2017-03-23 07:00:25
|
||||
---
|
||||
Hello and welcome for a short update!
|
||||
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/362fb27af3fe41da3f0d3da5c09eef184f256b56">Here's a commit to look at!</a>
|
||||
|
||||
There's not much and it's not very nice code. But it's something, right?
|
||||
|
||||
I decided to postpone Settlers II itself as I need transport layer. I decided ZMTP is the best one for me (why is the topic on the other blogpost incoming!) so I started doing something basic with it. According to ZMTP 3.1 specs first octet (8 bits) follows this convention:
|
||||
<ul>
|
||||
<li>bits 7-3 are reserved for future use and are 0</li>
|
||||
<li>bit 2 indicates if frame is message (0) or command (1)</li>
|
||||
<li>bit 1 indicates if frame is long(1) or short(0)</li>
|
||||
<li>bit 0 indicates if there are more frames (1) after this one or not (0). For command it's always 0.</li>
|
||||
</ul>
|
||||
Now for some clarification. "Bit 0" means "right-most bit". Short message has body of 0 to 255 octets. Long message has body of 0 to 2^63 - 1 octets.
|
||||
|
||||
Next we have size field - it's one or eight octets, depending on LONG flag. What's important that size doesn't include flags and itself - so empty frame has a size of 0 even if it has flags and size set.
|
||||
|
||||
Lastly we get SIZE octets of body.
|
||||
|
||||
In the commit we have simple encode/decode for frame with SIZE = 1, LONG = false. There's a difference between Command and Message.
|
||||
|
||||
I am sure that "reserved" is redundant and code itself is not something clean and nice. But it's a little start that I will continue working on and either refactor or throw it away.
|
||||
|
||||
Bytes are represented in Elixir as <<values>>. It's quite useful to get working, but we can get better than I got here.
|
||||
|
||||
As for functional language specific stuff, please take a look at multiple definitions of private method decode_flags. It's the pattern matching on functions (yup, can do it better here) - elixir will look for matching function and will call it. It's simple and quite powerful feature.
|
||||
|
||||
In the next commit(s) and post I will make those encode/decode functions more general to be able to work on all sized frames. And hopefully more ;)
|
||||
22
_posts/2017-03-26-integration-series-messaging.md
Normal file
22
_posts/2017-03-26-integration-series-messaging.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
ID: 68
|
||||
post_title: 'Integration series: Messaging'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/26/integration-series-messaging/
|
||||
published: true
|
||||
post_date: 2017-03-26 20:50:50
|
||||
---
|
||||
<a href="http://dreat.info/2017/03/17/introduction-to-integration/">Last time</a> we spoke about some integration methods we can use.
|
||||
|
||||
As we see, there are methods that are not so tight coupled, being able to generate lots of little data packages (like file transfer), easily synchronizable (like shared database), details of storage's structure hidden from applications (unlike shared database) and being able to send data to invoke behavior in other app (like RPI) but with being resistant to failure (unlike RPI).
|
||||
|
||||
And here messaging comes to play. The rules are simple: you create message, send it to message channel and someone waiting for this kind of message will get it. While it has some problems on it's own, it is reliable, fequent, fast and asynchronous and.
|
||||
<ol>
|
||||
<li>Being asynchronous means you won't block process while waiting for the result/answer. Calling app can continue with it's work.</li>
|
||||
<li>Decoupling. Messages will be sent to message channel without knowing almost anything about receiver. The common interface are the types of messages sent, not the bidings between apps. It also allows separation integration developement from application developement.</li>
|
||||
<li>Frequent, small messages allow applications to behave almost immediatly by sending more messages.</li>
|
||||
</ol>
|
||||
And many more we'll explore in the series. Why I will write a series on it? The main disadvantage of messaging is the learning curve. While other methods are fairly easy to use, messaging and async thinking is not something we're used to. But once learned this concepts will help you not only when integrating lots of enormous applications. You can also apply it to "integrate" classes/functions/actors in your code.
|
||||
32
_posts/2017-03-31-rabbitmq-vs-zeromq.md
Normal file
32
_posts/2017-03-31-rabbitmq-vs-zeromq.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
ID: 39
|
||||
post_title: RabbitMQ vs ZeroMQ
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/03/31/rabbitmq-vs-zeromq/
|
||||
published: true
|
||||
post_date: 2017-03-31 21:58:32
|
||||
---
|
||||
<div style="direction: ltr; border-width: 100%;">
|
||||
<div style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 6.6041in;">
|
||||
<div style="direction: ltr; margin-top: 0in; margin-left: 0in; width: 6.6041in;">
|
||||
|
||||
As for OpenSettlersII I want to present an interface to be able to implement for any possible GUI. And as I don't want to tie anyone with Elixir/Erlang I decided to go with messages. I looked throu the net and my own experience, and there are two picks that I though I could use
|
||||
<h1>RabbitMQ</h1>
|
||||
RabbitMQ is a Your Typical Message Queue. There's a message broker that handles messaging and whatnot. It's written in Erlang, which is huge advantage, as I could use it directly from Elixir (you can call any Erlang function from Elixir with no obstacles). Not only that -there's an official support for Elixir itself. I also used it in my previous work, as a client. It was trivial, as should be using it in OSII.
|
||||
|
||||
Or is it? My aim is to be able, after getting interface for GUI, to get started as quick as possible. With RabbitMQ, when you get to the server part, not only you have to install additional software, it can get ugly quickly. As for commercial products it's not a problem, as there's company with support behind it, for open source, pet project it is a problem.
|
||||
<h1>ZeroMQ</h1>
|
||||
I really need a citation here, but apparently creator of protocol for RabbitMQ decided that it's not really that good and did ZMTP (ZeroMQ Message Transport Protocol). It is brokerless message queue and some may argue that it's just simple socket. The biggest problem is message persistency - if you don't have anything to hold/save messages while other party is offline - you'll lost them. This doesn't really sound like a problem to me, as I think that there are some mechanisms in OTP that can help me here.
|
||||
|
||||
ZeroMQ is really easy to configure, I worked a bit more with it and have fond memories with it. Basic communication worked out of the box, no need for any additional installations or configurations.
|
||||
|
||||
|
||||
|
||||
I decided to go with ZeroMQ for reasons stated above, but there's one more reason. I may not google that much, but I haven't seend any ZMTP 3.0/3.1 implementations made in Elixir. There are some bindings, sure. But nothing made out of scratch. I won't lie - if I can learn even more doing this project and possibly make first 3.0/3.1 ZMTP for Elixir - I'm in!
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
26
_posts/2017-04-02-opensettlersii-2.md
Normal file
26
_posts/2017-04-02-opensettlersii-2.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
ID: 86
|
||||
post_title: 'OpenSettlersII #2'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/02/opensettlersii-2/
|
||||
published: true
|
||||
post_date: 2017-04-02 21:05:54
|
||||
---
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/086302655af2e017161bce6077eacfbf36e029bb">Here's a commit for you to look at!</a>
|
||||
|
||||
I didn't do much this week but progess is progress :)
|
||||
|
||||
I added the support for long frames. According documentation, long frame is defined by flag (Bit 1, "second one from right" must be 1). If the flag is set, size will be 8 octets, and body will be size octets. (So if size is 256, body will be 256 octets).
|
||||
|
||||
First lets look at tests. First change you can see is that I removed "reserved" from flags as it is not needed at all and obscured the data.
|
||||
Next I renamed "command" key to "type" - as it reflects better what it is - it indicated the type of frame - if it is a command or message.
|
||||
Next change (in decode) is that body is still in binary (inside << >>). I guess I will work on that later, but was needed in some changes.
|
||||
I added 2 tests to correctly decode long frames, for both command and message. What's important is :: size(64). It indicates the size of binary element. If not specified it will be default (8). What's also important (and quite logical) size have to be divisible by 8.
|
||||
|
||||
Now onward to code itself. There's only one public decode function, but it calls one of the private ones depending of the flag. There's a pattern matching on <em>long </em>key, and binary data. As you can see here I used <em>::size </em>accordingly.
|
||||
What's worth noting is if you want to match against <em>unknown sized</em> binary data you can use ::binary. Here I used it for body and for "rest" in main function - as before getting flags I don't care about size and body.
|
||||
|
||||
And that's it! Not a lot, but I learnt a bit when it comes to working with binary data in Elixir and made code a bit "better".
|
||||
20
_posts/2017-04-06-opensettlersii-3.md
Normal file
20
_posts/2017-04-06-opensettlersii-3.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
ID: 95
|
||||
post_title: 'OpenSettlersII #3'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/06/opensettlersii-3/
|
||||
published: true
|
||||
post_date: 2017-04-06 07:00:19
|
||||
---
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/1d645945893f63fe8e6c0f29ef9f35c6e645130e">As always, commit to look at!</a>
|
||||
|
||||
Today even smaller changes as I had little to no time, but at least moving slowly forward.
|
||||
|
||||
I added encoding of long frames. I did the same thing as in decoding, pattern match on flags and then construct proper binary data.
|
||||
|
||||
In tests file I added 2 tests for long frames and changed body: property in input to be binary as well. I think it's starting to be a good time to introduce some struct for my frames, but I will worry about this later. I'm also not happy with return values - they should be more "elixiry", so next step will be worrying about this (with some explanation what does it mean).
|
||||
|
||||
As I dislike post trailers - <a href="http://www.erlang-factory.com/rome2017#home">I'm going to Erlang Factory Lite</a> tomorrow. I will try to write down as much as possible and make a interesting review next week, so stay tuned!
|
||||
19
_posts/2017-04-08-today-i-learned-0.md
Normal file
19
_posts/2017-04-08-today-i-learned-0.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
ID: 90
|
||||
post_title: 'Today I Learned #0'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/08/today-i-learned-0/
|
||||
published: true
|
||||
post_date: 2017-04-08 07:00:54
|
||||
---
|
||||
<p style="text-align: center;"><em>This is Today I Learned - some nice things I learned, too short to be valid blog post, but too important/interesting/etc to not be written down</em></p>
|
||||
While exposing classes to WCF service, you have to use <em>[DataContract]</em> (for class) and <em>[DataMember]</em> (for properties) attributes. Or do you?
|
||||
|
||||
Turns out that around 3.5 you don't have to do it. If you provide class with no attributes it will work out of the box! Where's the catch? There are two:
|
||||
<ol>
|
||||
<li>You will lose some of features, like naming, being able to serialize private properties, declaring something as required. While some can be more useful than others in specific scenarios - just ask yourself - should you really send private data? ;)</li>
|
||||
<li><strong>And this is important!</strong> If you dare to use <em>[DataMember]</em> on <em>some</em> properties - only those will be serialized.</li>
|
||||
</ol>
|
||||
51
_posts/2017-04-17-erlang-factory-lite-rome-2017-0.md
Normal file
51
_posts/2017-04-17-erlang-factory-lite-rome-2017-0.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
ID: 100
|
||||
post_title: 'Erlang Factory Lite Rome 2017 #0'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/17/erlang-factory-lite-rome-2017-0/
|
||||
published: true
|
||||
post_date: 2017-04-17 14:12:07
|
||||
---
|
||||
Week ago I went to Rome to take part in Erlang Factory Lite, and, as promised, here is blogpost about it (the first part)
|
||||
|
||||
Starting with venue - it was near the centre of the city, easy to get with decent views. While inside was quite small (not a lot of people were there as well), the outside...
|
||||
|
||||
[caption id="attachment_101" align="aligncenter" width="300"]<a href="http://dreat.info/wp-content/uploads/2017/04/IMG_1895-e1492431408760.jpg"><img class="wp-image-101 size-medium" src="http://dreat.info/wp-content/uploads/2017/04/IMG_1895-e1492431408760-300x225.jpg" alt="" width="300" height="225" /></a> What a place to take a break![/caption]
|
||||
|
||||
|
||||
|
||||
Sadly, there were no recordings, but from what I saw speakers had the same talks as in some future (and maybe past?) events, so not all is lost.
|
||||
<h3 style="text-align: center;">Pilgrim's Progress to the Promised Land <em>by Robert Virding</em></h3>
|
||||
Opening talk by Erlang co-creator. It was a nice opening, showing learning Elixir as a pilgrimage. And it's quite good analogy. You begin your journey influenced by some prophets. It's important to validate their words - to decide if Elixir is the right tool for your job. Also the way of learning it is a bit like arriving to different interesting places.
|
||||
|
||||
Because of it's similarity to Ruby you quickly arrive to "Village of Confusion" as things don't seem to work they should. It's not an OO language (Joe had different opinion here ;) <em>Erlang is the only OO language</em> ).
|
||||
|
||||
Robert told us that people doing Erlang/Elixir are not scared of crashing things. And there are 3 ways of crashing things:
|
||||
<ol>
|
||||
<li>Just crash</li>
|
||||
<li>Crash and clean - for example process holding database connection won't close it if it dies</li>
|
||||
<li>Crash and restart - if process is critical to the system</li>
|
||||
</ol>
|
||||
Because of all this talking about crashing, you do a lot of upfront error handling - so you have it localized and easy.
|
||||
<blockquote>"You have to accept that things go wrong it you want to build fault-tolerant systems" - Robert</blockquote>
|
||||
<h3 style="text-align: center;">Stepping into a new era: injecting Elixir in a Ruby app <em>by <span class="modal_speaker_name">Andrea Leopardi</span></em></h3>
|
||||
This was the talk about replacing some parts of the existing Ruby + Python system with Elixir (and adding new ones with Elixir). This was quite full of examples (like issues going down significantly and performance going up), but I think that the most important thing is:
|
||||
<blockquote>Prepare your system: Split it into services first, or at least one monolith service and one small (it's a good start).</blockquote>
|
||||
<h3 class="talk-title" style="text-align: center;">It's the Type Theory Baby! <em>by <span class="modal_speaker_name">Michele Finelli</span></em></h3>
|
||||
This was talk full with nice theory. Michele defined a <em>formula </em>something that is always true or false. If you depend on external (I/O, DB, etc) logical formulas are no longer <em>eternal</em> - so this describes functional programming.
|
||||
|
||||
Nice thingies:
|
||||
<ol>
|
||||
<li><a href="http://homepages.inf.ed.ac.uk/wadler/papers/propositions-as-types/propositions-as-types.pdf" target="_blank">One thing to remember? Read this paper</a></li>
|
||||
<li><a href="https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence">Basically wiki article around this talk</a></li>
|
||||
<li>Duck typing? No! It's untyped and it's fine!</li>
|
||||
</ol>
|
||||
<h3 style="text-align: center;">Cook your distributed in memory KV store <em>by Gianluca Padovani</em></h3>
|
||||
Basically a explanation how <a href="https://github.com/basho/riak_core">Riak Core</a> works with concrete idea to implement. It was with some demos how to make a distributed KV store. And it worked like charm ;) I guess reading throu the code of this masterless cluster (nice idea btw) will be better than me describing it, but there one important quote
|
||||
<blockquote>
|
||||
<p style="text-align: center;"><strong>Always</strong> timeout!</p>
|
||||
</blockquote>
|
||||
<p style="text-align: left;">I've covered 5 out of 9 talks, so there's still material for next part, stay tuned!</p>
|
||||
18
_posts/2017-04-23-opensettlers4.md
Normal file
18
_posts/2017-04-23-opensettlers4.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
ID: 110
|
||||
post_title: 'OpenSettlers#4'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/23/opensettlers4/
|
||||
published: true
|
||||
post_date: 2017-04-23 21:35:21
|
||||
---
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/41929f3570c3c4450d5ffef3a5d824d103b8f606">As always - commit!</a>
|
||||
|
||||
I really need to spend more time. Today I struggled a lot with bitstrings. And still didn't find an answer for what I was looking for, but I created a map for command without redundant info. So no more flags, only command name, data and size.
|
||||
|
||||
After push thou I saw a better solution - I could do pattern match on functions, so I could eliminate switch. I get a lot of mess with all those maps. I think that rethinking/refactoring it should happen sooner than I initially thought.
|
||||
|
||||
Also "size" field seems a bit off. Additionally I don't feel as comfortable enough with specification as I was expecting, so I guess I'll spend some more time with it - this should also get me up to speed.
|
||||
66
_posts/2017-04-30-erlang-factory-lite-rome-2017-1.md
Normal file
66
_posts/2017-04-30-erlang-factory-lite-rome-2017-1.md
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
ID: 113
|
||||
post_title: 'Erlang Factory Lite Rome 2017 #1'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/30/erlang-factory-lite-rome-2017-1/
|
||||
published: true
|
||||
post_date: 2017-04-30 22:36:46
|
||||
---
|
||||
Hello for the second (and last) part of EFL Rome2017 post! You can find previous one <a href="http://dreat.info/2017/04/17/erlang-factory-lite-rome-2017-0/">here</a>
|
||||
<h3 class="talk-title" style="text-align: center;">Music and Message Passing Concurrency <em>by Joe Armstrong</em></h3>
|
||||
Here goes the big name, Joe himself. While it may suggest a lot about music, it was more about messaging and integration. Joe showed how he could remotely control <a href="http://sonic-pi.net/" target="_blank" rel="noopener noreferrer">Sonic Pi.</a> He was glad that there's an other way to control a program "than clicking a bloody mouse!".
|
||||
|
||||
He did that sending properly coded messages to UDP port. And here it all started. Joe is a big supporter of messaging based communication. API suposes a programming language, so it's not a best way - you're tied to programming language. As the main topic emerged once again - how to integrate and there are some programming languages better to do other things - so you'd naturally like to use them for specific purposes and not be stuck with one.
|
||||
|
||||
You should also treat specific parts/modules/apps like a black boxes - you know nothing (even the language used) except for how to communicate (using messages, of course ;) ) - "the protocol only matters."
|
||||
<ol>
|
||||
<li>Pick transport (TCP/UDP)</li>
|
||||
<li>Pick encoding (XML/JSON/YAML/etc)</li>
|
||||
<li>Pick protocol description (RFC/UBF/etc)</li>
|
||||
</ol>
|
||||
[caption id="attachment_102" align="aligncenter" width="300"]<a href="http://dreat.info/wp-content/uploads/2017/04/IMG_1904-e1493561399410.jpg"><img class="wp-image-102 size-medium" src="http://dreat.info/wp-content/uploads/2017/04/IMG_1904-e1493561399410-300x225.jpg" alt="" width="300" height="225" /></a> Some combinations for you to pick from[/caption]
|
||||
|
||||
[caption id="attachment_117" align="aligncenter" width="300"]<a href="http://dreat.info/wp-content/uploads/2017/04/IMG_1905-e1493586568689.jpg"><img class="size-medium wp-image-117" src="http://dreat.info/wp-content/uploads/2017/04/IMG_1905-e1493586568689-300x225.jpg" alt="" width="300" height="225" /></a> With the Joe himself![/caption]
|
||||
|
||||
Joe picked OSC over TCP/UPD with some English to describe it. OSC is a very simple encoding - and it has "simplicity by design", as Joe said, "if you can't create complex data structures, the interface will be simple and easy to understand".
|
||||
<blockquote>"if you can't create complex data structures, the interface will be simple and easy to understand"</blockquote>
|
||||
Which is another way worth remebering. Complicated systems are easy - you just keep adding stuff. Simple systems are difficult to make.
|
||||
|
||||
I think thou - if one thing should be remembered from this talk it's fact, that we should be able to understand the system by looking on the messages going in and out.
|
||||
<h3 class="talk-title" style="text-align: center;">Adopting Elixir in a 10 Year Old Codebase <em>by <span class="modal_speaker_name">Michael Klishin</span></em></h3>
|
||||
While it seems like adding Elixir to some Ruby ecosystem, it was actually using Elixir in Erlang project. They did a CLI tool in Elixir as a "check" with ~8k LOC, ~750 tests and 70 CL commands available.
|
||||
|
||||
I will just point out good:
|
||||
<ol>
|
||||
<li>It's more approachable than Erlang</li>
|
||||
<li>It's a recriutment honeypot - easier to lure people into project</li>
|
||||
<li>Has decent standard lib</li>
|
||||
<li>Potentian contributors could have not contributed if it was in Erlang</li>
|
||||
</ol>
|
||||
And bad things he learned:
|
||||
<ol>
|
||||
<li>Integration with Erlang.mk is a pain</li>
|
||||
<li>Elixir/Erlang data type mismatches</li>
|
||||
<li>String vs Binary</li>
|
||||
<li>Some Elixir libs are a one man show ( ;) )</li>
|
||||
</ol>
|
||||
Overall Michael feels like Elixir was worth adopting as sees a bright future for it - and you can utilize it even without agents, macros and sweet libs. He was even more optimistic for Elixir than for Erlang itself.
|
||||
<h3 class="talk-title" style="text-align: center;">A Little Replica of the Internet in Elixir <em>by <span class="modal_speaker_name">Ju Liu</span></em></h3>
|
||||
He describes himself as a Mad Scientist - and, boy, he is!
|
||||
|
||||
Basically it was a little trivia on the Internet and his attempt to do a small replica of it's routing system using Elixir (and nerves). He had 2 RP3s connected, simulating North America and Europe with routing links. There's a bit of how the Internet works and how it connects - he used that common knowledge to simulate it and it worked like a charm. There a code online if you want to look at it!
|
||||
|
||||
[caption id="attachment_103" align="aligncenter" width="300"]<a href="http://dreat.info/wp-content/uploads/2017/04/IMG_1912-e1492431051816.jpg"><img class="size-medium wp-image-103" src="http://dreat.info/wp-content/uploads/2017/04/IMG_1912-e1492431051816-300x225.jpg" alt="" width="300" height="225" /></a> This is the Internet! Be careful not to break it![/caption]
|
||||
|
||||
The real show started when he took the router, connected third Rasp and added Asia - it all worked! It was a nice show for the <a href="http://nerves-project.org/" target="_blank" rel="noopener noreferrer">Nerves project</a> to show what you can do with them. Funny thing - the most problems, and the slowest part was HTML+JS frontend where all the arrows where hacked as separate CSS elements - so it crashed when connection number rose. Still, great project and <a href="https://github.com/Arkham/mini_router" target="_blank" rel="noopener noreferrer">you can look at it on github!</a>
|
||||
<h3 class="talk-title" style="text-align: center;">Embrace the Database with Ecto <em>by <span class="modal_speaker_name">Josh Branchaud</span></em></h3>
|
||||
Basically it was how to use the Ecto and how to query the database. I really don't know if it was the high temperature in the room, or it was just quite obvious to me - but I cannot say that I didn't find anything at all - there was one statement that I won't say if I find true or false - because it's strengh is that it provokes some interesting conversations:
|
||||
|
||||
<em>"The database should be the ultimate gatekeeper - it should validate the data coming in"</em>
|
||||
<h3 class="talk-title" style="text-align: center;">Monitoring and Pre-emptive support: The road to five nines on the Beam <em>by <span class="modal_speaker_name">Francesco Cesarini</span></em></h3>
|
||||
It was a great talk with a lot of focusing on "no single point of failure" "we need at least 2 of everything". He showed 2 types of monitoring usefulness - you can prevent failures, or do quick post-mortems. With monitoring you can prove your innocence in 1.5 minutes - without trying to replicate the bug and trying to debug. While there's a lot to be said - he said so many cool stories I guess you have to go and give it a listen yourself - <a href="https://www.youtube.com/watch?v=EHqs_RrVMoE" target="_blank" rel="noopener noreferrer">this one seems almost identical.</a>
|
||||
|
||||
And this was it - it was a great experience and possibility to talk with those people was sometimes eye-opening.
|
||||
18
_posts/2017-04-30-opensettlers5.md
Normal file
18
_posts/2017-04-30-opensettlers5.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
ID: 115
|
||||
post_title: 'OpenSettlers#5'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/04/30/opensettlers5/
|
||||
published: true
|
||||
post_date: 2017-04-30 22:37:21
|
||||
---
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/e75c850094b394d51e60dd1712befa70e10d357f" target="_blank" rel="noopener noreferrer">As always - a commit!</a>
|
||||
|
||||
Here's a thing I struggled while doing previous commit - decoding command to something more structurized - according to docs it's composed of command name and body - all coming in one binary. I had to get the name and body (if any)
|
||||
|
||||
It seems like you have to use <em>::binary-size</em> for the first one, and just <em>::binary</em> for the rest - I may be wrong thou and I will have to research that more in the future.
|
||||
|
||||
It's slowly starting to be a mess - that's why I refactored enconding a bit to make a use of pattern matching. Not it's more "elixir style". Still I feel the lack of the bigger picture - I guess rushing into it wasn't as good idea as first though ;) I will have to do some more research and maybe a post on a protocol - it will surely help me. For example - turns out that command will never have "more" frames incoming - as you can see in changes in code - now all command have "more" set as false (with is quite redundant).
|
||||
24
_posts/2017-05-13-elixir-conf-eu.md
Normal file
24
_posts/2017-05-13-elixir-conf-eu.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
ID: 126
|
||||
post_title: Elixir Conf Eu
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/05/13/elixir-conf-eu/
|
||||
published: true
|
||||
post_date: 2017-05-13 20:00:59
|
||||
---
|
||||
Hello!
|
||||
|
||||
There was a week without updates as I went to the Barcelona to attent Elixir Conf Eu - and afterwards made a short vacation. This time I won't be as specific as I was with ErlangFactoryLite; it was way bigger conference and I didn't get to see all talks as well. Truth be told - but it's a problem with any bigger conference - overall level of talks was lower than EFL's ones - but it's inevitable. Organisation was really good, as the venue.
|
||||
|
||||
I have some stuff to share, less now, more later when I deep dive into them.
|
||||
|
||||
First, there's something called <a href="https://github.com/parroty/excheck" target="_blank" rel="noopener noreferrer">QuickCheck</a>. It's enables to do Property Testing - I'm not feeling comfortable enough with my knowledge of this subject to try explaning it, but I'm looking forward getting to know it more and write about it here!
|
||||
|
||||
Another thing is <a href="http://www.purescript.org/" target="_blank" rel="noopener noreferrer">PureScript </a>(looks like you can read a <a href="https://leanpub.com/purescript/read" target="_blank" rel="noopener noreferrer">recommended book here</a> for free!). It's compiled to JavaScript (as all of those new front-end stuff), but apparently you can also compile to Erlang and some other as well! It's influenced by Haskell, more elastic and powerful than Elm (which is easy to learn, but apparently if your app doesn't fit Elm's architecture you will have a lot of pain). I never did anything serious in frontend from start to finish (I did some work with React + <a href="http://cerebraljs.com/docs/get_started/" target="_blank" rel="noopener noreferrer">Cerebral,</a> but I wouldn't call myself front-end specialist) so I guess this could be an interesting start.
|
||||
|
||||
Nerves strikes again, as this time distributed computing on Rasps was shown. It's nice to see that this project grows. And also: nice project to get started: make temperature controller for beer fermentation (old fridge, old lightbulb for hear and rasp pi running nerves)!
|
||||
|
||||
|
||||
20
_posts/2017-05-14-opensettlersii-6.md
Normal file
20
_posts/2017-05-14-opensettlersii-6.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
ID: 128
|
||||
post_title: 'OpenSettlersII #6'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/05/14/opensettlersii-6/
|
||||
published: true
|
||||
post_date: 2017-05-14 20:38:02
|
||||
---
|
||||
<a href="https://github.com/Dreat/OpenSettlersII/commit/591554e9b2fdc1eeddba9dbde631a4b233241b9a" target="_blank" rel="noopener noreferrer">As always, a commit!</a>
|
||||
|
||||
Slowly crawling towards functioning lib.
|
||||
|
||||
This commit is not really that different from other, yet I started using Elixir convetion for return values: the tuple <em>{:ok, response}</em>/<em>{:error, message}</em>. I am quite not happy with the as_server function and I guess I will rename/rewrite it later. It's quite obvious what it does - checks the rightmost bit and responds and sets "as server" to according boolean value.
|
||||
|
||||
Also, encoding and decoding version - I have no way of validating it, but I'm not sure if I should. This is one of two things I need to check before proceeding - another one being the Signature - I'm not sure if it's version specific or not, so that's something to get to know before coding it.
|
||||
|
||||
And that's it for now :)
|
||||
25
_posts/2017-05-20-property-testing.md
Normal file
25
_posts/2017-05-20-property-testing.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
---
|
||||
ID: 131
|
||||
post_title: Property testing
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/05/20/property-testing/
|
||||
published: true
|
||||
post_date: 2017-05-20 19:00:38
|
||||
---
|
||||
During ElixirConfEu in Barcelona, I learned about Property Testing. It looks pretty neat and it got me interested. Basics sound quite easy but there’s more than meets the eye and I’ve been reading/listening about it for a while.
|
||||
As I don’t feel comfortable enough to do a deep dive into the topic I will do an introduction to it. After I get a deeper understanding with some “real life” examples (or maybe doing them myself) I will write a follow-up.
|
||||
|
||||
Property testing is a term originating from Haskell lib called QuickCheck. It was created to ease the pain of writing many tests. Instead of writing n specific unit test you can generate them.
|
||||
|
||||
Using QuickCheck (here is the list of ports to your language of choice) you define a property of a piece of code you’re testing.
|
||||
|
||||
For trivial example – if you were to write your own ordering function you can define few properties – if you order it twice the result won’t change, the only change is the position of elements (so you don’t hanger values) and so on.
|
||||
|
||||
QuickCheck then generates data, runs n tests using this random data and if it finds failing case it executes something called shrinking – trying to find minimal failing case. It can ease up debugging or seeing straight away what’s wrong.
|
||||
|
||||
While it’s all fun, I’m still not sure what are the cases in a commercial code where this is the best approach. Also, turns out that properties also form kind of patterns – and I’m yet to learn about all this.
|
||||
|
||||
Nevertheless, I’m quite hyped and want to learn more – it seems more of easy to get, hard to master useful tool than a novelty, but only time will tell.
|
||||
16
_posts/2017-06-12-end-of-getnoticed.md
Normal file
16
_posts/2017-06-12-end-of-getnoticed.md
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
ID: 138
|
||||
post_title: End of GetNoticed!
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/06/12/end-of-getnoticed/
|
||||
published: true
|
||||
post_date: 2017-06-12 07:00:19
|
||||
---
|
||||
Hello!
|
||||
|
||||
GetNoticed competition ended with the start of June. I didn't make it to the finalists' list, but I still am proud that I managed to do something. What's next? Will I abandon writing/coding OSII? Definitely not! I've had some busy time with music, so I stepped back a little, but also "cleared my mind" with something new, which I will write about. I still want to finish at least ZMTP part of OSII, I still want to write - end of competition changes only the recurring times of blog posts. I will try to write at least once a week now - not twice as stated in competition rules.
|
||||
|
||||
That's it for now! See you soon! :)
|
||||
50
_posts/2017-06-23-today-i-learned-1.md
Normal file
50
_posts/2017-06-23-today-i-learned-1.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
---
|
||||
ID: 147
|
||||
post_title: 'Today I Learned #1'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/06/23/today-i-learned-1/
|
||||
published: true
|
||||
post_date: 2017-06-23 21:22:01
|
||||
---
|
||||
While using EntityFramework in my integration tests (which is a separate topic ;) ) I discovered quite interesting thing. I guess this may be obvious to some, but I learned Entity "the hard way" jumping into an app with Entity already in place and had to adapt - this was my first app with a database by the way.
|
||||
|
||||
So if you add entities to your context I'm used to adding all entities to context, so the code would look like
|
||||
[csharp]
|
||||
using (var ctx = new Context())
|
||||
{
|
||||
var first = new FirstEntity { .. };
|
||||
var second = new SecondEntity { .. };
|
||||
|
||||
ctx.FirstEntities.Add(first);
|
||||
ctx.SecondEntities.Add(second);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
[/csharp]
|
||||
|
||||
But if entities are related, you can safely do this
|
||||
[csharp]
|
||||
using (var ctx = new Context())
|
||||
{
|
||||
var first = new FirstEntity { .. };
|
||||
var second = new SecondEntity { Relation = first };
|
||||
|
||||
//this will also take care of the first one!
|
||||
ctx.SecondEntities.Add(second);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
[/csharp]
|
||||
Or even this!
|
||||
[csharp]
|
||||
using (var ctx = new Context())
|
||||
{
|
||||
var second = new SecondEntity { Relation = new FirstEntity{ .. } };
|
||||
|
||||
ctx.SecondEntities.Add(second);
|
||||
ctx.SaveChanges();
|
||||
}
|
||||
[/csharp]
|
||||
|
||||
It's nice and saves some typing! :)
|
||||
31
_posts/2017-07-02-purescript-the-first-look.md
Normal file
31
_posts/2017-07-02-purescript-the-first-look.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
ID: 156
|
||||
post_title: 'PureScript: The First Look'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/07/02/purescript-the-first-look/
|
||||
published: true
|
||||
post_date: 2017-07-02 22:13:20
|
||||
---
|
||||
After ElixirConfEu I decided to try PureScript. Partly for yet another frontend try, party because it looked interesting and partly because I wanted a little break with something way different and new.
|
||||
|
||||
I read a bit of this awesome book and did some of the exercises. Here are some first thoughts:
|
||||
|
||||
The bad:
|
||||
<ul>
|
||||
<li>Install npm, to install bower, to install dependencies. I get it, it's JS. It's frontend. It's too young to have its own package manager and it's even better that it uses a common tool. But come one, you can do it better than this. Especially if apparently you can compile to C/Erlang/someothers - not only JS.</li>
|
||||
<li>Haskell-like docs. It's not the worst, but it's really not newbie friendly.</li>
|
||||
</ul>
|
||||
The good:
|
||||
<ul>
|
||||
<li>Types! This is the most awesome thing, really. You specify what type goes in, what goes out. It's marvelous, especially for someone with a strong C# background.</li>
|
||||
<li>Quite obvious, FP approach</li>
|
||||
<li>Book (mentioned earlier) is a great learning resource. It's free and written by PS creator</li>
|
||||
<li>I know that it's not something crucial, but I really like the syntax</li>
|
||||
<li>How easy is to start, VSCode tools are great, you can google stuff and get some answers already</li>
|
||||
<li>The community seems small but nice</li>
|
||||
<li>Error messages are really, really helpful!</li>
|
||||
</ul>
|
||||
As you can see, there are way more "goods" than "bads". Should you try it? Definitely? Should you use it in your pet project? Sure! Should you use it in production? It depends ;) After going with dotnet core RC1 in production I'd say "hell yeah" but this requires the team that wants (not "<em>can</em>"; <strong>want!</strong>) to handle it, so my answer here is "it depends". Nevertheless, I'm hyped and will do something more with it, but the break is over and I'm heading back to Beam world now.
|
||||
20
_posts/2017-09-14-today-i-learned-2.md
Normal file
20
_posts/2017-09-14-today-i-learned-2.md
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
ID: 165
|
||||
post_title: 'Today I Learned #2'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/09/14/today-i-learned-2/
|
||||
published: true
|
||||
post_date: 2017-09-14 07:00:35
|
||||
---
|
||||
While a back ago I did a little test. I read the <a href="https://leanpub.com/deliberatevim" target="_blank" rel="noopener">Deliberate Vim</a> book, did the exercises and decided to go full Vim. So I installed <a href="http://www.viemu.com/">ViEmu</a> to my VisualStudio 2015. Aaaand had a few struggles. Some shortcuts conflicts that I had to solve manually and still it wasn't so convenient to use.
|
||||
|
||||
I ended up skipping ViEmu for VS2017. But it didn't last for long - one day I noticed I'm really used to some of the Vim commands and it's more difficult to work now without them. So I did some research, and got a great recipe!
|
||||
|
||||
If you have anything keyboard-changing installed already (like Resharper) - reset all shortcuts to default - so you get only VisualStudio's default key bindings. After that install ViEmu and let it take all the shortcuts it needs. Finally, install Resharper/apply Resharper scheme. Those are the steps that will provide minimal friction while working with Vim in VS.
|
||||
|
||||
|
||||
|
||||
Bonus round: For VisualStudio Code - just install a <a href="https://github.com/VSCodeVim/Vim">plugin</a>, it works great!
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
ID: 168
|
||||
post_title: 'Today I Learned #3: Solving Comeonin problems on Windows!'
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/09/27/today-i-learned-3-solving-comeonin-problems-on-windows/
|
||||
published: true
|
||||
post_date: 2017-09-27 07:00:52
|
||||
---
|
||||
Hello there!
|
||||
|
||||
I did some Elixir tutorial back in the day and there was a need for <a href="https://github.com/riverrun/comeonin" target="_blank" rel="noopener">Comeonin lib</a>. It's used for hashing passwords, so you store them securely. I had enormous problems with <strong>mix deps.compile</strong> because of it.
|
||||
|
||||
Here's what you do if you stumble with deps error
|
||||
<ol>
|
||||
<li>The long way:
|
||||
<ol>
|
||||
<li>Open cmd</li>
|
||||
<li>Go to Program Files (x86)\Microsoft Visual Studio 14.0\VC</li>
|
||||
<li>Type vcvarsall.bat amd64</li>
|
||||
<li><strong>!important! </strong>using THE SAME cmd window go to you project</li>
|
||||
<li>Compile - you have to redo all the steps everytime :(</li>
|
||||
</ol>
|
||||
</li>
|
||||
<li>Easy way:
|
||||
<ol>
|
||||
<li>Use Pbkdf2 algorithm. It needs no C compiler :D</li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
And I used the second way while developing something mine. Works like a charm. As for me algorithm didn't really matter (each own has it's own pros and cons) I went with the least problematic one.
|
||||
|
||||
PS: What's funny for some there's no need for being in the same console/repeating those steps, but I wasn't that lucky :(
|
||||
24
_posts/2017-12-12-spawnfest-2017.md
Normal file
24
_posts/2017-12-12-spawnfest-2017.md
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
ID: 179
|
||||
post_title: Spawnfest 2017!
|
||||
author: dreat
|
||||
post_excerpt: ""
|
||||
layout: post
|
||||
permalink: >
|
||||
http://dreat.info/2017/12/12/spawnfest-2017/
|
||||
published: true
|
||||
post_date: 2017-12-12 20:31:22
|
||||
---
|
||||
Last weekend (9-10.12) I took part in <a href="https://spawnfest.github.io/" target="_blank" rel="noopener">SpawnFest2017</a> and I've got some thoughts to share
|
||||
<h3>What is it?</h3>
|
||||
SpawnFest is a hackaton (programming challenge to write a project in some limited time) that was all about BEAM - Erlang's virtual machine. All projects have to run on top of that (so you had to write it in Erlang/Elixir/LFE or something other from this family). You could add JS for frontend, use some third-party libs, etc. This was first edition in 5 years, so I had to take a part as I'm big BEAM enthusiast.
|
||||
<h3>Warning, personal stuff below!</h3>
|
||||
It was my firs (organised) hackaton. 48h deadline was quite stressful, and a lot of things didn't work. Being at beginner+ level didn't help either. But it was so much fun! I worked with my 3 friends on silly idea that we managed to bring to life. I learned a lot about not only Elixir, but developing and working under that kind of a stress. Memes were created and we never lost good spirit. A lot of code created was poor quality, but it didn't matter. We did something in language we're excited about, together, in less than 48 hours. That was magical. I cannot recommend enough taking part in SpawnFest - it was well organised, everyone was welcome and all the good things I cannot describe with words. It felt really awesome! Funny thing, when this all was over I was reminded that there are winners and prizes (Judges are still voting), but for me I already got the best prize - which is experience from this event
|
||||
<h3>So, what did we do?</h3>
|
||||
Application to monitor plants. We planned to have thermometer and proximity sensor, but we didn't manage to get it work in time, so we added buzzer to hydration and humidity sensors. This app (written using Nerves) communicated from Raspberry Pi to our webapp written in Elixir, that was deployed in Heroku. What was shocking - how damn fast it was! Below I'll paste README description of short video demo that we made.
|
||||
<blockquote>There's Elixir app with Phoenix fronend opened, showing sensor output. Sensors are connected to raspberry pi. When sensors are dry it will show cactus, when wet it will show water drop. First there's humidity sensor - if we spray it, the second image will change. As it was not dried properly you can see some changes later, as water drops flows down the sensor. Next there's hydration sensor put in the glass of water - first image will change. Below the images are charts with sensors data grouped by hour.
|
||||
|
||||
Finally "warning" button is pressed, and buzzer turns on. "Warning" button is a switch, so pressing it again turns the buzzer off.
|
||||
<p style="text-align: center;"><a href="https://twitter.com/Dreat_/status/939890791115296768" target="_blank" rel="noopener">VIDEO</a></p>
|
||||
</blockquote>
|
||||
See you next year! :)
|
||||
Loading…
Reference in a new issue