-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
926 lines (512 loc) · 39.6 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>royvanrijn | Java, algorithms, math, science and more!</title>
<meta name="description" content="Java, algorithms, math, science and more!">
<meta name="keywords" content="royvanrijn,programming,java,blog,devoxx,conference,speaker,technology,science,math,azspcs,tips,tricks" />
<link rel="shortcut icon" href="/images/favicon.png" type="image/x-icon" />
<link rel="apple-touch-icon" href="/images/avatar.jpg" />
<link rel="stylesheet" href="/css/main.css">
<link rel="canonical" href="https://royvanrijn.com/">
<link rel="alternate" type="application/rss+xml" title="royvanrijn" href="https://royvanrijn.com/feed/" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@royvanrijn" />
<meta name="twitter:title" content="royvanrijn" />
<meta name="twitter:description" content="Java, algorithms, math, science and more!" />
<meta name="twitter:image" content="http://www.royvanrijn.com/thumbnails/default.jpg"/>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-1EGFKH9M9P"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-1EGFKH9M9P');
</script>
<script src="https://cdn.jsdelivr.net/combine/npm/[email protected],npm/@magenta/[email protected]/es6/core.js,npm/focus-visible@5,npm/[email protected]"></script>
</head>
<body>
<header class="site-header">
<div class="wrapper">
<a class="site-title" href="/">
<img src="/images/header_royvanrijn.jpg" alt="royvanrijn" width="990" height="307"/>
</a>
<nav class="site-nav">
<div class="trigger">
</div>
</nav>
</div>
</header>
<div class="page-content">
<div class="wrapper">
<div class="home">
<hr/>
<!-- This loops through the paginated posts -->
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2023/01/java-notebooks/" title="Introduction to Java Notebooks">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Introduction to Java Notebooks" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2023-01-04T23:35:00+01:00" class="date" />
<span itemprop="datePublished" content="2023-01-04T23:35:00+01:00" class="date">
Jan 4, 2023 23:35:00
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2023/01/java-notebooks/">Introduction to Java Notebooks</a></h1>
<span itemprop="articleBody">
<p><strong>Java Notebook</strong> is a new and exciting way to explore the <a href="https://www.java.org">Java</a> programming language. It works a lot like <a href="https://jupyter.org/try-jupyter/retro/notebooks/?path=notebooks/Intro.ipynb">Jupyter Notebooks</a>.</p> <p>Notebooks are a community standard for communicating and performing interactive computing. They are a document that blends computations, outputs, explanatory text, mathematics, images, and rich media representations of objects.</p> <p>It allows you to interleave blocks of text (in <a href="https://en.wikipedia.org/wiki/Markdown">Markdown</a>), editable <em>and</em> executable <strong>Java</strong> code blocks and output blocks.</p> <figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="o">[</span><span class="mi">1</span><span class="o">]</span> <span class="o">[</span><span class="nc">Run</span><span class="o">]</span> <span class="o">[</span><span class="nc">Edit</span><span class="o">]</span> <span class="nc">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"Hello world!"</span><span class="o">);</span></code></pre></figure> <div class="highlighter-rouge"><div class="highlight"><pre...
</span>
<p><a class="title-link" href="/blog/2023/01/java-notebooks/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2022/07/daily-calendar-puzzle-solutions/" title="Solving the daily calendar puzzle">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Solving the daily calendar puzzle" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2022-07-07T20:42:12+02:00" class="date" />
<span itemprop="datePublished" content="2022-07-07T20:42:12+02:00" class="date">
Jul 7, 2022 20:42:12
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2022/07/daily-calendar-puzzle-solutions/">Solving the daily calendar puzzle</a></h1>
<span itemprop="articleBody">
<p>About a month ago I was watching a YouTube video where YouTuber <a href="https://www.youtube.com/c/DrewGooden1/videos">Drew Gooden</a> was struggling with a “weird” puzzle:</p> <iframe type="text/html" width="640" height="390" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="https://www.youtube.com/embed/WbAuL4fg5LI?start=888&title=0&byline=0&portrait=0"></iframe> <p>This is what the puzzle looks like:</p> <p><img src="/images/daily-calendar-puzzle.jpg" alt="example of the Daily Calendar Puzzle" /></p> <p>It has 10 pieces that can be flipped/rotated and placed on a calendar. They claim there is a solution for each day/month/weekday combination. In the YouTube video Drew is struggling and says:</p> <blockquote> <p>The problem is, I’ll never be able to prove that</p> </blockquote> <p>But… what if we <strong>can</strong>?</p> <p>As a programmer this sounds...
</span>
<p><a class="title-link" href="/blog/2022/07/daily-calendar-puzzle-solutions/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2022/03/all-the-music-megamix/" title="All The Music: the Megamix">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="All The Music: the Megamix" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2022-03-23T22:23:03+01:00" class="date" />
<span itemprop="datePublished" content="2022-03-23T22:23:03+01:00" class="date">
Mar 23, 2022 22:23:03
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2022/03/all-the-music-megamix/">All The Music: the Megamix</a></h1>
<span itemprop="articleBody">
<p>Or a clickbait title:</p> <blockquote> <p>How I became the world’s most prolific DJ, using code.</p> </blockquote> <p>This week I stumbled across a cool project: <a href="http://allthemusic.info/">All The Music</a>.</p> <p>Damien Riehl (programmer/copyright attorney) and Noah Rubin (programmer) decided to generate <strong>all possible songs</strong> with the basic 8 major notes (C4,D4,E4,F4,G4,A4,B4 and C5) with length 12. All these songs have been ‘freely’ released under the ‘Creative Commons’ license. Their goal is to stop copyright claims on melodies.</p> <iframe type="text/html" width="640" height="390" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="https://www.youtube.com/embed/sJtm0MoOgiU?title=0&byline=0&portrait=0"></iframe> <p>While watching their excellent TED talk and hearing about the challenges they had to generate these...
</span>
<p><a class="title-link" href="/blog/2022/03/all-the-music-megamix/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2022/03/pi-day-2022/" title="Roadtrip to Ludolph van Ceulen">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Roadtrip to Ludolph van Ceulen" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2022-03-14T03:14:15+01:00" class="date" />
<span itemprop="datePublished" content="2022-03-14T03:14:15+01:00" class="date">
Mar 14, 2022 03:14:15
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2022/03/pi-day-2022/">Roadtrip to Ludolph van Ceulen</a></h1>
<span itemprop="articleBody">
<p>Today is March 14th (3/14), otherwise known as Pi Day!</p> <h2 id="calculating-pi">Calculating Pi</h2> <p>To celebrate Pi Day people often try to come up with cool and interesting ways to calculate π, or to celebrate the number in weird ways.</p> <p>Here is a great example by the excellent Matt Parker (from Stand-up Maths):</p> <iframe type="text/html" width="640" height="390" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="https://www.youtube.com/embed/CKl1B8y4qXw?title=0&byline=0&portrait=0"></iframe> <p>He’s using the “Isaac Newton”-way to calculate π by hand. This method was discovered by Isaac Newton and German mathematician Gottfried Wilhelm Leibniz in 1665. And it uses ‘infinite series’.</p> <h2 id="before-newton">Before Newton</h2> <p>The method Newton used (infinite series)...
</span>
<p><a class="title-link" href="/blog/2022/03/pi-day-2022/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2022/03/wordle-to-nerdle/" title="From Wordle to Nerdle">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="From Wordle to Nerdle" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2022-03-03T08:01:25+01:00" class="date" />
<span itemprop="datePublished" content="2022-03-03T08:01:25+01:00" class="date">
Mar 3, 2022 08:01:25
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2022/03/wordle-to-nerdle/">From Wordle to Nerdle</a></h1>
<span itemprop="articleBody">
<p>About two months ago I wrote a <a href="/blog/2022/01/wordle-bot/">blogpost</a> about what strategies you could use to solve Wordle in the most efficient way. In the end I wrote a program that looks ahead a single guess and finds the word that gives you the most information.</p> <p>The main hype around Wordle (and all of the clones), seems to have settled down now… but I still play <em>some</em> of them.</p> <h2 id="nerdle">Nerdle</h2> <p>One clone I really enjoyed playing the last couple of weeks has been <a href="https://nerdlegame.com/">Nerdle</a>. In the game Nerdle all your guesses need to be a valid mathematical calculation....
</span>
<p><a class="title-link" href="/blog/2022/03/wordle-to-nerdle/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2022/01/wordle-bot/" title="An algorithm for Wordle">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="An algorithm for Wordle" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2022-01-07T08:01:25+01:00" class="date" />
<span itemprop="datePublished" content="2022-01-07T08:01:25+01:00" class="date">
Jan 7, 2022 08:01:25
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2022/01/wordle-bot/">An algorithm for Wordle</a></h1>
<span itemprop="articleBody">
<p>If you’ve used Twitter during the begining of 2022 you’ll almost certainly have seen people posting tweets like this:</p> <pre> Wordle 202 3/6 ⬜⬜⬜⬜🟨 🟨⬜⬜⬜⬜ 🟩🟩🟩🟩🟩 </pre> <p>This is the result of playing the latest viral game “Wordle”. The concept is very easy, you have to guess a 5-letter word each day. For each guess you get the basic “Mastermind” reply, green for the correct character, yellow if it’s in the wrong spot.</p> <p>This game was fun, for a couple of days, but my curious mind started to wonder… what are the <em>BEST</em> words to play?</p> <p>So I downloaded a...
</span>
<p><a class="title-link" href="/blog/2022/01/wordle-bot/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2021/12/divide-by-three/" title="Divide by three using shift and add">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Divide by three using shift and add" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2021-12-31T09:01:25+01:00" class="date" />
<span itemprop="datePublished" content="2021-12-31T09:01:25+01:00" class="date">
Dec 31, 2021 09:01:25
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2021/12/divide-by-three/">Divide by three using shift and add</a></h1>
<span itemprop="articleBody">
<p>Today I stumbled across this excellent short video bij Mathologer:</p> <iframe type="text/html" width="640" height="390" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="https://www.youtube.com/embed/SOBz-aFOH2I?title=0&byline=0&portrait=0"></iframe> <p>This simple proof shows that 1/3 is the same as: 1/4 + 1/4^2 + 1/4^3 + 1/4^N…</p> <p>As a programmer I wanted to try and program this.</p> <p>Dividing by multiples of two (like 4^3) is extremely easy in binary, we just shift a number to the right. So if you have some integer X and we want to divide by 4, we do <code class="highlighter-rouge">X >> 2</code>, if we want to divide by 4^2 we shift <code class="highlighter-rouge">X >> 4</code> etc.</p>...
</span>
<p><a class="title-link" href="/blog/2021/12/divide-by-three/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2021/12/hex-grid-coordinates-in-a-single-integer/" title="Hex grid in single integer">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Hex grid in single integer" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2021-12-28T11:19:31+01:00" class="date" />
<span itemprop="datePublished" content="2021-12-28T11:19:31+01:00" class="date">
Dec 28, 2021 11:19:31
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2021/12/hex-grid-coordinates-in-a-single-integer/">Hex grid in single integer</a></h1>
<span itemprop="articleBody">
<h2 id="azspcs-ap-math">AZsPCs: AP Math</h2>
<p><a href="http://azspcs.com/">Al Zimmermann</a> hosts awesome Programming Contests every once in a while. They usually run for a long time (multiple months) and it allows mathematicians and programmers to compete in optimization problems. Usually the search space is very large and optimal solutions aren’t found for large N-values.</p>
<p>This time the contest was called “AP Math” and the goal was:</p>
<blockquote>
<p>Given a hexagonal grid of size N, select the maximum amount of cells so no three cells form an arithmetic progression.</p>
</blockquote>
<p><img src="/images/azspcs-ap-math.png" alt="Description of contest" /></p>
<p>During this contest I didn’t find the right way to attack the problem, but I did discover a clever way to store all the hex coordinates in a singe integer value and do the math on that; which I wanted to share here.</p>
</span>
<p><a class="title-link" href="/blog/2021/12/hex-grid-coordinates-in-a-single-integer/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2021/12/log4j2-rce-problem/" title="Log4Shell / Leak4J">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Log4Shell / Leak4J" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2021-12-14T09:12:31+01:00" class="date" />
<span itemprop="datePublished" content="2021-12-14T09:12:31+01:00" class="date">
Dec 14, 2021 09:12:31
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2021/12/log4j2-rce-problem/">Log4Shell / Leak4J</a></h1>
<span itemprop="articleBody">
<p>Bert Jan Schrijver and I did a livestream showcasing Log4Shell and talking about the vulnerability, check it out here:</p>
<iframe type="text/html" width="640" height="390" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="https://www.youtube.com/embed/TX1SF2dhMc4?title=0&byline=0&portrait=0"></iframe>
<h2 id="what-is-log4shell">What is Log4Shell?</h2>
<p>Last couple of days (and nights) I’ve been studying the new (extremely dangerous) vulnerability in log4j2 called <a href="https://en.wikipedia.org/wiki/Log4Shell)">Log4Shell</a>.</p>
<p>All versions of log4j-core from 2.0-beta9 to 2.14.1 are affected by this, and it’s a <strong>big</strong> one.</p>
</span>
<p><a class="title-link" href="/blog/2021/12/log4j2-rce-problem/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2020/05/screw-you-world/" title="Sigh...">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Sigh..." width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2020-05-14T12:42:11+02:00" class="date" />
<span itemprop="datePublished" content="2020-05-14T12:42:11+02:00" class="date">
May 14, 2020 12:42:11
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2020/05/screw-you-world/">Sigh...</a></h1>
<span itemprop="articleBody">
<p>This morning I woke up and saw the following Tweet:</p>
<blockquote class="twitter-tweet"><p lang="en" dir="ltr">I'm a bit pissed right now! 😡 Why is the world so mean to me, to all of us developers, really? We've been so friendly! How often have we written "Hello, world"? And has anybody ever gotten as much as friendly nod in return?</p>— Nicolai Parlog (@nipafx) <a href="https://twitter.com/nipafx/status/1260865259738476547?ref_src=twsrc%5Etfw">May 14, 2020</a></blockquote>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
<p>And yes, I agree.</p>
<p>The world has been a pretty shitty friend to us in 2020. Why should all the new programmers/developers have to welcome this messed up world with open arms?</p>
<p>I say: <strong>Screw You, World.</strong></p>
</span>
<p><a class="title-link" href="/blog/2020/05/screw-you-world/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2019/11/openai-gpt-2/" title="OpenAI GPT-2 is amazing">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="OpenAI GPT-2 is amazing" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2019-11-20T15:42:11+01:00" class="date" />
<span itemprop="datePublished" content="2019-11-20T15:42:11+01:00" class="date">
Nov 20, 2019 15:42:11
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2019/11/openai-gpt-2/">OpenAI GPT-2 is amazing</a></h1>
<span itemprop="articleBody">
<p>This week I’ve finally gotten around to research (play with) OpenAI’s groundbreaking language model <a href="https://openai.com/blog/better-language-models/">GPT-2</a> using <a href="https://talktotransformer.com/">talktotransformer.com</a>.</p>
<h1 id="what-is-openai">What is OpenAI?</h1>
<p>OpenAI is an AI research organization founded by Elon Musk in January 2016 to explore, develop, and deploy technology for the benefit of humanity. It’s headquartered in San Francisco, with headquarters in Mountain View, California.</p>
<h1 id="and-gpt-2">And GPT-2?</h1>
<p>OpenAI recently unveiled a language model called GPT-2 that, given some input text, predicts the coming sentences. GPT-2 also supports the idea of the “Grammar of Reasoning” (GRR), in which the model attempts to extract sentences that would make the most intuitive sense, in terms of human understanding. For example, if you input “the dog ate the cat” and the model predicts “dogs eat cats”, the GRR system would make that sentence as the most probable result. The problem is that even though GRR is very good at answering the question, its predictions are still highly contingent. For example, it is still possible to be a cat-eating dog, and then someone else who doesn’t eat cats can still eat your dog, but the GRR system would not make such a mistake for the second sentence.</p>
</span>
<p><a class="title-link" href="/blog/2019/11/openai-gpt-2/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2019/11/joggling-4-trees/" title="Joggling4Trees">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="Joggling4Trees" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2019-11-18T09:11:24+01:00" class="date" />
<span itemprop="datePublished" content="2019-11-18T09:11:24+01:00" class="date">
Nov 18, 2019 09:11:24
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2019/11/joggling-4-trees/">Joggling4Trees</a></h1>
<span itemprop="articleBody">
<p>Last week, during a <a href="https://en.wikipedia.org/wiki/Code_Camp">code camp</a> session at work, for some reason the subject of “joggling” came up.</p>
<h1 id="what-is-joggling">What is Joggling?</h1>
<p>So what is this ‘<a href="https://en.wikipedia.org/wiki/Joggling">joggling</a>’? The word joggling is a <a href="https://en.wikipedia.org/wiki/Portmanteau">portmanteau</a> of juggling and jogging (running).</p>
<p>This might sound very strange, but it is an actual sport. There are people joggling marathons (in under three hours!), they are faster while juggling 3 balls than most people (including me) are just running. I’m probably never running a marathon under three hours.</p>
<p><img src="/images/joggling.jpg" alt="A man joggling (not me)" /></p>
</span>
<p><a class="title-link" href="/blog/2019/11/joggling-4-trees/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2019/11/the-world-of-biased-algorithms-copy/" title="The world of biased algorithms">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="The world of biased algorithms" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2019-11-12T13:11:24+01:00" class="date" />
<span itemprop="datePublished" content="2019-11-12T13:11:24+01:00" class="date">
Nov 12, 2019 13:11:24
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2019/11/the-world-of-biased-algorithms-copy/">The world of biased algorithms</a></h1>
<span itemprop="articleBody">
<p>The world is changing, more and more people are openly against racism, against gender discrimination, very much pro equality. People and companies are being called out when they do discriminate and there is a big movement against bias (in general).</p>
<p>One problematic thing though, for me as a programmer, is the backlash against ‘biased algorithms’.</p>
<h1 id="algorithms">Algorithms</h1>
<p>What are algorithms?</p>
<p>If you look up the definition <a href="https://en.wikipedia.org/wiki/Algorithm">wikipedia</a> you’ll find:</p>
<blockquote>
<p>A sequence of instructions, typically to solve a class of problems or perform a computation. Algorithms are unambiguous specifications for performing calculation, data processing, automated reasoning, and other tasks.</p>
</blockquote>
<p>In our case today, let’s define it is a set of instructions that a computer follows so it does a calculation and produces a result. People also do the same thing, they use sets of rules to come to certain conclusions.</p>
</span>
<p><a class="title-link" href="/blog/2019/11/the-world-of-biased-algorithms-copy/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2019/11/sat-solver-in-java/" title="SAT solving: Creating a solver in Java (part 2)">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="SAT solving: Creating a solver in Java (part 2)" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2019-11-11T21:42:12+01:00" class="date" />
<span itemprop="datePublished" content="2019-11-11T21:42:12+01:00" class="date">
Nov 11, 2019 21:42:12
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2019/11/sat-solver-in-java/">SAT solving: Creating a solver in Java (part 2)</a></h1>
<span itemprop="articleBody">
<p>This is the second blogpost in a series about SAT solving. Today we’re going to build a simple solver in <code class="highlighter-rouge">Java</code>.
Before continuing, if you don’t know what a SAT solver is, read <a href="/blog/2019/05/sat-solving-part-one/">part one</a>.</p>
<p>The algorithm we’re going to implement is called <a href="https://en.wikipedia.org/wiki/DPLL_algorithm">DPLL</a> (Davis Putnam Logemann Loveland).</p>
<h1 id="input-parsing">Input parsing</h1>
<p>The input we’ll accept is in <code class="highlighter-rouge">DIMACS</code> format. For now we can just skip the <code class="highlighter-rouge">p</code>-line with all the settings and just parse all the numbers.
Here is an example input:</p>
<figure class="highlight"><pre><code class="language-java" data-lang="java"><span class="n">p</span> <span class="n">cnf</span> <span class="mi">3</span> <span class="mi">4</span>
<span class="mi">1</span> <span class="mi">2</span> <span class="o">-</span><span class="mi">3</span> <span class="mi">0</span>
<span class="mi">2</span> <span class="mi">3</span> <span class="mi">0</span>
<span class="o">-</span><span class="mi">2</span> <span class="mi">0</span>
<span class="o">-</span><span class="mi">1</span> <span class="mi">3</span> <span class="mi">0</span></code></pre></figure>
<p>In Java we can parse this entire file with almost a one liner (don’t do this in production code):</p>
</span>
<p><a class="title-link" href="/blog/2019/11/sat-solver-in-java/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<article itemscope itemtype="http://schema.org/Article">
<div class="post">
<div class="post-thumbnail">
<a itemprop="mainEntityOfPage" href="/blog/2019/05/sat-solving-part-one/" title="SAT solving: Introduction to SAT (part 1)">
<img itemprop="image" class="post-thumbnail-img" src="/thumbnails/default.jpg" alt="SAT solving: Introduction to SAT (part 1)" width="100" height="100" />
</a>
</div>
<div class="post-data">
<p class="post-meta">
Written by <span itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Roy van Rijn</span></span>
(<span itemprop="publisher" itemscope itemtype="http://schema.org/Organization"><span itemprop="name">royvanrijn.com</span></span>) on
<span itemprop="dateModified" content="2019-05-26T19:21:12+02:00" class="date" />
<span itemprop="datePublished" content="2019-05-26T19:21:12+02:00" class="date">
May 26, 2019 19:21:12
</span>
</p>
<h1 itemprop="headline" class="post-title"><a class="title-link" href="/blog/2019/05/sat-solving-part-one/">SAT solving: Introduction to SAT (part 1)</a></h1>
<span itemprop="articleBody">
<p>Most software developers have never heard about SAT solvers, but they are amazingly powerful and the algorithms behind them are actually very easy to understand. The whole concept blew my mind when I learned about how they worked. This will be the first post in a series about SAT solving where we’ll end up building a simple solver in Java later on.</p> <p>In this first part of the series we’ll cover:</p> <ul> <li>Look at what SAT is</li> <li>Explain the SAT DIMACS format</li> <li>Solve a puzzle: Peaceable Queens</li> </ul> <p style="text-align:center;"> <img src="/images/peaceablequeens.png" alt="Peaceable Queen solution for N=8" /> </p> <h1...
</span>
<p><a class="title-link" href="/blog/2019/05/sat-solving-part-one/">Read more...</a></p>
</div>
</div>
</article>
<hr/>
<!-- Pagination -->
<div class="pagination">
<div class="pagination-center">
<div class="pagination-item">« Prev</div>
<div class="pagination-item"><strong>1</strong></div>
<div class="pagination-item"><a href="/page/2">2</a></div>
<div class="pagination-item"><a href="/page/3">3</a></div>
<div class="pagination-item"><a href="/page/4">4</a></div>
<div class="pagination-item"><a href="/page/5">5</a></div>
<div class="pagination-item"><a href="/page/6">6</a></div>
<div class="pagination-item"><a href="/page/7">7</a></div>
<div class="pagination-item"><a href="/page/8">8</a></div>
<div class="pagination-item"><a href="/page/9">9</a></div>
<div class="pagination-item"><a href="/page/10">10</a></div>
<div class="pagination-item"><a href="/page/11">11</a></div>
<div class="pagination-item"><a href="/page/12">12</a></div>
<div class="pagination-item"><a href="/page/13">13</a></div>
<div class="pagination-item"><a href="/page/2">Next »</a></div>
</div>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div class="wrapper">
<div class="footer-wrapper">
<div class="footer-wrapper-content">
<a href="https://www.linkedin.com/profile/view?id=10356027">
<span class="svg-icon linkedin">Connect on LinkedIn</span>
</a>
<a href="http://stackoverflow.com/users/442274/roy-van-rijn">
<span class="svg-icon stackoverflow">Follow me on StackOverflow</span>
</a>
<a href="https://github.com/royvanrijn">
<span class="svg-icon github">Follow me on GitHub</span>
</a>
<a href="https://twitter.com/royvanrijn">
<ispan class="svg-icon twitter">Follow me on Twitter</span>
</a>
<a href="/feed/index.xml">
<span class="svg-icon rss">Check out the RSS feed</span>
</a>
</div>
</div>
</div>
</footer>
</body>
</html>