-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfeed.xml
1728 lines (1726 loc) · 158 KB
/
feed.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?><feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
<title>Pol Bassiner</title>
<link rel="self" type="application/atom+xml" href="https://pbassiner.github.io/feed.xml"/>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/"/>
<updated>2017-12-29T00:00:00+0100</updated>
<id>https://pbassiner.github.io/</id>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<entry>
<title type="html">
<![CDATA[Monthly Digest - Dec 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_dec_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_dec_2017.html</id>
<published>2017-12-29T00:00:00+0100</published>
<updated>2017-12-29T00:00:00+0100</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://dzone.com/articles/learning-in-a-world-where-programming-skills-arent">Learning in a World Where Programming Skills Aren't That Important</a> by <a href="https://twitter.com/daedtech">Erik Dietrich</a></li>
<li><a href="http://www.stephendiehl.com/posts/haskell_2018.html">Reflecting on Haskell in 2017</a> by <a href="https://github.com/sdiehl">Stephen Diehl</a></li>
<li><a href="https://www.farnamstreetblog.com/2017/12/maker-vs-manager/">Maker vs. Manager: How Your Schedule Can Make or Break You</a></li>
<li><a href="http://blog.colinbreck.com/maximizing-throughput-for-akka-streams/">Maximizing Throughput for Akka Streams</a> by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://www.beyondthelines.net/computing/understanding-sbt/">Making sense of SBT</a> by <a href="https://github.com/btlines">btlines</a></li>
<li><a href="http://malaw.ski/2017/12/10/automatic-flamegraph-generation-from-jmh-benchmarks-using-sbt-jmh-extras-plain-java-too/">Automatic FlameGraph generation from JMH Benchmarks using (SBT) JMH Extras (plain Java too)</a> by <a href="https://github.com/ktoso">Konrad Malawski</a></li>
<li><a href="https://dev.to/gavincampbell/throwing-code-over-a-different-fence-c80">Throwing code over a different fence</a> by <a href="https://github.com/gavincampbell">Gavin Campbell</a></li>
<li><a href="https://slack.engineering/scaling-slacks-job-queue-687222e9d100">Scaling Slack’s Job Queue</a> by <a href="https://github.com/yadavsaroj">Saroj Yadav</a>, <a href="https://github.com/notmatt">Matthew Smillie</a>, <a href="https://github.com/demmer">Mike Demmer</a> and Tyler Johnson</li>
<li><a href="https://apiumhub.com/tech-blog-barcelona/micromanaging/">Micromanaging: signs, cons & advices</a></li>
<li><a href="https://dzone.com/articles/what-is-servant-leadership-1">What Is Servant Leadership?</a> by <a href="https://github.com/jpartogi">Joshua Partogi</a></li>
<li><a href="https://www.confluent.io/blog/enabling-exactly-kafka-streams/">Enabling Exactly-Once in Kafka Streams</a> by <a href="https://github.com/guozhangwang">Guozhang Wang</a></li>
<li><a href="https://typelevel.org/blog/2017/12/20/who-implements-typeclass.html">Who implements the typeclass instance?</a> by <a href="https://github.com/S11001001">Stephen Compall</a></li>
<li><a href="http://www.geekabyte.io/2017/11/exploring-typeclass-in-scala-knowledge.html">Exploring Type class in Scala: A knowledge pack</a> by <a href="https://github.com/dadepo">Dadepo Aderemi</a></li>
</ul>
<h2>Talks</h2>
<ul>
<li><a href="https://www.youtube.com/watch?v=po3wmq4S15A">Functional Programming with Effects</a> by <a href="https://github.com/tpolecat">Rob Norris</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://akka.io/blog/news/2017/12/08/akka-2.5.8-released">Akka 2.5.8 Released</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Nov 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_nov_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_nov_2017.html</id>
<published>2017-11-30T00:00:00+0100</published>
<updated>2017-11-30T00:00:00+0100</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://www.farnamstreetblog.com/2017/10/how-to-remember-what-you-read/">How to Remember What You Read</a></li>
<li><a href="http://blog.colinbreck.com/the-importance-of-agency/">The Importance of Agency</a> by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://dev.to/bosepchuk/how-to-make-time-to-repay-your-technical-debt-1lm">How to make time to repay your technical debt</a> by <a href="https://github.com/bosepchuk">Blaine Osepchuk</a></li>
<li><a href="http://www.scala-lang.org/blog/2017/11/03/zinc-blog-1.0.html">Speed up compile times with Zinc 1.0</a> by <a href="https://github.com/jvican">Jorge Vicente</a></li>
<li><a href="https://developer.lightbend.com/blog/2017-11-01-atotm-akka-messaging-part-2/index.html">Akka Message Delivery - At-Most-Once, At-Least-Once, and Exactly-Once - Part 2 At-Least-Once</a> by <a href="https://github.com/mckeeh3">Hugh McKee</a></li>
<li><a href="https://alexn.org/blog/2017/11/10/minitest-no-crap-scala-library.html">Minitest: Zero Crap Scala Testing Library</a> by <a href="https://github.com/alexandru/">Alexandru Nedelcu</a></li>
<li><a href="https://blog.codecentric.de/en/2017/11/custom-akka-http-pathmatcher/">Custom Akka HTTP PathMatcher</a> by <a href="https://github.com/daesul">Christian Börner-Schulte</a></li>
<li><a href="https://dzone.com/articles/lambda-calculus-for-mortal-developers">Lambda Calculus for Mortal Developers</a> by <a href="https://github.com/srodrigo">Sergio Rodrigo Royo</a></li>
<li><a href="https://dev.to/dev3l/zero-inventory-driven-development-dgd">Zero Inventory Driven Development</a> by <a href="https://github.com/DEV3L">Justin Beall</a></li>
<li><a href="http://www.lihaoyi.com/post/SowhatswrongwithSBT.html">So, what's wrong with SBT?</a> by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
<li><a href="https://developer.lightbend.com/blog/2017-11-27-sbt-1-0-4-hotfix-and-performance-fixes/">sbt 1.0.4 hotfix and the performance fixes</a></li>
<li><a href="https://www.confluent.io/blog/toward-functional-programming-analogy-microservices/">Toward a Functional Programming Analogy for Microservices</a> by <a href="https://github.com/bobby">Bobby Calderwood</a></li>
</ul>
<h2>Talks</h2>
<ul>
<li><a href="https://youtu.be/ycxvmOKDHMQ">How Events Are Reshaping Modern Systems</a> by <a href="https://github.com/jboner">Jonas Bonér</a></li>
<li><a href="https://youtu.be/wi_vLNULh9Y">The Design of the Scalaz 8 Effect System</a> by <a href="https://github.com/jdegoes">John A De Goes</a></li>
<li><a href="https://www.youtube.com/watch?v=YXDm3WHZT5g">Plain Functional Programming</a> by <a href="https://github.com/odersky">Martin Odersky</a></li>
<li><a href="https://www.youtube.com/watch?v=XV0o-hy1WUM">Simplicity in Composition</a> by <a href="https://github.com/adelbertc">Adelbert Chang</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://github.com/sbt/sbt/releases/tag/v1.0.4">sbt 1.0.4 released</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Oct 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_oct_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_oct_2017.html</id>
<published>2017-10-31T00:00:00+0100</published>
<updated>2017-10-31T00:00:00+0100</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://akka.io/blog/2017/09/28/typed-cluster">Akka Typed: New Cluster API</a> by <a href="https://github.com/patriknw">Patrik Nordwal</a></li>
<li><a href="https://akka.io/blog/2017/10/04/typed-cluster-tools">Akka Typed: New Cluster Tools API</a> by <a href="https://github.com/patriknw">Patrik Nordwal</a></li>
<li><a href="https://akka.io/blog/2017/10/13/typed-persistence">Akka Typed: New Persistence API</a> by <a href="https://github.com/patriknw">Patrik Nordwal</a></li>
<li><a href="https://heikoseeberger.de/2017/10/02/actor-model.html">The Actor Model in Akka and Akka Typed</a> by <a href="https://github.com/hseeberger">Heiko Seeberger</a></li>
<li><a href="http://blog.colinbreck.com/future-successful-blocking-your-future-success/">Scala's Future.successful: Do Not Block Your Future Success</a> by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://dzone.com/articles/where-do-i-start-with-event-driven-architecture">Where Do I Start With Event-Driven Architecture?</a> interview to <a href="https://github.com/jboner">Jonas Bonér</a></li>
<li><a href="http://www.lihaoyi.com/post/FastParse10PastPresentFuture.html">FastParse 1.0: Past, Present & Future</a> by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
<li><a href="https://apiumhub.com/tech-blog-barcelona/scala-type-bounds/">Scala Generics I: Scala type bounds</a> by <a href="https://github.com/Yaskier">Rafael Ruiz</a></li>
<li><a href="https://superruzafa.github.io/visual-scala-reference/index-en.html">Visual Scala Reference</a> by <a href="https://github.com/superruzafa">Alfonso Ruzafa</a></li>
<li><a href="https://www.confluent.io/blog/running-kafka-streams-applications-aws/">Running Kafka Streams Applications in AWS</a> by <a href="https://github.com/imduffy15">Ian Duffy</a> & <a href="https://github.com/geekity">Nina Hanzlikova</a></li>
<li><a href="https://dev.to/bosepchuk/technical-debt-we-need-better-communication-not-better-metaphors-d65">Technical debt: we need better communication, not better metaphors</a> by <a href="https://github.com/bosepchuk">Blaine Osepchuk</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://www.scala-lang.org/news/2.12.4">Scala 2.12.4 is now available!</a></li>
<li><a href="https://gist.github.com/lihaoyi/e1407272a3239ed10ba966d71971a37a">Resolving jars with Coursier and compiling Scala with the Zinc incremental compiler, in a self-contained Ammonite script</a> by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Defining Multi-project Builds with sbt]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/defining_multi-project_builds_with_sbt.html"/>
<id>https://pbassiner.github.io/blog/defining_multi-project_builds_with_sbt.html</id>
<published>2017-10-18T00:00:00+0200</published>
<updated>2017-10-18T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Let's setup a simple multi-project build using <code>sbt</code>, assuming we're already familiar with regular <em>single-project</em> builds.</p>
<h1>Goal</h1>
<p>We have two <em>deliverable</em> sub-projects (<code>multi1</code> and <code>multi2</code>) and a <em>common-stuff</em> sub-project (<code>common</code>) on which they both depend on.</p>
<p>To simplify development and maintenance we can use a single <code>build.sbt</code> file which allows for centralized configuration, dependency and build management.</p>
<p>Then each sub-project contains nothing but its source code, while they can depend on other sub-projects.</p>
<p>Finally, we only need to generate artifacts for <em>deliverable</em> sub-projects.</p>
<h1>File structure</h1>
<p>This is the project file tree:</p>
<ul>
<li>sbt-multi-project-example/
<ul>
<li>common/
<ul>
<li>src/</li>
<li>test/</li>
</ul>
</li>
<li>multi1/
<ul>
<li>src/</li>
<li>test/</li>
</ul>
</li>
<li>multi2/
<ul>
<li>src/</li>
<li>test/</li>
</ul>
</li>
<li>project/
<ul>
<li>build.properties</li>
<li>plugins.sbt</li>
</ul>
</li>
<li>build.sbt</li>
</ul>
</li>
</ul>
<h1>Build configuration</h1>
<p>Our build file will include all the configuration we need:</p>
<ul>
<li>Sub-projects definition</li>
<li>Build settings</li>
<li>Dependencies</li>
<li>Artifacts generation</li>
</ul>
<h2>Projects definition</h2>
<p>First of all we define our projects:</p>
<ul>
<li><code>global</code>: the parent project, aggregating the others</li>
<li><code>common</code>: where the common code is</li>
<li><code>multi1</code> and <code>multi2</code>: the two <em>deliverables</em>, which depend on <code>common</code></li>
</ul>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=projects.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-projects-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-projects-sbt</a></figcaption>
<p>Using <code>aggregate</code> in <code>global</code> implies that running a task on the aggregate project will also run it on the aggregated ones. On the other hand, using <code>dependsOn</code> sets the code dependency between sub-projects.</p>
<p>By default, dependency is set for the <code>compile</code> configuration. If we'd need to also depend on the <code>test</code> configuration (i.e. we have tests depending on other sub-project's test source code), we'd need to define dependency as follows: <code>common % "compile->compile;test->test"</code>.</p>
<p>Since the <code>global</code> project is in the project root folder, we need to explicitly specify it using <code>in(file(".")</code>. There's no need to do so with the other sub-projects since they are located in a folder with the same name.</p>
<h2>Settings</h2>
<p>We can setup some global settings as follows:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=globalSettings.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-globalsettings-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-globalsettings-sbt</a></figcaption>
<p>Settings that are subject to change can be defined as values that can later be used by each sub-project. Here we're defining the Scala compiler options and some extra repositories:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=settings.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-settings-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-settings-sbt</a></figcaption>
<p>Then we can use them in the sub-projects:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=settingsInProjects.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-settingsinprojects-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-settingsinprojects-sbt</a></figcaption>
<h2>Dependencies</h2>
<p>We'll follow the same strategy with the dependencies. First we define our catalog of dependencies:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=dependencies.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-dependencies-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-dependencies-sbt</a></figcaption>
<p>Then we identify the common ones used by all sub-projects:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=commonDependencies.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-commondependencies-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-commondependencies-sbt</a></figcaption>
<p>And finally we define each sub-project's dependencies combining the common with the specific ones:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=dependenciesInProjects.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-dependenciesinprojects-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-dependenciesinprojects-sbt</a></figcaption>
<p>The parent project, <code>global</code>, needs no dependencies since it has no code at all. The other sub-projects have the common dependencies along with some specific ones: <code>multi1</code> requires <code>monocle</code> and <code>multi2</code> requires <code>pureconfig</code>.</p>
<h2>Artifacts generation</h2>
<p>To generate artifacts for our <em>deliverable</em> sub-projects we'll use <a href="https://github.com/sbt/sbt-assembly">sbt-assembly</a> to produce a <em>fat-jar</em> (if we'd need to generate Docker images we could use <a href="https://github.com/sbt/sbt-native-packager">sbt-native-packager</a> instead).</p>
<p>First we define the corresponding settings:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=sbtAssemblySettings.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-sbtassemblysettings-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-sbtassemblysettings-sbt</a></figcaption>
<p>And then we add them <strong>only</strong> to the settings of our <em>deliverable</em> sub-projects <code>multi1</code> and <code>multi2</code>:</p>
<script src="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4.js?file=sbtAssemblySettingsInProjects.sbt"></script>
<figcaption><a href="https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-sbtassemblysettingsinprojects-sbt">https://gist.github.com/pbassiner/5ec3209743f42b3f67fbb54b72b446f4#file-sbtassemblysettingsinprojects-sbt</a></figcaption>
<h2>Putting it all together</h2>
<p>Simply running <code>sbt clean compile test assembly</code> will clean, compile and test all the sub-projects and generate a <em>fat-jar</em> only for our two <em>deliverable</em> sub-projects.</p>
<p>The full source code of this example can be found at <a href="https://github.com/pbassiner/sbt-multi-project-example">this repository</a>.</p>
<h1>References</h1>
<ul>
<li><a href="http://www.scala-sbt.org/release/docs/Multi-Project.html">Multi-project builds section in sbt documentation</a></li>
<li><a href="https://github.com/sbt/sbt-assembly">sbt-assembly</a></li>
<li><a href="https://github.com/sbt/sbt-native-packager">sbt-native-packager</a></li>
<li><a href="https://github.com/pbassiner/sbt-multi-project-example">sbt-multi-project-example</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Sep 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_sep_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_sep_2017.html</id>
<published>2017-09-29T00:00:00+0200</published>
<updated>2017-09-29T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://medium.com/@lauraconwill/to-my-sister-a-new-software-engineer-691cb33a5c20">To my sister, a new software engineer</a> by <a href="https://twitter.com/eleichsea">Laura Conwill</a></li>
<li><a href="https://www.beyondthelines.net/computing/grpc-akka-stream/">Akka stream interface for gRPC</a></li>
<li><a href="http://blog.colinbreck.com/integrating-akka-streams-and-akka-actors-part-iv/">Integrating Akka Streams and Akka Actors: Part IV</a> by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="http://www.cakesolutions.net/teamblogs/reactive-mistakes-distributed-transactions">Reactive Mistakes: Distributed Transactions</a> by <a href="https://github.com/pzapletal">Petr Zapletal</a></li>
<li><a href="https://medium.com/@skamille/how-do-managers-get-stuck-b6ec9ecd1da1">How Do Managers* Get Stuck?</a> by <a href="https://github.com/skamille">Camille Fournier</a></li>
<li><a href="https://bartoszmilewski.com/2017/09/06/monads-monoids-and-categories/amp/">Monads, Monoids, and Categories</a> by <a href="https://github.com/BartoszMilewski">Bartosz Milewski</a></li>
<li><a href="https://www.beyondthelines.net/databases/dynamodb-vs-cassandra/">Amazon DynamoDB vs Apache Cassandra</a></li>
<li><a href="http://blog.atom.io/2017/09/12/announcing-atom-ide.html">Introducing Atom-IDE</a> by <a href="https://github.com/damieng">Damien Guard</a></li>
<li><a href="https://hseeberger.github.io/2017/09/13/how-to-use-akka-testkit.html">How to (not) use akka-testkit</a> by <a href="https://github.com/hseeberger">Heiko Seeberger</a></li>
<li><a href="https://blog.knoldus.com/2017/09/12/reactors-io-actors-done-right/">Reactors.IO: Actors Done Right</a> by <a href="https://github.com/anmol2709">Anmol Sarna</a></li>
<li><a href="https://www.confluent.io/blog/apache-kafka-tested/">How Apache Kafka is Tested</a> by <a href="https://github.com/cmccabe">Colin McCabe</a></li>
<li><a href="http://degoes.net/articles/only-one-io">There Can Be Only One...IO Monad</a> by <a href="https://github.com/jdegoes">John A De Goes</a></li>
<li><a href="https://dev.to/jtvanwage/a-common-technical-lead-pitfall">A Common Technical Lead Pitfall</a> by <a href="https://twitter.com/jtvanwage">John Van Wagenen</a></li>
<li><a href="https://blog.codecentric.de/en/2017/09/jwt-authentication-akka-http">JWT authentication with Akka HTTP</a> by <a href="https://github.com/BranislavLazic">Branislav Lazic</a></li>
<li><a href="http://www.lihaoyi.com/post/uTesttheEssentialTestFrameworkforScala.html">uTest: the Essential Test Framework for Scala</a> by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://github.com/tpolecat/doobie/blob/series/0.5.x/build.sbt#L40-L41">Run sbt-updates on sbt startup</a> by <a href="https://github.com/tpolecat">Rob Norris</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Recording UI Tests Using Scalatest, Selenium and Akka]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/recording_ui_tests_using_scalatest,_selenium_and_akka.html"/>
<id>https://pbassiner.github.io/blog/recording_ui_tests_using_scalatest,_selenium_and_akka.html</id>
<published>2017-09-22T00:00:00+0200</published>
<updated>2017-09-22T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>In any web project with some kind of UI involved it's usually convenient to have, at least, a basic suite of automated User Acceptance Tests. In contrast to unit and even integration tests, these are likely to be the most fragile and therefore, the most expensive to maintain.</p>
<p>This is because they are typically end-to-end tests which involve all the moving pieces from a system (a UI, one or more APIs, storage, etc). A slight change on any part of the system can break those tests.</p>
<p><img src="https://i.imgflip.com/1w4fje.jpg" alt="no_tests" /></p>
<p>When something goes wrong during a test execution you can easily generate a screenshot, dump the current DOM and write the browser's JavaScript logs to a file for further analysis.</p>
<p>Having all this in place, what about periodically taking a screenshot and generating a GIF with all of them?</p>
<p>It could be useful at some point. In the meantime though, we can <em>do it for the lulz</em>.</p>
<p><img src="https://i.imgflip.com/1w4fp3.jpg" alt="gifs_everywhere" /></p>
<h1>Let's go for it</h1>
<p>First of all we need a GIF generator. I found <a href="http://elliot.kroo.net/software/java/GifSequenceWriter/GifSequenceWriter.java">this one</a> by <a href="https://github.com/kroo">Elliot Kroo</a>, although I had to tweak it just a bit (the modified version is available in <a href="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-gifsequencewriter-java">this gist</a>).</p>
<p>Now we need to continuously perform some actions while the test is executing:</p>
<ol>
<li>take a screenshot (using <a href="http://www.seleniumhq.org/docs/03_webdriver.jsp">Selenium Webdriver</a>)</li>
<li>read the screenshot file</li>
<li>write it into the GIF generator</li>
<li>delete the screenshot file</li>
</ol>
<p><a href="http://doc.akka.io/docs/akka/current/java/stream/">Akka Streams</a> seems a got fit to implement it:</p>
<script src="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d.js?file=RecorderStream.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-recorderstream-scala">https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-recorderstream-scala</a></figcaption>
<p>Since this <code>Stream</code> is infinite, we need to return both the <code>Cancellable</code> (something that can be cancelled) and the result, wrapped in a <code>Future</code>. Then we just need to wait for the test to end to stop the stream and close the GIF generator.</p>
<p>This is the full code of the test recorder:</p>
<script src="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d.js?file=TestRecorder.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-testrecorder-scala">https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-testrecorder-scala</a></figcaption>
<p>The recorder receives the test as a by-name parameter, in particular, a <em>thunk</em> (a function of zero arguments <code>() => T</code>). Then it starts the test recorder stream, runs the test and finally signals the cancellation of the stream, awaits for its result and closes all the resources.</p>
<h1>Usage</h1>
<p>To add this capability to a test we simply wrap the test with the recorder's <code>record</code> method and provide an instance of a <code>WebDriver</code>, the path where to store the screenshots and the function to be used to output the resulting GIF's path:</p>
<script src="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d.js?file=UsageExample.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-usageexample-scala">https://gist.github.com/pbassiner/d9c43e8279865dbc066a620e88560d8d#file-usageexample-scala</a></figcaption>
<h1>Result</h1>
<p>And this is the result (<i style="cursor: pointer" class="fa fa-repeat" aria-hidden="true" onClick="$('img[alt=test_recorder]').attr('src','../assets/2017-09-22.Recording_UI_Tests_Using_Scalatest,_Selenium_and_Akka.recording.gif');"> replay</i>):
<img src="../assets/2017-09-22.Recording_UI_Tests_Using_Scalatest,_Selenium_and_Akka.recording.gif" alt="test_recorder" /></p>
<h1>The reader's reaction</h1>
<p><img src="http://media0.giphy.com/media/gRxjhVNfFgqI0/giphy.gif" alt="applause" /></p>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Aug 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_aug_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_aug_2017.html</id>
<published>2017-08-31T00:00:00+0200</published>
<updated>2017-08-31T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://medium.com/@copyconstruct/the-death-of-ops-is-greatly-exaggerated-ff3bd4a67f24">Everyone is not Ops</a> - Blog post by <a href="https://twitter.com/copyconstruct">Cindy Sridharan</a></li>
<li><a href="https://medium.com/@rakyll/the-sre-model-6e19376ef986">The SRE model</a> - Blog post about how Google deals with development vs operations teams, by <a href="https://github.com/rakyll">JBD</a></li>
<li><a href="https://medium.com/@bfil/microservices-are-a-silver-bullet-f745d2b41dca">Microservices ARE a Silver Bullet</a> - Blog post by <a href="https://github.com/bfil">Bruno Filippone</a></li>
<li><a href="https://softwaremill.com/what-kafka-exactly-once-really-means/">What does Kafka's exactly-once processing really mean?</a> - Blog post by <a href="https://github.com/adamw">Adam Warski</a></li>
<li><a href="https://stackoverflow.com/questions/42831593/how-do-i-make-intellij-idea-to-highlight-scala-script-correctly-with-shebang/43115692#43115692">How to make IntelliJ Idea highlight Ammonite scrips</a> - Stack Overflow thread with a clever solution to make IntelliJ Idea highlight <a href="https://github.com/lihaoyi/Ammonite/">Ammonite</a> scripts</li>
<li><a href="http://blog.colinbreck.com/reflections-on-using-quality-views/">Reflections on Using Quality Views</a> - Blog post by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://dev.to/stefandorresteijn/hiring-masters">Hiring Masters</a> - Nice writeup by <a href="https://github.com/StefanDorresteijn">Stefan Dorresteijn</a></li>
<li><a href="https://blog.scalac.io/exploring-tagless-final.html">Exploring Tagless Final pattern for extensive and readable Scala code</a> - Blog post by <a href="https://github.com/pjazdzewski1990">Patryk Jażdżewski</a></li>
<li><a href="https://dev.to/gshotwell/why-you-should-work-remotely">Why you should work remotely</a> - Blog post by <a href="https://github.com/GShotwell">Gordon Shotwell</a></li>
<li><a href="https://alexn.org/blog/2017/08/16/automatic-releases-sbt-travis.html">Automatic Releases to Maven Central with Travis and SBT</a> - How releases are automated in the <a href="http://monix.io">Monix</a> project, by <a href="https://github.com/alexandru/">Alexandru Nedelcu</a></li>
<li><a href="http://developer.lightbend.com/guides/k8-akka-cluster/">Deploying clustered Akka applications on Kubernetes</a> - <a href="https://www.lightbend.com/">Lightbend</a>'s guide to deploy <a href="http://akka.io">Akka</a> on <a href="https://kubernetes.io/">Kubernetes</a></li>
<li><a href="https://lazicbrano.wordpress.com/2017/08/10/jwt-authentication-with-akka-http/">JWT authentication with Akka HTTP</a> - Implementing JWT in Akka Http, by <a href="https://github.com/BranislavLazic">Branislav Lazic</a></li>
<li><a href="https://tech.iheart.com/why-fp-its-the-composition-f585d17b01d3">Why FP? It’s the composition</a> - Blog post about how Functional Programming enables composition, by <a href="https://github.com/kailuowang">Kailuo Wang</a></li>
<li><a href="https://virtuslab.com/blog/cats-library/">Meow! Start using Cats in your project right now</a> - Hands-on introduction to the patterns most likely to take advantage of in Scala projects, by <a href="https://github.com/PawelLipski">Paweł Lipski</a></li>
<li><a href="https://softwaremill.com/akka-2.5.4-features/">5 New features in Akka (Streams) 2.5.4 you may have missed</a> - Nice summary by <a href="https://github.com/mikolak-net">Mikołaj Koziarkiewicz</a></li>
<li><a href="http://www.lihaoyi.com/post/HowtoconductagoodProgrammingInterview.html">How to conduct a good Programming Interview</a> - Excellent take on conducting programming interviews by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
<li><a href="https://www.linkedin.com/pulse/learning-scala-terminology-root-cause-analysis-part-tomer-ben-david-1">Learning Scala By Terminology Root Cause Analysis - Part 3 - Functor</a> - Post by <a href="https://github.com/tomer-ben-david">Tomer Ben David</a></li>
<li><a href="http://kto.so/2017/08/29/sbt-redefine-task-as-something-this-tasks-previous-self/">sbt: redefine task as "something" + "this tasks previous self"</a> - Sbt trick by <a href="https://github.com/ktoso">Konrad Malawski</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="http://developer.lightbend.com/blog/2017-08-11-sbt-1-0-0/">sbt 1.0.0 is now available</a></li>
</ul>
<h2>Talks</h2>
<ul>
<li><a href="https://youtu.be/Esd1UKIpvdU">Akka Clustering on Kubernetes</a> - Talk by <a href="https://github.com/lkysow">Luke Kysow</a> at <a href="http://scalaupnorth.com">Scala Up North 2017</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Jul 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_jul_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_jul_2017.html</id>
<published>2017-07-31T00:00:00+0200</published>
<updated>2017-07-31T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li>Exactly-once Support in Apache Kafka - Detailed reviews of how <a href="https://kafka.apache.org">Kafka</a> supports exactly-once semantics.
<ul>
<li><a href="https://www.confluent.io/blog/exactly-once-semantics-are-possible-heres-how-apache-kafka-does-it/">Exactly-once Semantics are Possible: Here’s How Kafka Does it</a> - Writeup by <a href="https://github.com/nehanarkhede">Neha Narkhede</a></li>
<li><a href="https://medium.com/@jaykreps/exactly-once-support-in-apache-kafka-55e1fdd0a35f">Exactly-once Support in Apache Kafka</a> - Post by <a href="https://github.com/jkreps">Jay Kreps</a></li>
</ul>
</li>
<li><a href="http://blog.colinbreck.com/integrating-akka-streams-and-akka-actors-part-iii/">Integrating Akka Streams and Akka Actors: Part III</a> - Yet another excellent blog post by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="http://www.cakesolutions.net/teamblogs/dotty">What is coming with Dotty?</a> - Complete summary of <a href="http://dotty.epfl.ch/">Dotty</a> features by <a href="https://github.com/ferhtaydn">Ferhat Aydin</a></li>
<li><a href="https://medium.com/@SeanWalshEsq/the-state-of-in-application-state-what-no-one-is-talking-about-c30392033b08">The State Of In-Application State: What No One Is Talking About</a> - Blog post by <a href="https://twitter.com/SeanWalshEsq">Sean Walsh</a></li>
<li><a href="http://www.beyondthelines.net/computing/scala-future-and-execution-context/">Understanding Scala Futures and Execution Contexts</a> - A thorough overview of the Scala Future and ExecutionContext implementation</li>
<li><a href="https://forcomprehension.com/2017/07/11/why-software-hasnt-worked-for-you/">Why Software Hasn’t Worked for You</a> - Blog post by <a href="https://github.com/VaughnVernon">Vaughn Vernon</a></li>
<li><a href="http://www.lihaoyi.com/post/PrinciplesofAutomatedTesting.html">Principles of Automated Testing</a> - Great blog post on the mindset regarding automated testing by <a href="https://github.com/lihaoyi">Li Haoyi</a></li>
<li><a href="https://softwaremill.com/reactive-streams-in-scala-comparing-akka-streams-and-monix-part-3/">Reactive Streams in Scala: Akka Streams vs Monix - part 3</a> - Final part of the Reactive Streams in Scala: Akka Streams vs Monix series by <a href="https://github.com/rucek">Jacek Kunicki</a></li>
<li><a href="http://www.beyondthelines.net/computing/akka-streams-patterns/">Akka Streams patterns</a> - Great post on patterns for Akka Streams</li>
<li><a href="https://blog.scalac.io/improving-akka-dispatcher.html">Improving Akka dispatchers</a> - Blog post by <a href="https://github.com/zaharidichev">Zahari Dichev</a></li>
<li><a href="http://www.beyondthelines.net/programming/futures-vs-tasks/">Scala Futures vs Monix Tasks</a> - A straightforward introduction to Monix tasks</li>
<li><a href="https://dzone.com/articles/linkerd-and-istio-like-peanut-butter-and-jelly">Linkerd and Istio</a> - The latest release of <a href="https://linkerd.io">Linkerd</a> includes integration with <a href="https://istio.io/">Istio</a></li>
<li><a href="https://softwaremill.com/introducing-sttp-the-scala-http-client/">Introducing sttp</a> - Say hello to <a href="https://github.com/softwaremill/sttp">sttp</a>, a new http client library, by <a href="https://github.com/adamw">Adam Warski</a></li>
<li><a href="http://www.beyondthelines.net/programming/introduction-to-tagless-final/">Introduction to Tagless final</a> - Practical introduction to the tagless-final encoding</li>
<li><a href="https://manuel.bernhardt.io/2017/07/26/a-new-adaptive-accrual-failure-detector-for-akka/">A new adaptive accrual failure detector for Akka</a> - Blog post by <a href="https://github.com/manuelbernhardt">Manuel Bernhardt</a></li>
<li><a href="https://partialflow.wordpress.com/2017/07/26/dependent-types-type-level-programming/">Dependent Types & Type Level Programming</a> - Type-level programming introduction in Scala, by <a href="https://github.com/gvolpe">Gabriel Volpe</a></li>
<li><a href="http://debasishg.blogspot.com.es/2017/07/domain-models-late-evaluation-buys-you.html">Domain Models - Late Evaluation buys you better Composition</a> - Practical example of how to improve composition by committing to a specific type at the latest possible stage, by <a href="https://github.com/debasishg">Debasish Ghosh</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://github.com/scala/scala/releases/tag/v2.12.3">Scala 2.12.3</a></li>
<li><a href="https://github.com/sbt/sbt/releases/tag/v0.13.16">Sbt 0.13.16</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Lessons Learned After Adopting Innovation Days]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/lessons_learned_after_adopting_innovation_days.html"/>
<id>https://pbassiner.github.io/blog/lessons_learned_after_adopting_innovation_days.html</id>
<published>2017-07-18T00:00:00+0200</published>
<updated>2017-07-18T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<h1>The initial motivation</h1>
<p>By the end of last year I began working on a proposal for the implementation of Innovation Days within the <a href="https://www.netquest.com">Netquest</a> technology department. My main goal was to provide allocated time periods everyone could spend on whatever they considered most beneficial, in the widest sense, since I believe this empowers each one of us to be more creative and innovative.</p>
<p>I didn't want to be too ambitious so I aimed for a simple set up for starters, scheduling the events in a monthly basis, gathering feedback from everyone afterwards and applying some slight changes on each iteration. I figure this approach sounds about right to software developers, am I right?</p>
<h1>The first edition</h1>
<p>The goal of the first edition was to deliver something with a <strong>tangible output</strong> in its broadest sense, <strong>including unfinished and negative outputs</strong>. For example:</p>
<ul>
<li>an analysis of a new technology</li>
<li>a new application or service</li>
<li>a new feature in an existing service</li>
<li>a major bug fix</li>
<li>a workshop on any technology</li>
</ul>
<p>And it could be in the form of a scope or specification document, an MVP, a PoC or even something production ready; and considering all areas: applications, infrastructure, development tools, monitoring, etc. The only restriction was that it had <strong>a real application within the organization</strong>.</p>
<p>Since this was the first time we were running this kind of event, everyone could decide if they'd rather make it an individual or a team activity.</p>
<p>The day started having breakfast all together and running a quick showcase of what everyone was up to during the day. By the end of the day everyone presented to the rest of the team what they had achieved, focusing on the problem to solve, who would benefit from it and the proposed solution.</p>
<h2>Feedback</h2>
<p>After the event I sent a satisfaction survey to every participant in order to obtain their feedback. The first edition scored an average of 7.45 over 10.</p>
<p>The most valued traits of the initiative were the opportunity of having a time frame to try new things, learn, research or acquire some kind of knowledge; along with the possibility of changing the day-to-day routine and context.</p>
<p>On the other hand, some people considered that maybe just a single day felt short and that teamwork should be encouraged.</p>
<h1>The second edition</h1>
<p>I didn't want to make too many changes at once on the second edition so, out of some people's feedback, I introduced a small portion of <em>competition</em> to the event by holding a vote to choose the most innovative idea or accomplishment, where the winner/s would get a prize.</p>
<h2>Feedback</h2>
<p>The <em>competition</em> was greatly welcome, although some people thought otherwise. Again, the most appreciated trait was the opportunity to learn. As a counterpart, some people claimed that the concept of <em>innovation</em> might have a negative impact because of its ambitious connotation.</p>
<p>Despite putting emphasis on the recommendation of forming teams, most people were still working on their own and this was also something that came up in the satisfaction survey.</p>
<h1>The following editions</h1>
<p>We carried out another two editions without applying any changes to the rules. Unsurprisingly, the received feedback didn't change as well.</p>
<h1>Conclusions</h1>
<p>After running four Innovation Day editions and mostly due to the feedback I received, I formed myself an opinion on what Innovation Days provide to a team.</p>
<p>I think Innovation Days should be a team activity that takes place twice a year or so. Gather together, form teams and generate ideas, bottom-up, providing value to the organization and to the team itself.</p>
<p>It should be a directed activity, seriously prepared: allocating a couple of days, hold in a nice venue, providing meals and all the necessary material to let people focus on new ideas and making them a reality.</p>
<p>The bottom line is, <strong>it should be a team building activity</strong>. One of the nice ones.</p>
<h1>Serendipity</h1>
<p>I accidentally realized though, that there's another angle on the activities carried out during an Innovation Day that wasn't the goal of the initiative but turns out to be, in my opinion, much more relevant to the team members: <strong>proactive development</strong>.</p>
<p>During the Innovation Days I observed that many (I could even say <em>most</em>) people focused on tasks almost completely related to their day-to-day / backlog / roadmap work. The main difference between those tasks and the ones carried out on a regular day is that <strong>they were the ones choosing them</strong>. Many of those tasks were mainly technical, related to perform some improvements, refactors, analyzing alternative technologies; but there were also functional tasks, which were simply not yet prioritized, deep down in the backlog or even brand new ideas.</p>
<p>This got me into thinking of the <em>famous</em> Google's "20-time" (20%) or Spotify's "hack time" (10%) but from a realistic point of view, since I was able to see it happen out of nothing. If you let people have some slack, eventually (and I think it would be a really short period), they will end up spending it in tasks closely related to their usual work, with a bunch of major benefits:</p>
<ol>
<li>they will focus on improving the things they work with each and every day</li>
<li>it will let them keep up with the technology evolution</li>
<li>it will reduce their stress because they know that there are regular <em>time-bubbles</em> where they can <em>decompress</em></li>
<li>it will increase personal and company profile, employee happiness and retention</li>
<li>it allows to form casual teams with members of different day-to-day teams</li>
</ol>
<p>All of which will have a significant impact on the work they carry on the rest of the <em>regular</em> days, which are most of them.</p>
<p>I'm not saying that this should be the time when we're allowed to address technical debt issues, evaluate new technologies or implement PoCs. This things <em>should</em> happen without these specific time frames. The company or department's culture should foster this empowerment of the developers. What I'm stating is that <strong>we should be allowed some time that's dedicated to our professional growth</strong> and within that time, we'll likely spend most of it in tasks that will <strong>directly benefit the business as well</strong>.</p>
<p>And in order to do so I think it comes down to a single word: <strong>trust</strong>.</p>
<h1>My takeaway</h1>
<p>Summing up, I think Innovation Days are a really nice initiative with many benefits for the team, but what I really think can make a difference is <strong>letting the team have some slack to enable work to be triggered from the bottom up</strong>.</p>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Jun 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_jun_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_jun_2017.html</id>
<published>2017-06-30T00:00:00+0200</published>
<updated>2017-06-30T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://blog.scalac.io/2017/06/01/why-should-you-care-about-monix.html">Why you should know Monix</a> - Introduction to <a href="https://monix.io/">Monix</a>, a library for asynchronous programming, by <a href="https://github.com/LGLO">Lech Głowiak</a></li>
<li>Akka monitoring with Kamon series by <a href="https://github.com/aludwiko">Andrzej Ludwikowski</a>
<ul>
<li><a href="https://softwaremill.com/akka-monitoring-with-kamon-part-1/">Part 1</a></li>
<li><a href="https://softwaremill.com/akka-monitoring-with-kamon-part-2/">Part 2</a></li>
<li><a href="https://softwaremill.com/akka-monitoring-with-kamon-part-3/">Part 3</a></li>
</ul>
</li>
<li><a href="http://www.cakesolutions.net/teamblogs/error-handling-pitfalls-in-scala">Error handling pitfalls in Scala</a> - Common caveats handling errors by <a href="https://github.com/jkpl">Jaakko Pallari</a></li>
<li><a href="http://blog.colinbreck.com/integrating-akka-streams-and-akka-actors-part-ii/">Integrating Akka Streams and Akka Actors: Part II</a> - Blog post by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="http://japgolly.blogspot.com.es/2017/06/dependently-typed-functions.html">Dependently-Typed Functions</a> - Review of the current Scala's support of dependently-typed functions by <a href="https://github.com/japgolly">David Barri</a></li>
<li><a href="http://underscore.io/blog/posts/2017/06/02/uniting-church-and-state.html">Uniting Church and State: FP and OO Together</a> - Blog post by <a href="https://github.com/noelwelsh/">Noel Welsh</a></li>
<li><a href="http://www.lihaoyi.com/post/ScalaScriptingGettingto10.html">Scala Scripting: Getting to 1.0</a> - <a href="https://github.com/lihaoyi">Li Haoyi</a> blog post about the motivation behind <a href="https://github.com/lihaoyi/ammonite">Ammonite</a> and the goals of the upcoming 1.0 release</li>
<li><a href="https://blog.scalac.io/optics-beyond-lenses-with-monocle.html">Optics beyond Lenses with Monocle</a> - Great blog post on Optics by <a href="https://github.com/note">Michał Sitko</a></li>
<li><a href="https://www.oreilly.com/ideas/the-evolution-of-scalable-microservices">The evolution of scalable microservices</a> - Excellent blog post by <a href="https://github.com/jboner">Jonas Bonér</a></li>
<li>Reactive Streams in Scala: Akka Streams vs Monix series focused on comparing <a href="http://doc.akka.io/docs/akka/current/scala/stream/index.html">Akka Streams</a> and <a href="https://monix.io/">Monix</a> implementations of Reactive Streams, by <a href="https://github.com/rucek">Jacek Kunicki</a>
<ul>
<li><a href="https://softwaremill.com/reactive-streams-in-scala-comparing-akka-streams-and-monix-part-1/">Part 1</a></li>
<li><a href="https://softwaremill.com/reactive-streams-in-scala-comparing-akka-streams-and-monix-part-2/">Part 2</a></li>
</ul>
</li>
<li><a href="http://cloudmark.github.io/FSM/">Akka Finite State Machine (FSM) and At Most Once Semantics</a> - Blog post by <a href="https://github.com/cloudmark">Mark Galea</a></li>
</ul>
<h2>Talks</h2>
<ul>
<li>The Future of Programming (<a href="https://youtu.be/sXdDqOxjKcc">Part 1</a> & <a href="https://youtu.be/XZl5DglVTCs">Part2</a>) by <a href="https://github.com/BartoszMilewski">Bartosz Milewski</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Composing Future, List and Either]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/composing_future,_list_and_either.html"/>
<id>https://pbassiner.github.io/blog/composing_future,_list_and_either.html</id>
<published>2017-06-13T00:00:00+0200</published>
<updated>2017-06-13T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Very often we deal with <code>Future[A]</code>, <code>List[A]</code> and <code>Either[A, B]</code> types but, when it comes to composing them, things can get messy.</p>
<p>I find it easier to understand with a real-world-<em>ish</em> example.</p>
<h2>The context</h2>
<p>Consider the following model for a <code>Commit</code>, an <code>Author</code> and their product <code>CommitAndAuthor</code>:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=Model.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-model-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-model-scala</a></figcaption>
<p>And let's assume we have the following methods already in place:</p>
<ul>
<li><code>getCommits</code>: get all commits from a repository</li>
<li><code>getAuthor</code>: get the Author of a specific commit</li>
</ul>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=GithubApi.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-githubapi-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-githubapi-scala</a></figcaption>
<h2>The task</h2>
<p>Now that we can retrieve all the commits and the author of a specific commit, let's try to provide all the commits <strong>with</strong> their authors:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=Compose.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-compose-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-compose-scala</a></figcaption>
<h2>Approach #1 - Using vanilla Scala</h2>
<p>So we <em>just</em> need to retrieve all the commits and, for each one, retrieve its author and then combine both commit and author.</p>
<p>We can start with the easiest part, the innermost author retrieval from the list of commits:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=FirstApproachInner.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachinner-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachinner-scala</a></figcaption>
<p>So now we have a <code>List[Future[Either[A, B]]]</code> but we need it to be a <code>Future[Either[A, List[B]]]</code> after we combine it with the result of <code>search()</code>.</p>
<p>First of all we'll use <code>Future</code>'s <code>sequence</code> traversal to reduce many <code>Future</code>s to a single <code>Future</code>:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=FirstApproachSequence.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachsequence-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachsequence-scala</a></figcaption>
<p>From the current <code>Future[List[Either[A, B]]]</code> we need to convert it to a <code>Future[Either[A, List[B]]</code> and we'll do so by mapping over the <code>Future</code> and then folding the <code>List</code> into a single <code>Either</code> containing a <code>List[CommitAndAuthor]</code>:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=FirstApproachFold.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachfold-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachfold-scala</a></figcaption>
<p>And finally, we have to compose the result of calling <code>search()</code> with this previous code:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=FirstApproach.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproach-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproach-scala</a></figcaption>
<p>which, if we expand the <code>listCommitsAndAuthor</code> function, would look like:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=FirstApproachExpanded.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachexpanded-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-firstapproachexpanded-scala</a></figcaption>
<p>Ok then, we got it but, even though it works as expected, it's kind of verbose and there's more boilerplate code than actual <em>logic</em>.</p>
<h2>Approach #2 - Using monad transformers</h2>
<p>Most code from the previous approach focuses on mapping over <code>Future</code> and <code>Either</code> to manipulate the underlaying data structures, and here's where monad transformers come into play.</p>
<p>We'll use the datatypes from <a href="https://github.com/typelevel/cats">Cats</a>, a <a href="http://typelevel.org/">Typelevel</a> project providing a lightweight, modular and extensible library for functional programming.</p>
<p>We can take advantage of <code>EitherT</code>, a monad transformer for <code>Either</code>:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=EitherT.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-eithert-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-eithert-scala</a></figcaption>
<p><code>EitherT</code>'s <code>flatMap</code> will apply both <code>Future</code> and <code>Either</code>'s <code>flatMap</code> functions so we don't have to, and it will preserve their short-circuiting nature either (pun intended) if <code>Future</code> fails or <code>Either</code> is <code>Left</code>.</p>
<p>To extract the value from an <code>EitherT</code> instance we just need to call the <code>value</code> function, which will transform it back to a <code>Future[Either[A, B]]</code> instance.</p>
<h3>Refactoring</h3>
<p>Now we can rewrite <code>listCommitsAndAuthor</code>, the innermost function, as:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=SecondApproachInner.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproachinner-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproachinner-scala</a></figcaption>
<p>Since we're composing <code>Future</code> and <code>Either</code> we need a couple of imports from <code>Cats</code> and an <code>ExecutionContext</code>.</p>
<p>We are left with a <code>List[Either[A, B]]</code>. Then, using the <code>sequenceU</code> method we can traverse the <code>List</code> and transform it into an <code>Either[List[A, B]]</code>:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=SecondApproachTraverse.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproachtraverse-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproachtraverse-scala</a></figcaption>
<p>Notice that since we are now also composing <code>List</code>s, we need a couple more imports from <code>Cats</code>.</p>
<p>Finally we can compose the call to <code>search()</code>, wrapped in an <code>EitherT</code> as well, with the previous code:</p>
<script src="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9.js?file=SecondApproach.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproach-scala">https://gist.github.com/pbassiner/6bb41c132da822cce2020827d6163cc9#file-secondapproach-scala</a></figcaption>
<h2>In conclusion</h2>
<p>Now we have a much cleaner implementation which let's you focus on the relevant logic and gently hides all the boilerplate code related to the composition of the monads.</p>
<p>The full code, including all required imports, is available in <a href="https://gist.github.com/pbassiner/bb820da4a662103e3a9e3b595d0e4ea5">this gist</a>.</p>
<h2>References</h2>
<ul>
<li><a href="http://eed3si9n.com/herding-cats/stacking-future-and-either.html">Stacking Future and Either</a> - Part of the Cats tutorial by <a href="https://github.com/eed3si9n">Eugene Yokota</a></li>
<li><a href="http://blog.leifbattermann.de/2017/03/16/7-most-convenient-ways-to-create-a-future-either-stack/">7 Most Convenient Ways To Create A Future Either Stack</a> - Concise summary of ways for dealing with Future/Either stacks by <a href="https://github.com/battermann">Leif Battermann</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - May 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_may_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_may_2017.html</id>
<published>2017-05-31T00:00:00+0200</published>
<updated>2017-05-31T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="http://typelevel.org/blog/2017/05/02/io-monad-for-cats.html">An IO monad for cats</a> - Detailed introduction and explanation of the motivation behind <a href="https://github.com/typelevel/cats-effect">cats-effect</a>, by <a href="https://github.com/djspiewak">Daniel Spiewak</a></li>
<li><a href="http://blog.colinbreck.com/reflections-on-being-a-team-lead/">Reflections on Being a Team Lead</a> - Blog post by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://www.quora.com/How-is-this-statement-%E2%80%9CMonad-is-a-monoid-in-the-category-of-endofunctors-%E2%80%9D-useful-in-programming/answer/Bartosz-Milewski?share=1de25e0b">How is this statement, "Monad is a monoid in the category of endofunctors", useful in programming?</a> - Answer to Quora question by <a href="https://github.com/BartoszMilewski">Bartosz Milewski</a></li>
<li>Akka Typed blog posts series by <a href="https://github.com/patriknw">Patrik Nordwal</a>
<ul>
<li><a href="http://blog.akka.io/typed/2017/05/05/typed-intro">Akka Typed: Hello World in the new API</a></li>
<li><a href="http://blog.akka.io/typed/2017/05/06/typed-coexistence">Akka Typed: Coexistence</a></li>
<li><a href="http://blog.akka.io/typed/2017/05/08/typed-mutable-vs-immutable">Akka Typed: Mutable vs. Immutable</a></li>
<li><a href="http://blog.akka.io/typed/2017/05/12/typed-protocols">Akka Typed: Protocols</a></li>
<li><a href="http://blog.akka.io/typed/2017/05/16/supervision">Akka Typed: Supervision</a></li>
<li><a href="http://blog.akka.io/typed/2017/05/19/signals">Akka Typed: Lifecycle and Watch</a></li>
<li><a href="http://akka.io/blog/2017/05/26/timers">Akka Typed: Timers</a></li>
</ul>
</li>
<li><a href="https://softwaremill.com/free-tagless-compared-how-not-to-commit-to-monad-too-early/">Free and tagless compared - how not to commit to a monad too early</a> - Detailed comparison between Free Monads and Final Tagless by <a href="https://github.com/adamw">Adam Warski</a></li>
<li><a href="https://dev.to/jlhcoder/how-to-set-the-technical-direction-for-your-team">How to Set the Technical Direction for Your Team</a> - Blog post on technical leadership by <a href="https://github.com/jlhood">James Hood</a></li>
<li><a href="http://scala-lang.org/blog/2017/05/30/tribulations-canbuildfrom.html">Tribulations of CanBuildFrom</a> - Blog post on the design and features built on top of <code>CanBuildFrom</code>, along with the alternative solutions implemented in the new collections</li>
<li><a href="https://softwaremill.com/interval-based-rate-limiter/">An interval-based rate limiter for Akka Stream</a> - Blog post by <a href="https://github.com/mkubala">Marcin Kubala</a></li>
<li><a href="https://cloudplatform.googleblog.com/2017/05/istio-modern-approach-to-developing-and.html">Istio: a modern approach to developing and managing microservices</a> - Announcement of the alpha release of <a href="https://istio.io/">Istio</a>: a new open-source project that provides a uniform way to help connect, secure, manage and monitor microservices</li>
</ul>
<h2>Talks</h2>
<ul>
<li><a href="https://www.slideshare.net/ManuelBernhardt/8-akka-antipatterns-youd-better-be-aware-of">8 Akka anti-patterns you'd better be aware of (slides)</a> - Talk slides by <a href="https://github.com/manuelbernhardt">Manuel Bernhardt</a></li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="http://tpolecat.github.io/2017/04/25/scalac-flags.html">Recommended Scalac Flags for 2.12</a> - by <a href="https://github.com/tpolecat">Rob Norris</a></li>
<li><a href="https://github.com/tpolecat/cats-infographic">Cats Infographic</a> - Visual representation of the <a href="https://github.com/typelevel/cats">cats</a> typeclass hierarchy, by <a href="https://github.com/tpolecat">Rob Norris</a></li>
<li><a href="http://scala-lang.org/blog/2017/05/19/scastie.html">Scastie is out of beta and available to everybody</a> - Public release of Scastie: Scala + sbt in your browser</li>
<li><a href="https://github.com/circe/circe-derivation">circe-derivation: Fast type class instance derivation for circe</a> - Macro-supported derivation of circe's type class instances. This library is for people who don't care about the full generic derivation experience but just want fast builds and instances that stay in sync with their definitions, and who don't mind a bit of boilerplate (a couple of lines per case class).</li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Essential sbt Plugins]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/essential_sbt_plugins.html"/>
<id>https://pbassiner.github.io/blog/essential_sbt_plugins.html</id>
<published>2017-05-16T00:00:00+0200</published>
<updated>2017-05-16T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>After working in several Scala projects you are likely to end up with a minimal <em>seed</em> (kind of a project template) that you'll use whenever you start a new project.</p>
<p>Part of this <em>seed</em> would include some general-purpose sbt plugins, and these are the ones I'd pick.</p>
<h2>Keeping all your dependencies under control</h2>
<h3>sbt-updates</h3>
<p>It's always ideal to have your dependencies updated to the latest release. To automate that, <a href="https://github.com/rtimush/sbt-updates">sbt-updates</a> can check maven repositories for dependency updates on your project dependencies (there is also a limited support for Ivy repositories hosted on BinTray).</p>
<p>Running the <code>dependencyUpdates</code> command displays the currently available updates:</p>
<pre><code>> dependencyUpdates
Found 14 dependency updates for project
com.typesafe:config : 1.3.0 -> 1.3.1
ch.qos.logback:logback-classic : 1.1.10 -> 1.2.1
org.slf4j:jcl-over-slf4j : 1.7.22 -> 1.7.23
com.typesafe.akka:akka-slf4j : 2.4.16 -> 2.4.17
com.typesafe.akka:akka-actor : 2.4.11.1 -> 2.4.17
com.typesafe.akka:akka-http-core : 2.4.11.1 -> 10.0.3
com.typesafe.akka:akka-stream : 2.4.11.1 -> 2.4.17
com.lightbend.akka:akka-stream-alpakka-sqs : 0.5 -> 0.6
de.heikoseeberger:akka-http-circe : 1.11.0 -> 1.12.0
org.scala-lang.modules:scala-parser-combinators : 1.0.4 -> 1.0.5
com.h2database:h2 : 1.4.192 -> 1.4.193
com.zaxxer:HikariCP : 2.5.1 -> 2.6.0
org.scalatest:scalatest : 3.0.1 -> 3.2.0-SNAP4
com.typesafe.akka:akka-stream-testkit : 2.4.16 -> 2.4.17
</code></pre>
<h3>sbt-dependency-graph</h3>
<p>Every now and then you might need to inspect the transitive dependencies in your project, especially when there are clashes and evictions. <a href="https://github.com/jrudolph/sbt-dependency-graph">sbt-dependency-graph</a> creates a dependency graph including that information.</p>
<p>Running the <code>dependencyGraph</code> command will output all the dependencies in an ASCII tree graph:</p>
<pre><code>> dependencyGraph
...
+-com.typesafe.akka:akka-stream_2.12:2.4.16 [S]
+-com.typesafe.akka:akka-actor_2.12:2.4.16 [S]
| +-com.typesafe:config:1.3.0 (evicted by: 1.3.1)
| +-com.typesafe:config:1.3.1
| +-org.scala-lang.modules:scala-java8-compat_2.12:0.8.0 [S]
|
+-com.typesafe:ssl-config-core_2.12:0.2.1 [S]
| +-com.typesafe:config:1.2.0 (evicted by: 1.3.1)
| +-com.typesafe:config:1.3.1
| +-org.scala-lang.modules:scala-parser-combinators_2.12:1.0.4 [S]
|
+-org.reactivestreams:reactive-streams:1.0.0
...
</code></pre>
<h2>Keeping the code clean</h2>
<h3>sbt-scalariform</h3>
<p>No matter what your formatting conventions are, avoid relying on manual enforcement is paramount. The main feature of <a href="https://github.com/sbt/sbt-scalariform">sbt-scalariform</a> is that it automatically formats the source code on the specified build stages, using <a href="https://github.com/scala-ide/scalariform">Scalariform</a>.</p>
<h3>scalastyle-sbt-plugin</h3>
<p>Even if the source code is automatically formatted, having a static style checker like <a href="https://github.com/scalastyle/scalastyle-sbt-plugin">scalastyle-sbt-plugin</a> allows to generate a report to visually inspect the analysis.</p>
<h3>sbt-wartremover</h3>
<p>In addition to the standard library warnings, <a href="https://github.com/wartremover/wartremover">sbt-wartremover</a> adds more validations during the compile stage to enforce better coding conventions such as usage of <code>null</code> and <code>asInstanceOf</code> or non-final case classes, for instance. Here's the list of all <a href="http://www.wartremover.org/doc/warts.html">supported validations</a>.</p>
<h3>sbt-scoverage</h3>
<p>In order to have a summary of the amount of code covered by unit tests, <a href="https://github.com/scoverage/sbt-scoverage">sbt-scoverage</a> provides code coverage reports in HTML and XML:
<img src="https://raw.githubusercontent.com/scoverage/scalac-scoverage-plugin/master/misc/screenshot2.png" alt="sbt-coverage" /></p>
<h2>Preparing to release</h2>
<h3>sbt-native-packager</h3>
<p><a href="https://github.com/sbt/sbt-native-packager">sbt-native-packager</a> lets you generate application packages in native formats. It supports universal <code>zip</code>, <code>tar.gz</code> and <code>xz</code> archives, <code>deb</code> and <code>rpm</code> for Debian/RHEL, <code>dmg</code> for OSX, <code>msi</code> for Windows and, <em>drumroll</em>, <code>docker</code> images.</p>
<h2>Usage</h2>
<p>In your CI jobs you can take advantage of most of these sbt plugins to generate everything you need in one go:</p>
<pre><code>sbt clean compile coverage test scalastyle coverageReport coverageOff docker:publish
</code></pre>
<p>This sequence of sbt commands will:</p>
<ul>
<li>Clean the generated target</li>
<li>Compile</li>
<li>Enable scoverage to instrument the code</li>
<li>Run the tests</li>
<li>Generate the scalastyle report</li>
<li>Generate the code coverage report</li>
<li>Disable scoverage to remove instrumentation (<strong>this step is mandatory if there are further build steps, since it would use instrumented code otherwise</strong>)</li>
<li>Build and publish the corresponding docker image</li>
</ul>
<p>Do you regularly use any other sbt plugins? Please share!</p>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Apr 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_apr_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_apr_2017.html</id>
<published>2017-04-28T00:00:00+0200</published>
<updated>2017-04-28T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="http://blog.colinbreck.com/integrating-akka-streams-and-akka-actors-part-i/">Integrating Akka Streams and Akka Actors: Part I</a> - Blog post by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="http://www.cakesolutions.net/teamblogs/existential-types-in-scala">Existential types in Scala</a> - Blog post by <a href="https://github.com/pjrt">Pedro Rodríguez</a></li>
<li><a href="https://gitlab.com/snippets/1655955">Some thoughts about typed functional programming in Scala</a> - Post by <a href="https://gitlab.com/types.snively">Paul Snively</a></li>
<li><a href="https://softwaremill.com/comparing-scala-relational-database-access-libraries/">Comparing Scala relational database access libraries</a> - Detailed comparison of RDBMS access libraries in Scala by <a href="https://github.com/adamw">Adam Warski</a></li>
<li><a href="http://blog.scalac.io/2017/04/18/akka-streams-introduction.html">Introduction to Streams in Akka</a> - Blog post by <a href="https://github.com/margorczynski">Marcin Gorczyński</a></li>
<li><a href="http://blog.scalac.io/2017/04/19/typeclasses-in-scala.html">Type classes in Scala</a> - Blog post by <a href="https://github.com/lukeindykiewicz">Łukasz Indykiewicz</a></li>
<li><a href="http://blog.scalac.io/2017/04/25/akka-streams-graph-stage.html">Custom GraphStage in Akka Streams</a> - Blog post by <a href="https://github.com/note">Michał Sitko</a></li>
<li><a href="http://blog.christianposta.com/microservices/the-hardest-part-of-microservices-calling-your-services">The Hardest Part of Microservices: Calling Your Services</a> - Blog post by <a href="https://github.com/christian-posta">Christian Posta</a></li>
</ul>
<h2>Talks</h2>
<ul>
<li><a href="https://youtu.be/C5oogxdX_Bo">Category Theory II 7.1: Comonads</a> - New video in the series Category Theory for Programmers: Comonads, by <a href="https://github.com/BartoszMilewski">Bartosz Milewski</a></li>
<li><a href="https://youtu.be/Zt6LjUnOcFQ">The Type Astronaut's Guide to Shapeless</a> - <a href="https://github.com/davegurnell">Dave Gurnell</a>'s workshop on <a href="https://github.com/milessabin/shapeless">Shapeless</a> at Scala World 2016</li>
<li><a href="https://youtu.be/aKUQUIHRGec">Free as in Monads</a> - <a href="https://github.com/djspiewak">Daniel Spiewak</a> about free monads at Northeast Scala Symposium 2017</li>
<li><a href="https://www.youtube.com/watch?v=Oij5V7LQJsA">What to Leave Implicit</a> - <a href="https://github.com/odersky">Martin Odersky</a>'s keynote at ScalaDays Chicago 2017</li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="http://akka.io/news/2017/04/13/akka-2.5.0-released.html">Akka 2.5.0 Released!</a> - Details on the important release, the first since 18 months.</li>
<li><a href="http://developer.lightbend.com/blog/2017-04-10-sbt-01315-JDK9-support-and-offline-installation/index.html">New in sbt 0.13.15</a> - Latest sbt release, full release notes available <a href="http://www.scala-sbt.org/0.13/docs/sbt-0.13-Tech-Previews.html#sbt+0.13.15">here</a></li>
<li><a href="http://www.scala-lang.org/news/releases-1Q17.html">Scala 2.12.2 is out!</a> - New minor releases for Scala 2.11.x, 2.12.x and the first milestone release for 2.13.0</li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Why I Choose Scala]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/why_i_choose_scala.html"/>
<id>https://pbassiner.github.io/blog/why_i_choose_scala.html</id>
<published>2017-04-11T00:00:00+0200</published>
<updated>2017-04-11T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<h2>Disclaimer</h2>
<p>As the title itself reflects, this is a highly opinionated post.</p>
<h2>TL;DR</h2>
<p>Why I choose Scala then?</p>
<ul>
<li>Type-safe (statically typed + type inference)</li>
<li>High development productivity</li>
<li>Supports both Object Oriented and Functional Programming paradigms</li>
<li>JVM Language + Seamless Java interoperability</li>
</ul>
<h2>Background</h2>
<p>The lead designer of Scala, <a href="https://twitter.com/odersky">Martin Odersky</a>, has been involved in Java since 1995 and contributed to the current Java Compiler and Generics introduced in version 1.5.</p>
<p>Around 2001, at the École Polytechnique Fédérale de Lausanne (EPFL), he started to investigate the next challenges in software programming and he thought that unifying OO & FP would address those challenges.</p>
<p>The outcome was Scala (acronym for Scalable Language), in 2003. In 2011 he and other collaborators founded Typesafe Inc. (<a href="http://www.lightbend.com/">Lightbend</a> as of Feb. 2016), a company to support and promote Scala.</p>
<h2>Type safety</h2>
<p>Dynamically typed languages have their place as well, they are versatile and have plenty of use cases where they shine. And of course, that's not only the case for Javascript (see Ruby, Python or Groovy, just to name some of them).</p>
<p>When talking about building an enterprise application though, type-safety is a must to me. That piece of software will be used to encode and manage business rules, and it'll be developed and maintained by many developers during its life which, in this context, should be rather a long time.</p>
<h2>JVM</h2>
<p>Coming from the Java ecosystem, transitioning to Scala is easier. It runs on the JVM so all you know about it prevails (memory management, configuration, fine tuning, etc). You can integrate Java libraries, frameworks and tools in a Scala application. Moreover, Java and Scala classes can be freely mixed.</p>
<p>The Scala community is an important part of the Java ecosystem.</p>
<h2>OOP + FP</h2>
<p>Functional Programming is on the rise nowadays. Beyond the <em>hype</em>, FP principles make it easier to reduce the complexity of a system by setting a clear separation between functions (<em>pure functions</em>) and side effects.</p>
<p>As Moseley and Marks described in <a href="http://shaffner.us/cs/papers/tarpit.pdf">Out of the Tar Pit</a>:</p>
<blockquote>
<p>Complexity is the root cause of the vast majority of problems with software today...</p>
</blockquote>
<blockquote>
<p>... it is our belief that the single biggest remaining cause of complexity in most contemporary large systems is state, and the more we can do to limit and manage state, the better.</p>
</blockquote>
<p>The deterministic nature of pure functions along with the type system significantly reduce the cognitive load required to reason about them. The lack of <code>null</code>s, thrown exceptions and mutability (<em>accidental complexity</em>) lets you focus on the important logic of the application (<em>essential complexity</em>).</p>
<p>Unlike many other FP languages, Scala allows a gradual, easy migration to a more FP style. You can start to use it as <em>Java without semicolons</em> and evolve it over time.</p>
<h2>Development productivity</h2>
<p>Besides the benefits of FP, Scala's features can boost development productivity even if used in a OOP fashion.</p>
<h3>Immutability by default</h3>
<p>Immutable objects and methods without side-effects make concurrent programming easier & thread-safe.</p>
<p>As Joshua Bloch stated in his book <em>Effective Java</em>:</p>
<blockquote>
<p>Classes should be immutable unless there's a very good reason to make them mutable</p>
</blockquote>
<p>In Scala, immutable is the <strong>default</strong>.</p>
<h3>Every operation is a method, even <code>==</code></h3>
<p>In contrast to Java, in Scala <code>==</code> is not a built-in operator but a method that can be overridden. For example, <code>String</code> class overrides it to compare the content of the strings.</p>
<h3>Tuples</h3>
<p>A tuple is an immutable sequence of values of multiple types.</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Tuples.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-tuples-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-tuples-scala</a></figcaption>
<h3>Option</h3>
<p>A <code>null</code> value is often abused to represent an absent optional value. This means the <code>null</code> value is bubbling up the hierarchy call. Sometimes this just leads to an exception much higher in the hierarchy, where some piece of code isn't that <em>null-friendly</em>.</p>
<p>In Scala there's the <code>Option</code> type, and it represents values that might or might not be present. Instances of <code>Option</code> are either an instance of <code>Some</code> or <code>None</code>.</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Option.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-option-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-option-scala</a></figcaption>
<h3>Case classes</h3>
<p>In Java, defining an immutable (for fairness in the comparison) POJO requires explicit declaration of the type members, constructor, getters and overriding the <code>hashCode</code>, <code>equals</code> and <code>toString</code> methods.</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Pojo.java"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-pojo-java">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-pojo-java</a></figcaption>
<p>In Scala you get all that just by defining a class as a <code>case class</code>:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=CaseClass.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-caseclass-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-caseclass-scala</a></figcaption>
<p>A <code>case class</code> is a regular class with reduced boilerplate by the compiler:</p>
<ul>
<li>The constructor parameters become public fields</li>
<li>Methods <code>toString</code>, <code>equals</code> and <code>hashCode</code> are defined based on the constructor fields</li>
<li>A companion object (where you define the equivalent of <code>static</code> methods in Java) containing:
<ul>
<li>An <code>apply</code> constructor based on the class constructor</li>
<li>An extractor based on constructor fields</li>
</ul>
</li>
</ul>
<p>The methods in the companion object allow to perform pattern matching on instances of the <code>case class</code> (see next section).</p>
<h3>Pattern matching</h3>
<p>Scala has a built-in general pattern matching mechanism. It allows to match on any sort of data with a first-match policy:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=PatternMatching.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatching-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatching-scala</a></figcaption>
<p>As you can see it can match values as well as data structures. This is of great use when in combination with <code>case classes</code>. With a small amount of code we can define an expression writer:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=PatternMatchingCaseClasses.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatchingcaseclasses-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatchingcaseclasses-scala</a></figcaption>
<p>Another useful scenario is pattern matching <code>Option</code>:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=PatternMatchingOption.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatchingoption-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-patternmatchingoption-scala</a></figcaption>
<h3>Collections API</h3>
<p>The Scala collections API provides plenty of methods to simplify manipulating data:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Collections.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-collections-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-collections-scala</a></figcaption>
<h3>First-class functions</h3>
<p>A function in Scala is a first-class value. Like any other value, it may be passed as a parameter or returned as a result. Functions which take other functions as parameters or return them as results are called higher-order functions.</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=FirstClassFunctions.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-firstclassfunctions-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-firstclassfunctions-scala</a></figcaption>
<h3>Traits and composition</h3>
<p>Traits are like Java interfaces but they can be partially implemented. This enables multiple inheritance (a <em>mixin</em>):</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Traits.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-traits-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-traits-scala</a></figcaption>
<p>(Example taken from the <a href="http://docs.scala-lang.org/tutorials/tour/mixin-class-composition.html">official Scala Documentation</a>)</p>
<h3>Futures</h3>
<p>Scala's <code>Future[T]</code> provides asynchronous, non-blocking computations that will eventually result in a value of type <code>T</code>. The future will either succeed or fail:</p>
<script src="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb.js?file=Futures.scala"></script>
<figcaption><a href="https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-futures-scala">https://gist.github.com/pbassiner/41c94ce57a3fd5da3a921587062ca2cb#file-futures-scala</a></figcaption>
<h2>More than just vanilla Scala</h2>
<p>The Scala community is increasing and it's more active every day, with many well known companies using it (LinkedIn, Twitter, Foursquare, Netflix, Tumblr, Soundcloud, Coursera, ...).</p>
<p><a href="http://www.lightbend.com/">Lightbend</a> (formerly Typesafe) is the most influential actor in the community. They are actively contributing to the Scala programming language and some frameworks on top of it. Their reactive platform is consists of the following components:</p>
<ul>
<li><a href="http://www.lagomframework.com/">Lagom</a>: a microservice framework</li>
<li><a href="https://www.playframework.com">Play</a>: a high velocity web framework</li>
<li><a href="http://akka.io">Akka</a>: a toolkit and runtime for building highly concurrent, distributed, and resilient message-driven applications on the JVM</li>
<li>Spark: <a href="http://spark.apache.org/">Apache Spark</a> is a fast and general engine for large-scale data processing</li>
</ul>
<p><a href="http://typelevel.org/">Typelevel</a> is another company which provides pure functional programming libraries for Scala. The more relevant ones are:</p>
<ul>
<li><a href="https://github.com/typelevel/cats">Cats</a>: Lightweight, modular, and extensible library for functional programming</li>
<li><a href="https://github.com/milessabin/shapeless">Shapeless</a>: Generic programming for Scala</li>
<li><a href="https://github.com/julien-truffaut/Monocle">Monocle</a>: Optics library for Scala</li>
<li><a href="https://github.com/circe/circe">Circe</a>: A JSON library for Scala powered by Cats</li>
<li><a href="https://github.com/tpolecat/doobie">Doobie</a>: a pure functional JDBC layer for Scala</li>
</ul>
<h2>Special mention: Akka</h2>
<p><a href="http://akka.io">Akka</a> deserves a dedicated section on its own merits. I am by no means an expert in Akka but I'd like to outline the most relevant features about it:</p>
<ul>
<li>Meant for distributed systems, out-of-the-box clustering and location transparency</li>
<li>Based on the Actor Model, with supervision hierarchies, to provide fault-tolerance</li>
<li><a href="http://doc.akka.io/docs/akka-http/current/scala.html">Http</a> - fully async and reactive HTTP server</li>
<li><a href="http://doc.akka.io/docs/akka/current/scala/stream/index.html">Streams</a> - back-pressured stream processing</li>
</ul>
<p>I plan to write a post about it at some point but, in the meantime, refer to the <a href="http://doc.akka.io/docs/akka/current/scala.html">Akka documentation</a> for more information about it.</p>
<h2>Conclusion</h2>
<p>I find Scala a great choice, especially as a step forward for Java developers eager to embrace functional programming. It's not only about purity, category theory, functors, monads or higher-kinded types, these will be the logical consequences of shifting to the FP paradigm. In this context, Scala is flexible enough to accommodate developers in all stages of FP adoption.</p>
<p>On the other hand, for a Java company, moving to Scala it's an acceptable risk due to their compatibility and shared runtime. For this to succeed, it's important that at least one or two developers can take responsibility for its adoption, motivating, training and assisting the rest of the team, while periodically assessing the potential risks of generating knowledge silos.</p>
<p>Therefore, it's a win-win scenario: reasonable risk and happier developers.</p>
<h2>Learning resources</h2>
<p>If you want to learn more about Scala, these are some useful resources:</p>
<ul>
<li><a href="https://www.scala-lang.org/documentation/">Scala Documentation</a></li>
<li><a href="http://danielwestheide.com/scala/neophytes.html">The Neophyte's Guide to Scala</a> - Blog series by Daniel Westheide</li>
<li><a href="https://www.coursera.org/specializations/scala">Functional Programming in Scala Specialization</a> - Coursera specialization lead by Martin Odersky</li>
<li><a href="https://www.scala-lang.org/documentation/books.html">Scala Books</a></li>
</ul>
<h2>References</h2>
<ul>
<li><a href="https://www.scala-lang.org">Scala Official Website</a></li>
<li><a href="http://shaffner.us/cs/papers/tarpit.pdf">Out of the Tar Pit</a> - Moseley & Marks, 2006</li>
<li><a href="http://www.lightbend.com/">Lightbend, Inc.</a></li>
<li><a href="http://typelevel.org/">Typelevel</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Monthly Digest - Mar 2017]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/monthly_digest_-_mar_2017.html"/>
<id>https://pbassiner.github.io/blog/monthly_digest_-_mar_2017.html</id>
<published>2017-03-31T00:00:00+0200</published>
<updated>2017-03-31T00:00:00+0200</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>Here's a recap of interesting stuff I've run into during this month.</p>
<h2>Reading</h2>
<ul>
<li><a href="https://medium.com/spire-labs/mitigating-an-aws-instance-failure-with-the-magic-of-kubernetes-128a44d44c14">Mitigating an AWS Instance Failure with the Magic of Kubernetes</a> - How Kubernetes can help to build resilient systems, by <a href="https://github.com/robscott">Rob Scott</a></li>
<li><a href="https://medium.com/google-cloud/clustering-akka-in-kubernetes-with-statefulset-and-deployment-459c0e05f2ea">Clustering Akka in Kubernetes with Statefulset and Deployment</a> - Tips to run Akka cluster in Kubernetes by <a href="https://github.com/saturnism">Ray Tsang</a></li>
<li><a href="https://developers.redhat.com/blog/2017/03/14/java-inside-docker/">Java inside docker: What you must know to not FAIL</a> - Common pitfalls and caveats on running Java inside Docker by <a href="https://github.com/rafabene">Rafael Benevides</a></li>
<li><a href="https://www.youtube.com/watch?v=LhGq4HlozV4">Getting Work Done with the Eff Monad in Scala (talk)</a> - <a href="https://github.com/benhutchison">Ben Hutchison</a>'s talk at <a href="http://www.composeconference.org/">Compose Conference</a></li>
<li><a href="https://speakerdeck.com/alexandru/fp-design-a-tale-of-monix">FP Design: A Tale Of Monix (slides)</a> - Slides from the talk <a href="https://github.com/alexandru">Alexandru Nedelcu</a> gave at the <a href="http://www.nescala.org/">NEScala Unconference</a> about Monix</li>
</ul>
<h2>Code</h2>
<ul>
<li><a href="https://blog.knoldus.com/2016/12/27/testing-rejection-handling-in-akka-http/">Testing Rejection Handling in Akka-Http</a> - Concise blog post on how to test rejections in Akka Http</li>
<li><a href="http://blog.colinbreck.com/patterns-for-streaming-measurement-data-with-akka-streams/">Patterns for Streaming Measurement Data with Akka Streams</a> - Excellent blog post (again) by <a href="https://twitter.com/breckcs">Colin Breck</a></li>
<li><a href="https://efekahraman.github.io/2017/02/a-simple-akka-cluster-application">A Simple Akka Cluster Application</a> - Blog post by <a href="https://github.com/efekahraman">Efe Kahraman</a></li>
<li><a href="https://blog.codecentric.de/en/2017/03/akka-best-practices-defining-actor-props/">Akka Best Practices: Defining Actor Props</a> - Quick tips on defining Akka Actor Props by <a href="https://github.com/britter">Benedikt Ritter</a></li>
<li><a href="http://blog.leifbattermann.de/2017/03/16/7-most-convenient-ways-to-create-a-future-either-stack/">7 Most Convenient Ways To Create A Future Either Stack</a> - Concise summary of ways for dealing with Future/Either stacks by <a href="https://github.com/battermann">Leif Battermann</a></li>
</ul>
]]>
</content>
</entry><entry>
<title type="html">
<![CDATA[Bullshitless Versioning]]>
</title>
<link rel="alternate" type="text/html" href="https://pbassiner.github.io/blog/bullshitless_versioning.html"/>
<id>https://pbassiner.github.io/blog/bullshitless_versioning.html</id>
<published>2017-03-14T00:00:00+0100</published>
<updated>2017-03-14T00:00:00+0100</updated>
<author>
<name>Pol Bassiner</name>
<uri>https://pbassiner.github.io/</uri>
</author>
<content type="html">
<![CDATA[<p>I have to admit the post title is deliberately provocative but I'll try to prove that it's not necessarily inaccurate, although I could certainly have titled it <strong>Versioning Internal Applications</strong> or <strong>Simplified Versioning</strong>.</p>
<h2>Semantic Versioning</h2>
<p>Semantic Versioning, a.k.a. <em>SemVer</em>, is a set of rules that define how version numbers should be assigned and incremented.</p>
<p>The versioning scheme is X.Y.Z, where:</p>
<ul>
<li>X is the MAJOR version</li>
<li>Y is the MINOR version</li>
<li>Z is the PATCH version</li>
</ul>
<p>And according to <a href="http://semver.org/">SemVer</a>, given a version number MAJOR.MINOR.PATCH, increment the:</p>
<ul>
<li>MAJOR version when you make incompatible API changes,</li>
<li>MINOR version when you add functionality in a backwards-compatible manner, and</li>
<li>PATCH version when you make backwards-compatible bug fixes.</li>
</ul>
<h2>The case for SemVer</h2>
<p>As one can conclude from the <em>SemVer</em> definition and its purpose, it's definitely <strong>relevant and useful for public APIs and libraries</strong> to ease the dependency management and reduce <a href="https://en.wikipedia.org/wiki/Dependency_hell">dependency hell</a>.</p>
<h2>The case against SemVer</h2>
<p>What about versioning <strong>internal applications</strong>? You'll probably have several of them and also some being dependencies of others. Does this necessarily mean that you have to version them using <em>SemVer</em>?</p>
<h3>Deciding the next version in advance</h3>