wine article
This commit is contained in:
parent
baf0a2b8b9
commit
6acba75cd5
196 changed files with 5763 additions and 2308 deletions
|
@ -30,6 +30,9 @@
|
||||||
</section><section class="main-content"><article class="listpage"><header><h1>Posts for year 2024</h1>
|
</section><section class="main-content"><article class="listpage"><header><h1>Posts for year 2024</h1>
|
||||||
</header><ul class="postlist">
|
</header><ul class="postlist">
|
||||||
<li>
|
<li>
|
||||||
|
<time class="listdate" datetime="2024-02-28T00:00:00Z" title="2024-02-28 00:00">2024-02-28 00:00</time><a href="../blog/2024/2/28/wine-gentoo/" class="listtitle">Playing videogames with WINE on Gentoo</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<time class="listdate" datetime="2024-01-12T00:00:00Z" title="2024-01-12 00:00">2024-01-12 00:00</time><a href="../blog/2024/1/12/happy-new-year-2024/" class="listtitle">Welkom 2024!</a>
|
<time class="listdate" datetime="2024-01-12T00:00:00Z" title="2024-01-12 00:00">2024-01-12 00:00</time><a href="../blog/2024/1/12/happy-new-year-2024/" class="listtitle">Welkom 2024!</a>
|
||||||
</li>
|
</li>
|
||||||
</ul></article><footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
</ul></article><footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
</header><ul class="postlist">
|
</header><ul class="postlist">
|
||||||
<li>
|
<li>
|
||||||
<a href="2024/">2024</a>
|
<a href="2024/">2024</a>
|
||||||
(1)
|
(2)
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="2023/">2023</a>
|
<a href="2023/">2023</a>
|
||||||
|
|
|
@ -29,11 +29,12 @@
|
||||||
<a class="btn" href="https://lezzo.org/git/public/Curriculum_vitae/raw/master/latex.dir/francesco_mecca_cv_eng.pdf">Curriculum</a>
|
<a class="btn" href="https://lezzo.org/git/public/Curriculum_vitae/raw/master/latex.dir/francesco_mecca_cv_eng.pdf">Curriculum</a>
|
||||||
</section><section class="main-content"><article class="listpage"><header><h1>Archive</h1>
|
</section><section class="main-content"><article class="listpage"><header><h1>Archive</h1>
|
||||||
</header><ul class="postlist">
|
</header><ul class="postlist">
|
||||||
<li style="list-style-type:none">2024 (1):
|
<li style="list-style-type:none">2024 (2):
|
||||||
</li>
|
</li>
|
||||||
<hr>
|
<hr>
|
||||||
<ul>
|
<ul>
|
||||||
<li style="list-style-type:disc"><p>12 January 2024 » <a href="blog/2024/1/12/happy-new-year-2024/">Welkom 2024!</a></p></li>
|
<li style="list-style-type:disc"><p>28 February 2024 » <a href="blog/2024/2/28/wine-gentoo/">Playing videogames with WINE on Gentoo</a></p></li>
|
||||||
|
<li style="list-style-type:disc"><p>12 January 2024 » <a href="blog/2024/1/12/happy-new-year-2024/">Welkom 2024!</a></p></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li style="list-style-type:none">2023 (1):
|
<li style="list-style-type:none">2023 (1):
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -614,6 +614,7 @@ pre.code .c1, .code .codetable .c1, .highlight pre .c1 { color: #3D7B7B; font-st
|
||||||
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
||||||
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
||||||
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
||||||
|
pre.code .ges, .code .codetable .ges, .highlight pre .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
||||||
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
||||||
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||||
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
||||||
|
|
|
@ -614,6 +614,7 @@ pre.code .c1, .code .codetable .c1, .highlight pre .c1 { color: #3D7B7B; font-st
|
||||||
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
||||||
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
||||||
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
||||||
|
pre.code .ges, .code .codetable .ges, .highlight pre .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
||||||
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
||||||
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||||
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
||||||
|
|
|
@ -18,6 +18,7 @@ pre.code .c1, .code .codetable .c1, .highlight pre .c1 { color: #3D7B7B; font-st
|
||||||
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
pre.code .cs, .code .codetable .cs, .highlight pre .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
|
||||||
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
pre.code .gd, .code .codetable .gd, .highlight pre .gd { color: #A00000 } /* Generic.Deleted */
|
||||||
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
pre.code .ge, .code .codetable .ge, .highlight pre .ge { font-style: italic } /* Generic.Emph */
|
||||||
|
pre.code .ges, .code .codetable .ges, .highlight pre .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
|
||||||
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
pre.code .gr, .code .codetable .gr, .highlight pre .gr { color: #E40000 } /* Generic.Error */
|
||||||
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
pre.code .gh, .code .codetable .gh, .highlight pre .gh { color: #000080; font-weight: bold } /* Generic.Heading */
|
||||||
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
pre.code .gi, .code .codetable .gi, .highlight pre .gi { color: #008400 } /* Generic.Inserted */
|
||||||
|
|
|
@ -100,56 +100,56 @@
|
||||||
Fonti: <a href="https://www.youtube.com/watch?v=YJmRqgBE_t8">www.youtube.com</a></p>
|
Fonti: <a href="https://www.youtube.com/watch?v=YJmRqgBE_t8">www.youtube.com</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre class="code literal-block"><span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
<div class="code"><pre class="code literal-block"><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
||||||
<span class="nt"><p></span>
|
<span class="w"> </span><span class="nt"><p></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
||||||
<span class="nt"><div</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"separator"</span> <span class="na">style=</span><span class="s">"clear:both;text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"separator"</span><span class="w"> </span><span class="na">style=</span><span class="s">"clear:both;text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><a</span> <span class="na">href=</span><span class="s">"https://www.youtube.com/embed/LiFrjbjASk4?feature=player_embedded"</span><span class="nt">></span>https://www.youtube.com/embed/LiFrjbjASk4?feature=player_embedded<span class="nt"></a></span>
|
<span class="w"> </span><span class="nt"><a</span><span class="w"> </span><span class="na">href=</span><span class="s">"https://www.youtube.com/embed/LiFrjbjASk4?feature=player_embedded"</span><span class="nt">></span>https://www.youtube.com/embed/LiFrjbjASk4?feature=player_embedded<span class="nt"></a></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:justify;"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span> <span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>We are Anonymous.<span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="w"> </span><span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>We<span class="w"> </span>are<span class="w"> </span>Anonymous.<span class="nt"></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span> <span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span> We are legion.<span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="w"> </span><span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span><span class="w"> </span>We<span class="w"> </span>are<span class="w"> </span>legion.<span class="nt"></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span> <span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span> We do not forgive. <span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="w"> </span><span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span><span class="w"> </span>We<span class="w"> </span>do<span class="w"> </span>not<span class="w"> </span>forgive.<span class="w"> </span><span class="nt"></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span> <span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>We do not forget. <span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="w"> </span><span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>We<span class="w"> </span>do<span class="w"> </span>not<span class="w"> </span>forget.<span class="w"> </span><span class="nt"></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span> <span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>Expect us<span class="nt"></span></span>!
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="w"> </span><span class="na">style=</span><span class="s">"background:white;font-family:Arial, sans-serif;font-size:10pt;"</span><span class="nt">></span>Expect<span class="w"> </span>us<span class="nt"></span></span>!
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><p></span>
|
<span class="w"> </span><span class="nt"><p></span>
|
||||||
<span class="nt"><div</span> <span class="na">class=</span><span class="s">"MsoNormal"</span> <span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">class=</span><span class="s">"MsoNormal"</span><span class="w"> </span><span class="na">style=</span><span class="s">"text-align:center;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">lang=</span><span class="s">"EN-US"</span><span class="nt">></span> Gabriele Corso<span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">lang=</span><span class="s">"EN-US"</span><span class="nt">></span><span class="w"> </span>Gabriele<span class="w"> </span>Corso<span class="nt"></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
</pre>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<aside class="postpromonav"><nav><h4>Categories</h4>
|
<aside class="postpromonav"><nav><h4>Categories</h4>
|
||||||
|
|
||||||
|
|
|
@ -104,17 +104,17 @@
|
||||||
<i><span style="font-family:inherit;">Viviamo <span style="font-family:inherit;">in un periodo di <span style="font-family:inherit;">forte e radicale cam<span style="font-family:inherit;">biamento, questo notevole avanzamento tecnologico non solo fornisce al <span style="font-family:inherit;">censore tutti gli strumenti per per<span style="font-family:inherit;">petuare la sua tirannia, ma con<span style="font-family:inherit;">ce<span style="font-family:inherit;">de anche all’<span style="font-family:inherit;">u<span style="font-family:inherit;">omo gli strumenti per liberars<span style="font-family:inherit;">e<span style="font-family:inherit;">ne e far volare libere le idee e i pensieri.</span></span></span></span></span></span></span></span></span></span></span></span></i></p>
|
<i><span style="font-family:inherit;">Viviamo <span style="font-family:inherit;">in un periodo di <span style="font-family:inherit;">forte e radicale cam<span style="font-family:inherit;">biamento, questo notevole avanzamento tecnologico non solo fornisce al <span style="font-family:inherit;">censore tutti gli strumenti per per<span style="font-family:inherit;">petuare la sua tirannia, ma con<span style="font-family:inherit;">ce<span style="font-family:inherit;">de anche all’<span style="font-family:inherit;">u<span style="font-family:inherit;">omo gli strumenti per liberars<span style="font-family:inherit;">e<span style="font-family:inherit;">ne e far volare libere le idee e i pensieri.</span></span></span></span></span></span></span></span></span></span></span></span></i></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pre class="code literal-block"> <span class="nt"><div</span> <span class="na">style=</span><span class="s">"line-height:100%;margin-bottom:0;"</span><span class="nt">></span>
|
<div class="code"><pre class="code literal-block"><span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">style=</span><span class="s">"line-height:100%;margin-bottom:0;"</span><span class="nt">></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><div</span> <span class="na">style=</span><span class="s">"line-height:100%;margin-bottom:0;text-align:right;"</span><span class="nt">></span>
|
<span class="w"> </span><span class="nt"><div</span><span class="w"> </span><span class="na">style=</span><span class="s">"line-height:100%;margin-bottom:0;text-align:right;"</span><span class="nt">></span>
|
||||||
<span class="nt"><span</span> <span class="na">style=</span><span class="s">"font-family:inherit;"</span><span class="nt">><span</span> <span class="na">style=</span><span class="s">"font-style:normal;"</span><span class="nt">></span>Francesco Mecca <span class="nt"></span></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">style=</span><span class="s">"font-family:inherit;"</span><span class="nt">><span</span><span class="w"> </span><span class="na">style=</span><span class="s">"font-style:normal;"</span><span class="nt">></span>Francesco<span class="w"> </span>Mecca<span class="w"> </span><span class="nt"></span></span></span>
|
||||||
<span class="nt"></div></span>
|
<span class="w"> </span><span class="nt"></div></span>
|
||||||
|
|
||||||
<span class="nt"><p></span>
|
<span class="w"> </span><span class="nt"><p></span>
|
||||||
<span class="nt"><span</span> <span class="na">style=</span><span class="s">"font-family:inherit;"</span><span class="nt">></span> <span class="nt"></span></span>
|
<span class="w"> </span><span class="nt"><span</span><span class="w"> </span><span class="na">style=</span><span class="s">"font-family:inherit;"</span><span class="nt">></span><span class="w"> </span><span class="nt"></span></span>
|
||||||
<span class="nt"></p></span>
|
<span class="w"> </span><span class="nt"></p></span>
|
||||||
</pre>
|
</pre></div>
|
||||||
</div>
|
</div>
|
||||||
<aside class="postpromonav"><nav><h4>Categories</h4>
|
<aside class="postpromonav"><nav><h4>Categories</h4>
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -72,74 +72,78 @@
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">iostream</span><span class="o">></span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">iostream</span><span class="o">></span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">vector</span><span class="o">></span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">vector</span><span class="o">></span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">algorithm</span><span class="o">></span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">algorithm</span><span class="o">></span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">random</span><span class="o">></span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">random</span><span class="o">></span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">string</span><span class="o">></span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">string</span><span class="o">></span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">></span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o"><</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">></span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>&</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>&</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>&</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>&</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">></span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">></span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o"><</span><span class="n">string</span><span class="o">>::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o"><<</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -150,14 +150,15 @@ Nel caso della vendita dell'automobile, abbiamo un semplice problema con una sol
|
||||||
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
||||||
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
||||||
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
||||||
<pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span>
|
||||||
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"></span>
|
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span>
|
||||||
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
||||||
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
||||||
<table>
|
<table>
|
||||||
|
@ -206,7 +207,7 @@ Ci sono varie funzioni che stimano l'errore e permettono di correggere i pesi o
|
||||||
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
||||||
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
||||||
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
||||||
<pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
|
@ -226,15 +227,17 @@ Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzion
|
||||||
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
||||||
<pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">></span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE DEF |</span>
|
<span class="c">| PREZZO FINALE DEF |</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Questa é, seppur molto basica, una rete neurale.
|
<p>Questa é, seppur molto basica, una rete neurale.
|
||||||
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
||||||
<p><img alt="rete2" src="../../../../../wp-content/uploads/2016/reteneurale2.jpg"></p>
|
<p><img alt="rete2" src="../../../../../wp-content/uploads/2016/reteneurale2.jpg"></p>
|
||||||
|
|
|
@ -75,28 +75,32 @@ Abbiamo in questo modo una <em>recurrent neural network</em> (RNN) dove ogni sta
|
||||||
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
||||||
Inizialmente l'output della nostra RNN non ha alcun valore:
|
Inizialmente l'output della nostra RNN non ha alcun valore:
|
||||||
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
||||||
<pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
||||||
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span><span class="w"></span>
|
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
||||||
Questo procedimento continua all'infinito.
|
Questo procedimento continua all'infinito.
|
||||||
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
||||||
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
||||||
<pre class="code literal-block">"Tmont thithey" fomesscerliund
|
<div class="code"><pre class="code literal-block">"Tmont thithey" fomesscerliund
|
||||||
Keushey. Thom here
|
Keushey. Thom here
|
||||||
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
||||||
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Dopo quasi mille:</p>
|
<p>Dopo quasi mille:</p>
|
||||||
<pre class="code literal-block"><span class="nv">Aftair</span> <span class="nv">fall</span> <span class="nv">unsuch</span> <span class="nv">that</span> <span class="nv">the</span> <span class="nv">hall</span> <span class="k">for</span> <span class="nv">Prince</span> <span class="nv">Velzonski</span><span class="s1">'</span><span class="s">s that me of</span>
|
<div class="code"><pre class="code literal-block"><span class="nv">Aftair</span><span class="w"> </span><span class="nv">fall</span><span class="w"> </span><span class="nv">unsuch</span><span class="w"> </span><span class="nv">that</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">hall</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nv">Prince</span><span class="w"> </span><span class="nv">Velzonski</span><span class="err">'s that me of</span>
|
||||||
<span class="nv">her</span> <span class="nv">hearly</span>, <span class="nv">and</span> <span class="nv">behs</span> <span class="nv">to</span> <span class="nv">so</span> <span class="nv">arwage</span> <span class="nv">fiving</span> <span class="nv">were</span> <span class="nv">to</span> <span class="nv">it</span> <span class="nv">beloge</span>, <span class="nv">pavu</span> <span class="nv">say</span> <span class="nv">falling</span> <span class="nv">misfort</span>
|
<span class="err">her hearly, and behs to so arwage fiving were to it beloge, pavu say falling misfort </span>
|
||||||
<span class="nv">how</span>, <span class="nv">and</span> <span class="nv">Gogition</span> <span class="nv">is</span> <span class="nv">so</span> <span class="nv">overelical</span> <span class="nv">and</span> <span class="nv">ofter</span>.
|
<span class="err">how, and Gogition is so overelical and ofter.</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Duemila:</p>
|
<p>Duemila:</p>
|
||||||
<pre class="code literal-block"><span class="s2">"</span><span class="s">Why do what that day,</span><span class="s2">"</span> <span class="nv">replied</span> <span class="nv">Natasha</span>, <span class="nv">and</span> <span class="nv">wishing</span> <span class="nv">to</span> <span class="nv">himself</span> <span class="nv">the</span> <span class="nv">fact</span> <span class="nv">the</span>
|
<div class="code"><pre class="code literal-block"><span class="s2">"Why do what that day,"</span><span class="w"> </span><span class="nv">replied</span><span class="w"> </span><span class="nv">Natasha</span>,<span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">wishing</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">himself</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">fact</span><span class="w"> </span><span class="nv">the</span>
|
||||||
<span class="nv">princess</span>, <span class="nv">Princess</span> <span class="nv">Mary</span> <span class="nv">was</span> <span class="nv">easier</span>, <span class="nv">fed</span> <span class="nv">in</span> <span class="nv">had</span> <span class="nv">oftened</span> <span class="nv">him</span>.
|
<span class="nv">princess</span>,<span class="w"> </span><span class="nv">Princess</span><span class="w"> </span><span class="nv">Mary</span><span class="w"> </span><span class="nv">was</span><span class="w"> </span><span class="nv">easier</span>,<span class="w"> </span><span class="nv">fed</span><span class="w"> </span><span class="nv">in</span><span class="w"> </span><span class="nv">had</span><span class="w"> </span><span class="nv">oftened</span><span class="w"> </span><span class="nv">him</span>.
|
||||||
<span class="nv">Pierre</span> <span class="nv">aking</span> <span class="nv">his</span> <span class="nv">soul</span> <span class="nv">came</span> <span class="nv">to</span> <span class="nv">the</span> <span class="nv">packs</span> <span class="nv">and</span> <span class="nv">drove</span> <span class="nv">up</span> <span class="nv">his</span> <span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span> <span class="nv">women</span>.
|
<span class="nv">Pierre</span><span class="w"> </span><span class="nv">aking</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">soul</span><span class="w"> </span><span class="nv">came</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">packs</span><span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">drove</span><span class="w"> </span><span class="nv">up</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span><span class="w"> </span><span class="nv">women</span>.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
||||||
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p>
|
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,12 +69,13 @@ Anyway in this post I want to explain bits of the code.</p>
|
||||||
<p>The main kpd file invoked when the command is run in the console is kpd.py
|
<p>The main kpd file invoked when the command is run in the console is kpd.py
|
||||||
The most interesting part in this file IMHO is these lines:</p>
|
The most interesting part in this file IMHO is these lines:</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">el</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">argsOrder</span><span class="p">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">el</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">argsOrder</span><span class="p">:</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">dictArgs</span><span class="o">[</span><span class="n">el</span><span class="o">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">False</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="n">dictArgs</span><span class="o">[</span><span class="n">el</span><span class="o">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="k">False</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">client</span><span class="p">.</span><span class="n">update_status</span><span class="w"> </span><span class="p">()</span><span class="w"></span>
|
<span class="w"> </span><span class="n">client</span><span class="p">.</span><span class="n">update_status</span><span class="w"> </span><span class="p">()</span>
|
||||||
<span class="w"> </span><span class="n">methodToCall</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">getattr</span><span class="w"> </span><span class="p">(</span><span class="n">util</span><span class="p">,</span><span class="w"> </span><span class="n">el</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">methodToCall</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">getattr</span><span class="w"> </span><span class="p">(</span><span class="n">util</span><span class="p">,</span><span class="w"> </span><span class="n">el</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="n">retUtil</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">methodToCall</span><span class="w"> </span><span class="p">(</span><span class="n">client</span><span class="p">,</span><span class="w"> </span><span class="n">dictArgs</span><span class="o">[</span><span class="n">el</span><span class="o">]</span><span class="p">,</span><span class="w"> </span><span class="n">searchRes</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">retUtil</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">methodToCall</span><span class="w"> </span><span class="p">(</span><span class="n">client</span><span class="p">,</span><span class="w"> </span><span class="n">dictArgs</span><span class="o">[</span><span class="n">el</span><span class="o">]</span><span class="p">,</span><span class="w"> </span><span class="n">searchRes</span><span class="p">)</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>argsOrder is a list of the arguments on the command line in the order the user wrote them.
|
<p>argsOrder is a list of the arguments on the command line in the order the user wrote them.
|
||||||
kpd uses a dictionary to store for every argument the corrispective string for the function that will be invoked using getattr.
|
kpd uses a dictionary to store for every argument the corrispective string for the function that will be invoked using getattr.
|
||||||
In this way any argument can be added to the main file without writing any other line of code. WE used this method to avoid using switch alike solutions.</p>
|
In this way any argument can be added to the main file without writing any other line of code. WE used this method to avoid using switch alike solutions.</p>
|
||||||
|
|
|
@ -64,7 +64,7 @@ Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a>
|
<li>Repubblica: <a href='http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12"'>"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a>
|
||||||
</li>
|
</li>
|
||||||
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a>
|
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -72,16 +72,18 @@ When Jekyll builds a website it parses all the markdown files and stores them in
|
||||||
layout: page
|
layout: page
|
||||||
title: Archive
|
title: Archive
|
||||||
---</p>
|
---</p>
|
||||||
<pre class="code literal-block"><span class="x">## Blog Posts</span>
|
<div class="code"><pre class="code literal-block"><span class="x">## Blog Posts</span>
|
||||||
|
|
||||||
<span class="cp">{%</span> <span class="k">for</span> <span class="nv">post</span> <span class="k">in</span> <span class="nv">site.posts</span> <span class="cp">%}</span><span class="x"></span>
|
<span class="cp">{%</span> <span class="k">for</span> <span class="nv">post</span> <span class="k">in</span> <span class="nv">site.posts</span> <span class="cp">%}</span>
|
||||||
<span class="x"> * </span><span class="cp">{{</span> <span class="nv">post.date</span> <span class="o">|</span> <span class="nf">date_to_string</span> <span class="cp">}}</span><span class="x"> &raquo; [ </span><span class="cp">{{</span> <span class="nv">post.title</span> <span class="cp">}}</span><span class="x"> ](</span><span class="cp">{{</span> <span class="nv">post.url</span> <span class="cp">}}</span><span class="x">)</span>
|
<span class="x"> * </span><span class="cp">{{</span> <span class="nv">post.date</span> <span class="o">|</span> <span class="nf">date_to_string</span> <span class="cp">}}</span><span class="x"> &raquo; [ </span><span class="cp">{{</span> <span class="nv">post.title</span> <span class="cp">}}</span><span class="x"> ](</span><span class="cp">{{</span> <span class="nv">post.url</span> <span class="cp">}}</span><span class="x">)</span>
|
||||||
<span class="cp">{%</span> <span class="k">endfor</span> <span class="cp">%}</span><span class="x">:wq</span>
|
<span class="cp">{%</span> <span class="k">endfor</span> <span class="cp">%}</span><span class="x">:wq</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>{% endraw %}
|
<p>{% endraw %}
|
||||||
I noticed that in _includes/head.html there is this line:</p>
|
I noticed that in _includes/head.html there is this line:</p>
|
||||||
<pre class="code literal-block"><link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700,800,600' rel='stylesheet' type='text/css'
|
<div class="code"><pre class="code literal-block"><span class="p"><</span><span class="nx">link</span><span class="w"> </span><span class="nx">href</span><span class="p">=</span><span class="err">'</span><span class="nx">https</span><span class="p">:</span><span class="c1">//fonts.googleapis.com/css?family=Open+Sans:400,300,700,800,600' rel='stylesheet' type='text/css'</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>so I proceed to remove it because is not needed for my blog.
|
<p>so I proceed to remove it because is not needed for my blog.
|
||||||
Finally I put a link to the archive, my github page and the atom feed on the sidebar by simple adding a href on _includes/sidebar.html.</p>
|
Finally I put a link to the archive, my github page and the atom feed on the sidebar by simple adding a href on _includes/sidebar.html.</p>
|
||||||
<p>I did not proceed with further modifications but there are tons of possibilities with jekyll. I think that the main advantages are the fact that you don't have to manage html code when writing a new post and that everything can be done via cli.</p>
|
<p>I did not proceed with further modifications but there are tons of possibilities with jekyll. I think that the main advantages are the fact that you don't have to manage html code when writing a new post and that everything can be done via cli.</p>
|
||||||
|
|
|
@ -58,21 +58,22 @@ When I noted that python uses the Mersenne Twister PRNG as well I decided to">
|
||||||
<p>During the final weeks of my exam session I started reading a bit about python 3 using an excellent book: <a href="http://www.diveintopython.net/">Dive into Python</a>.
|
<p>During the final weeks of my exam session I started reading a bit about python 3 using an excellent book: <a href="http://www.diveintopython.net/">Dive into Python</a>.
|
||||||
When I noted that python uses the <a href="https://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister PRNG</a> as well I decided to write another version of my <a href="http://francescomecca.eu/index.php/archives/207">Buridan's donkey program</a>.</p>
|
When I noted that python uses the <a href="https://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister PRNG</a> as well I decided to write another version of my <a href="http://francescomecca.eu/index.php/archives/207">Buridan's donkey program</a>.</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"> <span class="s s-Atom">import</span> <span class="s s-Atom">random</span><span class="p">,</span> <span class="s s-Atom">sys</span>
|
<div class="code"><pre class="code literal-block"> <span class="kn">import</span> <span class="nn">random</span><span class="o">,</span> <span class="nn">sys</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
|
||||||
|
<span class="n">args</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
|
||||||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">isatty</span><span class="p">():</span>
|
||||||
|
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="p">:</span>
|
||||||
|
<span class="k">if</span> <span class="n">line</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="ow">is</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">'</span><span class="p">:</span>
|
||||||
|
<span class="n">line</span> <span class="o">=</span> <span class="n">line</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||||
|
<span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||||
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
<span class="n">args</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||||
|
<span class="n">argRange</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
|
||||||
|
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">argRange</span><span class="p">):</span>
|
||||||
|
<span class="nb">print</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s1">'.'</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">random</span><span class="o">.</span><span class="n">randrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="s s-Atom">if</span> <span class="k">__</span><span class="s s-Atom">name__</span> <span class="o">==</span> <span class="s s-Atom">'__main__':</span>
|
|
||||||
<span class="s s-Atom">args</span> <span class="o">=</span> <span class="nf">list</span><span class="p">()</span>
|
|
||||||
<span class="s s-Atom">if</span> <span class="o">not</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="s s-Atom">stdin</span><span class="p">.</span><span class="nf">isatty</span><span class="p">()</span><span class="s s-Atom">:</span>
|
|
||||||
<span class="s s-Atom">for</span> <span class="s s-Atom">line</span> <span class="s s-Atom">in</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="nn">stdin</span><span class="p">:</span>
|
|
||||||
<span class="s s-Atom">if</span> <span class="s s-Atom">line</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">is</span> <span class="s s-Atom">'\n':</span>
|
|
||||||
<span class="s s-Atom">line</span> <span class="o">=</span> <span class="s s-Atom">line</span><span class="p">[:-</span><span class="mi">1</span><span class="p">]</span>
|
|
||||||
<span class="s s-Atom">args</span><span class="p">.</span><span class="nf">append</span><span class="p">(</span><span class="s s-Atom">line</span><span class="p">)</span>
|
|
||||||
<span class="nn">else</span><span class="p">:</span>
|
|
||||||
<span class="s s-Atom">args</span> <span class="o">=</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="s s-Atom">argv</span><span class="p">[</span><span class="mi">1</span><span class="s s-Atom">:</span><span class="p">]</span>
|
|
||||||
<span class="s s-Atom">argRange</span> <span class="o">=</span> <span class="nf">len</span><span class="p">(</span><span class="s s-Atom">args</span><span class="p">)</span>
|
|
||||||
<span class="s s-Atom">for</span> <span class="s s-Atom">i</span> <span class="s s-Atom">in</span> <span class="nf">range</span><span class="p">(</span><span class="s s-Atom">argRange</span><span class="p">)</span><span class="s s-Atom">:</span>
|
|
||||||
<span class="nf">print</span><span class="p">(</span><span class="nf">str</span><span class="p">(</span><span class="s s-Atom">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s s-Atom">'.'</span><span class="p">,</span> <span class="s s-Atom">args</span><span class="p">.</span><span class="nf">pop</span><span class="p">(</span><span class="s s-Atom">random</span><span class="p">.</span><span class="nf">randrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nf">len</span><span class="p">(</span><span class="s s-Atom">args</span><span class="p">))))</span>
|
|
||||||
</pre>
|
|
||||||
<p>This script works in a different way than the one in c++.
|
<p>This script works in a different way than the one in c++.
|
||||||
Rather than shuffling a list made by the entries in the arguments, it pops randomly one entry from the list till the list is empty.</p>
|
Rather than shuffling a list made by the entries in the arguments, it pops randomly one entry from the list till the list is empty.</p>
|
||||||
<p>Not satisfied enough, I wrote also a telegram bot using the <a href="https://github.com/eternnoir/pyTelegramBotAPI">telebot library</a> that works as the script above but inside the telegram app.
|
<p>Not satisfied enough, I wrote also a telegram bot using the <a href="https://github.com/eternnoir/pyTelegramBotAPI">telebot library</a> that works as the script above but inside the telegram app.
|
||||||
|
|
|
@ -83,35 +83,39 @@ The main components of a GA are:</p>
|
||||||
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
||||||
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span>
|
||||||
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span><span class="w"></span>
|
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span>
|
||||||
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span>
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
||||||
<pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
||||||
<pre class="code literal-block"><span class="nb">result</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">-</span> <span class="ss">(</span><span class="nv">abs</span> <span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span> <span class="o">-</span> <span class="nv">y</span><span class="ss">)</span> <span class="o">/</span> <span class="nv">rangeLimit</span><span class="ss">)</span>
|
<div class="code"><pre class="code literal-block"><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="ss">(</span><span class="nv">abs</span><span class="w"> </span><span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nv">y</span><span class="ss">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="nv">rangeLimit</span><span class="ss">)</span>
|
||||||
<span class="k">if</span> <span class="nb">result</span> <span class="o"><</span> <span class="mi">0</span>:
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o"><</span><span class="w"> </span><span class="mi">0</span>:
|
||||||
<span class="nb">result</span> <span class="o">=</span> <span class="mi">0</span>
|
<span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
||||||
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
||||||
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
||||||
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
||||||
<pre class="code literal-block">-0.0487839869993989 * x^0 + 4.600339125358671 * x^1 + -0.2780958075230644 * x^2
|
<div class="code"><pre class="code literal-block">-0.0487839869993989 <span class="gs">* x^0 + 4.600339125358671 *</span> x^1 + -0.2780958075230644 * x^2
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
||||||
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p>
|
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -59,11 +59,12 @@ The key in Wright's">
|
||||||
<p>I explained in my previous <a href="http://francescomecca.eu/pescewanda/2016/04/17/wright-nakamoto/">post</a> (in italian) that the signature that Wright provided as a public proof is in fact invalid.
|
<p>I explained in my previous <a href="http://francescomecca.eu/pescewanda/2016/04/17/wright-nakamoto/">post</a> (in italian) that the signature that Wright provided as a public proof is in fact invalid.
|
||||||
I want to explain briefly how you could check this claim.
|
I want to explain briefly how you could check this claim.
|
||||||
The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">post</a> is this:</p>
|
The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">post</a> is this:</p>
|
||||||
<pre class="code literal-block"><span class="nb">-------------------------</span><span class="c"> Signature File </span><span class="nb">-------------------------</span><span class="c"></span>
|
<div class="code"><pre class="code literal-block"><span class="nb">-------------------------</span><span class="c"> Signature File </span><span class="nb">-------------------------</span>
|
||||||
<span class="c">MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl1</span>
|
<span class="c">MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl1</span>
|
||||||
<span class="c">3VTC3ihl6XUlhcU</span><span class="nb">+</span><span class="c">fM4=</span>
|
<span class="c">3VTC3ihl6XUlhcU</span><span class="nb">+</span><span class="c">fM4=</span>
|
||||||
<span class="nb">-------------------------</span><span class="c"> End Signature </span><span class="nb">--------------------------</span><span class="c"></span>
|
<span class="nb">-------------------------</span><span class="c"> End Signature </span><span class="nb">--------------------------</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Now we can use some bash utilities:</p>
|
<p>Now we can use some bash utilities:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>base64, that translates encoded ASCII text;</li>
|
<li>base64, that translates encoded ASCII text;</li>
|
||||||
|
@ -71,10 +72,11 @@ The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signi
|
||||||
<li>cut, used to remove the binary part of the input;</li>
|
<li>cut, used to remove the binary part of the input;</li>
|
||||||
<li>tr, used to delete spaces and carriage return from the input;</li>
|
<li>tr, used to delete spaces and carriage return from the input;</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block">base64 -d <<<'MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=' | hexdump -C| cut -b 11-60| tr -d ' \n'
|
<div class="code"><pre class="code literal-block">base64 -d <<<'MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=' | hexdump -C| cut -b 11-60| tr -d ' \n'
|
||||||
|
|
||||||
3045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce
|
3045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Let's analyze the command one by one:</p>
|
<p>Let's analyze the command one by one:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
|
@ -82,41 +84,47 @@ The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signi
|
||||||
<li>
|
<li>
|
||||||
<code>hexdump -C</code> is used with a pipe to convert to hexadecimal:</li>
|
<code>hexdump -C</code> is used with a pipe to convert to hexadecimal:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">00000000</span><span class="w"> </span><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span><span class="err">|</span><span class="mf">0</span><span class="n">E</span><span class="mf">.</span><span class="err">!</span><span class="mf">..</span><span class="o">*</span><span class="err">}</span><span class="n">T</span><span class="mf">.</span><span class="o">/</span><span class="err">&</span><span class="mf">.</span><span class="n">L</span><span class="mf">..</span><span class="err">|</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">00000000</span><span class="w"> </span><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span><span class="err">|</span><span class="mf">0</span><span class="n">E</span><span class="mf">.</span><span class="err">!</span><span class="mf">..</span><span class="o">*</span><span class="err">}</span><span class="n">T</span><span class="mf">.</span><span class="o">/</span><span class="err">&</span><span class="mf">.</span><span class="n">L</span><span class="mf">..</span><span class="err">|</span>
|
||||||
<span class="mf">00000010</span><span class="w"> </span><span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span><span class="err">|</span><span class="mf">3.</span><span class="n">Q</span><span class="s">"...A}....hA.|</span><span class="w"></span>
|
<span class="mf">00000010</span><span class="w"> </span><span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span><span class="err">|</span><span class="mf">3.</span><span class="n">Q</span><span class="s">"...A}....hA.|</span>
|
||||||
<span class="mf">00000020</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span><span class="err">|\</span><span class="mf">4</span><span class="s">"... fc,\....:|</span><span class="w"></span>
|
<span class="mf">00000020</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span><span class="err">|\</span><span class="mf">4</span><span class="s">"... fc,\....:|</span>
|
||||||
<span class="mf">00000030</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span><span class="err">|</span><span class="p">(</span><span class="mf">7</span><span class="n">vN</span><span class="mf">...</span><span class="n">Iu</span><span class="mf">.</span><span class="n">T</span><span class="mf">..</span><span class="p">(</span><span class="n">e</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
|
<span class="mf">00000030</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span><span class="err">|</span><span class="p">(</span><span class="mf">7</span><span class="n">vN</span><span class="mf">...</span><span class="n">Iu</span><span class="mf">.</span><span class="n">T</span><span class="mf">..</span><span class="p">(</span><span class="n">e</span><span class="mf">.</span><span class="err">|</span>
|
||||||
<span class="mf">00000040</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span><span class="err">|</span><span class="n">u%</span><span class="mf">..</span><span class="o">></span><span class="err">|</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
|
<span class="mf">00000040</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span><span class="err">|</span><span class="n">u%</span><span class="mf">..</span><span class="o">></span><span class="err">|</span><span class="mf">.</span><span class="err">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>cut -b 11-60 displays only the characters from column 11 to 60:</li>
|
<li>cut -b 11-60 displays only the characters from column 11 to 60:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span>
|
||||||
<span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span>
|
<span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span>
|
||||||
<span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span>
|
<span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span>
|
||||||
<span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span>
|
<span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span>
|
||||||
<span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span>
|
<span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<code>tr -d ' \n'</code> is used to delete spaces and carriage returns from the output so that is shown in one line and it gives us the final result:</li>
|
<code>tr -d ' \n'</code> is used to delete spaces and carriage returns from the output so that is shown in one line and it gives us the final result:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>If you noticed, there is also another cleartext string at the beginning of Wright's post:</p>
|
<p>If you noticed, there is also another cleartext string at the beginning of Wright's post:</p>
|
||||||
<pre class="code literal-block">$ base64 -d <span class="o"><<<</span><span class="s1">'IFdyaWdodCwgaXQgaXMgbm90IHRoZSBzYW1lIGFzIGlmIEkgc2lnbiBDcmFpZyBXcmlnaHQsIFNhdG9zaGkuCgo='</span>
|
<div class="code"><pre class="code literal-block">$<span class="w"> </span>base64<span class="w"> </span>-d<span class="w"> </span><span class="o"><<<</span><span class="s1">'IFdyaWdodCwgaXQgaXMgbm90IHRoZSBzYW1lIGFzIGlmIEkgc2lnbiBDcmFpZyBXcmlnaHQsIFNhdG9zaGkuCgo='</span>
|
||||||
Wright, it is not the same as <span class="k">if</span> I sign Craig Wright, Satoshi.
|
Wright,<span class="w"> </span>it<span class="w"> </span>is<span class="w"> </span>not<span class="w"> </span>the<span class="w"> </span>same<span class="w"> </span>as<span class="w"> </span><span class="k">if</span><span class="w"> </span>I<span class="w"> </span>sign<span class="w"> </span>Craig<span class="w"> </span>Wright,<span class="w"> </span>Satoshi.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Now let's head to blockchain.info.
|
<p>Now let's head to blockchain.info.
|
||||||
Blockchain.info has a little <a href="https://blockchain.info/decode-tx">utility</a> to get hexadecimal informations out of a transaction on the blockchain, so let's use it to get the related info about this transaction:</p>
|
Blockchain.info has a little <a href="https://blockchain.info/decode-tx">utility</a> to get hexadecimal informations out of a transaction on the blockchain, so let's use it to get the related info about this transaction:</p>
|
||||||
<p><a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe</a>
|
<p><a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe</a>
|
||||||
<a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe?format=hex">tx/828ef3b079f9... in hexadecimal</a></p>
|
<a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe?format=hex">tx/828ef3b079f9... in hexadecimal</a></p>
|
||||||
<p>As you can see the entire output of the first bash command, that is</p>
|
<p>As you can see the entire output of the first bash command, that is</p>
|
||||||
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>is contained in:</p>
|
<p>is contained in:</p>
|
||||||
<pre class="code literal-block">"script":"483045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce01"
|
<div class="code"><pre class="code literal-block">"script":"483045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce01"
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>except for the 48 at the beginning and the 01 at the end.</p>
|
<p>except for the 48 at the beginning and the 01 at the end.</p>
|
||||||
<p>That is a signature hash:
|
<p>That is a signature hash:
|
||||||
this <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes">page</a> explains that the 48 is just a decimal prefix given to uncompressed transactions, and the 01 at the end is just a SIGHASH_ALL <a href="https://bitcoin.org/en/glossary/signature-hash">code</a> that flags the end of the signature.</p>
|
this <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes">page</a> explains that the 48 is just a decimal prefix given to uncompressed transactions, and the 01 at the end is just a SIGHASH_ALL <a href="https://bitcoin.org/en/glossary/signature-hash">code</a> that flags the end of the signature.</p>
|
||||||
|
|
|
@ -94,10 +94,11 @@ Every time you want to flash a new firmware the Arduino must be put in DFU mode
|
||||||
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
||||||
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
||||||
The commands are the following and there is no risk to brick the Uno:</p>
|
The commands are the following and there is no risk to brick the Uno:</p>
|
||||||
<pre class="code literal-block">dfu-programmer atmega16u2 erase
|
<div class="code"><pre class="code literal-block">dfu-programmer atmega16u2 erase
|
||||||
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
||||||
dfu-programmer atmega16u2 reset
|
dfu-programmer atmega16u2 reset
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
||||||
<p><img alt="Arduino and the shield" src="../../../../../wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
<p><img alt="Arduino and the shield" src="../../../../../wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
||||||
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p>
|
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p>
|
||||||
|
|
|
@ -122,10 +122,11 @@ Helpful references
|
||||||
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
||||||
<pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span>
|
||||||
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"></span>
|
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span>
|
||||||
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span><span class="w"></span>
|
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Do both PCBs the same.</p>
|
<p>Do both PCBs the same.</p>
|
||||||
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
||||||
<h3>Mount Header Pins</h3>
|
<h3>Mount Header Pins</h3>
|
||||||
|
|
|
@ -125,45 +125,46 @@ Negli ultimi anni abbiamo assistito all'ascesa di un gran numero di linguaggi di
|
||||||
<li>Corpo della funzione</li>
|
<li>Corpo della funzione</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Un esempio:</p>
|
<p>Un esempio:</p>
|
||||||
<pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
<span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span>
|
||||||
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-></span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-></span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span><span class="w"></span>
|
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="n">c</span><span class="o">-></span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">></span><span class="w"> </span><span class="n">c</span><span class="o">-></span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="p">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
||||||
<h5>Un approccio moderno alle concorrenze</h5>
|
<h5>Un approccio moderno alle concorrenze</h5>
|
||||||
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<link rel="canonical" href="francescomecca.eu/blog/2023/08/12/three-years-later/">
|
<link rel="canonical" href="francescomecca.eu/blog/2023/08/12/three-years-later/">
|
||||||
<meta name="author" content="Francesco Mecca">
|
<meta name="author" content="Francesco Mecca">
|
||||||
<link rel="prev" href="../../../../2019/05/18/cultura-hacker/" title="Breve storia della cultura hacker" type="text/html">
|
<link rel="prev" href="../../../../2019/05/18/cultura-hacker/" title="Breve storia della cultura hacker" type="text/html">
|
||||||
<link rel="next" href="../../../../2024/1/12/happy-new-year-2024/" title="Ciao 2024" type="text/html">
|
<link rel="next" href="../../../../2024/1/12/happy-new-year-2024/" title="Welkom 2024!" type="text/html">
|
||||||
<meta property="og:site_name" content="Caught in the Net">
|
<meta property="og:site_name" content="Caught in the Net">
|
||||||
<meta property="og:title" content="Three years later">
|
<meta property="og:title" content="Three years later">
|
||||||
<meta property="og:url" content="francescomecca.eu/blog/2023/08/12/three-years-later/">
|
<meta property="og:url" content="francescomecca.eu/blog/2023/08/12/three-years-later/">
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<link rel="canonical" href="francescomecca.eu/blog/2024/1/12/happy-new-year-2024/">
|
<link rel="canonical" href="francescomecca.eu/blog/2024/1/12/happy-new-year-2024/">
|
||||||
<meta name="author" content="Francesco Mecca">
|
<meta name="author" content="Francesco Mecca">
|
||||||
<link rel="prev" href="../../../../2023/08/12/three-years-later/" title="Three years later" type="text/html">
|
<link rel="prev" href="../../../../2023/08/12/three-years-later/" title="Three years later" type="text/html">
|
||||||
|
<link rel="next" href="../../../2/28/wine-gentoo/" title="Playing videogames with WINE on Gentoo" type="text/html">
|
||||||
<meta property="og:site_name" content="Caught in the Net">
|
<meta property="og:site_name" content="Caught in the Net">
|
||||||
<meta property="og:title" content="Welkom 2024!">
|
<meta property="og:title" content="Welkom 2024!">
|
||||||
<meta property="og:url" content="francescomecca.eu/blog/2024/1/12/happy-new-year-2024/">
|
<meta property="og:url" content="francescomecca.eu/blog/2024/1/12/happy-new-year-2024/">
|
||||||
|
|
325
output/blog/2024/2/28/three-years-later/index.html
Normal file
325
output/blog/2024/2/28/three-years-later/index.html
Normal file
|
@ -0,0 +1,325 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<title>Playng videogames with WINE on Gentoo | Caught in the Net</title>
|
||||||
|
<link rel="stylesheet" href="../../../../../assets/blog/fonts/opensans.css">
|
||||||
|
<link href="../../../../../assets/blog/css/normalize.css" rel="stylesheet" type="text/css">
|
||||||
|
<link href="../../../../../assets/blog/css/cayman.css" rel="stylesheet" type="text/css">
|
||||||
|
<meta name="theme-color" content="#5670d4">
|
||||||
|
<meta name="generator" content="Nikola (getnikola.com)">
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="../../../../../rss.xml">
|
||||||
|
<link rel="canonical" href="francescomecca.eu/blog/2024/2/28/three-years-later/">
|
||||||
|
<meta name="author" content="Francesco Mecca">
|
||||||
|
<link rel="prev" href="../../../1/12/happy-new-year-2024/" title="Welkom 2024!" type="text/html">
|
||||||
|
<meta property="og:site_name" content="Caught in the Net">
|
||||||
|
<meta property="og:title" content="Playng videogames with WINE on Gentoo">
|
||||||
|
<meta property="og:url" content="francescomecca.eu/blog/2024/2/28/three-years-later/">
|
||||||
|
<meta property="og:description" content="Playing videogames with WINE on Gentoo
|
||||||
|
One of my new year's resolution are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpos">
|
||||||
|
<meta property="og:type" content="article">
|
||||||
|
<meta property="article:published_time" content="2024-02-28T00:00:00Z">
|
||||||
|
<meta property="article:tag" content="Gentoo">
|
||||||
|
<meta property="article:tag" content="linux">
|
||||||
|
<meta property="article:tag" content="videogames">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container">
|
||||||
|
|
||||||
|
<section class="page-header"><h1 class="project-name">
|
||||||
|
Caught in the Net
|
||||||
|
</h1>
|
||||||
|
<h2 class="project-tagline">La rete ti cattura ma libera il pensiero</h2>
|
||||||
|
<a class="btn" href="../../../../../">Home</a>
|
||||||
|
<a class="btn" href="../../../../../pages/about/">About me</a>
|
||||||
|
<a class="btn" href="../../../../../pages/contattami/">Contact me</a>
|
||||||
|
<a class="btn" href="../../../../../archiveall.html">Archive</a>
|
||||||
|
<a class="btn" href="../../../../../rss.xml">RSS</a>
|
||||||
|
<a class="btn" href="http://francescomecca.eu/git/pesceWanda">Personal Git</a>
|
||||||
|
<a class="btn" href="https://github.com/FraMecca">Github</a>
|
||||||
|
<a class="btn" href="https://lezzo.org/git/public/Curriculum_vitae/raw/master/latex.dir/francesco_mecca_cv_eng.pdf">Curriculum</a>
|
||||||
|
</section><section class="main-content"><div class="post">
|
||||||
|
|
||||||
|
<header><h1 class="post-title">
|
||||||
|
|
||||||
|
<h1 class="p-name post-title" itemprop="headline name">Playng videogames with WINE on Gentoo</h1>
|
||||||
|
|
||||||
|
</h1>
|
||||||
|
</header><p class="dateline post-date">28 February 2024</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="e-content entry-content" itemprop="articleBody text">
|
||||||
|
<h2>Playing videogames with WINE on Gentoo</h2>
|
||||||
|
<p><a href="../../../../../2024/1/12/happy-new-year-2024/">One of my new year's resolution</a> are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the <a href="https://wiki.gentoo.org/wiki/Wine">Gentoo
|
||||||
|
wiki</a> and the <a href="https://wiki.archlinux.org/title/Wine">Arch
|
||||||
|
Wiki</a>. </p>
|
||||||
|
<p>These objectives should be clear:</p>
|
||||||
|
<ul>
|
||||||
|
<li>I will not use steam: I only buy from <a href="https://www.gog.com/games">GOG</a> or use CDs</li>
|
||||||
|
<li>I want to use one of my controllers for games that need it</li>
|
||||||
|
<li>use as much software from the Gentoo repos as possible. This means avoiding <a href="https://usebottles.com/">Bottles</a> and <a href="https://lutris.net/">Lutris</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Hardware</h3>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~></span><span class="w"> </span><span class="n">sudo</span><span class="w"> </span><span class="n">inxi</span><span class="w"> </span><span class="o">-</span><span class="n">AGSC</span>
|
||||||
|
<span class="n">System</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Host</span><span class="p">:</span><span class="w"> </span><span class="n">____</span><span class="w"> </span><span class="n">Kernel</span><span class="p">:</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">arch</span><span class="p">:</span><span class="w"> </span><span class="n">x86_64</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">Desktop</span><span class="p">:</span><span class="w"> </span><span class="n">spectrwm</span>
|
||||||
|
<span class="w"> </span><span class="n">Distro</span><span class="p">:</span><span class="w"> </span><span class="n">Gentoo</span><span class="w"> </span><span class="n">Base</span><span class="w"> </span><span class="n">System</span><span class="w"> </span><span class="n">release</span><span class="w"> </span><span class="mf">2.14</span>
|
||||||
|
<span class="n">CPU</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Info</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="o">-</span><span class="n">core</span><span class="w"> </span><span class="n">model</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Ryzen</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">2600</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">MT</span><span class="w"> </span><span class="n">MCP</span><span class="w"> </span><span class="n">cache</span><span class="p">:</span><span class="w"> </span><span class="n">L2</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">MiB</span>
|
||||||
|
<span class="w"> </span><span class="n">Speed</span><span class="w"> </span><span class="p">(</span><span class="n">MHz</span><span class="p">):</span><span class="w"> </span><span class="n">avg</span><span class="p">:</span><span class="w"> </span><span class="mi">1858</span><span class="w"> </span><span class="nb">min</span><span class="o">/</span><span class="nb">max</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="o">/</span><span class="mi">3400</span><span class="w"> </span><span class="n">cores</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="w"> </span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">6</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">7</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">8</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">9</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">10</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">11</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">12</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="n">Graphics</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">22</span><span class="w"> </span><span class="p">[</span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6700</span><span class="o">/</span><span class="mi">6700</span><span class="w"> </span><span class="n">XT</span><span class="o">/</span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">6800</span><span class="n">M</span><span class="o">/</span><span class="mi">6850</span><span class="n">M</span><span class="w"> </span><span class="n">XT</span><span class="p">]</span>
|
||||||
|
<span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">Logitech</span><span class="w"> </span><span class="n">C920</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Pro</span><span class="w"> </span><span class="n">Webcam</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">usbfs</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">Display</span><span class="p">:</span><span class="w"> </span><span class="n">server</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="o">.</span><span class="n">org</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.21</span><span class="o">.</span><span class="mf">1.11</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="p">:</span><span class="w"> </span><span class="n">loaded</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">unloaded</span><span class="p">:</span><span class="w"> </span><span class="n">modesetting</span><span class="p">,</span><span class="n">radeon</span><span class="w"> </span><span class="n">dri</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="w"> </span><span class="n">gpu</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">resolution</span><span class="p">:</span><span class="w"> </span><span class="mi">1920</span><span class="n">x1200</span><span class="o">~</span><span class="mi">60</span><span class="n">Hz</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">EGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.5</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="p">,</span><span class="n">swrast</span>
|
||||||
|
<span class="w"> </span><span class="n">platforms</span><span class="p">:</span><span class="w"> </span><span class="n">gbm</span><span class="p">,</span><span class="n">x11</span><span class="p">,</span><span class="n">surfaceless</span><span class="p">,</span><span class="n">device</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">OpenGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">4.6</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="w"> </span><span class="n">amd</span><span class="w"> </span><span class="n">mesa</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">23.3</span><span class="o">.</span><span class="mi">5</span><span class="w"> </span><span class="n">renderer</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span>
|
||||||
|
<span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="p">(</span><span class="n">radeonsi</span><span class="w"> </span><span class="n">navi22</span><span class="w"> </span><span class="n">LLVM</span><span class="w"> </span><span class="mf">17.0</span><span class="o">.</span><span class="mi">6</span><span class="w"> </span><span class="n">DRM</span><span class="w"> </span><span class="mf">3.49</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">Vulkan</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">N</span><span class="o">/</span><span class="n">A</span><span class="w"> </span><span class="n">surfaces</span><span class="p">:</span><span class="w"> </span><span class="n">xcb</span><span class="p">,</span><span class="n">xlib</span>
|
||||||
|
<span class="n">Audio</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">21</span><span class="o">/</span><span class="mi">23</span><span class="w"> </span><span class="n">HDMI</span><span class="o">/</span><span class="n">DP</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Family</span><span class="w"> </span><span class="mi">17</span><span class="n">h</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd</span><span class="o">-</span><span class="n">usb</span><span class="o">-</span><span class="n">audio</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">ALSA</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">k6</span><span class="o">.</span><span class="mf">1.69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span><span class="o">-</span><span class="n">api</span>
|
||||||
|
<span class="w"> </span><span class="n">Server</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">PulseAudio</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">16.1</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="w"> </span><span class="n">process</span><span class="p">)</span>
|
||||||
|
<span class="n">USB</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">splitkb</span><span class="o">.</span><span class="n">com</span><span class="w"> </span><span class="n">Kyria</span><span class="w"> </span><span class="n">rev2</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">keyboard</span><span class="p">,</span><span class="n">HID</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">7</span><span class="p">:</span><span class="mi">4</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Microsoft</span><span class="w"> </span><span class="n">Xbox360</span><span class="w"> </span><span class="n">Controller</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o"><</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">></span>
|
||||||
|
<span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">audio</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">6</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">ThrustMaster</span><span class="w"> </span><span class="n">XB1</span><span class="w"> </span><span class="n">Classic</span><span class="w"> </span><span class="n">Controller</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o"><</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">></span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h3>Drivers</h3>
|
||||||
|
<p>For the kernel, I am using the <code>gentoo-kernel</code> seed.</p>
|
||||||
|
<p>For the GPU setup you need:</p>
|
||||||
|
<ul>
|
||||||
|
<li>the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU</li>
|
||||||
|
<li>the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO</li>
|
||||||
|
<li>the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:</li>
|
||||||
|
</ul>
|
||||||
|
<div class="code"><pre class="code literal-block">user ~> lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block">user ~> glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~></span><span class="w"> </span><span class="n">vulkaninfo</span><span class="w"> </span><span class="o">--</span><span class="n">summary</span><span class="w"> </span>
|
||||||
|
<span class="n">ac_compute_device_uuid</span><span class="s1">'s output is based on invalid pci bus info.</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
<span class="n">VULKANINFO</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
|
||||||
|
<span class="n">Vulkan</span><span class="w"> </span><span class="n">Instance</span><span class="w"> </span><span class="n">Version</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Extensions</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span>
|
||||||
|
<span class="o">-------------------------------</span>
|
||||||
|
<span class="n">VK_EXT_acquire_drm_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_acquire_xlib_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_debug_report</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">10</span>
|
||||||
|
<span class="n">VK_EXT_debug_utils</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_EXT_direct_mode_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_display_surface_counter</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_surface_maintenance1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_swapchain_colorspace</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">4</span>
|
||||||
|
<span class="n">VK_KHR_device_group_creation</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">23</span>
|
||||||
|
<span class="n">VK_KHR_external_fence_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_memory_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_semaphore_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_display_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_physical_device_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_KHR_get_surface_capabilities2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_portability_enumeration</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">25</span>
|
||||||
|
<span class="n">VK_KHR_surface_protected_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_xcb_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_KHR_xlib_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_LUNARG_direct_driver_loading</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Layers</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span>
|
||||||
|
<span class="o">--------------------------</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_32</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_64</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_MESA_device_select</span><span class="w"> </span><span class="n">Linux</span><span class="w"> </span><span class="n">device</span><span class="w"> </span><span class="n">selection</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">211</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Devices</span><span class="p">:</span>
|
||||||
|
<span class="o">========</span>
|
||||||
|
<span class="n">GPU0</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">260</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">279</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_PROPRIETARY</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">shader</span><span class="w"> </span><span class="n">compiler</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">3.1</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
<span class="n">GPU1</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">257</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_OPEN_SOURCE</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">open</span><span class="o">-</span><span class="n">source</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2023.</span><span class="n">Q1</span><span class="o">.</span><span class="mi">3</span><span class="w"> </span><span class="p">(</span><span class="n">LLPC</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">0.0</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>The most important bits are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>Kernel driver in use: amdgpu</code></li>
|
||||||
|
<li><code>direct rendering: Yes</code></li>
|
||||||
|
<li>that <code>vulkaninfo</code> doesn't produce any errors</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Wine and other software packages</h3>
|
||||||
|
<p>These are my current useflags:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine: <code>+abi_x86_32 +abi_x86_64 +proton</code>
|
||||||
|
</li>
|
||||||
|
<li>wine-staging: <code>+X +abi_x86_32 +abi_x86_64 -alsa -capi -crossdev-mingw -cups -custom-cflags -dos +fontconfig +gecko -gphoto2 +gstreamer -kerberos -llvm-libunwind +mingw +mono -netapi +nls -opencl +opengl -osmesa -pcap -perl +pulseaudio -samba -scanner +sdl -smartcard +ssl +strip +truetype -udev -udisks +unwind +usb -v4l +vulkan -wayland -wow64 +xcomposite -xinerama</code>
|
||||||
|
</li>
|
||||||
|
<li>wine-proton: <code>+X +abi_x86_32 +abi_x86_64 -alsa -capi -crossdev-mingw -cups -custom-cflags -dos +fontconfig +gecko -gphoto2 +gstreamer -kerberos -llvm-libunwind +mingw +mono -netapi +nls -odbc -opencl +opengl -osmesa -pcap -perl +pulseaudio -samba -scanner +sdl -smartcard +ssl +strip +truetype -udev -udisks +unwind -usb -v4l +vulkan -wayland -wow64 +xcomposite -xinerama</code>
|
||||||
|
</li>
|
||||||
|
<li>wine-vanilla: <code>+abi_x86_32 +abi_x86_64 -alsa -crossdev-mingw -custom-cflags +fontconfig +gecko +gstreamer -llvm-libunwind +mono +nls -osmesa -perl +pulseaudio +sdl +ssl +strip -udev -udisks +unwind +usb -v4l +video_cards_amdgpu +xcomposite -xinerama</code>
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use <code>eselect wine</code> to switch between versions.</li>
|
||||||
|
</ul>
|
||||||
|
<p>I have enable the <code>abi_x86_32</code> use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.</p>
|
||||||
|
<p>These are the additional WINE related packages that I installed:</p>
|
||||||
|
<ul>
|
||||||
|
<li>app-emulation/winetricks: <code>+gtk +rar</code>
|
||||||
|
</li>
|
||||||
|
<li>app-emulation/vkd3d-proton: <code>+abi_x86_32 +strip</code>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>GPU related packages:</p>
|
||||||
|
<ul>
|
||||||
|
<li>dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan</li>
|
||||||
|
<li>media-libs/vulkan-loader: <code>+X +abi_x86_32 +layers</code>
|
||||||
|
</li>
|
||||||
|
<li>dev-util/vulkan-tools: <code>+X</code>
|
||||||
|
</li>
|
||||||
|
<li>media-libs/amdgpu-pro-vulkan: <code>+abi_x86_32 +video_cards_amdgpu</code>
|
||||||
|
</li>
|
||||||
|
<li>media-libs/amdvlk: <code>+abi_x86_32 +raytracing</code> but I am not sure my gpu supports raytracing</li>
|
||||||
|
<li>media-libs/shaderc</li>
|
||||||
|
</ul>
|
||||||
|
<p>Controller related tools:</p>
|
||||||
|
<ul>
|
||||||
|
<li>app-misc/evtest: to test the controllers input</li>
|
||||||
|
</ul>
|
||||||
|
<p>I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:</p>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">ERROR</span><span class="p">:</span><span class="w"> </span><span class="n">ld</span><span class="o">.</span><span class="n">so</span><span class="p">:</span><span class="w"> </span><span class="n">object</span><span class="w"> </span><span class="s1">'/usr/lib64/libswmhack.so.0.0'</span><span class="w"> </span><span class="n">from</span><span class="w"> </span><span class="n">LD_PRELOAD</span><span class="w"> </span><span class="n">cannot</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">preloaded</span><span class="w"> </span><span class="p">(</span><span class="n">wrong</span><span class="w"> </span><span class="n">ELF</span><span class="w"> </span><span class="k">class</span><span class="p">:</span><span class="w"> </span><span class="n">ELFCLASS64</span><span class="p">):</span><span class="w"> </span><span class="n">ignored</span><span class="o">.</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.</p>
|
||||||
|
<p>user ~> WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink</p>
|
||||||
|
<ul>
|
||||||
|
<li>wineboot</li>
|
||||||
|
<li>la demo</li>
|
||||||
|
<li>app-emulation/vkd3d-proton<div class="code"><pre class="code literal-block">elog " WINEPREFIX=/path/to/prefix setup_dxvk.sh install --symlink"
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>WINEPREFIX=user ~> setup_vkd3d_proton.sh install</p>
|
||||||
|
<ul>
|
||||||
|
<li>evtest; wine control joy....; dxdiag?</li>
|
||||||
|
</ul>
|
||||||
|
<p>windows managers?</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<p>hardware: controller, gpu, cpu, audio</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>snapshot .cache/wine</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<aside class="postpromonav"><nav><h4>Categories</h4>
|
||||||
|
|
||||||
|
<ul itemprop="keywords" class="tags">
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/gentoo/" rel="tag">Gentoo</a></li>
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/linux/" rel="tag">linux</a></li>
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/videogames/" rel="tag">videogames</a></li>
|
||||||
|
</ul></nav></aside><p class="sourceline"><a href="index.md" class="sourcelink">Source</a></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
||||||
|
<span class="site-footer-credits"><a href="https://getnikola.com">Nikola</a>, <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a>.</span>
|
||||||
|
</footer></section>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
258
output/blog/2024/2/28/three-years-later/index.md
Normal file
258
output/blog/2024/2/28/three-years-later/index.md
Normal file
|
@ -0,0 +1,258 @@
|
||||||
|
<!--
|
||||||
|
.. title: Playng videogames with WINE on Gentoo
|
||||||
|
.. slug: three-years-later
|
||||||
|
.. date: 2024-02-28
|
||||||
|
.. tags: videogames,linux,Gentoo
|
||||||
|
.. category: PesceWanda
|
||||||
|
.. link:
|
||||||
|
.. description:
|
||||||
|
.. type: text
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Playing videogames with WINE on Gentoo
|
||||||
|
[One of my new year's resolution](/2024/1/12/happy-new-year-2024/) are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the [Gentoo
|
||||||
|
wiki](https://wiki.gentoo.org/wiki/Wine) and the [Arch
|
||||||
|
Wiki](https://wiki.archlinux.org/title/Wine).
|
||||||
|
|
||||||
|
These objectives should be clear:
|
||||||
|
|
||||||
|
- I will not use steam: I only buy from [GOG](https://www.gog.com/games) or use CDs
|
||||||
|
- I want to use one of my controllers for games that need it
|
||||||
|
- use as much software from the Gentoo repos as possible. This means avoiding [Bottles](https://usebottles.com/) and [Lutris](https://lutris.net/)
|
||||||
|
## Hardware
|
||||||
|
```
|
||||||
|
user ~> sudo inxi -AGSC
|
||||||
|
System:
|
||||||
|
Host: ____ Kernel: 6.1.69-gentoo-dist arch: x86_64 bits: 64 Desktop: spectrwm
|
||||||
|
Distro: Gentoo Base System release 2.14
|
||||||
|
CPU:
|
||||||
|
Info: 6-core model: AMD Ryzen 5 2600 bits: 64 type: MT MCP cache: L2: 3 MiB
|
||||||
|
Speed (MHz): avg: 1858 min/max: 1550/3400 cores: 1: 3400 2: 1550 3: 1550
|
||||||
|
4: 1550 5: 1550 6: 1550 7: 1550 8: 1550 9: 3400 10: 1550 11: 1550 12: 1550
|
||||||
|
Graphics:
|
||||||
|
Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
driver: amdgpu v: kernel
|
||||||
|
Device-2: Logitech C920 HD Pro Webcam driver: usbfs type: USB
|
||||||
|
Display: server: X.org v: 1.21.1.11 driver: X: loaded: amdgpu
|
||||||
|
unloaded: modesetting,radeon dri: radeonsi gpu: amdgpu
|
||||||
|
resolution: 1920x1200~60Hz
|
||||||
|
API: EGL v: 1.5 drivers: radeonsi,swrast
|
||||||
|
platforms: gbm,x11,surfaceless,device
|
||||||
|
API: OpenGL v: 4.6 vendor: amd mesa v: 23.3.5 renderer: AMD Radeon RX
|
||||||
|
6750 XT (radeonsi navi22 LLVM 17.0.6 DRM 3.49 6.1.69-gentoo-dist)
|
||||||
|
API: Vulkan v: 1.3.275 drivers: N/A surfaces: xcb,xlib
|
||||||
|
Audio:
|
||||||
|
Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel
|
||||||
|
Device-2: AMD Family 17h HD Audio driver: snd_hda_intel
|
||||||
|
Device-5: Focusrite-Novation Focusrite Scarlett 2i2 driver: snd-usb-audio
|
||||||
|
type: USB
|
||||||
|
API: ALSA v: k6.1.69-gentoo-dist status: kernel-api
|
||||||
|
Server-1: PulseAudio v: 16.1 status: active (root, process)
|
||||||
|
USB:
|
||||||
|
Device-1: 1-4:2 info: splitkb.com Kyria rev2 type: keyboard,HID rev: 2.0
|
||||||
|
Device-2: 1-7:4 info: Microsoft Xbox360 Controller type: <vendor specific>
|
||||||
|
rev: 2.0
|
||||||
|
Device-3: 3-2:3 info: Focusrite-Novation Focusrite Scarlett 2i2
|
||||||
|
type: audio rev: 2.0
|
||||||
|
Device-4: 3-4:6 info: ThrustMaster XB1 Classic Controller
|
||||||
|
type: <vendor specific> rev: 2.0
|
||||||
|
```
|
||||||
|
## Drivers
|
||||||
|
For the kernel, I am using the `gentoo-kernel` seed.
|
||||||
|
|
||||||
|
For the GPU setup you need:
|
||||||
|
|
||||||
|
- the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU
|
||||||
|
- the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO
|
||||||
|
- the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:
|
||||||
|
```
|
||||||
|
user ~> lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
```
|
||||||
|
```
|
||||||
|
user ~> glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
```
|
||||||
|
```
|
||||||
|
user ~> vulkaninfo --summary
|
||||||
|
ac_compute_device_uuid's output is based on invalid pci bus info.
|
||||||
|
==========
|
||||||
|
VULKANINFO
|
||||||
|
==========
|
||||||
|
|
||||||
|
Vulkan Instance Version: 1.3.275
|
||||||
|
|
||||||
|
|
||||||
|
Instance Extensions: count = 22
|
||||||
|
-------------------------------
|
||||||
|
VK_EXT_acquire_drm_display : extension revision 1
|
||||||
|
VK_EXT_acquire_xlib_display : extension revision 1
|
||||||
|
VK_EXT_debug_report : extension revision 10
|
||||||
|
VK_EXT_debug_utils : extension revision 2
|
||||||
|
VK_EXT_direct_mode_display : extension revision 1
|
||||||
|
VK_EXT_display_surface_counter : extension revision 1
|
||||||
|
VK_EXT_surface_maintenance1 : extension revision 1
|
||||||
|
VK_EXT_swapchain_colorspace : extension revision 4
|
||||||
|
VK_KHR_device_group_creation : extension revision 1
|
||||||
|
VK_KHR_display : extension revision 23
|
||||||
|
VK_KHR_external_fence_capabilities : extension revision 1
|
||||||
|
VK_KHR_external_memory_capabilities : extension revision 1
|
||||||
|
VK_KHR_external_semaphore_capabilities : extension revision 1
|
||||||
|
VK_KHR_get_display_properties2 : extension revision 1
|
||||||
|
VK_KHR_get_physical_device_properties2 : extension revision 2
|
||||||
|
VK_KHR_get_surface_capabilities2 : extension revision 1
|
||||||
|
VK_KHR_portability_enumeration : extension revision 1
|
||||||
|
VK_KHR_surface : extension revision 25
|
||||||
|
VK_KHR_surface_protected_capabilities : extension revision 1
|
||||||
|
VK_KHR_xcb_surface : extension revision 6
|
||||||
|
VK_KHR_xlib_surface : extension revision 6
|
||||||
|
VK_LUNARG_direct_driver_loading : extension revision 1
|
||||||
|
|
||||||
|
Instance Layers: count = 3
|
||||||
|
--------------------------
|
||||||
|
VK_LAYER_AMD_switchable_graphics_32 AMD switchable graphics layer 1.3.241 version 1
|
||||||
|
VK_LAYER_AMD_switchable_graphics_64 AMD switchable graphics layer 1.3.241 version 1
|
||||||
|
VK_LAYER_MESA_device_select Linux device selection layer 1.3.211 version 1
|
||||||
|
|
||||||
|
Devices:
|
||||||
|
========
|
||||||
|
GPU0:
|
||||||
|
apiVersion = 1.3.260
|
||||||
|
driverVersion = 2.0.279
|
||||||
|
vendorID = 0x1002
|
||||||
|
deviceID = 0x73df
|
||||||
|
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
|
||||||
|
deviceName = AMD Radeon RX 6750 XT
|
||||||
|
driverID = DRIVER_ID_AMD_PROPRIETARY
|
||||||
|
driverName = AMD proprietary driver
|
||||||
|
driverInfo = (AMD proprietary shader compiler)
|
||||||
|
conformanceVersion = 1.3.3.1
|
||||||
|
deviceUUID =
|
||||||
|
driverUUID = 414d442d-4c49-4e55-582d-445256000000
|
||||||
|
GPU1:
|
||||||
|
apiVersion = 1.3.241
|
||||||
|
driverVersion = 2.0.257
|
||||||
|
vendorID = 0x1002
|
||||||
|
deviceID = 0x73df
|
||||||
|
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
|
||||||
|
deviceName = AMD Radeon RX 6750 XT
|
||||||
|
driverID = DRIVER_ID_AMD_OPEN_SOURCE
|
||||||
|
driverName = AMD open-source driver
|
||||||
|
driverInfo = 2023.Q1.3 (LLPC)
|
||||||
|
conformanceVersion = 1.3.0.0
|
||||||
|
deviceUUID =
|
||||||
|
driverUUID = 414d442d-4c49-4e55-582d-445256000000
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
The most important bits are:
|
||||||
|
|
||||||
|
- `Kernel driver in use: amdgpu`
|
||||||
|
- `direct rendering: Yes`
|
||||||
|
- that `vulkaninfo` doesn't produce any errors
|
||||||
|
|
||||||
|
## Wine and other software packages
|
||||||
|
These are my current useflags:
|
||||||
|
|
||||||
|
- wine: `+abi_x86_32 +abi_x86_64 +proton`
|
||||||
|
- wine-staging: `+X +abi_x86_32 +abi_x86_64 -alsa -capi -crossdev-mingw -cups -custom-cflags -dos +fontconfig +gecko -gphoto2 +gstreamer -kerberos -llvm-libunwind +mingw +mono -netapi +nls -opencl +opengl -osmesa -pcap -perl +pulseaudio -samba -scanner +sdl -smartcard +ssl +strip +truetype -udev -udisks +unwind +usb -v4l +vulkan -wayland -wow64 +xcomposite -xinerama`
|
||||||
|
- wine-proton: `+X +abi_x86_32 +abi_x86_64 -alsa -capi -crossdev-mingw -cups -custom-cflags -dos +fontconfig +gecko -gphoto2 +gstreamer -kerberos -llvm-libunwind +mingw +mono -netapi +nls -odbc -opencl +opengl -osmesa -pcap -perl +pulseaudio -samba -scanner +sdl -smartcard +ssl +strip +truetype -udev -udisks +unwind -usb -v4l +vulkan -wayland -wow64 +xcomposite -xinerama`
|
||||||
|
- wine-vanilla: `+abi_x86_32 +abi_x86_64 -alsa -crossdev-mingw -custom-cflags +fontconfig +gecko +gstreamer -llvm-libunwind +mono +nls -osmesa -perl +pulseaudio +sdl +ssl +strip -udev -udisks +unwind +usb -v4l +video_cards_amdgpu +xcomposite -xinerama`
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use `eselect wine` to switch between versions.
|
||||||
|
|
||||||
|
I have enable the `abi_x86_32` use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.
|
||||||
|
|
||||||
|
These are the additional WINE related packages that I installed:
|
||||||
|
|
||||||
|
- app-emulation/winetricks: `+gtk +rar`
|
||||||
|
- app-emulation/vkd3d-proton: `+abi_x86_32 +strip`
|
||||||
|
|
||||||
|
GPU related packages:
|
||||||
|
|
||||||
|
- dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan
|
||||||
|
- media-libs/vulkan-loader: `+X +abi_x86_32 +layers`
|
||||||
|
- dev-util/vulkan-tools: `+X`
|
||||||
|
- media-libs/amdgpu-pro-vulkan: `+abi_x86_32 +video_cards_amdgpu`
|
||||||
|
- media-libs/amdvlk: `+abi_x86_32 +raytracing` but I am not sure my gpu supports raytracing
|
||||||
|
- media-libs/shaderc
|
||||||
|
|
||||||
|
Controller related tools:
|
||||||
|
|
||||||
|
- app-misc/evtest: to test the controllers input
|
||||||
|
|
||||||
|
I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:
|
||||||
|
```
|
||||||
|
ERROR: ld.so: object '/usr/lib64/libswmhack.so.0.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
|
||||||
|
```
|
||||||
|
Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
user ~> WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink
|
||||||
|
|
||||||
|
- wineboot
|
||||||
|
- la demo
|
||||||
|
- app-emulation/vkd3d-proton
|
||||||
|
|
||||||
|
|
||||||
|
elog " WINEPREFIX=/path/to/prefix setup_dxvk.sh install --symlink"
|
||||||
|
|
||||||
|
WINEPREFIX=user ~> setup_vkd3d_proton.sh install
|
||||||
|
|
||||||
|
|
||||||
|
- evtest; wine control joy....; dxdiag?
|
||||||
|
|
||||||
|
|
||||||
|
windows managers?
|
||||||
|
|
||||||
|
- hardware: controller, gpu, cpu, audio
|
||||||
|
|
||||||
|
- snapshot .cache/wine
|
358
output/blog/2024/2/28/wine-gentoo/index.html
Normal file
358
output/blog/2024/2/28/wine-gentoo/index.html
Normal file
|
@ -0,0 +1,358 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width">
|
||||||
|
<title>Playing videogames with WINE on Gentoo | Caught in the Net</title>
|
||||||
|
<link rel="stylesheet" href="../../../../../assets/blog/fonts/opensans.css">
|
||||||
|
<link href="../../../../../assets/blog/css/normalize.css" rel="stylesheet" type="text/css">
|
||||||
|
<link href="../../../../../assets/blog/css/cayman.css" rel="stylesheet" type="text/css">
|
||||||
|
<meta name="theme-color" content="#5670d4">
|
||||||
|
<meta name="generator" content="Nikola (getnikola.com)">
|
||||||
|
<link rel="alternate" type="application/rss+xml" title="RSS" hreflang="en" href="../../../../../rss.xml">
|
||||||
|
<link rel="canonical" href="francescomecca.eu/blog/2024/2/28/wine-gentoo/">
|
||||||
|
<meta name="author" content="Francesco Mecca">
|
||||||
|
<link rel="prev" href="../../../1/12/happy-new-year-2024/" title="Welkom 2024!" type="text/html">
|
||||||
|
<meta property="og:site_name" content="Caught in the Net">
|
||||||
|
<meta property="og:title" content="Playing videogames with WINE on Gentoo">
|
||||||
|
<meta property="og:url" content="francescomecca.eu/blog/2024/2/28/wine-gentoo/">
|
||||||
|
<meta property="og:description" content="One of my new year's resolution are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guid">
|
||||||
|
<meta property="og:type" content="article">
|
||||||
|
<meta property="article:published_time" content="2024-02-28T00:00:00Z">
|
||||||
|
<meta property="article:tag" content="Gentoo">
|
||||||
|
<meta property="article:tag" content="linux">
|
||||||
|
<meta property="article:tag" content="videogames">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="container">
|
||||||
|
|
||||||
|
<section class="page-header"><h1 class="project-name">
|
||||||
|
Caught in the Net
|
||||||
|
</h1>
|
||||||
|
<h2 class="project-tagline">La rete ti cattura ma libera il pensiero</h2>
|
||||||
|
<a class="btn" href="../../../../../">Home</a>
|
||||||
|
<a class="btn" href="../../../../../pages/about/">About me</a>
|
||||||
|
<a class="btn" href="../../../../../pages/contattami/">Contact me</a>
|
||||||
|
<a class="btn" href="../../../../../archiveall.html">Archive</a>
|
||||||
|
<a class="btn" href="../../../../../rss.xml">RSS</a>
|
||||||
|
<a class="btn" href="http://francescomecca.eu/git/pesceWanda">Personal Git</a>
|
||||||
|
<a class="btn" href="https://github.com/FraMecca">Github</a>
|
||||||
|
<a class="btn" href="https://lezzo.org/git/public/Curriculum_vitae/raw/master/latex.dir/francesco_mecca_cv_eng.pdf">Curriculum</a>
|
||||||
|
</section><section class="main-content"><div class="post">
|
||||||
|
|
||||||
|
<header><h1 class="post-title">
|
||||||
|
|
||||||
|
<h1 class="p-name post-title" itemprop="headline name">Playing videogames with WINE on Gentoo</h1>
|
||||||
|
|
||||||
|
</h1>
|
||||||
|
</header><p class="dateline post-date">28 February 2024</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="e-content entry-content" itemprop="articleBody text">
|
||||||
|
<p><a href="../../../../../2024/1/12/happy-new-year-2024/">One of my new year's resolution</a> are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the <a href="https://wiki.gentoo.org/wiki/Wine">Gentoo
|
||||||
|
wiki</a> and the <a href="https://wiki.archlinux.org/title/Wine">Arch
|
||||||
|
Wiki</a>. </p>
|
||||||
|
<p>These objectives should be clear:</p>
|
||||||
|
<ul>
|
||||||
|
<li>I will not use steam: I only buy from <a href="https://www.gog.com/games">GOG</a> or use CDs</li>
|
||||||
|
<li>I want to use one of my controllers for games that need it</li>
|
||||||
|
<li>use as much software from the Gentoo repos as possible; this means avoiding <a href="https://usebottles.com/">Bottles</a> and <a href="https://lutris.net/">Lutris</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Hardware</h3>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~></span><span class="w"> </span><span class="n">sudo</span><span class="w"> </span><span class="n">inxi</span><span class="w"> </span><span class="o">-</span><span class="n">AGSC</span>
|
||||||
|
<span class="n">System</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Host</span><span class="p">:</span><span class="w"> </span><span class="n">____</span><span class="w"> </span><span class="n">Kernel</span><span class="p">:</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">arch</span><span class="p">:</span><span class="w"> </span><span class="n">x86_64</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">Desktop</span><span class="p">:</span><span class="w"> </span><span class="n">spectrwm</span>
|
||||||
|
<span class="w"> </span><span class="n">Distro</span><span class="p">:</span><span class="w"> </span><span class="n">Gentoo</span><span class="w"> </span><span class="n">Base</span><span class="w"> </span><span class="n">System</span><span class="w"> </span><span class="n">release</span><span class="w"> </span><span class="mf">2.14</span>
|
||||||
|
<span class="n">CPU</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Info</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="o">-</span><span class="n">core</span><span class="w"> </span><span class="n">model</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Ryzen</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">2600</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">MT</span><span class="w"> </span><span class="n">MCP</span><span class="w"> </span><span class="n">cache</span><span class="p">:</span><span class="w"> </span><span class="n">L2</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">MiB</span>
|
||||||
|
<span class="w"> </span><span class="n">Speed</span><span class="w"> </span><span class="p">(</span><span class="n">MHz</span><span class="p">):</span><span class="w"> </span><span class="n">avg</span><span class="p">:</span><span class="w"> </span><span class="mi">1858</span><span class="w"> </span><span class="nb">min</span><span class="o">/</span><span class="nb">max</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="o">/</span><span class="mi">3400</span><span class="w"> </span><span class="n">cores</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="w"> </span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">6</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">7</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">8</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">9</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">10</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">11</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">12</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="n">Graphics</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">22</span><span class="w"> </span><span class="p">[</span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6700</span><span class="o">/</span><span class="mi">6700</span><span class="w"> </span><span class="n">XT</span><span class="o">/</span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">6800</span><span class="n">M</span><span class="o">/</span><span class="mi">6850</span><span class="n">M</span><span class="w"> </span><span class="n">XT</span><span class="p">]</span>
|
||||||
|
<span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">Logitech</span><span class="w"> </span><span class="n">C920</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Pro</span><span class="w"> </span><span class="n">Webcam</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">usbfs</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">Display</span><span class="p">:</span><span class="w"> </span><span class="n">server</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="o">.</span><span class="n">org</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.21</span><span class="o">.</span><span class="mf">1.11</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="p">:</span><span class="w"> </span><span class="n">loaded</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">unloaded</span><span class="p">:</span><span class="w"> </span><span class="n">modesetting</span><span class="p">,</span><span class="n">radeon</span><span class="w"> </span><span class="n">dri</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="w"> </span><span class="n">gpu</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">resolution</span><span class="p">:</span><span class="w"> </span><span class="mi">1920</span><span class="n">x1200</span><span class="o">~</span><span class="mi">60</span><span class="n">Hz</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">EGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.5</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="p">,</span><span class="n">swrast</span>
|
||||||
|
<span class="w"> </span><span class="n">platforms</span><span class="p">:</span><span class="w"> </span><span class="n">gbm</span><span class="p">,</span><span class="n">x11</span><span class="p">,</span><span class="n">surfaceless</span><span class="p">,</span><span class="n">device</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">OpenGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">4.6</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="w"> </span><span class="n">amd</span><span class="w"> </span><span class="n">mesa</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">23.3</span><span class="o">.</span><span class="mi">5</span><span class="w"> </span><span class="n">renderer</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span>
|
||||||
|
<span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="p">(</span><span class="n">radeonsi</span><span class="w"> </span><span class="n">navi22</span><span class="w"> </span><span class="n">LLVM</span><span class="w"> </span><span class="mf">17.0</span><span class="o">.</span><span class="mi">6</span><span class="w"> </span><span class="n">DRM</span><span class="w"> </span><span class="mf">3.49</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">Vulkan</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">N</span><span class="o">/</span><span class="n">A</span><span class="w"> </span><span class="n">surfaces</span><span class="p">:</span><span class="w"> </span><span class="n">xcb</span><span class="p">,</span><span class="n">xlib</span>
|
||||||
|
<span class="n">Audio</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">21</span><span class="o">/</span><span class="mi">23</span><span class="w"> </span><span class="n">HDMI</span><span class="o">/</span><span class="n">DP</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Family</span><span class="w"> </span><span class="mi">17</span><span class="n">h</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd</span><span class="o">-</span><span class="n">usb</span><span class="o">-</span><span class="n">audio</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">ALSA</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">k6</span><span class="o">.</span><span class="mf">1.69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span><span class="o">-</span><span class="n">api</span>
|
||||||
|
<span class="w"> </span><span class="n">Server</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">PulseAudio</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">16.1</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="w"> </span><span class="n">process</span><span class="p">)</span>
|
||||||
|
<span class="n">USB</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">splitkb</span><span class="o">.</span><span class="n">com</span><span class="w"> </span><span class="n">Kyria</span><span class="w"> </span><span class="n">rev2</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">keyboard</span><span class="p">,</span><span class="n">HID</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">7</span><span class="p">:</span><span class="mi">4</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Microsoft</span><span class="w"> </span><span class="n">Xbox360</span><span class="w"> </span><span class="n">Controller</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o"><</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">></span>
|
||||||
|
<span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">audio</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">6</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">ThrustMaster</span><span class="w"> </span><span class="n">XB1</span><span class="w"> </span><span class="n">Classic</span><span class="w"> </span><span class="n">Controller</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o"><</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">></span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h3>Drivers</h3>
|
||||||
|
<p>For the kernel, I am using the <code>gentoo-kernel</code> seed.</p>
|
||||||
|
<p>For the GPU setup you need:</p>
|
||||||
|
<ul>
|
||||||
|
<li>the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU</li>
|
||||||
|
<li>the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO</li>
|
||||||
|
<li>the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:</li>
|
||||||
|
</ul>
|
||||||
|
<div class="code"><pre class="code literal-block">user ~> lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block">user ~> glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~></span><span class="w"> </span><span class="n">vulkaninfo</span><span class="w"> </span><span class="o">--</span><span class="n">summary</span><span class="w"> </span>
|
||||||
|
<span class="n">ac_compute_device_uuid</span><span class="s1">'s output is based on invalid pci bus info.</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
<span class="n">VULKANINFO</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
|
||||||
|
<span class="n">Vulkan</span><span class="w"> </span><span class="n">Instance</span><span class="w"> </span><span class="n">Version</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Extensions</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span>
|
||||||
|
<span class="o">-------------------------------</span>
|
||||||
|
<span class="n">VK_EXT_acquire_drm_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_acquire_xlib_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_debug_report</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">10</span>
|
||||||
|
<span class="n">VK_EXT_debug_utils</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_EXT_direct_mode_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_display_surface_counter</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_surface_maintenance1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_swapchain_colorspace</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">4</span>
|
||||||
|
<span class="n">VK_KHR_device_group_creation</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">23</span>
|
||||||
|
<span class="n">VK_KHR_external_fence_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_memory_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_semaphore_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_display_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_physical_device_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_KHR_get_surface_capabilities2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_portability_enumeration</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">25</span>
|
||||||
|
<span class="n">VK_KHR_surface_protected_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_xcb_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_KHR_xlib_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_LUNARG_direct_driver_loading</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Layers</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span>
|
||||||
|
<span class="o">--------------------------</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_32</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_64</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_MESA_device_select</span><span class="w"> </span><span class="n">Linux</span><span class="w"> </span><span class="n">device</span><span class="w"> </span><span class="n">selection</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">211</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Devices</span><span class="p">:</span>
|
||||||
|
<span class="o">========</span>
|
||||||
|
<span class="n">GPU0</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">260</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">279</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_PROPRIETARY</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">shader</span><span class="w"> </span><span class="n">compiler</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">3.1</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
<span class="n">GPU1</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">257</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_OPEN_SOURCE</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">open</span><span class="o">-</span><span class="n">source</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2023.</span><span class="n">Q1</span><span class="o">.</span><span class="mi">3</span><span class="w"> </span><span class="p">(</span><span class="n">LLPC</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">0.0</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>The most important bits are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>Kernel driver in use: amdgpu</code></li>
|
||||||
|
<li><code>direct rendering: Yes</code></li>
|
||||||
|
<li>that <code>vulkaninfo</code> doesn't produce any errors</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Wine and other software packages</h3>
|
||||||
|
<p>These are my current useflags:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine: <code>+abi_x86_32 +abi_x86_64 +proton</code>
|
||||||
|
</li>
|
||||||
|
<li>wine-staging: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +usb +vulkan +xcomposite -wow64</code>
|
||||||
|
</li>
|
||||||
|
<li>wine-proton: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +vulkan +xcomposite -wow64</code>
|
||||||
|
</li>
|
||||||
|
<li>[ ] wine-vanilla: <code>+abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mono +nls +pulseaudio +sdl +ssl +strip +unwind +usb +video_cards_amdgpu +xcomposite -wow6</code>
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use <code>eselect wine</code> to switch between versions.
|
||||||
|
Until the Gentoo devs says that wow64 feature is stable and fully functional, I will keep it off.</li>
|
||||||
|
</ul>
|
||||||
|
<p>I have enable the <code>abi_x86_32</code> use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.</p>
|
||||||
|
<p>These are the additional WINE related packages that I installed:</p>
|
||||||
|
<ul>
|
||||||
|
<li>app-emulation/winetricks: <code>+gtk +rar</code>
|
||||||
|
</li>
|
||||||
|
<li>app-emulation/vkd3d-proton: <code>+abi_x86_32 +strip</code>
|
||||||
|
</li>
|
||||||
|
<li>app-emulation/dxvk: <code>+d3d10 +d3d11 +d3d9 +dxgi +strig +abi_x86_32</code>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>GPU related packages:</p>
|
||||||
|
<ul>
|
||||||
|
<li>dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan</li>
|
||||||
|
<li>media-libs/vulkan-loader: <code>+X +abi_x86_32 +layers</code>
|
||||||
|
</li>
|
||||||
|
<li>dev-util/vulkan-tools: <code>+X</code>
|
||||||
|
</li>
|
||||||
|
<li>media-libs/amdgpu-pro-vulkan: <code>+abi_x86_32 +video_cards_amdgpu</code>
|
||||||
|
</li>
|
||||||
|
<li>media-libs/amdvlk: <code>+abi_x86_32 +raytracing</code> but I am not sure my gpu supports raytracing</li>
|
||||||
|
<li>media-libs/shaderc</li>
|
||||||
|
</ul>
|
||||||
|
<p>I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:</p>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">ERROR</span><span class="p">:</span><span class="w"> </span><span class="n">ld</span><span class="o">.</span><span class="n">so</span><span class="p">:</span><span class="w"> </span><span class="n">object</span><span class="w"> </span><span class="s1">'/usr/lib64/libswmhack.so.0.0'</span><span class="w"> </span><span class="n">from</span><span class="w"> </span><span class="n">LD_PRELOAD</span><span class="w"> </span><span class="n">cannot</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">preloaded</span><span class="w"> </span><span class="p">(</span><span class="n">wrong</span><span class="w"> </span><span class="n">ELF</span><span class="w"> </span><span class="k">class</span><span class="p">:</span><span class="w"> </span><span class="n">ELFCLASS64</span><span class="p">):</span><span class="w"> </span><span class="n">ignored</span><span class="o">.</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.</p>
|
||||||
|
<h3>Using WINE</h3>
|
||||||
|
<p>If you have no clue about how WINE works, start by reading the <a href="https://wiki.winehq.org/FAQ#Wineprefixes">FAQs</a>.</p>
|
||||||
|
<p>The biggest considerations you have to make when using WINE are the
|
||||||
|
software dependencies of the Windows program you want to use. For the
|
||||||
|
moment I have been able to survive with only two prefixes, one for 32
|
||||||
|
bits games and one for more recent software.</p>
|
||||||
|
<p>What all of this means, is that I have two folders in my home, <code>.wine</code> and <code>.wine32</code> in which I instruct WINE to start a new program using the environment variable (that is what WINEPREFIX is all about). When I feel lazy, I select the WINE prefix using winetricks, then navigate to the game using explorer.exe.</p>
|
||||||
|
<p>It's important to remember that whenever you create a new WINE prefix, you need to symlink the correct directx dependencies, as the Gentoo ebuilds suggests:</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<code>WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink</code> for directx12</li>
|
||||||
|
<li>
|
||||||
|
<code>WINEPREFIX=/home/user/.wine setup_dxvk.sh install --symlink</code> for directx11 and earlier</li>
|
||||||
|
</ul>
|
||||||
|
<p>Usually WINE takes care of starting up necessary processes inside the
|
||||||
|
prefixes. This is done by the <code>wineboot</code> program so I suggest to read
|
||||||
|
its manpage.</p>
|
||||||
|
<p>To install software dependencies, I use winetricks. If a dependency is
|
||||||
|
not available through winetricks, it's always possible to install the
|
||||||
|
.exe as you would on Windows. Take in mind that WINE uses some Linux
|
||||||
|
specific software in place of some Windows libraries. Some key replacements include:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine-mono in place of dotnet</li>
|
||||||
|
<li>dxvk and vkd3d in place of directx</li>
|
||||||
|
<li>gallium-nine and wined3d, in place of directx but I had better experience with dxvk and vkd3d</li>
|
||||||
|
<li>wine-gecko in place of whatever web view IE was offering</li>
|
||||||
|
<li>wineconsole in place of the Windows cmd program</li>
|
||||||
|
<li>your dotnet installation is usually enough for WINE, you don't need
|
||||||
|
to install the dotnet runtimes, although I have to check this assertion on a
|
||||||
|
fresh installation</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Dependencies rules of thumb</h4>
|
||||||
|
<ol>
|
||||||
|
<li>lots of games prompt you to install dependencies such as directx. Avoid it as much as possible and rely on WINE specific libraries</li>
|
||||||
|
<li>winetricks can manage most if not all of those dependencies for you. It will save you time to figure out the correct paths for each library and automate the install as much as possible</li>
|
||||||
|
<li>recent games usually want the Visual C++ libraries. You can install them all with the vcrun2022 package </li>
|
||||||
|
<li>older games usually want Visual C++ libraries, but you need to install the different yearly versions one by one</li>
|
||||||
|
<li>you can backup or modify the winetricks installers. They are in you cache directory, usually <code>~/.cache/winetricks</code>
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
<h4>Debugging</h4>
|
||||||
|
<p>In all honesty, it's too early in this journey to write a comprehensive chapter on this topic. The <code>winedbg</code> command is still shrouded in mystery.</p>
|
||||||
|
<p>At the moment I am keeping a small set of games that are self contained and allows me to check if WINE inside the wineprefix is working as I expect.</p>
|
||||||
|
<p>I have uploaded some mostly self contained demos that you can use to test that directx and you GPU is working as it should:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="UnrealEngine4%20tech%20demo%20for%20directx12">https://archive.org/details/elemental-demo-dx-12-guru-3-d.com</a></li>
|
||||||
|
<li><a href="the%20same%20demo,%20but%20for%20directx11">https://archive.org/details/ue-4-elemental-demo</a></li>
|
||||||
|
<li><a href="ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20v1.1ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20for%20directx9">https://archive.org/details/ati-radeon-9700-debevec-rnl-demo-v-1.1.7z</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>You can find more video card demos at <a href="soggi.org">https://soggi.org/video-cards/tech-demos.htm</a>.</p>
|
||||||
|
<p>For controllers, you can use two tools:</p>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<code>wine dxdiag</code> that launches the directx toolbox, useful not only for the gpu, but also for audio and input devices</li>
|
||||||
|
<li>
|
||||||
|
<code>wine control joy.cpl</code>, a cool utility to see your XInput and DInput compatible hardware</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<aside class="postpromonav"><nav><h4>Categories</h4>
|
||||||
|
|
||||||
|
<ul itemprop="keywords" class="tags">
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/gentoo/" rel="tag">Gentoo</a></li>
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/linux/" rel="tag">linux</a></li>
|
||||||
|
<li><a class="tag p-category" href="../../../../../categories/videogames/" rel="tag">videogames</a></li>
|
||||||
|
</ul></nav></aside><p class="sourceline"><a href="index.md" class="sourcelink">Source</a></p>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
||||||
|
<span class="site-footer-credits"><a href="https://getnikola.com">Nikola</a>, <a href="https://github.com/jasonlong/cayman-theme">Cayman theme</a>.</span>
|
||||||
|
</footer></section>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
292
output/blog/2024/2/28/wine-gentoo/index.md
Normal file
292
output/blog/2024/2/28/wine-gentoo/index.md
Normal file
|
@ -0,0 +1,292 @@
|
||||||
|
<!--
|
||||||
|
.. title: Playing videogames with WINE on Gentoo
|
||||||
|
.. slug: wine-gentoo
|
||||||
|
.. date: 2024-02-28
|
||||||
|
.. tags: videogames,linux,Gentoo
|
||||||
|
.. category: PesceWanda
|
||||||
|
.. link:
|
||||||
|
.. description:
|
||||||
|
.. type: text
|
||||||
|
-->
|
||||||
|
|
||||||
|
[One of my new year's resolution](/2024/1/12/happy-new-year-2024/) are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the [Gentoo
|
||||||
|
wiki](https://wiki.gentoo.org/wiki/Wine) and the [Arch
|
||||||
|
Wiki](https://wiki.archlinux.org/title/Wine).
|
||||||
|
|
||||||
|
These objectives should be clear:
|
||||||
|
|
||||||
|
- I will not use steam: I only buy from [GOG](https://www.gog.com/games) or use CDs
|
||||||
|
- I want to use one of my controllers for games that need it
|
||||||
|
- use as much software from the Gentoo repos as possible; this means avoiding [Bottles](https://usebottles.com/) and [Lutris](https://lutris.net/)
|
||||||
|
## Hardware
|
||||||
|
```
|
||||||
|
user ~> sudo inxi -AGSC
|
||||||
|
System:
|
||||||
|
Host: ____ Kernel: 6.1.69-gentoo-dist arch: x86_64 bits: 64 Desktop: spectrwm
|
||||||
|
Distro: Gentoo Base System release 2.14
|
||||||
|
CPU:
|
||||||
|
Info: 6-core model: AMD Ryzen 5 2600 bits: 64 type: MT MCP cache: L2: 3 MiB
|
||||||
|
Speed (MHz): avg: 1858 min/max: 1550/3400 cores: 1: 3400 2: 1550 3: 1550
|
||||||
|
4: 1550 5: 1550 6: 1550 7: 1550 8: 1550 9: 3400 10: 1550 11: 1550 12: 1550
|
||||||
|
Graphics:
|
||||||
|
Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
driver: amdgpu v: kernel
|
||||||
|
Device-2: Logitech C920 HD Pro Webcam driver: usbfs type: USB
|
||||||
|
Display: server: X.org v: 1.21.1.11 driver: X: loaded: amdgpu
|
||||||
|
unloaded: modesetting,radeon dri: radeonsi gpu: amdgpu
|
||||||
|
resolution: 1920x1200~60Hz
|
||||||
|
API: EGL v: 1.5 drivers: radeonsi,swrast
|
||||||
|
platforms: gbm,x11,surfaceless,device
|
||||||
|
API: OpenGL v: 4.6 vendor: amd mesa v: 23.3.5 renderer: AMD Radeon RX
|
||||||
|
6750 XT (radeonsi navi22 LLVM 17.0.6 DRM 3.49 6.1.69-gentoo-dist)
|
||||||
|
API: Vulkan v: 1.3.275 drivers: N/A surfaces: xcb,xlib
|
||||||
|
Audio:
|
||||||
|
Device-1: AMD Navi 21/23 HDMI/DP Audio driver: snd_hda_intel
|
||||||
|
Device-2: AMD Family 17h HD Audio driver: snd_hda_intel
|
||||||
|
Device-5: Focusrite-Novation Focusrite Scarlett 2i2 driver: snd-usb-audio
|
||||||
|
type: USB
|
||||||
|
API: ALSA v: k6.1.69-gentoo-dist status: kernel-api
|
||||||
|
Server-1: PulseAudio v: 16.1 status: active (root, process)
|
||||||
|
USB:
|
||||||
|
Device-1: 1-4:2 info: splitkb.com Kyria rev2 type: keyboard,HID rev: 2.0
|
||||||
|
Device-2: 1-7:4 info: Microsoft Xbox360 Controller type: <vendor specific>
|
||||||
|
rev: 2.0
|
||||||
|
Device-3: 3-2:3 info: Focusrite-Novation Focusrite Scarlett 2i2
|
||||||
|
type: audio rev: 2.0
|
||||||
|
Device-4: 3-4:6 info: ThrustMaster XB1 Classic Controller
|
||||||
|
type: <vendor specific> rev: 2.0
|
||||||
|
```
|
||||||
|
## Drivers
|
||||||
|
For the kernel, I am using the `gentoo-kernel` seed.
|
||||||
|
|
||||||
|
For the GPU setup you need:
|
||||||
|
|
||||||
|
- the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU
|
||||||
|
- the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO
|
||||||
|
- the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:
|
||||||
|
```
|
||||||
|
user ~> lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
```
|
||||||
|
```
|
||||||
|
user ~> glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
```
|
||||||
|
```
|
||||||
|
user ~> vulkaninfo --summary
|
||||||
|
ac_compute_device_uuid's output is based on invalid pci bus info.
|
||||||
|
==========
|
||||||
|
VULKANINFO
|
||||||
|
==========
|
||||||
|
|
||||||
|
Vulkan Instance Version: 1.3.275
|
||||||
|
|
||||||
|
|
||||||
|
Instance Extensions: count = 22
|
||||||
|
-------------------------------
|
||||||
|
VK_EXT_acquire_drm_display : extension revision 1
|
||||||
|
VK_EXT_acquire_xlib_display : extension revision 1
|
||||||
|
VK_EXT_debug_report : extension revision 10
|
||||||
|
VK_EXT_debug_utils : extension revision 2
|
||||||
|
VK_EXT_direct_mode_display : extension revision 1
|
||||||
|
VK_EXT_display_surface_counter : extension revision 1
|
||||||
|
VK_EXT_surface_maintenance1 : extension revision 1
|
||||||
|
VK_EXT_swapchain_colorspace : extension revision 4
|
||||||
|
VK_KHR_device_group_creation : extension revision 1
|
||||||
|
VK_KHR_display : extension revision 23
|
||||||
|
VK_KHR_external_fence_capabilities : extension revision 1
|
||||||
|
VK_KHR_external_memory_capabilities : extension revision 1
|
||||||
|
VK_KHR_external_semaphore_capabilities : extension revision 1
|
||||||
|
VK_KHR_get_display_properties2 : extension revision 1
|
||||||
|
VK_KHR_get_physical_device_properties2 : extension revision 2
|
||||||
|
VK_KHR_get_surface_capabilities2 : extension revision 1
|
||||||
|
VK_KHR_portability_enumeration : extension revision 1
|
||||||
|
VK_KHR_surface : extension revision 25
|
||||||
|
VK_KHR_surface_protected_capabilities : extension revision 1
|
||||||
|
VK_KHR_xcb_surface : extension revision 6
|
||||||
|
VK_KHR_xlib_surface : extension revision 6
|
||||||
|
VK_LUNARG_direct_driver_loading : extension revision 1
|
||||||
|
|
||||||
|
Instance Layers: count = 3
|
||||||
|
--------------------------
|
||||||
|
VK_LAYER_AMD_switchable_graphics_32 AMD switchable graphics layer 1.3.241 version 1
|
||||||
|
VK_LAYER_AMD_switchable_graphics_64 AMD switchable graphics layer 1.3.241 version 1
|
||||||
|
VK_LAYER_MESA_device_select Linux device selection layer 1.3.211 version 1
|
||||||
|
|
||||||
|
Devices:
|
||||||
|
========
|
||||||
|
GPU0:
|
||||||
|
apiVersion = 1.3.260
|
||||||
|
driverVersion = 2.0.279
|
||||||
|
vendorID = 0x1002
|
||||||
|
deviceID = 0x73df
|
||||||
|
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
|
||||||
|
deviceName = AMD Radeon RX 6750 XT
|
||||||
|
driverID = DRIVER_ID_AMD_PROPRIETARY
|
||||||
|
driverName = AMD proprietary driver
|
||||||
|
driverInfo = (AMD proprietary shader compiler)
|
||||||
|
conformanceVersion = 1.3.3.1
|
||||||
|
deviceUUID =
|
||||||
|
driverUUID = 414d442d-4c49-4e55-582d-445256000000
|
||||||
|
GPU1:
|
||||||
|
apiVersion = 1.3.241
|
||||||
|
driverVersion = 2.0.257
|
||||||
|
vendorID = 0x1002
|
||||||
|
deviceID = 0x73df
|
||||||
|
deviceType = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
|
||||||
|
deviceName = AMD Radeon RX 6750 XT
|
||||||
|
driverID = DRIVER_ID_AMD_OPEN_SOURCE
|
||||||
|
driverName = AMD open-source driver
|
||||||
|
driverInfo = 2023.Q1.3 (LLPC)
|
||||||
|
conformanceVersion = 1.3.0.0
|
||||||
|
deviceUUID =
|
||||||
|
driverUUID = 414d442d-4c49-4e55-582d-445256000000
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
The most important bits are:
|
||||||
|
|
||||||
|
- `Kernel driver in use: amdgpu`
|
||||||
|
- `direct rendering: Yes`
|
||||||
|
- that `vulkaninfo` doesn't produce any errors
|
||||||
|
|
||||||
|
## Wine and other software packages
|
||||||
|
These are my current useflags:
|
||||||
|
|
||||||
|
- wine: `+abi_x86_32 +abi_x86_64 +proton`
|
||||||
|
- wine-staging: `+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +usb +vulkan +xcomposite -wow64`
|
||||||
|
- wine-proton: `+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +vulkan +xcomposite -wow64`
|
||||||
|
- [ ] wine-vanilla: `+abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mono +nls +pulseaudio +sdl +ssl +strip +unwind +usb +video_cards_amdgpu +xcomposite -wow6`
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use `eselect wine` to switch between versions.
|
||||||
|
Until the Gentoo devs says that wow64 feature is stable and fully functional, I will keep it off.
|
||||||
|
|
||||||
|
I have enable the `abi_x86_32` use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.
|
||||||
|
|
||||||
|
These are the additional WINE related packages that I installed:
|
||||||
|
|
||||||
|
- app-emulation/winetricks: `+gtk +rar`
|
||||||
|
- app-emulation/vkd3d-proton: `+abi_x86_32 +strip`
|
||||||
|
- app-emulation/dxvk: `+d3d10 +d3d11 +d3d9 +dxgi +strig +abi_x86_32`
|
||||||
|
|
||||||
|
GPU related packages:
|
||||||
|
|
||||||
|
- dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan
|
||||||
|
- media-libs/vulkan-loader: `+X +abi_x86_32 +layers`
|
||||||
|
- dev-util/vulkan-tools: `+X`
|
||||||
|
- media-libs/amdgpu-pro-vulkan: `+abi_x86_32 +video_cards_amdgpu`
|
||||||
|
- media-libs/amdvlk: `+abi_x86_32 +raytracing` but I am not sure my gpu supports raytracing
|
||||||
|
- media-libs/shaderc
|
||||||
|
|
||||||
|
I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:
|
||||||
|
```
|
||||||
|
ERROR: ld.so: object '/usr/lib64/libswmhack.so.0.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.
|
||||||
|
```
|
||||||
|
Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.
|
||||||
|
|
||||||
|
## Using WINE
|
||||||
|
|
||||||
|
If you have no clue about how WINE works, start by reading the [FAQs](https://wiki.winehq.org/FAQ#Wineprefixes).
|
||||||
|
|
||||||
|
The biggest considerations you have to make when using WINE are the
|
||||||
|
software dependencies of the Windows program you want to use. For the
|
||||||
|
moment I have been able to survive with only two prefixes, one for 32
|
||||||
|
bits games and one for more recent software.
|
||||||
|
|
||||||
|
What all of this means, is that I have two folders in my home, `.wine` and `.wine32` in which I instruct WINE to start a new program using the environment variable (that is what WINEPREFIX is all about). When I feel lazy, I select the WINE prefix using winetricks, then navigate to the game using explorer.exe.
|
||||||
|
|
||||||
|
It's important to remember that whenever you create a new WINE prefix, you need to symlink the correct directx dependencies, as the Gentoo ebuilds suggests:
|
||||||
|
|
||||||
|
- `WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink` for directx12
|
||||||
|
- `WINEPREFIX=/home/user/.wine setup_dxvk.sh install --symlink` for directx11 and earlier
|
||||||
|
|
||||||
|
Usually WINE takes care of starting up necessary processes inside the
|
||||||
|
prefixes. This is done by the `wineboot` program so I suggest to read
|
||||||
|
its manpage.
|
||||||
|
|
||||||
|
To install software dependencies, I use winetricks. If a dependency is
|
||||||
|
not available through winetricks, it's always possible to install the
|
||||||
|
.exe as you would on Windows. Take in mind that WINE uses some Linux
|
||||||
|
specific software in place of some Windows libraries. Some key replacements include:
|
||||||
|
|
||||||
|
- wine-mono in place of dotnet
|
||||||
|
- dxvk and vkd3d in place of directx
|
||||||
|
- gallium-nine and wined3d, in place of directx but I had better experience with dxvk and vkd3d
|
||||||
|
- wine-gecko in place of whatever web view IE was offering
|
||||||
|
- wineconsole in place of the Windows cmd program
|
||||||
|
- your dotnet installation is usually enough for WINE, you don't need
|
||||||
|
to install the dotnet runtimes, although I have to check this assertion on a
|
||||||
|
fresh installation
|
||||||
|
|
||||||
|
### Dependencies rules of thumb
|
||||||
|
|
||||||
|
1. lots of games prompt you to install dependencies such as directx. Avoid it as much as possible and rely on WINE specific libraries
|
||||||
|
2. winetricks can manage most if not all of those dependencies for you. It will save you time to figure out the correct paths for each library and automate the install as much as possible
|
||||||
|
3. recent games usually want the Visual C++ libraries. You can install them all with the vcrun2022 package
|
||||||
|
4. older games usually want Visual C++ libraries, but you need to install the different yearly versions one by one
|
||||||
|
5. you can backup or modify the winetricks installers. They are in you cache directory, usually `~/.cache/winetricks`
|
||||||
|
|
||||||
|
### Debugging
|
||||||
|
In all honesty, it's too early in this journey to write a comprehensive chapter on this topic. The `winedbg` command is still shrouded in mystery.
|
||||||
|
|
||||||
|
At the moment I am keeping a small set of games that are self contained and allows me to check if WINE inside the wineprefix is working as I expect.
|
||||||
|
|
||||||
|
I have uploaded some mostly self contained demos that you can use to test that directx and you GPU is working as it should:
|
||||||
|
|
||||||
|
- [https://archive.org/details/elemental-demo-dx-12-guru-3-d.com](UnrealEngine4 tech demo for directx12)
|
||||||
|
- [https://archive.org/details/ue-4-elemental-demo](the same demo, but for directx11)
|
||||||
|
- [https://archive.org/details/ati-radeon-9700-debevec-rnl-demo-v-1.1.7z](ATI Radeon 9700 Debevec RNL Demo v1.1ATI Radeon 9700 Debevec RNL Demo for directx9)
|
||||||
|
|
||||||
|
You can find more video card demos at [https://soggi.org/video-cards/tech-demos.htm](soggi.org).
|
||||||
|
|
||||||
|
For controllers, you can use two tools:
|
||||||
|
|
||||||
|
- `wine dxdiag` that launches the directx toolbox, useful not only for the gpu, but also for audio and input devices
|
||||||
|
- `wine control joy.cpl`, a cool utility to see your XInput and DInput compatible hardware
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about AI)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/ai.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about AI)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/ai.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
||||||
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
||||||
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
||||||
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
||||||
|
@ -37,28 +37,32 @@ Abbiamo in questo modo una <em>recurrent neural network</em> (RNN) d
|
||||||
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
||||||
Inizialmente l'output della nostra RNN non ha alcun valore:
|
Inizialmente l'output della nostra RNN non ha alcun valore:
|
||||||
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
||||||
<pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
||||||
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span><span class="w"></span>
|
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
||||||
Questo procedimento continua all'infinito.
|
Questo procedimento continua all'infinito.
|
||||||
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
||||||
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
||||||
<pre class="code literal-block">"Tmont thithey" fomesscerliund
|
<div class="code"><pre class="code literal-block">"Tmont thithey" fomesscerliund
|
||||||
Keushey. Thom here
|
Keushey. Thom here
|
||||||
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
||||||
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Dopo quasi mille:</p>
|
<p>Dopo quasi mille:</p>
|
||||||
<pre class="code literal-block"><span class="nv">Aftair</span> <span class="nv">fall</span> <span class="nv">unsuch</span> <span class="nv">that</span> <span class="nv">the</span> <span class="nv">hall</span> <span class="k">for</span> <span class="nv">Prince</span> <span class="nv">Velzonski</span><span class="s1">'</span><span class="s">s that me of</span>
|
<div class="code"><pre class="code literal-block"><span class="nv">Aftair</span><span class="w"> </span><span class="nv">fall</span><span class="w"> </span><span class="nv">unsuch</span><span class="w"> </span><span class="nv">that</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">hall</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nv">Prince</span><span class="w"> </span><span class="nv">Velzonski</span><span class="err">'s that me of</span>
|
||||||
<span class="nv">her</span> <span class="nv">hearly</span>, <span class="nv">and</span> <span class="nv">behs</span> <span class="nv">to</span> <span class="nv">so</span> <span class="nv">arwage</span> <span class="nv">fiving</span> <span class="nv">were</span> <span class="nv">to</span> <span class="nv">it</span> <span class="nv">beloge</span>, <span class="nv">pavu</span> <span class="nv">say</span> <span class="nv">falling</span> <span class="nv">misfort</span>
|
<span class="err">her hearly, and behs to so arwage fiving were to it beloge, pavu say falling misfort </span>
|
||||||
<span class="nv">how</span>, <span class="nv">and</span> <span class="nv">Gogition</span> <span class="nv">is</span> <span class="nv">so</span> <span class="nv">overelical</span> <span class="nv">and</span> <span class="nv">ofter</span>.
|
<span class="err">how, and Gogition is so overelical and ofter.</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Duemila:</p>
|
<p>Duemila:</p>
|
||||||
<pre class="code literal-block"><span class="s2">"</span><span class="s">Why do what that day,</span><span class="s2">"</span> <span class="nv">replied</span> <span class="nv">Natasha</span>, <span class="nv">and</span> <span class="nv">wishing</span> <span class="nv">to</span> <span class="nv">himself</span> <span class="nv">the</span> <span class="nv">fact</span> <span class="nv">the</span>
|
<div class="code"><pre class="code literal-block"><span class="s2">"Why do what that day,"</span><span class="w"> </span><span class="nv">replied</span><span class="w"> </span><span class="nv">Natasha</span>,<span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">wishing</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">himself</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">fact</span><span class="w"> </span><span class="nv">the</span>
|
||||||
<span class="nv">princess</span>, <span class="nv">Princess</span> <span class="nv">Mary</span> <span class="nv">was</span> <span class="nv">easier</span>, <span class="nv">fed</span> <span class="nv">in</span> <span class="nv">had</span> <span class="nv">oftened</span> <span class="nv">him</span>.
|
<span class="nv">princess</span>,<span class="w"> </span><span class="nv">Princess</span><span class="w"> </span><span class="nv">Mary</span><span class="w"> </span><span class="nv">was</span><span class="w"> </span><span class="nv">easier</span>,<span class="w"> </span><span class="nv">fed</span><span class="w"> </span><span class="nv">in</span><span class="w"> </span><span class="nv">had</span><span class="w"> </span><span class="nv">oftened</span><span class="w"> </span><span class="nv">him</span>.
|
||||||
<span class="nv">Pierre</span> <span class="nv">aking</span> <span class="nv">his</span> <span class="nv">soul</span> <span class="nv">came</span> <span class="nv">to</span> <span class="nv">the</span> <span class="nv">packs</span> <span class="nv">and</span> <span class="nv">drove</span> <span class="nv">up</span> <span class="nv">his</span> <span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span> <span class="nv">women</span>.
|
<span class="nv">Pierre</span><span class="w"> </span><span class="nv">aking</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">soul</span><span class="w"> </span><span class="nv">came</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">packs</span><span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">drove</span><span class="w"> </span><span class="nv">up</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span><span class="w"> </span><span class="nv">women</span>.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
||||||
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
||||||
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
||||||
|
@ -157,14 +161,15 @@ Nel caso della vendita dell'automobile, abbiamo un semplice problema con una sol
|
||||||
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
||||||
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
||||||
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
||||||
<pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span>
|
||||||
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"></span>
|
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span>
|
||||||
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
||||||
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
||||||
<table>
|
<table>
|
||||||
|
@ -215,7 +220,7 @@ Ci sono varie funzioni che stimano l'errore e permettono di correggere i pesi o
|
||||||
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
||||||
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
||||||
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
||||||
<pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
|
@ -235,15 +240,17 @@ Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzion
|
||||||
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
||||||
<pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE DEF |</span>
|
<span class="c">| PREZZO FINALE DEF |</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Questa é, seppur molto basica, una rete neurale.
|
<p>Questa é, seppur molto basica, una rete neurale.
|
||||||
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
||||||
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
||||||
|
@ -283,34 +290,38 @@ The main components of a GA are:</p>
|
||||||
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
||||||
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span>
|
||||||
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span><span class="w"></span>
|
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span>
|
||||||
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span>
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
||||||
<pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
||||||
<pre class="code literal-block"><span class="nb">result</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">-</span> <span class="ss">(</span><span class="nv">abs</span> <span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span> <span class="o">-</span> <span class="nv">y</span><span class="ss">)</span> <span class="o">/</span> <span class="nv">rangeLimit</span><span class="ss">)</span>
|
<div class="code"><pre class="code literal-block"><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="ss">(</span><span class="nv">abs</span><span class="w"> </span><span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nv">y</span><span class="ss">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="nv">rangeLimit</span><span class="ss">)</span>
|
||||||
<span class="k">if</span> <span class="nb">result</span> <span class="o">&lt;</span> <span class="mi">0</span>:
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span>:
|
||||||
<span class="nb">result</span> <span class="o">=</span> <span class="mi">0</span>
|
<span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
||||||
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
||||||
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
||||||
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
||||||
<pre class="code literal-block">-0.0487839869993989 * x^0 + 4.600339125358671 * x^1 + -0.2780958075230644 * x^2
|
<div class="code"><pre class="code literal-block">-0.0487839869993989 <span class="gs">* x^0 + 4.600339125358671 *</span> x^1 + -0.2780958075230644 * x^2
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
||||||
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p></description><category>AI</category><category>Genetic algorithm</category><category>PesceWanda</category><category>programming</category><category>python</category><guid>francescomecca.eu/blog/2016/5/15/genetic-alg/</guid><pubDate>Sun, 15 May 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p></description><category>AI</category><category>Genetic algorithm</category><category>PesceWanda</category><category>programming</category><category>python</category><guid>francescomecca.eu/blog/2016/5/15/genetic-alg/</guid><pubDate>Sun, 15 May 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about algoritmi genetici)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/algoritmi-genetici.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about algoritmi genetici)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/algoritmi-genetici.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
||||||
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
||||||
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
||||||
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
||||||
|
@ -37,28 +37,32 @@ Abbiamo in questo modo una <em>recurrent neural network</em> (RNN) d
|
||||||
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
||||||
Inizialmente l'output della nostra RNN non ha alcun valore:
|
Inizialmente l'output della nostra RNN non ha alcun valore:
|
||||||
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
||||||
<pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
||||||
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span><span class="w"></span>
|
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
||||||
Questo procedimento continua all'infinito.
|
Questo procedimento continua all'infinito.
|
||||||
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
||||||
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
||||||
<pre class="code literal-block">"Tmont thithey" fomesscerliund
|
<div class="code"><pre class="code literal-block">"Tmont thithey" fomesscerliund
|
||||||
Keushey. Thom here
|
Keushey. Thom here
|
||||||
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
||||||
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Dopo quasi mille:</p>
|
<p>Dopo quasi mille:</p>
|
||||||
<pre class="code literal-block"><span class="nv">Aftair</span> <span class="nv">fall</span> <span class="nv">unsuch</span> <span class="nv">that</span> <span class="nv">the</span> <span class="nv">hall</span> <span class="k">for</span> <span class="nv">Prince</span> <span class="nv">Velzonski</span><span class="s1">'</span><span class="s">s that me of</span>
|
<div class="code"><pre class="code literal-block"><span class="nv">Aftair</span><span class="w"> </span><span class="nv">fall</span><span class="w"> </span><span class="nv">unsuch</span><span class="w"> </span><span class="nv">that</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">hall</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nv">Prince</span><span class="w"> </span><span class="nv">Velzonski</span><span class="err">'s that me of</span>
|
||||||
<span class="nv">her</span> <span class="nv">hearly</span>, <span class="nv">and</span> <span class="nv">behs</span> <span class="nv">to</span> <span class="nv">so</span> <span class="nv">arwage</span> <span class="nv">fiving</span> <span class="nv">were</span> <span class="nv">to</span> <span class="nv">it</span> <span class="nv">beloge</span>, <span class="nv">pavu</span> <span class="nv">say</span> <span class="nv">falling</span> <span class="nv">misfort</span>
|
<span class="err">her hearly, and behs to so arwage fiving were to it beloge, pavu say falling misfort </span>
|
||||||
<span class="nv">how</span>, <span class="nv">and</span> <span class="nv">Gogition</span> <span class="nv">is</span> <span class="nv">so</span> <span class="nv">overelical</span> <span class="nv">and</span> <span class="nv">ofter</span>.
|
<span class="err">how, and Gogition is so overelical and ofter.</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Duemila:</p>
|
<p>Duemila:</p>
|
||||||
<pre class="code literal-block"><span class="s2">"</span><span class="s">Why do what that day,</span><span class="s2">"</span> <span class="nv">replied</span> <span class="nv">Natasha</span>, <span class="nv">and</span> <span class="nv">wishing</span> <span class="nv">to</span> <span class="nv">himself</span> <span class="nv">the</span> <span class="nv">fact</span> <span class="nv">the</span>
|
<div class="code"><pre class="code literal-block"><span class="s2">"Why do what that day,"</span><span class="w"> </span><span class="nv">replied</span><span class="w"> </span><span class="nv">Natasha</span>,<span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">wishing</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">himself</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">fact</span><span class="w"> </span><span class="nv">the</span>
|
||||||
<span class="nv">princess</span>, <span class="nv">Princess</span> <span class="nv">Mary</span> <span class="nv">was</span> <span class="nv">easier</span>, <span class="nv">fed</span> <span class="nv">in</span> <span class="nv">had</span> <span class="nv">oftened</span> <span class="nv">him</span>.
|
<span class="nv">princess</span>,<span class="w"> </span><span class="nv">Princess</span><span class="w"> </span><span class="nv">Mary</span><span class="w"> </span><span class="nv">was</span><span class="w"> </span><span class="nv">easier</span>,<span class="w"> </span><span class="nv">fed</span><span class="w"> </span><span class="nv">in</span><span class="w"> </span><span class="nv">had</span><span class="w"> </span><span class="nv">oftened</span><span class="w"> </span><span class="nv">him</span>.
|
||||||
<span class="nv">Pierre</span> <span class="nv">aking</span> <span class="nv">his</span> <span class="nv">soul</span> <span class="nv">came</span> <span class="nv">to</span> <span class="nv">the</span> <span class="nv">packs</span> <span class="nv">and</span> <span class="nv">drove</span> <span class="nv">up</span> <span class="nv">his</span> <span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span> <span class="nv">women</span>.
|
<span class="nv">Pierre</span><span class="w"> </span><span class="nv">aking</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">soul</span><span class="w"> </span><span class="nv">came</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">packs</span><span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">drove</span><span class="w"> </span><span class="nv">up</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span><span class="w"> </span><span class="nv">women</span>.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
||||||
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
||||||
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
||||||
|
@ -157,14 +161,15 @@ Nel caso della vendita dell'automobile, abbiamo un semplice problema con una sol
|
||||||
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
||||||
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
||||||
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
||||||
<pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span>
|
||||||
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"></span>
|
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span>
|
||||||
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
||||||
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
||||||
<table>
|
<table>
|
||||||
|
@ -215,7 +220,7 @@ Ci sono varie funzioni che stimano l'errore e permettono di correggere i pesi o
|
||||||
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
||||||
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
||||||
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
||||||
<pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
|
@ -235,15 +240,17 @@ Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzion
|
||||||
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
||||||
<pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE DEF |</span>
|
<span class="c">| PREZZO FINALE DEF |</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Questa é, seppur molto basica, una rete neurale.
|
<p>Questa é, seppur molto basica, una rete neurale.
|
||||||
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
||||||
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about anonimato)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/anonimato.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Non abbiamo nulla da nascondere</title><link>francescomecca.eu/blog/2015/4/15/non-abbiamo-nulla-da-nascondere/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="separator" style="clear: both; text-align: center;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about anonimato)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/anonimato.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Non abbiamo nulla da nascondere</title><link>francescomecca.eu/blog/2015/4/15/non-abbiamo-nulla-da-nascondere/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="separator" style="clear: both; text-align: center;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about apple)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/apple.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about apple)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/apple.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
||||||
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about archive.org)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/archiveorg.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Script per il bulk download da Archive.org</title><link>francescomecca.eu/blog/2015/6/30/script-per-il-bulk-download-da-archive-org/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In questi giorni mi e` capitato di dover scaricare varie collezioni da <a href="https://en.wikipedia.org/wiki/Internet_Archive">archive.org</a>, una libreria digitale multimediale la cui missione e` l’accesso universale a tutta la conoscenza.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about archive.org)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/archiveorg.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Script per il bulk download da Archive.org</title><link>francescomecca.eu/blog/2015/6/30/script-per-il-bulk-download-da-archive-org/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In questi giorni mi e` capitato di dover scaricare varie collezioni da <a href="https://en.wikipedia.org/wiki/Internet_Archive">archive.org</a>, una libreria digitale multimediale la cui missione e` l’accesso universale a tutta la conoscenza.</p>
|
||||||
<p>Principalmente lo uso per scaricare tantissime registrazioni live di vari concerti registrati a mio avviso in maniera impeccabile.</p>
|
<p>Principalmente lo uso per scaricare tantissime registrazioni live di vari concerti registrati a mio avviso in maniera impeccabile.</p>
|
||||||
<p>Nel sito si trova una guida per scaricare in bulk usando wget e gli strumenti del sito, ma risulta piuttosto prolissa e complicata se si vuole fare un download al volo.</p>
|
<p>Nel sito si trova una guida per scaricare in bulk usando wget e gli strumenti del sito, ma risulta piuttosto prolissa e complicata se si vuole fare un download al volo.</p>
|
||||||
<p>Questo e` lo script che uso, modificato da <a href="https://github.com/ghalfacree/bash-scripts/blob/master/archivedownload.sh">questo</a> script: e` scritto in bash e funziona su tutte le distribuzioni sulle quali e` installato wget, tail e sed.</p>
|
<p>Questo e` lo script che uso, modificato da <a href="https://github.com/ghalfacree/bash-scripts/blob/master/archivedownload.sh">questo</a> script: e` scritto in bash e funziona su tutte le distribuzioni sulle quali e` installato wget, tail e sed.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about arduino uno)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/arduino-uno.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about arduino uno)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/arduino-uno.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
||||||
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
||||||
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
||||||
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
||||||
|
@ -37,10 +37,11 @@ Every time you want to flash a new firmware the Arduino must be put in DFU mode
|
||||||
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
||||||
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
||||||
The commands are the following and there is no risk to brick the Uno:</p>
|
The commands are the following and there is no risk to brick the Uno:</p>
|
||||||
<pre class="code literal-block">dfu-programmer atmega16u2 erase
|
<div class="code"><pre class="code literal-block">dfu-programmer atmega16u2 erase
|
||||||
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
||||||
dfu-programmer atmega16u2 reset
|
dfu-programmer atmega16u2 reset
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
||||||
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
||||||
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Arduino)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/arduino.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Arduino)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/arduino.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
||||||
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
||||||
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
||||||
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
||||||
|
@ -37,10 +37,11 @@ Every time you want to flash a new firmware the Arduino must be put in DFU mode
|
||||||
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
||||||
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
||||||
The commands are the following and there is no risk to brick the Uno:</p>
|
The commands are the following and there is no risk to brick the Uno:</p>
|
||||||
<pre class="code literal-block">dfu-programmer atmega16u2 erase
|
<div class="code"><pre class="code literal-block">dfu-programmer atmega16u2 erase
|
||||||
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
||||||
dfu-programmer atmega16u2 reset
|
dfu-programmer atmega16u2 reset
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
||||||
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
||||||
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about avvocato 2.0)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/avvocato-20.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rivoluzione Digitale nella Professione dell&#8217;Avvocato</title><link>francescomecca.eu/blog/2015/7/7/la-rivoluzione-digitale-nella-professione-dellavvocato/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa</span></h5>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about avvocato 2.0)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/avvocato-20.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rivoluzione Digitale nella Professione dell&#8217;Avvocato</title><link>francescomecca.eu/blog/2015/7/7/la-rivoluzione-digitale-nella-professione-dellavvocato/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa</span></h5>
|
||||||
<p>Con l’avvento dell’informatizzazione e` notevolmente mutata la modalita` con cui l’avvocato svolge la propria professione; sinteticamente si puo` arrivare ad affermare che al di la` della partecipazione alle udienze e il ricevimento dei clienti, tutta l’attivita` si puo` svolgere con il computer nel proprio studio, senza alzarsi dalla poltrona.</p>
|
<p>Con l’avvento dell’informatizzazione e` notevolmente mutata la modalita` con cui l’avvocato svolge la propria professione; sinteticamente si puo` arrivare ad affermare che al di la` della partecipazione alle udienze e il ricevimento dei clienti, tutta l’attivita` si puo` svolgere con il computer nel proprio studio, senza alzarsi dalla poltrona.</p>
|
||||||
<p>Per quanto mi riguarda vorrei premettere che io sono un avvocato dipendente di un ente pubblico (l’INAIL) e pertanto unico mio cliente e` l’Istituto che io difendo sia in ambito giudiziario (cause legali) che extragiudiziario (composizione bonaria delle liti).</p>
|
<p>Per quanto mi riguarda vorrei premettere che io sono un avvocato dipendente di un ente pubblico (l’INAIL) e pertanto unico mio cliente e` l’Istituto che io difendo sia in ambito giudiziario (cause legali) che extragiudiziario (composizione bonaria delle liti).</p>
|
||||||
<p>L’avvento dell’informatica ha modificato il modo di lavorare nella sua globalita`, vediamo pertanto le singole fasi dell’attivita`.</p>
|
<p>L’avvento dell’informatica ha modificato il modo di lavorare nella sua globalita`, vediamo pertanto le singole fasi dell’attivita`.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about avvocato)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/avvocato.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rivoluzione Digitale nella Professione dell&#8217;Avvocato</title><link>francescomecca.eu/blog/2015/7/7/la-rivoluzione-digitale-nella-professione-dellavvocato/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa</span></h5>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about avvocato)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/avvocato.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rivoluzione Digitale nella Professione dell&#8217;Avvocato</title><link>francescomecca.eu/blog/2015/7/7/la-rivoluzione-digitale-nella-professione-dellavvocato/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa</span></h5>
|
||||||
<p>Con l’avvento dell’informatizzazione e` notevolmente mutata la modalita` con cui l’avvocato svolge la propria professione; sinteticamente si puo` arrivare ad affermare che al di la` della partecipazione alle udienze e il ricevimento dei clienti, tutta l’attivita` si puo` svolgere con il computer nel proprio studio, senza alzarsi dalla poltrona.</p>
|
<p>Con l’avvento dell’informatizzazione e` notevolmente mutata la modalita` con cui l’avvocato svolge la propria professione; sinteticamente si puo` arrivare ad affermare che al di la` della partecipazione alle udienze e il ricevimento dei clienti, tutta l’attivita` si puo` svolgere con il computer nel proprio studio, senza alzarsi dalla poltrona.</p>
|
||||||
<p>Per quanto mi riguarda vorrei premettere che io sono un avvocato dipendente di un ente pubblico (l’INAIL) e pertanto unico mio cliente e` l’Istituto che io difendo sia in ambito giudiziario (cause legali) che extragiudiziario (composizione bonaria delle liti).</p>
|
<p>Per quanto mi riguarda vorrei premettere che io sono un avvocato dipendente di un ente pubblico (l’INAIL) e pertanto unico mio cliente e` l’Istituto che io difendo sia in ambito giudiziario (cause legali) che extragiudiziario (composizione bonaria delle liti).</p>
|
||||||
<p>L’avvento dell’informatica ha modificato il modo di lavorare nella sua globalita`, vediamo pertanto le singole fasi dell’attivita`.</p>
|
<p>L’avvento dell’informatica ha modificato il modo di lavorare nella sua globalita`, vediamo pertanto le singole fasi dell’attivita`.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about ban)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/ban.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Addio Reddit</title><link>francescomecca.eu/blog/2018/3/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about ban)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/ban.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Addio Reddit</title><link>francescomecca.eu/blog/2018/3/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
||||||
<p>It is also common ground, however, that the First Amendment does not guarantee the right to communicate one's views at all times and places or in any manner that may be desired.</p>
|
<p>It is also common ground, however, that the First Amendment does not guarantee the right to communicate one's views at all times and places or in any manner that may be desired.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Tempo fa rimasi colpito nel leggere questo <a href="https://www.courtlistener.com/opinion/110532/heffron-v-international-soc-for-krishna-consciousness-inc/">orientamento</a> della corte degli Stati Uniti dal quale ho tratto la precedente citazione.</p>
|
<p>Tempo fa rimasi colpito nel leggere questo <a href="https://www.courtlistener.com/opinion/110532/heffron-v-international-soc-for-krishna-consciousness-inc/">orientamento</a> della corte degli Stati Uniti dal quale ho tratto la precedente citazione.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Berkman Center internet and society)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/berkman-center-internet-and-society.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Berkman Center internet and society)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/berkman-center-internet-and-society.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
||||||
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
||||||
<h4>Whose Security?</h4>
|
<h4>Whose Security?</h4>
|
||||||
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Berkman Klein internship)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/berkman-klein-internship.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Berkman Klein internship)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/berkman-klein-internship.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
||||||
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
||||||
<h4>Whose Security?</h4>
|
<h4>Whose Security?</h4>
|
||||||
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Big data)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/big-data.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Il Big Bang dei Big Data</title><link>francescomecca.eu/blog/2015/4/5/il-big-bang-dei-big-data/</link><dc:creator>Francesco Mecca</dc:creator><description><p>“Perche` sto puntando tutto sul deep learning? Perche’ sara` il nuovo Big Bang”</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Big data)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/big-data.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Il Big Bang dei Big Data</title><link>francescomecca.eu/blog/2015/4/5/il-big-bang-dei-big-data/</link><dc:creator>Francesco Mecca</dc:creator><description><p>“Perche` sto puntando tutto sul deep learning? Perche’ sara` il nuovo Big Bang”</p>
|
||||||
<p>Cosi` ha parlato il CEO di Nvidia Jensen Huang il 3 marzo scorso alla sua <a href="http://www.gputechconf.com/">GTC 2015</a>.<br>
|
<p>Cosi` ha parlato il CEO di Nvidia Jensen Huang il 3 marzo scorso alla sua <a href="http://www.gputechconf.com/">GTC 2015</a>.<br>
|
||||||
L’attenzione di Huang si e` concentrata sul deep learning e come le deep neural networks negli ultimi anni abbiano compiuto progressi impressionanti tali da superare il cervello umano nei test di analisi immagine.</p>
|
L’attenzione di Huang si e` concentrata sul deep learning e come le deep neural networks negli ultimi anni abbiano compiuto progressi impressionanti tali da superare il cervello umano nei test di analisi immagine.</p>
|
||||||
<p>Molta della ricerca negli ultimi anni, in particolare dal 2012 ad oggi, si sta concentrando sul programmare algoritmi tali da consentire alle intelligenze artificiali di processare dati in maniera gerarchica e organizzata tramite l’apprendimento progressivo dei livelli di rappresentazione.<br>
|
<p>Molta della ricerca negli ultimi anni, in particolare dal 2012 ad oggi, si sta concentrando sul programmare algoritmi tali da consentire alle intelligenze artificiali di processare dati in maniera gerarchica e organizzata tramite l’apprendimento progressivo dei livelli di rappresentazione.<br>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bitcoin scam)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bitcoin-scam.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bitcoin scam)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bitcoin-scam.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
||||||
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
||||||
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
@ -7,7 +7,7 @@ Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
<li>Repubblica: <a href='http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12"'>"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
||||||
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
||||||
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
||||||
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Bitcoin)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bitcoin.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Why Wright's proof is a fake</title><link>francescomecca.eu/blog/2016/5/3/satoshisignature/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I explained in my previous <a href="http://francescomecca.eu/pescewanda/2016/04/17/wright-nakamoto/">post</a> (in italian) that the signature that Wright provided as a public proof is in fact invalid.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Bitcoin)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bitcoin.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Why Wright's proof is a fake</title><link>francescomecca.eu/blog/2016/5/3/satoshisignature/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I explained in my previous <a href="http://francescomecca.eu/pescewanda/2016/04/17/wright-nakamoto/">post</a> (in italian) that the signature that Wright provided as a public proof is in fact invalid.
|
||||||
I want to explain briefly how you could check this claim.
|
I want to explain briefly how you could check this claim.
|
||||||
The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">post</a> is this:</p>
|
The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-signing-significance/">post</a> is this:</p>
|
||||||
<pre class="code literal-block"><span class="nb">-------------------------</span><span class="c"> Signature File </span><span class="nb">-------------------------</span><span class="c"></span>
|
<div class="code"><pre class="code literal-block"><span class="nb">-------------------------</span><span class="c"> Signature File </span><span class="nb">-------------------------</span>
|
||||||
<span class="c">MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl1</span>
|
<span class="c">MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl1</span>
|
||||||
<span class="c">3VTC3ihl6XUlhcU</span><span class="nb">+</span><span class="c">fM4=</span>
|
<span class="c">3VTC3ihl6XUlhcU</span><span class="nb">+</span><span class="c">fM4=</span>
|
||||||
<span class="nb">-------------------------</span><span class="c"> End Signature </span><span class="nb">--------------------------</span><span class="c"></span>
|
<span class="nb">-------------------------</span><span class="c"> End Signature </span><span class="nb">--------------------------</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Now we can use some bash utilities:</p>
|
<p>Now we can use some bash utilities:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>base64, that translates encoded ASCII text;</li>
|
<li>base64, that translates encoded ASCII text;</li>
|
||||||
|
@ -14,49 +15,56 @@ The key in Wright's <a href="http://www.drcraigwright.net/jean-paul-sartre-si
|
||||||
<li>cut, used to remove the binary part of the input;</li>
|
<li>cut, used to remove the binary part of the input;</li>
|
||||||
<li>tr, used to delete spaces and carriage return from the input;</li>
|
<li>tr, used to delete spaces and carriage return from the input;</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block">base64 -d &lt;&lt;&lt;'MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=' | hexdump -C| cut -b 11-60| tr -d ' \n'
|
<div class="code"><pre class="code literal-block">base64 -d &lt;&lt;&lt;'MEUCIQDBKn1Uly8m0UyzETObUSL4wYdBfd4ejvtoQfVcNCIK4AIgZmMsXNQWHvo6KDd2Tu6euEl13VTC3ihl6XUlhcU+fM4=' | hexdump -C| cut -b 11-60| tr -d ' \n'
|
||||||
|
|
||||||
3045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce
|
3045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Let's analyze the command one by one:</p>
|
<p>Let's analyze the command one by one:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>base64 -d</code> decodes the redirected string, the output is some gibberish characters so I won't display them here;</li>
|
<li><code>base64 -d</code> decodes the redirected string, the output is some gibberish characters so I won't display them here;</li>
|
||||||
<li><code>hexdump -C</code> is used with a pipe to convert to hexadecimal:</li>
|
<li><code>hexdump -C</code> is used with a pipe to convert to hexadecimal:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">00000000</span><span class="w"> </span><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span><span class="err">|</span><span class="mf">0</span><span class="n">E</span><span class="mf">.</span><span class="err">!</span><span class="mf">..</span><span class="o">*</span><span class="err">}</span><span class="n">T</span><span class="mf">.</span><span class="o">/</span><span class="err">&amp;</span><span class="mf">.</span><span class="n">L</span><span class="mf">..</span><span class="err">|</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">00000000</span><span class="w"> </span><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span><span class="err">|</span><span class="mf">0</span><span class="n">E</span><span class="mf">.</span><span class="err">!</span><span class="mf">..</span><span class="o">*</span><span class="err">}</span><span class="n">T</span><span class="mf">.</span><span class="o">/</span><span class="err">&amp;</span><span class="mf">.</span><span class="n">L</span><span class="mf">..</span><span class="err">|</span>
|
||||||
<span class="mf">00000010</span><span class="w"> </span><span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span><span class="err">|</span><span class="mf">3.</span><span class="n">Q</span><span class="s">"...A}....hA.|</span><span class="w"></span>
|
<span class="mf">00000010</span><span class="w"> </span><span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span><span class="err">|</span><span class="mf">3.</span><span class="n">Q</span><span class="s">"...A}....hA.|</span>
|
||||||
<span class="mf">00000020</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span><span class="err">|\</span><span class="mf">4</span><span class="s">"... fc,\....:|</span><span class="w"></span>
|
<span class="mf">00000020</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span><span class="err">|\</span><span class="mf">4</span><span class="s">"... fc,\....:|</span>
|
||||||
<span class="mf">00000030</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span><span class="err">|</span><span class="p">(</span><span class="mf">7</span><span class="n">vN</span><span class="mf">...</span><span class="n">Iu</span><span class="mf">.</span><span class="n">T</span><span class="mf">..</span><span class="p">(</span><span class="n">e</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
|
<span class="mf">00000030</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span><span class="err">|</span><span class="p">(</span><span class="mf">7</span><span class="n">vN</span><span class="mf">...</span><span class="n">Iu</span><span class="mf">.</span><span class="n">T</span><span class="mf">..</span><span class="p">(</span><span class="n">e</span><span class="mf">.</span><span class="err">|</span>
|
||||||
<span class="mf">00000040</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span><span class="err">|</span><span class="n">u%</span><span class="mf">..</span><span class="o">&gt;</span><span class="err">|</span><span class="mf">.</span><span class="err">|</span><span class="w"></span>
|
<span class="mf">00000040</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span><span class="err">|</span><span class="n">u%</span><span class="mf">..</span><span class="o">&gt;</span><span class="err">|</span><span class="mf">.</span><span class="err">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>cut -b 11-60 displays only the characters from column 11 to 60:</li>
|
<li>cut -b 11-60 displays only the characters from column 11 to 60:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="mf">30</span><span class="w"> </span><span class="mf">45</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">21</span><span class="w"> </span><span class="mf">00</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">2</span><span class="n">a</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="mf">97</span><span class="w"> </span><span class="mf">2</span><span class="n">f</span><span class="w"> </span><span class="mf">26</span><span class="w"> </span><span class="n">d1</span><span class="w"> </span><span class="mf">4</span><span class="n">c</span><span class="w"> </span><span class="n">b3</span><span class="w"> </span><span class="mf">11</span><span class="w"> </span>
|
||||||
<span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span>
|
<span class="mf">33</span><span class="w"> </span><span class="mf">9</span><span class="n">b</span><span class="w"> </span><span class="mf">51</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="n">f8</span><span class="w"> </span><span class="n">c1</span><span class="w"> </span><span class="mf">87</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="mf">7</span><span class="n">d</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="mf">8</span><span class="n">e</span><span class="w"> </span><span class="n">fb</span><span class="w"> </span><span class="mf">68</span><span class="w"> </span><span class="mf">41</span><span class="w"> </span><span class="n">f5</span><span class="w"> </span>
|
||||||
<span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span>
|
<span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="mf">34</span><span class="w"> </span><span class="mf">22</span><span class="w"> </span><span class="mf">0</span><span class="n">a</span><span class="w"> </span><span class="n">e0</span><span class="w"> </span><span class="mf">02</span><span class="w"> </span><span class="mf">20</span><span class="w"> </span><span class="mf">66</span><span class="w"> </span><span class="mf">63</span><span class="w"> </span><span class="mf">2</span><span class="n">c</span><span class="w"> </span><span class="mf">5</span><span class="n">c</span><span class="w"> </span><span class="n">d4</span><span class="w"> </span><span class="mf">16</span><span class="w"> </span><span class="mf">1</span><span class="n">e</span><span class="w"> </span><span class="n">fa</span><span class="w"> </span><span class="mf">3</span><span class="n">a</span><span class="w"> </span>
|
||||||
<span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span>
|
<span class="mf">28</span><span class="w"> </span><span class="mf">37</span><span class="w"> </span><span class="mf">76</span><span class="w"> </span><span class="mf">4</span><span class="n">e</span><span class="w"> </span><span class="n">ee</span><span class="w"> </span><span class="mf">9</span><span class="n">e</span><span class="w"> </span><span class="n">b8</span><span class="w"> </span><span class="mf">49</span><span class="w"> </span><span class="mf">75</span><span class="w"> </span><span class="n">dd</span><span class="w"> </span><span class="mf">54</span><span class="w"> </span><span class="n">c2</span><span class="w"> </span><span class="n">de</span><span class="w"> </span><span class="mf">28</span><span class="w"> </span><span class="mf">65</span><span class="w"> </span><span class="n">e9</span><span class="w"> </span>
|
||||||
<span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span>
|
<span class="mf">75</span><span class="w"> </span><span class="mf">25</span><span class="w"> </span><span class="mf">85</span><span class="w"> </span><span class="n">c5</span><span class="w"> </span><span class="mf">3</span><span class="n">e</span><span class="w"> </span><span class="mf">7</span><span class="n">c</span><span class="w"> </span><span class="n">ce</span><span class="w"> </span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><code>tr -d ' \n'</code> is used to delete spaces and carriage returns from the output so that is shown in one line and it gives us the final result:</li>
|
<li><code>tr -d ' \n'</code> is used to delete spaces and carriage returns from the output so that is shown in one line and it gives us the final result:</li>
|
||||||
</ul>
|
</ul>
|
||||||
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>If you noticed, there is also another cleartext string at the beginning of Wright's post:</p>
|
<p>If you noticed, there is also another cleartext string at the beginning of Wright's post:</p>
|
||||||
<pre class="code literal-block">$ base64 -d <span class="o">&lt;&lt;&lt;</span><span class="s1">'IFdyaWdodCwgaXQgaXMgbm90IHRoZSBzYW1lIGFzIGlmIEkgc2lnbiBDcmFpZyBXcmlnaHQsIFNhdG9zaGkuCgo='</span>
|
<div class="code"><pre class="code literal-block">$<span class="w"> </span>base64<span class="w"> </span>-d<span class="w"> </span><span class="o">&lt;&lt;&lt;</span><span class="s1">'IFdyaWdodCwgaXQgaXMgbm90IHRoZSBzYW1lIGFzIGlmIEkgc2lnbiBDcmFpZyBXcmlnaHQsIFNhdG9zaGkuCgo='</span>
|
||||||
Wright, it is not the same as <span class="k">if</span> I sign Craig Wright, Satoshi.
|
Wright,<span class="w"> </span>it<span class="w"> </span>is<span class="w"> </span>not<span class="w"> </span>the<span class="w"> </span>same<span class="w"> </span>as<span class="w"> </span><span class="k">if</span><span class="w"> </span>I<span class="w"> </span>sign<span class="w"> </span>Craig<span class="w"> </span>Wright,<span class="w"> </span>Satoshi.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Now let's head to blockchain.info.
|
<p>Now let's head to blockchain.info.
|
||||||
Blockchain.info has a little <a href="https://blockchain.info/decode-tx">utility</a> to get hexadecimal informations out of a transaction on the blockchain, so let's use it to get the related info about this transaction:</p>
|
Blockchain.info has a little <a href="https://blockchain.info/decode-tx">utility</a> to get hexadecimal informations out of a transaction on the blockchain, so let's use it to get the related info about this transaction:</p>
|
||||||
<p><a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe</a>
|
<p><a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe">tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe</a>
|
||||||
<a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe?format=hex">tx/828ef3b079f9... in hexadecimal</a></p>
|
<a href="https://blockchain.info/tx/828ef3b079f9c23829c56fe86e85b4a69d9e06e5b54ea597eef5fb3ffef509fe?format=hex">tx/828ef3b079f9... in hexadecimal</a></p>
|
||||||
<p>As you can see the entire output of the first bash command, that is</p>
|
<p>As you can see the entire output of the first bash command, that is</p>
|
||||||
<pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="mf">3045022100</span><span class="n">c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>is contained in:</p>
|
<p>is contained in:</p>
|
||||||
<pre class="code literal-block">"script":"483045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce01"
|
<div class="code"><pre class="code literal-block">"script":"483045022100c12a7d54972f26d14cb311339b5122f8c187417dde1e8efb6841f55c34220ae0022066632c5cd4161efa3a2837764eee9eb84975dd54c2de2865e9752585c53e7cce01"
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>except for the 48 at the beginning and the 01 at the end.</p>
|
<p>except for the 48 at the beginning and the 01 at the end.</p>
|
||||||
<p>That is a signature hash:
|
<p>That is a signature hash:
|
||||||
this <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes">page</a> explains that the 48 is just a decimal prefix given to uncompressed transactions, and the 01 at the end is just a SIGHASH_ALL <a href="https://bitcoin.org/en/glossary/signature-hash">code</a> that flags the end of the signature.</p>
|
this <a href="https://en.bitcoin.it/wiki/List_of_address_prefixes">page</a> explains that the 48 is just a decimal prefix given to uncompressed transactions, and the 01 at the end is just a SIGHASH_ALL <a href="https://bitcoin.org/en/glossary/signature-hash">code</a> that flags the end of the signature.</p>
|
||||||
|
@ -71,7 +79,7 @@ Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
<li>Repubblica: <a href='http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12"'>"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
||||||
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
||||||
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
||||||
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about blog)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/blog.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about blog)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/blog.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
||||||
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
||||||
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
||||||
<h3>A dream that disappeared</h3>
|
<h3>A dream that disappeared</h3>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about blogging)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/blogging.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Thu, 31 Aug 2023 10:13:31 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Three years later</title><link>francescomecca.eu/blog/2023/08/12/three-years-later/</link><dc:creator>Francesco Mecca</dc:creator><description><p>More than three years have passed since my last blogpost. I used
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about blogging)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/blogging.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Three years later</title><link>francescomecca.eu/blog/2023/08/12/three-years-later/</link><dc:creator>Francesco Mecca</dc:creator><description><p>More than three years have passed since my last blogpost. I used
|
||||||
to believe that a more hectic life would provide me with a
|
to believe that a more hectic life would provide me with a
|
||||||
surplus of things to write about. While that holds true, the flip side
|
surplus of things to write about. While that holds true, the flip side
|
||||||
is that I now find myself with less and less time for writing.</p>
|
is that I now find myself with less and less time for writing.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bpc)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bpc.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Facciamo luce sui profili ombra</title><link>francescomecca.eu/blog/2015/4/13/facciamo-luce-sui-profili-ombra/</link><dc:creator>Francesco Mecca</dc:creator><description><p>La BPC, Belgian Privacy Commision, il 31 marzo ha pubblicato un <a href="http://www.law.kuleuven.be/icri/en/news/item/facebooks-revised-policies-and-terms-v1-2.pdf">documento</a> investigativo sulle policy di Facebook e da questa indagine e` emersa una violazione delle leggi europee sul <a href="http://rt.com/news/245769-facebook-spies-eu-laws/">tracciamento online</a>.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bpc)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bpc.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Facciamo luce sui profili ombra</title><link>francescomecca.eu/blog/2015/4/13/facciamo-luce-sui-profili-ombra/</link><dc:creator>Francesco Mecca</dc:creator><description><p>La BPC, Belgian Privacy Commision, il 31 marzo ha pubblicato un <a href="http://www.law.kuleuven.be/icri/en/news/item/facebooks-revised-policies-and-terms-v1-2.pdf">documento</a> investigativo sulle policy di Facebook e da questa indagine e` emersa una violazione delle leggi europee sul <a href="http://rt.com/news/245769-facebook-spies-eu-laws/">tracciamento online</a>.</p>
|
||||||
<p>Ogni volta che un utente non loggato, o perfino senza account sul social network, visita una pagina che incorpora il bottone “like” o altri plugin sociali riceve un piccolo file di testo chiamato <a href="https://www.facebook.com/help/cookies">cookie</a> che incorpora una miriade di informazioni e la propria attivita` online in toto. Anche se si ha scelto per l’opt out un particolare cookie chiamato ‘<a href="http://www.zdnet.com/article/facebook-tracking-cookie-returns-according-to-hacker/">datr</a>‘ contenente un ID unico viene scaricato e mantenuto nella cache del browser identificando il computer dell’utente in maniera indistinguibile.<br>
|
<p>Ogni volta che un utente non loggato, o perfino senza account sul social network, visita una pagina che incorpora il bottone “like” o altri plugin sociali riceve un piccolo file di testo chiamato <a href="https://www.facebook.com/help/cookies">cookie</a> che incorpora una miriade di informazioni e la propria attivita` online in toto. Anche se si ha scelto per l’opt out un particolare cookie chiamato ‘<a href="http://www.zdnet.com/article/facebook-tracking-cookie-returns-according-to-hacker/">datr</a>‘ contenente un ID unico viene scaricato e mantenuto nella cache del browser identificando il computer dell’utente in maniera indistinguibile.<br>
|
||||||
Per quale motivo Facebook usa questo sistema di tracciamento?</p>
|
Per quale motivo Facebook usa questo sistema di tracciamento?</p>
|
||||||
<div class="separator" style="clear:both;text-align:center;">
|
<div class="separator" style="clear:both;text-align:center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bulk download archive.org)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bulk-download-archiveorg.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Script per il bulk download da Archive.org</title><link>francescomecca.eu/blog/2015/6/30/script-per-il-bulk-download-da-archive-org/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In questi giorni mi e` capitato di dover scaricare varie collezioni da <a href="https://en.wikipedia.org/wiki/Internet_Archive">archive.org</a>, una libreria digitale multimediale la cui missione e` l’accesso universale a tutta la conoscenza.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about bulk download archive.org)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/bulk-download-archiveorg.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Script per il bulk download da Archive.org</title><link>francescomecca.eu/blog/2015/6/30/script-per-il-bulk-download-da-archive-org/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In questi giorni mi e` capitato di dover scaricare varie collezioni da <a href="https://en.wikipedia.org/wiki/Internet_Archive">archive.org</a>, una libreria digitale multimediale la cui missione e` l’accesso universale a tutta la conoscenza.</p>
|
||||||
<p>Principalmente lo uso per scaricare tantissime registrazioni live di vari concerti registrati a mio avviso in maniera impeccabile.</p>
|
<p>Principalmente lo uso per scaricare tantissime registrazioni live di vari concerti registrati a mio avviso in maniera impeccabile.</p>
|
||||||
<p>Nel sito si trova una guida per scaricare in bulk usando wget e gli strumenti del sito, ma risulta piuttosto prolissa e complicata se si vuole fare un download al volo.</p>
|
<p>Nel sito si trova una guida per scaricare in bulk usando wget e gli strumenti del sito, ma risulta piuttosto prolissa e complicata se si vuole fare un download al volo.</p>
|
||||||
<p>Questo e` lo script che uso, modificato da <a href="https://github.com/ghalfacree/bash-scripts/blob/master/archivedownload.sh">questo</a> script: e` scritto in bash e funziona su tutte le distribuzioni sulle quali e` installato wget, tail e sed.</p>
|
<p>Questo e` lo script che uso, modificato da <a href="https://github.com/ghalfacree/bash-scripts/blob/master/archivedownload.sh">questo</a> script: e` scritto in bash e funziona su tutte le distribuzioni sulle quali e` installato wget, tail e sed.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan c++)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan-c%2B%2B.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan c++)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan-c%2B%2B.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
||||||
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -10,74 +10,78 @@
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan donkey)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan-donkey.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan's donkey in python</title><link>francescomecca.eu/blog/2016/4/2/buridan_donkey/</link><dc:creator>Francesco Mecca</dc:creator><description><p>During the final weeks of my exam session I started reading a bit about python 3 using an excellent book: <a href="http://www.diveintopython.net/">Dive into Python</a>.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan donkey)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan-donkey.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan's donkey in python</title><link>francescomecca.eu/blog/2016/4/2/buridan_donkey/</link><dc:creator>Francesco Mecca</dc:creator><description><p>During the final weeks of my exam session I started reading a bit about python 3 using an excellent book: <a href="http://www.diveintopython.net/">Dive into Python</a>.
|
||||||
When I noted that python uses the <a href="https://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister PRNG</a> as well I decided to write another version of my <a href="http://francescomecca.eu/index.php/archives/207">Buridan's donkey program</a>.</p>
|
When I noted that python uses the <a href="https://en.wikipedia.org/wiki/Mersenne_Twister">Mersenne Twister PRNG</a> as well I decided to write another version of my <a href="http://francescomecca.eu/index.php/archives/207">Buridan's donkey program</a>.</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"> <span class="s s-Atom">import</span> <span class="s s-Atom">random</span><span class="p">,</span> <span class="s s-Atom">sys</span>
|
<div class="code"><pre class="code literal-block"> <span class="kn">import</span> <span class="nn">random</span><span class="o">,</span> <span class="nn">sys</span>
|
||||||
|
|
||||||
|
<span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s1">'__main__'</span><span class="p">:</span>
|
||||||
|
<span class="n">args</span> <span class="o">=</span> <span class="nb">list</span><span class="p">()</span>
|
||||||
|
<span class="k">if</span> <span class="ow">not</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="o">.</span><span class="n">isatty</span><span class="p">():</span>
|
||||||
|
<span class="k">for</span> <span class="n">line</span> <span class="ow">in</span> <span class="n">sys</span><span class="o">.</span><span class="n">stdin</span><span class="p">:</span>
|
||||||
|
<span class="k">if</span> <span class="n">line</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="ow">is</span> <span class="s1">'</span><span class="se">\n</span><span class="s1">'</span><span class="p">:</span>
|
||||||
|
<span class="n">line</span> <span class="o">=</span> <span class="n">line</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
|
||||||
|
<span class="n">args</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||||
|
<span class="k">else</span><span class="p">:</span>
|
||||||
|
<span class="n">args</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
|
||||||
|
<span class="n">argRange</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
|
||||||
|
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">argRange</span><span class="p">):</span>
|
||||||
|
<span class="nb">print</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s1">'.'</span><span class="p">,</span> <span class="n">args</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">random</span><span class="o">.</span><span class="n">randrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">))))</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="s s-Atom">if</span> <span class="k">__</span><span class="s s-Atom">name__</span> <span class="o">==</span> <span class="s s-Atom">'__main__':</span>
|
|
||||||
<span class="s s-Atom">args</span> <span class="o">=</span> <span class="nf">list</span><span class="p">()</span>
|
|
||||||
<span class="s s-Atom">if</span> <span class="o">not</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="s s-Atom">stdin</span><span class="p">.</span><span class="nf">isatty</span><span class="p">()</span><span class="s s-Atom">:</span>
|
|
||||||
<span class="s s-Atom">for</span> <span class="s s-Atom">line</span> <span class="s s-Atom">in</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="nn">stdin</span><span class="p">:</span>
|
|
||||||
<span class="s s-Atom">if</span> <span class="s s-Atom">line</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">is</span> <span class="s s-Atom">'\n':</span>
|
|
||||||
<span class="s s-Atom">line</span> <span class="o">=</span> <span class="s s-Atom">line</span><span class="p">[:-</span><span class="mi">1</span><span class="p">]</span>
|
|
||||||
<span class="s s-Atom">args</span><span class="p">.</span><span class="nf">append</span><span class="p">(</span><span class="s s-Atom">line</span><span class="p">)</span>
|
|
||||||
<span class="nn">else</span><span class="p">:</span>
|
|
||||||
<span class="s s-Atom">args</span> <span class="o">=</span> <span class="s s-Atom">sys</span><span class="p">.</span><span class="s s-Atom">argv</span><span class="p">[</span><span class="mi">1</span><span class="s s-Atom">:</span><span class="p">]</span>
|
|
||||||
<span class="s s-Atom">argRange</span> <span class="o">=</span> <span class="nf">len</span><span class="p">(</span><span class="s s-Atom">args</span><span class="p">)</span>
|
|
||||||
<span class="s s-Atom">for</span> <span class="s s-Atom">i</span> <span class="s s-Atom">in</span> <span class="nf">range</span><span class="p">(</span><span class="s s-Atom">argRange</span><span class="p">)</span><span class="s s-Atom">:</span>
|
|
||||||
<span class="nf">print</span><span class="p">(</span><span class="nf">str</span><span class="p">(</span><span class="s s-Atom">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="o">+</span> <span class="s s-Atom">'.'</span><span class="p">,</span> <span class="s s-Atom">args</span><span class="p">.</span><span class="nf">pop</span><span class="p">(</span><span class="s s-Atom">random</span><span class="p">.</span><span class="nf">randrange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nf">len</span><span class="p">(</span><span class="s s-Atom">args</span><span class="p">))))</span>
|
|
||||||
</pre>
|
|
||||||
<p>This script works in a different way than the one in c++.
|
<p>This script works in a different way than the one in c++.
|
||||||
Rather than shuffling a list made by the entries in the arguments, it pops randomly one entry from the list till the list is empty.</p>
|
Rather than shuffling a list made by the entries in the arguments, it pops randomly one entry from the list till the list is empty.</p>
|
||||||
<p>Not satisfied enough, I wrote also a telegram bot using the <a href="https://github.com/eternnoir/pyTelegramBotAPI">telebot library</a> that works as the script above but inside the telegram app.
|
<p>Not satisfied enough, I wrote also a telegram bot using the <a href="https://github.com/eternnoir/pyTelegramBotAPI">telebot library</a> that works as the script above but inside the telegram app.
|
||||||
|
@ -33,74 +34,78 @@ The bot can be added to your contact list by simply searching for <a href="ht
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridan.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
||||||
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -10,74 +10,78 @@
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan'ass)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridanass.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about buridan'ass)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/buridanass.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
||||||
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -10,74 +10,78 @@
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about c++11)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/c%2B%2B11.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about c++11)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/c%2B%2B11.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>The Buridan&#8217;s donkey paradox</title><link>francescomecca.eu/blog/2015/9/20/the-buridans-donkey-paradox/</link><dc:creator>Francesco Mecca</dc:creator><description><p style="text-align: left;">
|
||||||
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
The Buridan’s donkey is an illustration of a paradox regarding the philosophy of moral determinism and free will.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
@ -10,74 +10,78 @@
|
||||||
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
<p><a href="https://en.wikipedia.org/wiki/Buridan's_ass"><img class="aligncenter size-full wp-image-209" src="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg" alt="Deliberations_of_Congress" width="431" height="425" srcset="http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress-300x296.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/09/Deliberations_of_Congress.jpg 431w" sizes="(max-width: 431px) 100vw, 431px"></a>I have decided to write a cli program that chooses for me when I can’t make up my mind.</p>
|
||||||
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
<p>The program is written in C++ and when invoked along with two or more arguments it puts them in a vector and then changes the order randomly.</p>
|
||||||
<p>.. code:: c</p>
|
<p>.. code:: c</p>
|
||||||
<pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">iostream</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vector</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">algorithm</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">random</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span>
|
||||||
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span><span class="w"></span>
|
<span class="n">#include</span><span class="w"> </span><span class="o">&lt;</span><span class="n">sys</span><span class="o">/</span><span class="n">poll</span><span class="p">.</span><span class="n">h</span><span class="o">&gt;</span>
|
||||||
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span><span class="w"></span>
|
<span class="k">using</span><span class="w"> </span><span class="n">namespace</span><span class="w"> </span><span class="n">std</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="n">struct</span><span class="w"> </span><span class="n">pollfd</span><span class="w"> </span><span class="n">stdin_poll</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span><span class="w"></span>
|
<span class="w"> </span><span class="p">.</span><span class="n">fd</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">fileno</span><span class="w"> </span><span class="p">(</span><span class="n">stdin</span><span class="p">),</span><span class="w"> </span><span class="p">.</span><span class="n">events</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">POLLIN</span>
|
||||||
<span class="err">}</span><span class="p">;</span><span class="w"></span>
|
<span class="err">}</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">string</span><span class="w"> </span><span class="n">x</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">while</span><span class="w"> </span><span class="p">(</span><span class="n">getline</span><span class="w"> </span><span class="p">(</span><span class="n">cin</span><span class="p">,</span><span class="w"> </span><span class="n">x</span><span class="p">))</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">x</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span><span class="w"></span>
|
<span class="n">void</span><span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">const</span><span class="w"> </span><span class="nc">int</span><span class="o">&amp;</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">,</span><span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">lst</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">"Usage: asino [string] [string] ..."</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="k">exit</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">exit</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">size_type</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">argc</span><span class="p">;</span><span class="w"> </span><span class="o">++</span><span class="n">i</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="n">push_back</span><span class="w"> </span><span class="p">(</span><span class="n">argv</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="err">}</span><span class="w"></span>
|
<span class="err">}</span>
|
||||||
|
|
||||||
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span><span class="w"></span>
|
<span class="nc">int</span><span class="w"> </span><span class="n">main</span><span class="w"> </span><span class="p">(</span><span class="nc">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="nc">char</span><span class="o">*</span><span class="w"> </span><span class="n">argv</span><span class="err">[]</span><span class="p">)</span>
|
||||||
<span class="err">{</span><span class="w"></span>
|
<span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;</span><span class="w"> </span><span class="n">lst</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">poll_ret</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">poll</span><span class="w"> </span><span class="p">(</span><span class="o">&amp;</span><span class="n">stdin_poll</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">poll_ret</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_piped_input</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
<span class="w"> </span><span class="k">else</span><span class="w"> </span><span class="err">{</span>
|
||||||
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">read_from_arguments</span><span class="w"> </span><span class="p">(</span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="n">argv</span><span class="p">,</span><span class="w"> </span><span class="n">lst</span><span class="p">);</span>
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">random_device</span><span class="w"> </span><span class="n">rd</span><span class="p">;</span>
|
||||||
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span><span class="w"></span>
|
<span class="w"> </span><span class="n">mt19937</span><span class="w"> </span><span class="n">m</span><span class="p">(</span><span class="n">rd</span><span class="p">());</span>
|
||||||
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">shuffle</span><span class="w"> </span><span class="p">(</span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">(),</span><span class="w"> </span><span class="n">m</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span>
|
||||||
|
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span>
|
||||||
|
<span class="w"> </span><span class="err">}</span>
|
||||||
|
<span class="err">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nc">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">string</span><span class="o">&gt;::</span><span class="n">iterator</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">begin</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="n">it</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="n">lst</span><span class="p">.</span><span class="k">end</span><span class="w"> </span><span class="p">();</span><span class="w"> </span><span class="o">++</span><span class="n">it</span><span class="p">)</span><span class="w"> </span><span class="err">{</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">cout</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="ss">". "</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="o">*</span><span class="n">it</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="w"> </span><span class="n">endl</span><span class="p">;</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="err">}</span><span class="w"></span>
|
|
||||||
<span class="err">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
<p>I have used the <a href="http://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine" target="_blank">Mersenne Twister PRNG</a> just to give it a try.</p>
|
||||||
<p style="text-align: left;">
|
<p style="text-align: left;">
|
||||||
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
One of the challenges was to read from stdin instead of arguments when the program is piped after another program in the shell:
|
||||||
</p>
|
</p>
|
||||||
<p>.. code:: sh</p>
|
<p>.. code:: sh</p>
|
||||||
<pre class="code literal-block">ls /media/my_movies/ | buridan
|
<div class="code"><pre class="code literal-block">ls /media/my_movies/ | buridan
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
<p>So I have used poll() that checks for a specified amount of time if the selected device (/dev/stdin in my case) can perform I/O operations; in my code:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
<div class="code"><pre class="code literal-block">poll (&amp;stdin_poll, 1, 0)
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
<p>I selected the POLLIN as event so poll() only checks if there is data to read, 1 as the number of items in the fds array, 0 milliseconds of timeout because when the program is invoked /dev/stdin may already contain input.</p>
|
||||||
<p>The program should be compiled this way:</p>
|
<p>The program should be compiled this way:</p>
|
||||||
<p>.. code:: bash</p>
|
<p>.. code:: bash</p>
|
||||||
<pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
<div class="code"><pre class="code literal-block">g++ -std=c++11 ./program.cpp -o output
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>You are free to reuse this little piece of code as you wish.</p>
|
<p>You are free to reuse this little piece of code as you wish.</p>
|
||||||
<p>EDIT: 02-04-2016
|
<p>EDIT: 02-04-2016
|
||||||
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
The original idea for the Buridan's donkey came from my mentor <a href="https://twitter.com/bassosimone">Simone Basso</a> who wrote the original one in haskell.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Carla de Girolamo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/carla-de-girolamo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dodici brevi domande sul mondo del giornalismo nell&#8217;era digitale</title><link>francescomecca.eu/blog/2015/7/7/dodici-brevi-domande-sul-mondo-del-giornalismo-nellera-digitale/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa </span></h5>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Carla de Girolamo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/carla-de-girolamo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dodici brevi domande sul mondo del giornalismo nell&#8217;era digitale</title><link>francescomecca.eu/blog/2015/7/7/dodici-brevi-domande-sul-mondo-del-giornalismo-nellera-digitale/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa </span></h5>
|
||||||
<p>La Rivoluzione Digitale ha toccato la societa` in tutti i suoi aspetti, e fra questi ha anche minato le fondamenta di un settore, quello dell’informazione, alle fondamenta della nostra societa`.</p>
|
<p>La Rivoluzione Digitale ha toccato la societa` in tutti i suoi aspetti, e fra questi ha anche minato le fondamenta di un settore, quello dell’informazione, alle fondamenta della nostra societa`.</p>
|
||||||
<p>La decentralizzazione delle fonti di informazione, che avviene attraverso i blog e le piattaforme online, la micro messaggistica istantanea e i tweet, i social media, ma piu` in generale tutti gli strumenti che Internet ci offre, hanno mutato radicalmente non solo il modo di fare giornalismo, ma il rapporto del cittadino digitale con l’informazione cartacea e digitale.</p>
|
<p>La decentralizzazione delle fonti di informazione, che avviene attraverso i blog e le piattaforme online, la micro messaggistica istantanea e i tweet, i social media, ma piu` in generale tutti gli strumenti che Internet ci offre, hanno mutato radicalmente non solo il modo di fare giornalismo, ma il rapporto del cittadino digitale con l’informazione cartacea e digitale.</p>
|
||||||
<p>Per questo abbiamo posto 12 domande a <a href="https://twitter.com/cidigi">Carla De Girolamo</a>, vicecaporedattore di <a href="http://panorama.it/">Panorama</a>, basandoci sulle parole di <a href="http://blog.debiase.com/">Luca de Biase</a>, il quale <a href="https://www.youtube.com/watch?v=6al_1ELORXk">afferma</a> che nel mondo dell’editoria la Rivoluzione Digitale e` stata una rivoluzione di tre nature: Francese, Copernica e Industriale.</p>
|
<p>Per questo abbiamo posto 12 domande a <a href="https://twitter.com/cidigi">Carla De Girolamo</a>, vicecaporedattore di <a href="http://panorama.it/">Panorama</a>, basandoci sulle parole di <a href="http://blog.debiase.com/">Luca de Biase</a>, il quale <a href="https://www.youtube.com/watch?v=6al_1ELORXk">afferma</a> che nel mondo dell’editoria la Rivoluzione Digitale e` stata una rivoluzione di tre nature: Francese, Copernica e Industriale.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Mr E.)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_mr-e.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Aerei FBI: pericolo per la privacy o sicurezza per i cittadini?</title><link>francescomecca.eu/blog/2015/6/6/aerei-fbi-pericolo-per-la-privacy-o-sicurezza-per-i-cittadini/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recentemente l’<a href="http://bigstory.ap.org/article/4b3f220e33b64123a3909c60845da045/fbi-behind-mysterious-surveillance-aircraft-over-us-cities">Associated Press</a> ha dichiarato che sono stati avvistati numerosi aerei americani che volavano a bassa quota nei pressi di alcune città americane. Dopo averli tracciati si è scoperto che gli aerei erano in possesso dell’FBI, che ne aveva menzionato ben 115 nel documento di bilancio federale del 2009.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Mr E.)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_mr-e.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Aerei FBI: pericolo per la privacy o sicurezza per i cittadini?</title><link>francescomecca.eu/blog/2015/6/6/aerei-fbi-pericolo-per-la-privacy-o-sicurezza-per-i-cittadini/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recentemente l’<a href="http://bigstory.ap.org/article/4b3f220e33b64123a3909c60845da045/fbi-behind-mysterious-surveillance-aircraft-over-us-cities">Associated Press</a> ha dichiarato che sono stati avvistati numerosi aerei americani che volavano a bassa quota nei pressi di alcune città americane. Dopo averli tracciati si è scoperto che gli aerei erano in possesso dell’FBI, che ne aveva menzionato ben 115 nel documento di bilancio federale del 2009.</p>
|
||||||
<p>Per molti anni questi aerei avevano aiutato l’FBI con le operazioni di sorveglianza al suolo, ora invece sono stati equipaggiati con telecamere hi-tech e dispositivi in grado di tracciare migliaia di telefoni e risalire ai propri possessori anche se non si stanno effettuando chiamate, anche se a quanto detto dall’agenzia quest’ultima tecnologia è usata raramente.</p>
|
<p>Per molti anni questi aerei avevano aiutato l’FBI con le operazioni di sorveglianza al suolo, ora invece sono stati equipaggiati con telecamere hi-tech e dispositivi in grado di tracciare migliaia di telefoni e risalire ai propri possessori anche se non si stanno effettuando chiamate, anche se a quanto detto dall’agenzia quest’ultima tecnologia è usata raramente.</p>
|
||||||
<p>Charles Grasseley, presidente della commissione Giustizia del Senato, ha detto: “E’ importante che le forze dell’ordine abbiano gli strumenti essenziali per rintracciare e catturare i criminali, ma quando un’operazione monitora anche i cittadini americani che non sono sospettati, dobbiamo essere sicuri di salvaguardare la libertà degli americani innocenti”.</p>
|
<p>Charles Grasseley, presidente della commissione Giustizia del Senato, ha detto: “E’ importante che le forze dell’ordine abbiano gli strumenti essenziali per rintracciare e catturare i criminali, ma quando un’operazione monitora anche i cittadini americani che non sono sospettati, dobbiamo essere sicuri di salvaguardare la libertà degli americani innocenti”.</p>
|
||||||
<div class="separator" style="clear:both;text-align:center;">
|
<div class="separator" style="clear:both;text-align:center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Mr G.)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_mr-g.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Mr G.)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_mr-g.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
||||||
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,274 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about PesceWanda)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_pescewanda.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Fri, 12 Jan 2024 10:31:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Welkom 2024!</title><link>francescomecca.eu/blog/2024/1/12/happy-new-year-2024/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Il 2023 è stato un anno molto molto intenso, sia dal punto di vista
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about PesceWanda)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cat_pescewanda.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 13:37:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Playing videogames with WINE on Gentoo</title><link>francescomecca.eu/blog/2024/2/28/wine-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="francescomecca.eu/2024/1/12/happy-new-year-2024/">One of my new year's resolution</a> are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the <a href="https://wiki.gentoo.org/wiki/Wine">Gentoo
|
||||||
|
wiki</a> and the <a href="https://wiki.archlinux.org/title/Wine">Arch
|
||||||
|
Wiki</a>. </p>
|
||||||
|
<p>These objectives should be clear:</p>
|
||||||
|
<ul>
|
||||||
|
<li>I will not use steam: I only buy from <a href="https://www.gog.com/games">GOG</a> or use CDs</li>
|
||||||
|
<li>I want to use one of my controllers for games that need it</li>
|
||||||
|
<li>use as much software from the Gentoo repos as possible; this means avoiding <a href="https://usebottles.com/">Bottles</a> and <a href="https://lutris.net/">Lutris</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Hardware</h3>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~&gt;</span><span class="w"> </span><span class="n">sudo</span><span class="w"> </span><span class="n">inxi</span><span class="w"> </span><span class="o">-</span><span class="n">AGSC</span>
|
||||||
|
<span class="n">System</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Host</span><span class="p">:</span><span class="w"> </span><span class="n">____</span><span class="w"> </span><span class="n">Kernel</span><span class="p">:</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">arch</span><span class="p">:</span><span class="w"> </span><span class="n">x86_64</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">Desktop</span><span class="p">:</span><span class="w"> </span><span class="n">spectrwm</span>
|
||||||
|
<span class="w"> </span><span class="n">Distro</span><span class="p">:</span><span class="w"> </span><span class="n">Gentoo</span><span class="w"> </span><span class="n">Base</span><span class="w"> </span><span class="n">System</span><span class="w"> </span><span class="n">release</span><span class="w"> </span><span class="mf">2.14</span>
|
||||||
|
<span class="n">CPU</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Info</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="o">-</span><span class="n">core</span><span class="w"> </span><span class="n">model</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Ryzen</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">2600</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">MT</span><span class="w"> </span><span class="n">MCP</span><span class="w"> </span><span class="n">cache</span><span class="p">:</span><span class="w"> </span><span class="n">L2</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">MiB</span>
|
||||||
|
<span class="w"> </span><span class="n">Speed</span><span class="w"> </span><span class="p">(</span><span class="n">MHz</span><span class="p">):</span><span class="w"> </span><span class="n">avg</span><span class="p">:</span><span class="w"> </span><span class="mi">1858</span><span class="w"> </span><span class="nb">min</span><span class="o">/</span><span class="nb">max</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="o">/</span><span class="mi">3400</span><span class="w"> </span><span class="n">cores</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="w"> </span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">6</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">7</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">8</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">9</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">10</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">11</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">12</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="n">Graphics</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">22</span><span class="w"> </span><span class="p">[</span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6700</span><span class="o">/</span><span class="mi">6700</span><span class="w"> </span><span class="n">XT</span><span class="o">/</span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">6800</span><span class="n">M</span><span class="o">/</span><span class="mi">6850</span><span class="n">M</span><span class="w"> </span><span class="n">XT</span><span class="p">]</span>
|
||||||
|
<span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">Logitech</span><span class="w"> </span><span class="n">C920</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Pro</span><span class="w"> </span><span class="n">Webcam</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">usbfs</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">Display</span><span class="p">:</span><span class="w"> </span><span class="n">server</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="o">.</span><span class="n">org</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.21</span><span class="o">.</span><span class="mf">1.11</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="p">:</span><span class="w"> </span><span class="n">loaded</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">unloaded</span><span class="p">:</span><span class="w"> </span><span class="n">modesetting</span><span class="p">,</span><span class="n">radeon</span><span class="w"> </span><span class="n">dri</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="w"> </span><span class="n">gpu</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">resolution</span><span class="p">:</span><span class="w"> </span><span class="mi">1920</span><span class="n">x1200</span><span class="o">~</span><span class="mi">60</span><span class="n">Hz</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">EGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.5</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="p">,</span><span class="n">swrast</span>
|
||||||
|
<span class="w"> </span><span class="n">platforms</span><span class="p">:</span><span class="w"> </span><span class="n">gbm</span><span class="p">,</span><span class="n">x11</span><span class="p">,</span><span class="n">surfaceless</span><span class="p">,</span><span class="n">device</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">OpenGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">4.6</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="w"> </span><span class="n">amd</span><span class="w"> </span><span class="n">mesa</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">23.3</span><span class="o">.</span><span class="mi">5</span><span class="w"> </span><span class="n">renderer</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span>
|
||||||
|
<span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="p">(</span><span class="n">radeonsi</span><span class="w"> </span><span class="n">navi22</span><span class="w"> </span><span class="n">LLVM</span><span class="w"> </span><span class="mf">17.0</span><span class="o">.</span><span class="mi">6</span><span class="w"> </span><span class="n">DRM</span><span class="w"> </span><span class="mf">3.49</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">Vulkan</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">N</span><span class="o">/</span><span class="n">A</span><span class="w"> </span><span class="n">surfaces</span><span class="p">:</span><span class="w"> </span><span class="n">xcb</span><span class="p">,</span><span class="n">xlib</span>
|
||||||
|
<span class="n">Audio</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">21</span><span class="o">/</span><span class="mi">23</span><span class="w"> </span><span class="n">HDMI</span><span class="o">/</span><span class="n">DP</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Family</span><span class="w"> </span><span class="mi">17</span><span class="n">h</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd</span><span class="o">-</span><span class="n">usb</span><span class="o">-</span><span class="n">audio</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">ALSA</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">k6</span><span class="o">.</span><span class="mf">1.69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span><span class="o">-</span><span class="n">api</span>
|
||||||
|
<span class="w"> </span><span class="n">Server</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">PulseAudio</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">16.1</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="w"> </span><span class="n">process</span><span class="p">)</span>
|
||||||
|
<span class="n">USB</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">splitkb</span><span class="o">.</span><span class="n">com</span><span class="w"> </span><span class="n">Kyria</span><span class="w"> </span><span class="n">rev2</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">keyboard</span><span class="p">,</span><span class="n">HID</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">7</span><span class="p">:</span><span class="mi">4</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Microsoft</span><span class="w"> </span><span class="n">Xbox360</span><span class="w"> </span><span class="n">Controller</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">&gt;</span>
|
||||||
|
<span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">audio</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">6</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">ThrustMaster</span><span class="w"> </span><span class="n">XB1</span><span class="w"> </span><span class="n">Classic</span><span class="w"> </span><span class="n">Controller</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">&gt;</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h3>Drivers</h3>
|
||||||
|
<p>For the kernel, I am using the <code>gentoo-kernel</code> seed.</p>
|
||||||
|
<p>For the GPU setup you need:</p>
|
||||||
|
<ul>
|
||||||
|
<li>the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU</li>
|
||||||
|
<li>the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO</li>
|
||||||
|
<li>the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:</li>
|
||||||
|
</ul>
|
||||||
|
<div class="code"><pre class="code literal-block">user ~&gt; lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block">user ~&gt; glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~&gt;</span><span class="w"> </span><span class="n">vulkaninfo</span><span class="w"> </span><span class="o">--</span><span class="n">summary</span><span class="w"> </span>
|
||||||
|
<span class="n">ac_compute_device_uuid</span><span class="s1">'s output is based on invalid pci bus info.</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
<span class="n">VULKANINFO</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
|
||||||
|
<span class="n">Vulkan</span><span class="w"> </span><span class="n">Instance</span><span class="w"> </span><span class="n">Version</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Extensions</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span>
|
||||||
|
<span class="o">-------------------------------</span>
|
||||||
|
<span class="n">VK_EXT_acquire_drm_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_acquire_xlib_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_debug_report</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">10</span>
|
||||||
|
<span class="n">VK_EXT_debug_utils</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_EXT_direct_mode_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_display_surface_counter</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_surface_maintenance1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_swapchain_colorspace</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">4</span>
|
||||||
|
<span class="n">VK_KHR_device_group_creation</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">23</span>
|
||||||
|
<span class="n">VK_KHR_external_fence_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_memory_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_semaphore_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_display_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_physical_device_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_KHR_get_surface_capabilities2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_portability_enumeration</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">25</span>
|
||||||
|
<span class="n">VK_KHR_surface_protected_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_xcb_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_KHR_xlib_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_LUNARG_direct_driver_loading</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Layers</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span>
|
||||||
|
<span class="o">--------------------------</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_32</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_64</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_MESA_device_select</span><span class="w"> </span><span class="n">Linux</span><span class="w"> </span><span class="n">device</span><span class="w"> </span><span class="n">selection</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">211</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Devices</span><span class="p">:</span>
|
||||||
|
<span class="o">========</span>
|
||||||
|
<span class="n">GPU0</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">260</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">279</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_PROPRIETARY</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">shader</span><span class="w"> </span><span class="n">compiler</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">3.1</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
<span class="n">GPU1</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">257</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_OPEN_SOURCE</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">open</span><span class="o">-</span><span class="n">source</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2023.</span><span class="n">Q1</span><span class="o">.</span><span class="mi">3</span><span class="w"> </span><span class="p">(</span><span class="n">LLPC</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">0.0</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>The most important bits are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>Kernel driver in use: amdgpu</code></li>
|
||||||
|
<li><code>direct rendering: Yes</code></li>
|
||||||
|
<li>that <code>vulkaninfo</code> doesn't produce any errors</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Wine and other software packages</h3>
|
||||||
|
<p>These are my current useflags:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine: <code>+abi_x86_32 +abi_x86_64 +proton</code></li>
|
||||||
|
<li>wine-staging: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +usb +vulkan +xcomposite -wow64</code></li>
|
||||||
|
<li>wine-proton: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +vulkan +xcomposite -wow64</code></li>
|
||||||
|
<li>[ ] wine-vanilla: <code>+abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mono +nls +pulseaudio +sdl +ssl +strip +unwind +usb +video_cards_amdgpu +xcomposite -wow6</code>
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use <code>eselect wine</code> to switch between versions.
|
||||||
|
Until the Gentoo devs says that wow64 feature is stable and fully functional, I will keep it off.</li>
|
||||||
|
</ul>
|
||||||
|
<p>I have enable the <code>abi_x86_32</code> use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.</p>
|
||||||
|
<p>These are the additional WINE related packages that I installed:</p>
|
||||||
|
<ul>
|
||||||
|
<li>app-emulation/winetricks: <code>+gtk +rar</code></li>
|
||||||
|
<li>app-emulation/vkd3d-proton: <code>+abi_x86_32 +strip</code></li>
|
||||||
|
<li>app-emulation/dxvk: <code>+d3d10 +d3d11 +d3d9 +dxgi +strig +abi_x86_32</code></li>
|
||||||
|
</ul>
|
||||||
|
<p>GPU related packages:</p>
|
||||||
|
<ul>
|
||||||
|
<li>dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan</li>
|
||||||
|
<li>media-libs/vulkan-loader: <code>+X +abi_x86_32 +layers</code></li>
|
||||||
|
<li>dev-util/vulkan-tools: <code>+X</code></li>
|
||||||
|
<li>media-libs/amdgpu-pro-vulkan: <code>+abi_x86_32 +video_cards_amdgpu</code></li>
|
||||||
|
<li>media-libs/amdvlk: <code>+abi_x86_32 +raytracing</code> but I am not sure my gpu supports raytracing</li>
|
||||||
|
<li>media-libs/shaderc</li>
|
||||||
|
</ul>
|
||||||
|
<p>I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:</p>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">ERROR</span><span class="p">:</span><span class="w"> </span><span class="n">ld</span><span class="o">.</span><span class="n">so</span><span class="p">:</span><span class="w"> </span><span class="n">object</span><span class="w"> </span><span class="s1">'/usr/lib64/libswmhack.so.0.0'</span><span class="w"> </span><span class="n">from</span><span class="w"> </span><span class="n">LD_PRELOAD</span><span class="w"> </span><span class="n">cannot</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">preloaded</span><span class="w"> </span><span class="p">(</span><span class="n">wrong</span><span class="w"> </span><span class="n">ELF</span><span class="w"> </span><span class="k">class</span><span class="p">:</span><span class="w"> </span><span class="n">ELFCLASS64</span><span class="p">):</span><span class="w"> </span><span class="n">ignored</span><span class="o">.</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.</p>
|
||||||
|
<h3>Using WINE</h3>
|
||||||
|
<p>If you have no clue about how WINE works, start by reading the <a href="https://wiki.winehq.org/FAQ#Wineprefixes">FAQs</a>.</p>
|
||||||
|
<p>The biggest considerations you have to make when using WINE are the
|
||||||
|
software dependencies of the Windows program you want to use. For the
|
||||||
|
moment I have been able to survive with only two prefixes, one for 32
|
||||||
|
bits games and one for more recent software.</p>
|
||||||
|
<p>What all of this means, is that I have two folders in my home, <code>.wine</code> and <code>.wine32</code> in which I instruct WINE to start a new program using the environment variable (that is what WINEPREFIX is all about). When I feel lazy, I select the WINE prefix using winetricks, then navigate to the game using explorer.exe.</p>
|
||||||
|
<p>It's important to remember that whenever you create a new WINE prefix, you need to symlink the correct directx dependencies, as the Gentoo ebuilds suggests:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink</code> for directx12</li>
|
||||||
|
<li><code>WINEPREFIX=/home/user/.wine setup_dxvk.sh install --symlink</code> for directx11 and earlier</li>
|
||||||
|
</ul>
|
||||||
|
<p>Usually WINE takes care of starting up necessary processes inside the
|
||||||
|
prefixes. This is done by the <code>wineboot</code> program so I suggest to read
|
||||||
|
its manpage.</p>
|
||||||
|
<p>To install software dependencies, I use winetricks. If a dependency is
|
||||||
|
not available through winetricks, it's always possible to install the
|
||||||
|
.exe as you would on Windows. Take in mind that WINE uses some Linux
|
||||||
|
specific software in place of some Windows libraries. Some key replacements include:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine-mono in place of dotnet</li>
|
||||||
|
<li>dxvk and vkd3d in place of directx</li>
|
||||||
|
<li>gallium-nine and wined3d, in place of directx but I had better experience with dxvk and vkd3d</li>
|
||||||
|
<li>wine-gecko in place of whatever web view IE was offering</li>
|
||||||
|
<li>wineconsole in place of the Windows cmd program</li>
|
||||||
|
<li>your dotnet installation is usually enough for WINE, you don't need
|
||||||
|
to install the dotnet runtimes, although I have to check this assertion on a
|
||||||
|
fresh installation</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Dependencies rules of thumb</h4>
|
||||||
|
<ol>
|
||||||
|
<li>lots of games prompt you to install dependencies such as directx. Avoid it as much as possible and rely on WINE specific libraries</li>
|
||||||
|
<li>winetricks can manage most if not all of those dependencies for you. It will save you time to figure out the correct paths for each library and automate the install as much as possible</li>
|
||||||
|
<li>recent games usually want the Visual C++ libraries. You can install them all with the vcrun2022 package </li>
|
||||||
|
<li>older games usually want Visual C++ libraries, but you need to install the different yearly versions one by one</li>
|
||||||
|
<li>you can backup or modify the winetricks installers. They are in you cache directory, usually <code>~/.cache/winetricks</code></li>
|
||||||
|
</ol>
|
||||||
|
<h4>Debugging</h4>
|
||||||
|
<p>In all honesty, it's too early in this journey to write a comprehensive chapter on this topic. The <code>winedbg</code> command is still shrouded in mystery.</p>
|
||||||
|
<p>At the moment I am keeping a small set of games that are self contained and allows me to check if WINE inside the wineprefix is working as I expect.</p>
|
||||||
|
<p>I have uploaded some mostly self contained demos that you can use to test that directx and you GPU is working as it should:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/UnrealEngine4%20tech%20demo%20for%20directx12">https://archive.org/details/elemental-demo-dx-12-guru-3-d.com</a></li>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/the%20same%20demo,%20but%20for%20directx11">https://archive.org/details/ue-4-elemental-demo</a></li>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20v1.1ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20for%20directx9">https://archive.org/details/ati-radeon-9700-debevec-rnl-demo-v-1.1.7z</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>You can find more video card demos at <a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/soggi.org">https://soggi.org/video-cards/tech-demos.htm</a>.</p>
|
||||||
|
<p>For controllers, you can use two tools:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>wine dxdiag</code> that launches the directx toolbox, useful not only for the gpu, but also for audio and input devices</li>
|
||||||
|
<li><code>wine control joy.cpl</code>, a cool utility to see your XInput and DInput compatible hardware</li>
|
||||||
|
</ul></description><category>Gentoo</category><category>linux</category><category>videogames</category><guid>francescomecca.eu/blog/2024/2/28/wine-gentoo/</guid><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate></item><item><title>Welkom 2024!</title><link>francescomecca.eu/blog/2024/1/12/happy-new-year-2024/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Il 2023 è stato un anno molto molto intenso, sia dal punto di vista
|
||||||
lavorativo che personale. Per quanto riguarda il lavoro uno dei più
|
lavorativo che personale. Per quanto riguarda il lavoro uno dei più
|
||||||
grandi cambiamenti è stato l'arrivo del nuovo CTO (direttore tecnico)
|
grandi cambiamenti è stato l'arrivo del nuovo CTO (direttore tecnico)
|
||||||
in azienda, a Dicembre 2022. Avevo una collaborazione molto stretta
|
in azienda, a Dicembre 2022. Avevo una collaborazione molto stretta
|
||||||
|
@ -811,45 +1080,46 @@ The following is a list of the positive and negative results of such studies gro
|
||||||
<li>Corpo della funzione</li>
|
<li>Corpo della funzione</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Un esempio:</p>
|
<p>Un esempio:</p>
|
||||||
<pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
<span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span>
|
||||||
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span><span class="w"></span>
|
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="p">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
||||||
<h5>Un approccio moderno alle concorrenze</h5>
|
<h5>Un approccio moderno alle concorrenze</h5>
|
||||||
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
||||||
|
@ -950,10 +1220,11 @@ Ho interessi di nicchia e Reddit mi permetteva di riunirmi con persone dall'altr
|
||||||
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
||||||
<pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span>
|
||||||
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"></span>
|
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span>
|
||||||
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span><span class="w"></span>
|
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Do both PCBs the same.</p>
|
<p>Do both PCBs the same.</p>
|
||||||
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
||||||
<h3>Mount Header Pins</h3>
|
<h3>Mount Header Pins</h3>
|
||||||
|
@ -1037,5 +1308,4 @@ Ho interessi di nicchia e Reddit mi permetteva di riunirmi con persone dall'altr
|
||||||
<p>Floral Shoppe traces the outlines of the mental prison in which we now live, it gives us hope of one day transcending it. It reminds us what real freedom, the freedom of the heart, tastes like.</p>
|
<p>Floral Shoppe traces the outlines of the mental prison in which we now live, it gives us hope of one day transcending it. It reminds us what real freedom, the freedom of the heart, tastes like.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>In the novel <a href="https://en.wikipedia.org/wiki/Neuromancer">Neuromance</a> by cyberpunk father William Gibson the Internet is conceived as some sort of "consensual allucination". In the world where that book was written Internet is just a collective delusion.</p>
|
<p>In the novel <a href="https://en.wikipedia.org/wiki/Neuromancer">Neuromance</a> by cyberpunk father William Gibson the Internet is conceived as some sort of "consensual allucination". In the world where that book was written Internet is just a collective delusion.</p>
|
||||||
<p>Vaporwave forces us to recognize our helplessness with the Dataspace and for me it is a remembrace of a cyber-utopia that never got off the ground.</p></description><category>blog</category><category>cyberpunk</category><category>cyberspace</category><category>music</category><category>PesceWanda</category><category>utopia</category><category>vaporwave</category><guid>francescomecca.eu/blog/2017/5/9/vaporwave/</guid><pubDate>Tue, 09 May 2017 00:00:00 GMT</pubDate></item><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
<p>Vaporwave forces us to recognize our helplessness with the Dataspace and for me it is a remembrace of a cyber-utopia that never got off the ground.</p></description><category>blog</category><category>cyberpunk</category><category>cyberspace</category><category>music</category><category>PesceWanda</category><category>utopia</category><category>vaporwave</category><guid>francescomecca.eu/blog/2017/5/9/vaporwave/</guid><pubDate>Tue, 09 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
||||||
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
|
|
@ -42,6 +42,9 @@
|
||||||
|
|
||||||
</header><ul class="postlist">
|
</header><ul class="postlist">
|
||||||
<li>
|
<li>
|
||||||
|
<time class="listdate" datetime="2024-02-28T00:00:00Z" title="2024-02-28 00:00">2024-02-28 00:00</time><a href="../../blog/2024/2/28/wine-gentoo/" class="listtitle">Playing videogames with WINE on Gentoo</a><a></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<time class="listdate" datetime="2024-01-12T00:00:00Z" title="2024-01-12 00:00">2024-01-12 00:00</time><a href="../../blog/2024/1/12/happy-new-year-2024/" class="listtitle">Welkom 2024!</a><a></a>
|
<time class="listdate" datetime="2024-01-12T00:00:00Z" title="2024-01-12 00:00">2024-01-12 00:00</time><a href="../../blog/2024/1/12/happy-new-year-2024/" class="listtitle">Welkom 2024!</a><a></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about community)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/community.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about community)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/community.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
||||||
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
||||||
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
||||||
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Conference)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/conference.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Conference)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/conference.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
||||||
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
||||||
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
||||||
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about conoscenza)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/conoscenza.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about conoscenza)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/conoscenza.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
||||||
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
||||||
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
||||||
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cookie)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cookie.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Facciamo luce sui profili ombra</title><link>francescomecca.eu/blog/2015/4/13/facciamo-luce-sui-profili-ombra/</link><dc:creator>Francesco Mecca</dc:creator><description><p>La BPC, Belgian Privacy Commision, il 31 marzo ha pubblicato un <a href="http://www.law.kuleuven.be/icri/en/news/item/facebooks-revised-policies-and-terms-v1-2.pdf">documento</a> investigativo sulle policy di Facebook e da questa indagine e` emersa una violazione delle leggi europee sul <a href="http://rt.com/news/245769-facebook-spies-eu-laws/">tracciamento online</a>.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cookie)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cookie.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Facciamo luce sui profili ombra</title><link>francescomecca.eu/blog/2015/4/13/facciamo-luce-sui-profili-ombra/</link><dc:creator>Francesco Mecca</dc:creator><description><p>La BPC, Belgian Privacy Commision, il 31 marzo ha pubblicato un <a href="http://www.law.kuleuven.be/icri/en/news/item/facebooks-revised-policies-and-terms-v1-2.pdf">documento</a> investigativo sulle policy di Facebook e da questa indagine e` emersa una violazione delle leggi europee sul <a href="http://rt.com/news/245769-facebook-spies-eu-laws/">tracciamento online</a>.</p>
|
||||||
<p>Ogni volta che un utente non loggato, o perfino senza account sul social network, visita una pagina che incorpora il bottone “like” o altri plugin sociali riceve un piccolo file di testo chiamato <a href="https://www.facebook.com/help/cookies">cookie</a> che incorpora una miriade di informazioni e la propria attivita` online in toto. Anche se si ha scelto per l’opt out un particolare cookie chiamato ‘<a href="http://www.zdnet.com/article/facebook-tracking-cookie-returns-according-to-hacker/">datr</a>‘ contenente un ID unico viene scaricato e mantenuto nella cache del browser identificando il computer dell’utente in maniera indistinguibile.<br>
|
<p>Ogni volta che un utente non loggato, o perfino senza account sul social network, visita una pagina che incorpora il bottone “like” o altri plugin sociali riceve un piccolo file di testo chiamato <a href="https://www.facebook.com/help/cookies">cookie</a> che incorpora una miriade di informazioni e la propria attivita` online in toto. Anche se si ha scelto per l’opt out un particolare cookie chiamato ‘<a href="http://www.zdnet.com/article/facebook-tracking-cookie-returns-according-to-hacker/">datr</a>‘ contenente un ID unico viene scaricato e mantenuto nella cache del browser identificando il computer dell’utente in maniera indistinguibile.<br>
|
||||||
Per quale motivo Facebook usa questo sistema di tracciamento?</p>
|
Per quale motivo Facebook usa questo sistema di tracciamento?</p>
|
||||||
<div class="separator" style="clear:both;text-align:center;">
|
<div class="separator" style="clear:both;text-align:center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Craig Wright)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/craig-wright.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Craig Wright)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/craig-wright.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
||||||
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
||||||
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
@ -7,7 +7,7 @@ Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
<li>Repubblica: <a href='http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12"'>"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
||||||
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
||||||
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
||||||
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about crittografia)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/crittografia.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about crittografia)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/crittografia.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
||||||
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cryptography)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cryptography.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cryptography)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cryptography.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
||||||
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
||||||
<h4>Whose Security?</h4>
|
<h4>Whose Security?</h4>
|
||||||
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cyberpunk)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cyberpunk.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cyberpunk)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cyberpunk.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
||||||
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
||||||
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
||||||
<h3>A dream that disappeared</h3>
|
<h3>A dream that disappeared</h3>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cyberspace)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cyberspace.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about cyberspace)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/cyberspace.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Cyber-utopia and vaporwave</title><link>francescomecca.eu/blog/2017/5/9/vaporwave/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Recently I decided to change the <a href="https://github.com/jasonlong/cayman-theme">css</a> of my blog to reflect a vaporwave-ish aestethic. </p>
|
||||||
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
<p>Although I don't listen to a lot of electronic music, 2814 has been my go to music when I am programming and I go through a lot of James Ferraro's works during the day.</p>
|
||||||
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
<p>What is the reason for my recent obsession on vaporwave culture?</p>
|
||||||
<h3>A dream that disappeared</h3>
|
<h3>A dream that disappeared</h3>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about DConf)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/dconf.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about DConf)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/dconf.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
||||||
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
||||||
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
||||||
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Deep learning)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/deep-learning.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Può un sottomarino nuotare? Deep learning e intelligenze artificiali</title><link>francescomecca.eu/blog/2015/7/21/puo-un-sottomarino-nuotare-deep-learning-e-intelligenze-artificiali/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel <a href="https://en.wikipedia.org/wiki/De_Arte_Combinatoria">De Arte Combinatoria</a> (1666) Leibniz afferma che tutta la logica del pensiero umano non sia altro che una combinazione di pensieri piu` piccoli che a loro volta possono essere frammentati in idee semplicissime e concatenabili.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Deep learning)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/deep-learning.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Può un sottomarino nuotare? Deep learning e intelligenze artificiali</title><link>francescomecca.eu/blog/2015/7/21/puo-un-sottomarino-nuotare-deep-learning-e-intelligenze-artificiali/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel <a href="https://en.wikipedia.org/wiki/De_Arte_Combinatoria">De Arte Combinatoria</a> (1666) Leibniz afferma che tutta la logica del pensiero umano non sia altro che una combinazione di pensieri piu` piccoli che a loro volta possono essere frammentati in idee semplicissime e concatenabili.</p>
|
||||||
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about deniability)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/deniability.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Defend yourself: crittografia e &#8220;plausible deniability&#8221;</title><link>francescomecca.eu/blog/2015/5/22/defend-yourself-crittografia-e-plausible-deniability/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel 2000, ben molto prima dello scandalo datagate, prima perfino dell’attacco alle torri gemelle, il Parlamento inglese approvo` una legge sulla sorveglianza di massa.<br>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about deniability)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/deniability.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Defend yourself: crittografia e &#8220;plausible deniability&#8221;</title><link>francescomecca.eu/blog/2015/5/22/defend-yourself-crittografia-e-plausible-deniability/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel 2000, ben molto prima dello scandalo datagate, prima perfino dell’attacco alle torri gemelle, il Parlamento inglese approvo` una legge sulla sorveglianza di massa.<br>
|
||||||
Questa legge, intitolata <a href="https://en.wikipedia.org/wiki/Regulation_of_Investigatory_Powers_Act_2000">RIPA</a>, Regulation of Investigatory Powers Act, interviene su come il corpo di polizia puo` condurre le investigazioni telematiche. </p>
|
Questa legge, intitolata <a href="https://en.wikipedia.org/wiki/Regulation_of_Investigatory_Powers_Act_2000">RIPA</a>, Regulation of Investigatory Powers Act, interviene su come il corpo di polizia puo` condurre le investigazioni telematiche. </p>
|
||||||
<p>Con questa legge viene permesso: </p>
|
<p>Con questa legge viene permesso: </p>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about discrezione)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/discrezione.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Non abbiamo nulla da nascondere</title><link>francescomecca.eu/blog/2015/4/15/non-abbiamo-nulla-da-nascondere/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="separator" style="clear: both; text-align: center;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about discrezione)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/discrezione.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Non abbiamo nulla da nascondere</title><link>francescomecca.eu/blog/2015/4/15/non-abbiamo-nulla-da-nascondere/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="separator" style="clear: both; text-align: center;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Divario digitale)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/divario-digitale.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Divario digitale)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/divario-digitale.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
||||||
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
||||||
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
||||||
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about DIY)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/diy.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Minidox, a guide for the Europeans and the Scrooges</title><link>francescomecca.eu/blog/2017/10/2/minidoxguide/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This guide is adapted from the <a href="https://github.com/nicinabox/lets-split-guide/blob/master/assembly.md">Let's split guide</a>.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about DIY)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/diy.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Minidox, a guide for the Europeans and the Scrooges</title><link>francescomecca.eu/blog/2017/10/2/minidoxguide/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This guide is adapted from the <a href="https://github.com/nicinabox/lets-split-guide/blob/master/assembly.md">Let's split guide</a>.</p>
|
||||||
<p>It is tailored between the Scrooges like me and all the europeans that couldn't find some TRRS jacks.</p>
|
<p>It is tailored between the Scrooges like me and all the europeans that couldn't find some TRRS jacks.</p>
|
||||||
<h3>Helpful references</h3>
|
<h3>Helpful references</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -60,10 +60,11 @@
|
||||||
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
<p>This part is not really needed, but you may want to do it in case you will mount the TRRS jacks in the future.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
<p>On the <strong>underside</strong> of the PCB, right below the TRRS jack, you'll see two sets of 3 pads labelled VCC and GND. Jumper them like this:</p>
|
||||||
<pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">VCC</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="n">VCC</span>
|
||||||
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"></span>
|
<span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span>
|
||||||
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span><span class="w"></span>
|
<span class="n">GND</span><span class="w"> </span><span class="o">[</span><span class="n"> </span><span class="o">]</span><span class="w"> </span><span class="o">[</span><span class="n">x</span><span class="o">]</span><span class="w"> </span><span class="n">GND</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Do both PCBs the same.</p>
|
<p>Do both PCBs the same.</p>
|
||||||
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
<p><img alt="" src="https://i.imgur.com/AUT3VUd.png"></p>
|
||||||
<h3>Mount Header Pins</h3>
|
<h3>Mount Header Pins</h3>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about dlang)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/dlang.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about dlang)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/dlang.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dconf 2019</title><link>francescomecca.eu/blog/2019/03/06/Dconf-2019/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quest'anno molto del mio tempo passato al pc e` stato investito per D e la sua community.
|
||||||
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazione al <a href="https://dlang.org/blog/symmetry-autumn-of-code">SAOC</a> con il mio amico e collega <a href="https://fragal.eu">Francesco Galla`</a>.</p>
|
||||||
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
<p>Accompagnero` Francesco all'edizione del 2019 della <a href="https://dconf.org/2019/index.html">DConf</a> che si terra` dall'otto all'undici marzo a Londra.</p>
|
||||||
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item><item><title>Un articolo per r/italyinformatica</title><link>francescomecca.eu/blog/2018/07/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo articolo è stato originalmente scritto per il <a href="https://tldr.italyinformatica.org">blog</a> di <a href="https://reddit.com/r/italyinformatica">r/italyinformatica</a>.</p>
|
<p>See you there!</p></description><category>Conference</category><category>DConf</category><category>dlang</category><category>PesceWanda</category><guid>francescomecca.eu/blog/2019/03/06/Dconf-2019/</guid><pubDate>Wed, 06 Mar 2019 00:00:00 GMT</pubDate></item><item><title>Un articolo per r/italyinformatica</title><link>francescomecca.eu/blog/2018/07/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo articolo è stato originalmente scritto per il <a href="https://tldr.italyinformatica.org">blog</a> di <a href="https://reddit.com/r/italyinformatica">r/italyinformatica</a>.</p>
|
||||||
|
@ -73,45 +73,46 @@ I miei sforzi nell'imparare questo linguaggio sono confluiti nella partecipazion
|
||||||
<li>Corpo della funzione</li>
|
<li>Corpo della funzione</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Un esempio:</p>
|
<p>Un esempio:</p>
|
||||||
<pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">struct</span><span class="w"> </span><span class="n">Clock</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">invariant</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">time</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
<span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
<span class="n">short</span><span class="w"> </span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">Clock</span><span class="w"> </span><span class="n">c</span><span class="p">,</span><span class="w"> </span><span class="n">short</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="w"> </span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="p">{</span>
|
||||||
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">n</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="w"> </span><span class="n">body</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">t</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span><span class="w"></span>
|
<span class="w"> </span><span class="n">out</span><span class="w"> </span><span class="p">(</span><span class="n">result</span><span class="p">){</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="p">;</span><span class="w"></span>
|
<span class="w"> </span><span class="n">result</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="n">c</span><span class="o">-&gt;</span><span class="n">time</span><span class="p">;</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="p">}</span><span class="w"></span>
|
<span class="w"> </span><span class="p">}</span>
|
||||||
|
|
||||||
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
|
<span class="n">unittest</span><span class="w"> </span><span class="p">{</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="n">auto</span><span class="w"> </span><span class="n">clock</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Clock</span><span class="p">(</span><span class="mi">60</span><span class="p">);</span>
|
||||||
|
|
||||||
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span><span class="w"></span>
|
<span class="w"> </span><span class="nb">assert</span><span class="w"> </span><span class="p">(</span><span class="n">addReturnTime</span><span class="p">(</span><span class="n">clock</span><span class="p">,</span><span class="w"> </span><span class="mi">10</span><span class="p">)</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">70</span><span class="p">);</span>
|
||||||
|
|
||||||
|
<span class="p">}</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="p">}</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
<p>Come si nota dall'esempio il supporto ai tests è built-in nel linguaggio e distanti solo una flag in fase di compilazione.</p>
|
||||||
<h5>Un approccio moderno alle concorrenze</h5>
|
<h5>Un approccio moderno alle concorrenze</h5>
|
||||||
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
<p>Il modello primitivo delle concorrenze in Posix è discutibilmente datato e prono ad errori per il programmatore.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about education)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/education.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about education)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/education.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
||||||
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
||||||
<h2>In the beginning there was the LMS</h2>
|
<h2>In the beginning there was the LMS</h2>
|
||||||
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about elearning)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/elearning.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about elearning)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/elearning.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
||||||
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
||||||
<h2>In the beginning there was the LMS</h2>
|
<h2>In the beginning there was the LMS</h2>
|
||||||
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about emerge)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/emerge.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>About Perl packages in Gentoo</title><link>francescomecca.eu/blog/2015/9/11/about-perl-packages-in-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In this post I wish to explain a bit about Perl related ebuilds in Gentoo and how to update from perl-core to virtual/perl without conflicts.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about emerge)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/emerge.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>About Perl packages in Gentoo</title><link>francescomecca.eu/blog/2015/9/11/about-perl-packages-in-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In this post I wish to explain a bit about Perl related ebuilds in Gentoo and how to update from perl-core to virtual/perl without conflicts.</p>
|
||||||
<p>First of all the core distribution of Perl is included in <a href="https://packages.gentoo.org/package/dev-lang/perl">dev-lang/Perl</a> along with <a href="http://perldoc.perl.org/index-modules-A.html">modules</a>.</p>
|
<p>First of all the core distribution of Perl is included in <a href="https://packages.gentoo.org/package/dev-lang/perl">dev-lang/Perl</a> along with <a href="http://perldoc.perl.org/index-modules-A.html">modules</a>.</p>
|
||||||
<p>The <a href="https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/perl-core/">perl-core category</a> in portage contains ebuilds for perl modules, some of which are included in the core perl distibution. The perl-core ebuilds overrides the perl-core modules such that you can update them without recompiling dev-lang/Perl.</p>
|
<p>The <a href="https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/perl-core/">perl-core category</a> in portage contains ebuilds for perl modules, some of which are included in the core perl distibution. The perl-core ebuilds overrides the perl-core modules such that you can update them without recompiling dev-lang/Perl.</p>
|
||||||
<p>Each perl-core module has a corrensponding virtual/perl-* package. The virtual category is used by portage when emerging to take into account that a module can be either provided by dev-lang/perl package or found in perl-core category.</p>
|
<p>Each perl-core module has a corrensponding virtual/perl-* package. The virtual category is used by portage when emerging to take into account that a module can be either provided by dev-lang/perl package or found in perl-core category.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about encription)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/encription.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about encription)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/encription.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A short talk about cryptography at the Berkman Klein Center</title><link>francescomecca.eu/blog/2016/7/7/pres-berk/</link><dc:creator>Francesco Mecca</dc:creator><description><p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
|
||||||
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
<p>What follows is a short summary of that presentation. The slides are available <a href="francescomecca.eu/wp-content/uploads/2016/fwneas.pptx">here</a></p>
|
||||||
<h4>Whose Security?</h4>
|
<h4>Whose Security?</h4>
|
||||||
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
<p>Let's define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Facebook)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/facebook.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Facebook)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/facebook.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>eLearning in the age of Social Networks, the EduHack Platform</title><link>francescomecca.eu/blog/2018/10/2/eduhack-coventry/</link><dc:creator>Francesco Mecca</dc:creator><description><p>This is the revised transcript of my <a href="http://conf.owlteh.org/contributions/published/elearning-in-the-age-of-social-networks-the-eduhack-model/">talk</a> at the <a href="https://www.conf.owlteh.org/">OWLTEH Conference 2018</a> at the Coventry University.</p>
|
||||||
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
<p><img alt="Me, giving the talk" src="francescomecca.eu/wp-content/uploads/2018/coventry.jpg"></p>
|
||||||
<h2>In the beginning there was the LMS</h2>
|
<h2>In the beginning there was the LMS</h2>
|
||||||
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
<p>Learning Management Systems appeared on the market around the beginning of 2000.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about FBI)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/fbi.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about FBI)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/fbi.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>L&#8217;FBI contro la crittografia</title><link>francescomecca.eu/blog/2015/6/13/lfbi-contro-la-crittografia/</link><dc:creator>Francesco Mecca</dc:creator><description><div class="MsoNormal" style="text-align: justify;">
|
||||||
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
Un argomento sul quale si è discusso molto negli ultimi tempi è quello della crittografia dei dati, un ufficiale dell’FBI ha testimoniato che lo scopo delle forze dell’ordine è quello di collaborare con una società tecnologica per prevenire la crittografia. Anche se le compagnie non dovrebbero mettere l’accesso alla crittazione dei clienti prima di preoccupazioni per la sicurezza nazionale, perché la maggiore priorità del governo è quella di prevenire l’uso di tecnologie che proteggono ogni cosa che le persone fanno online. Il loro scopo non è quello di usare una “back door”, termine usato dagli esperti per descrivere punti di accesso integrati, ma quello di accedere ai contenuti dopo essere passati per un processo giudiziario.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about fcc)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/fcc.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rete e&#8217; neutrale</title><link>francescomecca.eu/blog/2015/5/8/la-rete-e-neutrale/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quando ogni giorno ci connettiamo al web lo facciamo con dei presupposti di cui magari non siamo consapevoli, ma che sono alla base della nostra esperienza in rete. </p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about fcc)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/fcc.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La Rete e&#8217; neutrale</title><link>francescomecca.eu/blog/2015/5/8/la-rete-e-neutrale/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Quando ogni giorno ci connettiamo al web lo facciamo con dei presupposti di cui magari non siamo consapevoli, ma che sono alla base della nostra esperienza in rete. </p>
|
||||||
<p>Presupponiamo che possiamo accedere a qualsiasi sito web che desideriamo e che la velocita` a cui accediamo a questo sito web dipenda solamente da quanto paghiamo il nostro provider. Ogni servizio che noi usiamo nel web, che sia lo streaming di video da Youtube, l’upload di foto su Flickr, l’invio di piccoli messaggi di testo su qualche IRC e tanto altro, non puo` essere soggetto a discriminazioni da parte di chi fornisce la connessione. Questi sono i principi della Net Neutrality. </p>
|
<p>Presupponiamo che possiamo accedere a qualsiasi sito web che desideriamo e che la velocita` a cui accediamo a questo sito web dipenda solamente da quanto paghiamo il nostro provider. Ogni servizio che noi usiamo nel web, che sia lo streaming di video da Youtube, l’upload di foto su Flickr, l’invio di piccoli messaggi di testo su qualche IRC e tanto altro, non puo` essere soggetto a discriminazioni da parte di chi fornisce la connessione. Questi sono i principi della Net Neutrality. </p>
|
||||||
<p>Il 26 febbraio scorso FCC (la Commissione Federale per le Comunicazioni negli Stati Uniti) ha riaffermato la validita` di queste regole che in precedenza gli ISP avevano provato ad abolire. Abolire come?</p>
|
<p>Il 26 febbraio scorso FCC (la Commissione Federale per le Comunicazioni negli Stati Uniti) ha riaffermato la validita` di queste regole che in precedenza gli ISP avevano provato ad abolire. Abolire come?</p>
|
||||||
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left:auto;margin-right:auto;text-align:center;">
|
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left:auto;margin-right:auto;text-align:center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about feudalesimo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/feudalesimo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about feudalesimo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/feudalesimo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
||||||
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
||||||
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
||||||
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about feudalism)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/feudalism.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about feudalism)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/feudalism.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Some shallow thoughts from my tiny virtual space</title><link>francescomecca.eu/blog/2017/3/20/spazio-digitale-rant-facebook__eng/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I am not the kind of guy who goes to concerts. Ever.</p>
|
||||||
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
<p>I prefer studio recordings because in these, the logical thoughts of the artist emerge as the track comes to life and reaches our ears. I have always been attracted by that, much more than to the sprinkle of emotions that come from venues and theaters.</p>
|
||||||
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
<p>In my case the exceptions are the live performances of Dale Crover (from The Melvins) and Jeff Mangum. Both of which were some kind of unshaped epiphanic experiences for me. </p>
|
||||||
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
<p>Milan, December 2015, The Melvins were at the end of their most recent European tour when Jeff Pinkus drops the bass guitar, tunes the effects pedal and kicks the bass with his bare foot until the right repetition of sounds comes out of the speakers. Slowly, each one of the members leaves the stage, sounds are still coming from
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Flanagan)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/flanagan.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>56 secondi di celebrita`</title><link>francescomecca.eu/blog/2015/8/31/56-secondi-di-celebrita/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="http://www.mantellini.it/2015/08/26/state-al-riparo/" target="_blank" rel="http://www.mantellini.it/2015/08/26/state-al-riparo/"><img class="aligncenter wp-image-178 size-full" src="http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31.jpg" alt="" width="644" height="533" srcset="http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31-300x248.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31.jpg 644w" sizes="(max-width: 644px) 100vw, 644px"></a></p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Flanagan)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/flanagan.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>56 secondi di celebrita`</title><link>francescomecca.eu/blog/2015/8/31/56-secondi-di-celebrita/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="http://www.mantellini.it/2015/08/26/state-al-riparo/" target="_blank" rel="http://www.mantellini.it/2015/08/26/state-al-riparo/"><img class="aligncenter wp-image-178 size-full" src="http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31.jpg" alt="" width="644" height="533" srcset="http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31-300x248.jpg 300w, http://francescomecca.eu/wp-content/uploads/2015/08/Schermata-2015-08-26-alle-22.29.31.jpg 644w" sizes="(max-width: 644px) 100vw, 644px"></a></p>
|
||||||
<p>Dura 56 secondi il video di Vester Lee Flanagan che testimonia l’omicidio in prima persona di due giornalisti in Virginia durante un live broadcast televisivo. Durante l’inseguimento nel quale si e` tolto la vita Flanagan ha caricato su Twitter e Facebook il video dell’uccisione in prima persona.</p>
|
<p>Dura 56 secondi il video di Vester Lee Flanagan che testimonia l’omicidio in prima persona di due giornalisti in Virginia durante un live broadcast televisivo. Durante l’inseguimento nel quale si e` tolto la vita Flanagan ha caricato su Twitter e Facebook il video dell’uccisione in prima persona.</p>
|
||||||
<p>Twitter e Facebook hanno tempestivamente censurato il video e rimosso l’account dell’omicida ed alcune emittenti televisive (come SkyTg24) hanno scelto allo stesso modo di non pubblicare il video in diretta.</p>
|
<p>Twitter e Facebook hanno tempestivamente censurato il video e rimosso l’account dell’omicida ed alcune emittenti televisive (come SkyTg24) hanno scelto allo stesso modo di non pubblicare il video in diretta.</p>
|
||||||
<h4>To publish or not to publish?</h4>
|
<h4>To publish or not to publish?</h4>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about francesco mecca)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/francesco-mecca.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about francesco mecca)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/francesco-mecca.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
||||||
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
||||||
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
||||||
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about free speech)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/free-speech.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Addio Reddit</title><link>francescomecca.eu/blog/2018/3/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about free speech)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/free-speech.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Addio Reddit</title><link>francescomecca.eu/blog/2018/3/27/addio-reddit/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
||||||
<p>It is also common ground, however, that the First Amendment does not guarantee the right to communicate one's views at all times and places or in any manner that may be desired.</p>
|
<p>It is also common ground, however, that the First Amendment does not guarantee the right to communicate one's views at all times and places or in any manner that may be desired.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Tempo fa rimasi colpito nel leggere questo <a href="https://www.courtlistener.com/opinion/110532/heffron-v-international-soc-for-krishna-consciousness-inc/">orientamento</a> della corte degli Stati Uniti dal quale ho tratto la precedente citazione.</p>
|
<p>Tempo fa rimasi colpito nel leggere questo <a href="https://www.courtlistener.com/opinion/110532/heffron-v-international-soc-for-krishna-consciousness-inc/">orientamento</a> della corte degli Stati Uniti dal quale ho tratto la precedente citazione.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about frode)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/frode.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about frode)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/frode.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>#JeSuisSatoshiNakamoto</title><link>francescomecca.eu/blog/2016/4/17/wright-nakamoto/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Ieri mattina appena sveglio mi sono imbattuto in questo <a href="http://gavinandresen.ninja/satoshi">post</a> di Gavin Andresen, uno dei più importanti membri della Bitcoin Foundation.
|
||||||
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
In quelle righe Gavin attribuisce l'identità di Satoshi Nakamoto, il padre dei Bitcoin, a Craig Wright, un imprenditore australiano.
|
||||||
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
|
@ -7,7 +7,7 @@ Sono stato subito scosso dall'articolo, dove si spiega:</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
<p>Continuo la mia navigazione imbattendomi nei seguenti titoli di alcune testate italiane:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Repubblica: <a href="http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12%22">"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
<li>Repubblica: <a href='http://www.repubblica.it/tecnologia/2016/05/02/news/l_imprenditore_australiano_craig_wright_sono_io_il_creatore_del_bitcoin_-138896449/?ref=HREC1-12"'>"Bitcoin: il creatore sono io", l'imprenditore australiano Craig Wright esce allo scoperto</a></li>
|
||||||
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
<li>La Stampa: <a href="http://www.lastampa.it/2016/05/02/economia/imprenditore-australiano-fa-coming-out-sono-linventore-del-bitcoin-l6G9XXHlFGXOavjRv4snQL/pagina.html">Imprenditore australiano fa coming out: sono l’inventore del Bitcoin</a></li>
|
||||||
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
<li>Il corriere della sera: <a href="http://www.corriere.it/economia/16_maggio_02/bitcoin-la-bbc-padre-l-australiano-craig-wright-ba2124ec-1043-11e6-aba7-a1898801ab6b.shtml">per la «Bbc» il padre è l’australiano Craig Wright</a></li>
|
||||||
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
<li>Il sole 24 ore: <a href="http://www.ilsole24ore.com/art/finanza-e-mercati/2016-05-02/scoperto-l-inventore-bitcoin-e-imprenditore-australiano-111525.shtml?uuid=ACMVhYJD">Scoperto l’inventore del Bitcoin: è un imprenditore australiano</a></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Genetic algorithm)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/genetic-algorithm.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Genetic algorithm)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/genetic-algorithm.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Capire il Machine Learning (parte 3)</title><link>francescomecca.eu/blog/2016/11/15/machine-learning-parte3/</link><dc:creator>Francesco Mecca</dc:creator><description><h3>Riconoscimento delle immagini</h3>
|
||||||
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
|
||||||
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
|
||||||
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
|
||||||
|
@ -37,28 +37,32 @@ Abbiamo in questo modo una <em>recurrent neural network</em> (RNN) d
|
||||||
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
|
||||||
Inizialmente l'output della nostra RNN non ha alcun valore:
|
Inizialmente l'output della nostra RNN non ha alcun valore:
|
||||||
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
in questo esempio, abbiamo l'output di una RNN allenata attraverso Guerra e Pace:</p>
|
||||||
<pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
<div class="code"><pre class="code literal-block"><span class="n">tyntd</span><span class="o">-</span><span class="n">iafhatawiaoihrdemot</span><span class="w"> </span><span class="n">lytdws</span><span class="w"> </span><span class="n">e</span><span class="w"> </span><span class="p">,</span><span class="n">tfti</span><span class="p">,</span><span class="w"> </span><span class="n">astai</span><span class="w"> </span><span class="n">f</span><span class="w"> </span><span class="n">ogoh</span><span class="w"> </span><span class="n">eoase</span><span class="w"> </span><span class="n">rrranbyne</span><span class="w"> </span><span class="p">'</span><span class="n">nhthnee</span><span class="w"> </span><span class="n">e</span><span class="w"> </span>
|
||||||
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span><span class="w"></span>
|
<span class="n">plia</span><span class="w"> </span><span class="n">tklrgd</span><span class="w"> </span><span class="n">t</span><span class="w"> </span><span class="n">o</span><span class="w"> </span><span class="n">idoe</span><span class="w"> </span><span class="n">ns</span><span class="p">,</span><span class="n">smtt</span><span class="w"> </span><span class="n">h</span><span class="w"> </span><span class="n">ne</span><span class="w"> </span><span class="n">etie</span><span class="w"> </span><span class="n">h</span><span class="p">,</span><span class="n">hregtrs</span><span class="w"> </span><span class="n">nigtike</span><span class="p">,</span><span class="n">aoaenns</span><span class="w"> </span><span class="n">lngty</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
<p>L'output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
|
||||||
Questo procedimento continua all'infinito.
|
Questo procedimento continua all'infinito.
|
||||||
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
Ogni volta che la RNN produce dell'output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
|
||||||
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
|
||||||
<pre class="code literal-block">"Tmont thithey" fomesscerliund
|
<div class="code"><pre class="code literal-block">"Tmont thithey" fomesscerliund
|
||||||
Keushey. Thom here
|
Keushey. Thom here
|
||||||
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
|
||||||
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Dopo quasi mille:</p>
|
<p>Dopo quasi mille:</p>
|
||||||
<pre class="code literal-block"><span class="nv">Aftair</span> <span class="nv">fall</span> <span class="nv">unsuch</span> <span class="nv">that</span> <span class="nv">the</span> <span class="nv">hall</span> <span class="k">for</span> <span class="nv">Prince</span> <span class="nv">Velzonski</span><span class="s1">'</span><span class="s">s that me of</span>
|
<div class="code"><pre class="code literal-block"><span class="nv">Aftair</span><span class="w"> </span><span class="nv">fall</span><span class="w"> </span><span class="nv">unsuch</span><span class="w"> </span><span class="nv">that</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">hall</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="nv">Prince</span><span class="w"> </span><span class="nv">Velzonski</span><span class="err">'s that me of</span>
|
||||||
<span class="nv">her</span> <span class="nv">hearly</span>, <span class="nv">and</span> <span class="nv">behs</span> <span class="nv">to</span> <span class="nv">so</span> <span class="nv">arwage</span> <span class="nv">fiving</span> <span class="nv">were</span> <span class="nv">to</span> <span class="nv">it</span> <span class="nv">beloge</span>, <span class="nv">pavu</span> <span class="nv">say</span> <span class="nv">falling</span> <span class="nv">misfort</span>
|
<span class="err">her hearly, and behs to so arwage fiving were to it beloge, pavu say falling misfort </span>
|
||||||
<span class="nv">how</span>, <span class="nv">and</span> <span class="nv">Gogition</span> <span class="nv">is</span> <span class="nv">so</span> <span class="nv">overelical</span> <span class="nv">and</span> <span class="nv">ofter</span>.
|
<span class="err">how, and Gogition is so overelical and ofter.</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Duemila:</p>
|
<p>Duemila:</p>
|
||||||
<pre class="code literal-block"><span class="s2">"</span><span class="s">Why do what that day,</span><span class="s2">"</span> <span class="nv">replied</span> <span class="nv">Natasha</span>, <span class="nv">and</span> <span class="nv">wishing</span> <span class="nv">to</span> <span class="nv">himself</span> <span class="nv">the</span> <span class="nv">fact</span> <span class="nv">the</span>
|
<div class="code"><pre class="code literal-block"><span class="s2">"Why do what that day,"</span><span class="w"> </span><span class="nv">replied</span><span class="w"> </span><span class="nv">Natasha</span>,<span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">wishing</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">himself</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">fact</span><span class="w"> </span><span class="nv">the</span>
|
||||||
<span class="nv">princess</span>, <span class="nv">Princess</span> <span class="nv">Mary</span> <span class="nv">was</span> <span class="nv">easier</span>, <span class="nv">fed</span> <span class="nv">in</span> <span class="nv">had</span> <span class="nv">oftened</span> <span class="nv">him</span>.
|
<span class="nv">princess</span>,<span class="w"> </span><span class="nv">Princess</span><span class="w"> </span><span class="nv">Mary</span><span class="w"> </span><span class="nv">was</span><span class="w"> </span><span class="nv">easier</span>,<span class="w"> </span><span class="nv">fed</span><span class="w"> </span><span class="nv">in</span><span class="w"> </span><span class="nv">had</span><span class="w"> </span><span class="nv">oftened</span><span class="w"> </span><span class="nv">him</span>.
|
||||||
<span class="nv">Pierre</span> <span class="nv">aking</span> <span class="nv">his</span> <span class="nv">soul</span> <span class="nv">came</span> <span class="nv">to</span> <span class="nv">the</span> <span class="nv">packs</span> <span class="nv">and</span> <span class="nv">drove</span> <span class="nv">up</span> <span class="nv">his</span> <span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span> <span class="nv">women</span>.
|
<span class="nv">Pierre</span><span class="w"> </span><span class="nv">aking</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">soul</span><span class="w"> </span><span class="nv">came</span><span class="w"> </span><span class="nv">to</span><span class="w"> </span><span class="nv">the</span><span class="w"> </span><span class="nv">packs</span><span class="w"> </span><span class="nv">and</span><span class="w"> </span><span class="nv">drove</span><span class="w"> </span><span class="nv">up</span><span class="w"> </span><span class="nv">his</span><span class="w"> </span><span class="nv">father</span><span class="o">-</span><span class="nv">in</span><span class="o">-</span><span class="nv">law</span><span class="w"> </span><span class="nv">women</span>.
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
<p>Possiamo notare come l'output migliori visibilmente.</p>
|
||||||
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p></description><category>AI</category><category>algoritmi genetici</category><category>Genetic algorithm</category><category>Neural networks</category><category>PesceWanda</category><category>programming</category><category>reti neurali</category><guid>francescomecca.eu/blog/2016/11/11/machine-learning-parte2/</guid><pubDate>Fri, 11 Nov 2016 00:00:00 GMT</pubDate></item><item><title>Capire il Machine Learning (parte 1)</title><link>francescomecca.eu/blog/2016/11/10/machine-learning-intro/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Questo è il primo di una serie di post che hanno l'obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali più in generale.
|
||||||
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
Mi auguro che questa breve introduzione al mondo dell'apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
|
||||||
|
@ -157,14 +161,15 @@ Nel caso della vendita dell'automobile, abbiamo un semplice problema con una sol
|
||||||
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
|
||||||
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
<em>prezzo finale</em> = A <em><em>prezzo originale</em> + B </em><em>km percorsi</em> + C * stato di usura</p>
|
||||||
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
|
||||||
<pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">funzione</span><span class="o">:</span><span class="w"> </span><span class="n">calcola_prezzo_auto</span><span class="o">:</span>
|
||||||
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"></span>
|
<span class="w"> </span><span class="n">parametri</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="o">,</span><span class="w"> </span><span class="n">km_percorsi</span><span class="o">,</span><span class="w"> </span><span class="n">stato_usura</span>
|
||||||
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">variabili</span><span class="o">:</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
|
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span>
|
||||||
|
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_originale</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">0.804246</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">km_percorsi</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mf">0.000125</span><span class="w"></span>
|
|
||||||
<span class="w"> </span><span class="n">prezzo</span><span class="w"> </span><span class="n">finale</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">prezzo_finale</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="n">stato_usura</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="o">-</span><span class="mi">2500</span><span class="w"></span>
|
|
||||||
</pre>
|
|
||||||
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
<p>I valori di quelle costanti, stabilite casualmente nell'esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
|
||||||
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l'errore:</p>
|
||||||
<table>
|
<table>
|
||||||
|
@ -215,7 +220,7 @@ Ci sono varie funzioni che stimano l'errore e permettono di correggere i pesi o
|
||||||
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
<p>Ora, come possiamo immaginare, il prezzo di un'auto ha molti fattori che si aggiungono a quelli elencati nell'esempio.
|
||||||
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si può semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
|
||||||
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
<p>Possiamo arricchire l'esempio dell'automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
|
||||||
<pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_ORIG * peso A1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| KM_PERCORSI * peso B1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C1 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
|
@ -235,15 +240,17 @@ Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzion
|
||||||
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| STATO_USURA * peso C3 </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
<span class="c">| PREZZO FINALE STIMATO 3|</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un'ultimo risultato:</p>
|
||||||
<pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
<div class="code"><pre class="code literal-block"><span class="c">| </span><span class="nb">--------------------------------------------------</span><span class="c">|</span>
|
||||||
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_1 * peso X </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_2 * peso Y </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
<span class="c">| PREZZO_3 * peso Z </span><span class="nb">-----</span><span class="nv">&gt;</span><span class="c"> |</span>
|
||||||
<span class="c">| PREZZO FINALE DEF |</span>
|
<span class="c">| PREZZO FINALE DEF |</span>
|
||||||
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
<span class="c">|</span><span class="nb">---------------------------------------------------</span><span class="c">|</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>Questa é, seppur molto basica, una rete neurale.
|
<p>Questa é, seppur molto basica, una rete neurale.
|
||||||
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
Proviamo a visualizzarla in un'immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi "nascosti" e temporanei.</p>
|
||||||
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
<p><img alt="rete2" src="francescomecca.eu/wp-content/uploads/2016/reteneurale2.jpg"></p>
|
||||||
|
@ -283,34 +290,38 @@ The main components of a GA are:</p>
|
||||||
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
<p>Our program, that is available <a href="http://francescomecca.eu:3000/pesceWanda/interpol_genetica">here</a> uses a class to define the various members of the population and a string for the genes, a class as well for the points on the plane.</p>
|
||||||
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
<p>The fitness function is not as precise as it should be because this is only a proof of concept:</p>
|
||||||
<p>.. code:: python</p>
|
<p>.. code:: python</p>
|
||||||
<pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="n">mutationProbability</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">0.1</span>
|
||||||
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span><span class="w"></span>
|
<span class="n">rangeLimit</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">5</span>
|
||||||
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="n">def</span><span class="w"> </span><span class="n">fitness</span><span class="p">(</span><span class="n">item</span><span class="p">,</span><span class="w"> </span><span class="n">pointList</span><span class="p">,</span><span class="w"> </span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">p</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="nl">pointList</span><span class="p">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="p">(</span><span class="nf">abs</span><span class="w"> </span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="n">y</span><span class="p">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">rangeLimit</span><span class="p">)</span>
|
||||||
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span><span class="w"></span>
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="w"></span>
|
<span class="w"> </span><span class="k">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span><span class="w"></span>
|
<span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="k">result</span>
|
||||||
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span><span class="w"></span>
|
<span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="k">value</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="n">n</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
<p>item is just a member of the population, poinList is the list of points and n is the number of points (n - 1 is the grade of the function).</p>
|
||||||
<pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span><span class="w"></span>
|
<div class="code"><pre class="code literal-block"><span class="k">for</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="ow">in</span><span class="w"> </span><span class="k">range</span><span class="p">(</span><span class="n">n</span><span class="p">)</span><span class="err">:</span>
|
||||||
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span><span class="w"></span>
|
<span class="w"> </span><span class="n">y</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">item</span><span class="p">.</span><span class="n">gene</span><span class="o">[</span><span class="n">i</span><span class="o">]</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="n">pow</span><span class="p">(</span><span class="n">p</span><span class="p">.</span><span class="n">x</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">)</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
<p>this piece of code gives us the value of the function encoded in the genes in the points of pointList;</p>
|
||||||
<pre class="code literal-block"><span class="nb">result</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">-</span> <span class="ss">(</span><span class="nv">abs</span> <span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span> <span class="o">-</span> <span class="nv">y</span><span class="ss">)</span> <span class="o">/</span> <span class="nv">rangeLimit</span><span class="ss">)</span>
|
<div class="code"><pre class="code literal-block"><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="ss">(</span><span class="nv">abs</span><span class="w"> </span><span class="ss">(</span><span class="nv">p</span>.<span class="nv">y</span><span class="w"> </span><span class="o">-</span><span class="w"> </span><span class="nv">y</span><span class="ss">)</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="nv">rangeLimit</span><span class="ss">)</span>
|
||||||
<span class="k">if</span> <span class="nb">result</span> <span class="o">&lt;</span> <span class="mi">0</span>:
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="mi">0</span>:
|
||||||
<span class="nb">result</span> <span class="o">=</span> <span class="mi">0</span>
|
<span class="w"> </span><span class="nb">result</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span>
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
<p>while here the script stores 1 - the previous result because if the GA has yield a good result there should be distance = 0 from the function evaluated and the points; If this is the case, the fitness function should attribute the highest possible reproduction probability for that member.
|
||||||
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
At the end the fitness function returns the total value over the number of points evaluated.</p>
|
||||||
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
<p>As you can see this fitness function is by no means an optimal one. The reproduction probability is higher for functions that crosses some points and are really distant from others rather than for functions that are closer to every point but crosses none.
|
||||||
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
Anyway for simple cases the GA yields good results, as an example for points (0 0), (1 4), (2 9) one of the member with the highest reproduction probability has this function in its genes:</p>
|
||||||
<pre class="code literal-block">-0.0487839869993989 * x^0 + 4.600339125358671 * x^1 + -0.2780958075230644 * x^2
|
<div class="code"><pre class="code literal-block">-0.0487839869993989 <span class="gs">* x^0 + 4.600339125358671 *</span> x^1 + -0.2780958075230644 * x^2
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
<p>that crosses this points: (0 -0.0488), (1 4.2735), (2 8.0395) given 80 iterations, initial population of 600 members and a two digit approximation.</p>
|
||||||
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p></description><category>AI</category><category>Genetic algorithm</category><category>PesceWanda</category><category>programming</category><category>python</category><guid>francescomecca.eu/blog/2016/5/15/genetic-alg/</guid><pubDate>Sun, 15 May 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>For a more precise computation a higher population size and a really high number of iterations should be used.</p></description><category>AI</category><category>Genetic algorithm</category><category>PesceWanda</category><category>programming</category><category>python</category><guid>francescomecca.eu/blog/2016/5/15/genetic-alg/</guid><pubDate>Sun, 15 May 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,274 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Gentoo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/gentoo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>About Perl packages in Gentoo</title><link>francescomecca.eu/blog/2015/9/11/about-perl-packages-in-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In this post I wish to explain a bit about Perl related ebuilds in Gentoo and how to update from perl-core to virtual/perl without conflicts.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Gentoo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/gentoo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 13:37:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Playing videogames with WINE on Gentoo</title><link>francescomecca.eu/blog/2024/2/28/wine-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="francescomecca.eu/2024/1/12/happy-new-year-2024/">One of my new year's resolution</a> are
|
||||||
|
related to playing videogames on GNU/Linux rather than resorting to
|
||||||
|
dual booting as I did for the last 15 years. This blogpost aims to be
|
||||||
|
a continuosly updated guide to my journey in having a proper gaming
|
||||||
|
setup on my Gentoo workstation. My main resources are the <a href="https://wiki.gentoo.org/wiki/Wine">Gentoo
|
||||||
|
wiki</a> and the <a href="https://wiki.archlinux.org/title/Wine">Arch
|
||||||
|
Wiki</a>. </p>
|
||||||
|
<p>These objectives should be clear:</p>
|
||||||
|
<ul>
|
||||||
|
<li>I will not use steam: I only buy from <a href="https://www.gog.com/games">GOG</a> or use CDs</li>
|
||||||
|
<li>I want to use one of my controllers for games that need it</li>
|
||||||
|
<li>use as much software from the Gentoo repos as possible; this means avoiding <a href="https://usebottles.com/">Bottles</a> and <a href="https://lutris.net/">Lutris</a></li>
|
||||||
|
</ul>
|
||||||
|
<h3>Hardware</h3>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~&gt;</span><span class="w"> </span><span class="n">sudo</span><span class="w"> </span><span class="n">inxi</span><span class="w"> </span><span class="o">-</span><span class="n">AGSC</span>
|
||||||
|
<span class="n">System</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Host</span><span class="p">:</span><span class="w"> </span><span class="n">____</span><span class="w"> </span><span class="n">Kernel</span><span class="p">:</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">arch</span><span class="p">:</span><span class="w"> </span><span class="n">x86_64</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">Desktop</span><span class="p">:</span><span class="w"> </span><span class="n">spectrwm</span>
|
||||||
|
<span class="w"> </span><span class="n">Distro</span><span class="p">:</span><span class="w"> </span><span class="n">Gentoo</span><span class="w"> </span><span class="n">Base</span><span class="w"> </span><span class="n">System</span><span class="w"> </span><span class="n">release</span><span class="w"> </span><span class="mf">2.14</span>
|
||||||
|
<span class="n">CPU</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Info</span><span class="p">:</span><span class="w"> </span><span class="mi">6</span><span class="o">-</span><span class="n">core</span><span class="w"> </span><span class="n">model</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Ryzen</span><span class="w"> </span><span class="mi">5</span><span class="w"> </span><span class="mi">2600</span><span class="w"> </span><span class="n">bits</span><span class="p">:</span><span class="w"> </span><span class="mi">64</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">MT</span><span class="w"> </span><span class="n">MCP</span><span class="w"> </span><span class="n">cache</span><span class="p">:</span><span class="w"> </span><span class="n">L2</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="n">MiB</span>
|
||||||
|
<span class="w"> </span><span class="n">Speed</span><span class="w"> </span><span class="p">(</span><span class="n">MHz</span><span class="p">):</span><span class="w"> </span><span class="n">avg</span><span class="p">:</span><span class="w"> </span><span class="mi">1858</span><span class="w"> </span><span class="nb">min</span><span class="o">/</span><span class="nb">max</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="o">/</span><span class="mi">3400</span><span class="w"> </span><span class="n">cores</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="w"> </span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">6</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">7</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">8</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">9</span><span class="p">:</span><span class="w"> </span><span class="mi">3400</span><span class="w"> </span><span class="mi">10</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">11</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span><span class="w"> </span><span class="mi">12</span><span class="p">:</span><span class="w"> </span><span class="mi">1550</span>
|
||||||
|
<span class="n">Graphics</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">22</span><span class="w"> </span><span class="p">[</span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6700</span><span class="o">/</span><span class="mi">6700</span><span class="w"> </span><span class="n">XT</span><span class="o">/</span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="o">/</span><span class="w"> </span><span class="mi">6800</span><span class="n">M</span><span class="o">/</span><span class="mi">6850</span><span class="n">M</span><span class="w"> </span><span class="n">XT</span><span class="p">]</span>
|
||||||
|
<span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">Logitech</span><span class="w"> </span><span class="n">C920</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Pro</span><span class="w"> </span><span class="n">Webcam</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">usbfs</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">Display</span><span class="p">:</span><span class="w"> </span><span class="n">server</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="o">.</span><span class="n">org</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.21</span><span class="o">.</span><span class="mf">1.11</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">X</span><span class="p">:</span><span class="w"> </span><span class="n">loaded</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">unloaded</span><span class="p">:</span><span class="w"> </span><span class="n">modesetting</span><span class="p">,</span><span class="n">radeon</span><span class="w"> </span><span class="n">dri</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="w"> </span><span class="n">gpu</span><span class="p">:</span><span class="w"> </span><span class="n">amdgpu</span>
|
||||||
|
<span class="w"> </span><span class="n">resolution</span><span class="p">:</span><span class="w"> </span><span class="mi">1920</span><span class="n">x1200</span><span class="o">~</span><span class="mi">60</span><span class="n">Hz</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">EGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.5</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">radeonsi</span><span class="p">,</span><span class="n">swrast</span>
|
||||||
|
<span class="w"> </span><span class="n">platforms</span><span class="p">:</span><span class="w"> </span><span class="n">gbm</span><span class="p">,</span><span class="n">x11</span><span class="p">,</span><span class="n">surfaceless</span><span class="p">,</span><span class="n">device</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">OpenGL</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">4.6</span><span class="w"> </span><span class="n">vendor</span><span class="p">:</span><span class="w"> </span><span class="n">amd</span><span class="w"> </span><span class="n">mesa</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">23.3</span><span class="o">.</span><span class="mi">5</span><span class="w"> </span><span class="n">renderer</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span>
|
||||||
|
<span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span><span class="w"> </span><span class="p">(</span><span class="n">radeonsi</span><span class="w"> </span><span class="n">navi22</span><span class="w"> </span><span class="n">LLVM</span><span class="w"> </span><span class="mf">17.0</span><span class="o">.</span><span class="mi">6</span><span class="w"> </span><span class="n">DRM</span><span class="w"> </span><span class="mf">3.49</span><span class="w"> </span><span class="mf">6.1</span><span class="o">.</span><span class="mi">69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">Vulkan</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span><span class="w"> </span><span class="n">drivers</span><span class="p">:</span><span class="w"> </span><span class="n">N</span><span class="o">/</span><span class="n">A</span><span class="w"> </span><span class="n">surfaces</span><span class="p">:</span><span class="w"> </span><span class="n">xcb</span><span class="p">,</span><span class="n">xlib</span>
|
||||||
|
<span class="n">Audio</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Navi</span><span class="w"> </span><span class="mi">21</span><span class="o">/</span><span class="mi">23</span><span class="w"> </span><span class="n">HDMI</span><span class="o">/</span><span class="n">DP</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Family</span><span class="w"> </span><span class="mi">17</span><span class="n">h</span><span class="w"> </span><span class="n">HD</span><span class="w"> </span><span class="n">Audio</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd_hda_intel</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">5</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span><span class="w"> </span><span class="n">driver</span><span class="p">:</span><span class="w"> </span><span class="n">snd</span><span class="o">-</span><span class="n">usb</span><span class="o">-</span><span class="n">audio</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">USB</span>
|
||||||
|
<span class="w"> </span><span class="n">API</span><span class="p">:</span><span class="w"> </span><span class="n">ALSA</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="n">k6</span><span class="o">.</span><span class="mf">1.69</span><span class="o">-</span><span class="n">gentoo</span><span class="o">-</span><span class="n">dist</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">kernel</span><span class="o">-</span><span class="n">api</span>
|
||||||
|
<span class="w"> </span><span class="n">Server</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="n">PulseAudio</span><span class="w"> </span><span class="n">v</span><span class="p">:</span><span class="w"> </span><span class="mf">16.1</span><span class="w"> </span><span class="n">status</span><span class="p">:</span><span class="w"> </span><span class="n">active</span><span class="w"> </span><span class="p">(</span><span class="n">root</span><span class="p">,</span><span class="w"> </span><span class="n">process</span><span class="p">)</span>
|
||||||
|
<span class="n">USB</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">1</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">2</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">splitkb</span><span class="o">.</span><span class="n">com</span><span class="w"> </span><span class="n">Kyria</span><span class="w"> </span><span class="n">rev2</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">keyboard</span><span class="p">,</span><span class="n">HID</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="o">-</span><span class="mi">7</span><span class="p">:</span><span class="mi">4</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Microsoft</span><span class="w"> </span><span class="n">Xbox360</span><span class="w"> </span><span class="n">Controller</span><span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">&gt;</span>
|
||||||
|
<span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">3</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">2</span><span class="p">:</span><span class="mi">3</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">Focusrite</span><span class="o">-</span><span class="n">Novation</span><span class="w"> </span><span class="n">Focusrite</span><span class="w"> </span><span class="n">Scarlett</span><span class="w"> </span><span class="mi">2</span><span class="n">i2</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="n">audio</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
<span class="w"> </span><span class="n">Device</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="o">-</span><span class="mi">4</span><span class="p">:</span><span class="mi">6</span><span class="w"> </span><span class="n">info</span><span class="p">:</span><span class="w"> </span><span class="n">ThrustMaster</span><span class="w"> </span><span class="n">XB1</span><span class="w"> </span><span class="n">Classic</span><span class="w"> </span><span class="n">Controller</span>
|
||||||
|
<span class="w"> </span><span class="n">type</span><span class="p">:</span><span class="w"> </span><span class="o">&lt;</span><span class="n">vendor</span><span class="w"> </span><span class="n">specific</span><span class="o">&gt;</span><span class="w"> </span><span class="n">rev</span><span class="p">:</span><span class="w"> </span><span class="mf">2.0</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<h3>Drivers</h3>
|
||||||
|
<p>For the kernel, I am using the <code>gentoo-kernel</code> seed.</p>
|
||||||
|
<p>For the GPU setup you need:</p>
|
||||||
|
<ul>
|
||||||
|
<li>the open source drivers, see https://wiki.gentoo.org/wiki/AMDGPU</li>
|
||||||
|
<li>the proprietary drivers, see https://wiki.gentoo.org/wiki/AMDGPU-PRO</li>
|
||||||
|
<li>the vulkan drivers, see https://wiki.gentoo.org/wiki/AMDVLK
|
||||||
|
These are useful commands to check if the drivers are loaded correctly:</li>
|
||||||
|
</ul>
|
||||||
|
<div class="code"><pre class="code literal-block">user ~&gt; lspci -k | grep -A 3 -E "(VGA|3D)"
|
||||||
|
08:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] (rev c0)
|
||||||
|
Subsystem: Tul Corporation / PowerColor Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
|
||||||
|
Kernel driver in use: amdgpu
|
||||||
|
Kernel modules: amdgpu
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block">user ~&gt; glxinfo -B
|
||||||
|
name of display: :0
|
||||||
|
display: :0 screen: 0
|
||||||
|
direct rendering: Yes
|
||||||
|
Extended renderer info (GLX_MESA_query_renderer):
|
||||||
|
Vendor: AMD (0x1002)
|
||||||
|
Device: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist) (0x73df)
|
||||||
|
Version: 23.3.5
|
||||||
|
Accelerated: yes
|
||||||
|
Video memory: 12288MB
|
||||||
|
Unified memory: no
|
||||||
|
Preferred profile: core (0x1)
|
||||||
|
Max core profile version: 4.6
|
||||||
|
Max compat profile version: 4.6
|
||||||
|
Max GLES1 profile version: 1.1
|
||||||
|
Max GLES[23] profile version: 3.2
|
||||||
|
Memory info (GL_ATI_meminfo):
|
||||||
|
VBO free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
VBO free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Texture free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Texture free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Renderbuffer free memory - total: 11874 MB, largest block: 11874 MB
|
||||||
|
Renderbuffer free aux. memory - total: 32064 MB, largest block: 32064 MB
|
||||||
|
Memory info (GL_NVX_gpu_memory_info):
|
||||||
|
Dedicated video memory: 12288 MB
|
||||||
|
Total available memory: 44400 MB
|
||||||
|
Currently available dedicated video memory: 11874 MB
|
||||||
|
OpenGL vendor string: AMD
|
||||||
|
OpenGL renderer string: AMD Radeon RX 6750 XT (radeonsi, navi22, LLVM 17.0.6, DRM 3.49, 6.1.69-gentoo-dist)
|
||||||
|
OpenGL core profile version string: 4.6 (Core Profile) Mesa 23.3.5
|
||||||
|
OpenGL core profile shading language version string: 4.60
|
||||||
|
OpenGL core profile context flags: (none)
|
||||||
|
OpenGL core profile profile mask: core profile
|
||||||
|
|
||||||
|
OpenGL version string: 4.6 (Compatibility Profile) Mesa 23.3.5
|
||||||
|
OpenGL shading language version string: 4.60
|
||||||
|
OpenGL context flags: (none)
|
||||||
|
OpenGL profile mask: compatibility profile
|
||||||
|
|
||||||
|
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.3.5
|
||||||
|
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">user</span><span class="w"> </span><span class="o">~&gt;</span><span class="w"> </span><span class="n">vulkaninfo</span><span class="w"> </span><span class="o">--</span><span class="n">summary</span><span class="w"> </span>
|
||||||
|
<span class="n">ac_compute_device_uuid</span><span class="s1">'s output is based on invalid pci bus info.</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
<span class="n">VULKANINFO</span>
|
||||||
|
<span class="o">==========</span>
|
||||||
|
|
||||||
|
<span class="n">Vulkan</span><span class="w"> </span><span class="n">Instance</span><span class="w"> </span><span class="n">Version</span><span class="p">:</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">275</span>
|
||||||
|
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Extensions</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">22</span>
|
||||||
|
<span class="o">-------------------------------</span>
|
||||||
|
<span class="n">VK_EXT_acquire_drm_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_acquire_xlib_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_debug_report</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">10</span>
|
||||||
|
<span class="n">VK_EXT_debug_utils</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_EXT_direct_mode_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_display_surface_counter</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_surface_maintenance1</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_EXT_swapchain_colorspace</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">4</span>
|
||||||
|
<span class="n">VK_KHR_device_group_creation</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_display</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">23</span>
|
||||||
|
<span class="n">VK_KHR_external_fence_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_memory_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_external_semaphore_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_display_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_get_physical_device_properties2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">2</span>
|
||||||
|
<span class="n">VK_KHR_get_surface_capabilities2</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_portability_enumeration</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">25</span>
|
||||||
|
<span class="n">VK_KHR_surface_protected_capabilities</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_KHR_xcb_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_KHR_xlib_surface</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">6</span>
|
||||||
|
<span class="n">VK_LUNARG_direct_driver_loading</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="n">extension</span><span class="w"> </span><span class="n">revision</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Instance</span><span class="w"> </span><span class="n">Layers</span><span class="p">:</span><span class="w"> </span><span class="n">count</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">3</span>
|
||||||
|
<span class="o">--------------------------</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_32</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_AMD_switchable_graphics_64</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">switchable</span><span class="w"> </span><span class="n">graphics</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
<span class="n">VK_LAYER_MESA_device_select</span><span class="w"> </span><span class="n">Linux</span><span class="w"> </span><span class="n">device</span><span class="w"> </span><span class="n">selection</span><span class="w"> </span><span class="n">layer</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">211</span><span class="w"> </span><span class="n">version</span><span class="w"> </span><span class="mi">1</span>
|
||||||
|
|
||||||
|
<span class="n">Devices</span><span class="p">:</span>
|
||||||
|
<span class="o">========</span>
|
||||||
|
<span class="n">GPU0</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">260</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">279</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_PROPRIETARY</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="n">AMD</span><span class="w"> </span><span class="n">proprietary</span><span class="w"> </span><span class="n">shader</span><span class="w"> </span><span class="n">compiler</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">3.1</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
<span class="n">GPU1</span><span class="p">:</span>
|
||||||
|
<span class="w"> </span><span class="n">apiVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mi">241</span>
|
||||||
|
<span class="w"> </span><span class="n">driverVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2.0</span><span class="o">.</span><span class="mi">257</span>
|
||||||
|
<span class="w"> </span><span class="n">vendorID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x1002</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mh">0x73df</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PHYSICAL_DEVICE_TYPE_DISCRETE_GPU</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">Radeon</span><span class="w"> </span><span class="n">RX</span><span class="w"> </span><span class="mi">6750</span><span class="w"> </span><span class="n">XT</span>
|
||||||
|
<span class="w"> </span><span class="n">driverID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">DRIVER_ID_AMD_OPEN_SOURCE</span>
|
||||||
|
<span class="w"> </span><span class="n">driverName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">AMD</span><span class="w"> </span><span class="n">open</span><span class="o">-</span><span class="n">source</span><span class="w"> </span><span class="n">driver</span>
|
||||||
|
<span class="w"> </span><span class="n">driverInfo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">2023.</span><span class="n">Q1</span><span class="o">.</span><span class="mi">3</span><span class="w"> </span><span class="p">(</span><span class="n">LLPC</span><span class="p">)</span>
|
||||||
|
<span class="w"> </span><span class="n">conformanceVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">1.3</span><span class="o">.</span><span class="mf">0.0</span>
|
||||||
|
<span class="w"> </span><span class="n">deviceUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span>
|
||||||
|
<span class="w"> </span><span class="n">driverUUID</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">414</span><span class="n">d442d</span><span class="o">-</span><span class="mi">4</span><span class="n">c49</span><span class="o">-</span><span class="mf">4e55</span><span class="o">-</span><span class="mi">582</span><span class="n">d</span><span class="o">-</span><span class="mi">445256000000</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>The most important bits are:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>Kernel driver in use: amdgpu</code></li>
|
||||||
|
<li><code>direct rendering: Yes</code></li>
|
||||||
|
<li>that <code>vulkaninfo</code> doesn't produce any errors</li>
|
||||||
|
</ul>
|
||||||
|
<h3>Wine and other software packages</h3>
|
||||||
|
<p>These are my current useflags:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine: <code>+abi_x86_32 +abi_x86_64 +proton</code></li>
|
||||||
|
<li>wine-staging: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +usb +vulkan +xcomposite -wow64</code></li>
|
||||||
|
<li>wine-proton: <code>+X +abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mingw +mono +nls +opengl +pulseaudio +sdl +ssl +strip +truetype +unwind +vulkan +xcomposite -wow64</code></li>
|
||||||
|
<li>[ ] wine-vanilla: <code>+abi_x86_32 +abi_x86_64 +fontconfig +gecko +gstreamer +mono +nls +pulseaudio +sdl +ssl +strip +unwind +usb +video_cards_amdgpu +xcomposite -wow6</code>
|
||||||
|
Notice that I am targeting all WINE packages in order to test slightly different configurations. Use <code>eselect wine</code> to switch between versions.
|
||||||
|
Until the Gentoo devs says that wow64 feature is stable and fully functional, I will keep it off.</li>
|
||||||
|
</ul>
|
||||||
|
<p>I have enable the <code>abi_x86_32</code> use flag for many packages, probably more than needed. This is to ensure that I avoid problems related to my configuration. Enabling the flag globally seems like a waste of cpu and disk.</p>
|
||||||
|
<p>These are the additional WINE related packages that I installed:</p>
|
||||||
|
<ul>
|
||||||
|
<li>app-emulation/winetricks: <code>+gtk +rar</code></li>
|
||||||
|
<li>app-emulation/vkd3d-proton: <code>+abi_x86_32 +strip</code></li>
|
||||||
|
<li>app-emulation/dxvk: <code>+d3d10 +d3d11 +d3d9 +dxgi +strig +abi_x86_32</code></li>
|
||||||
|
</ul>
|
||||||
|
<p>GPU related packages:</p>
|
||||||
|
<ul>
|
||||||
|
<li>dev-util/DirectXShaderCompiler: necessary for proper directX support with vulkan</li>
|
||||||
|
<li>media-libs/vulkan-loader: <code>+X +abi_x86_32 +layers</code></li>
|
||||||
|
<li>dev-util/vulkan-tools: <code>+X</code></li>
|
||||||
|
<li>media-libs/amdgpu-pro-vulkan: <code>+abi_x86_32 +video_cards_amdgpu</code></li>
|
||||||
|
<li>media-libs/amdvlk: <code>+abi_x86_32 +raytracing</code> but I am not sure my gpu supports raytracing</li>
|
||||||
|
<li>media-libs/shaderc</li>
|
||||||
|
</ul>
|
||||||
|
<p>I am using spectrwm as my windows manager. It is not the best option and I would suggest to use a more featured DE.
|
||||||
|
This is an example of an innocous error that is caused by spectrwm when using WINE:</p>
|
||||||
|
<div class="code"><pre class="code literal-block"><span class="n">ERROR</span><span class="p">:</span><span class="w"> </span><span class="n">ld</span><span class="o">.</span><span class="n">so</span><span class="p">:</span><span class="w"> </span><span class="n">object</span><span class="w"> </span><span class="s1">'/usr/lib64/libswmhack.so.0.0'</span><span class="w"> </span><span class="n">from</span><span class="w"> </span><span class="n">LD_PRELOAD</span><span class="w"> </span><span class="n">cannot</span><span class="w"> </span><span class="n">be</span><span class="w"> </span><span class="n">preloaded</span><span class="w"> </span><span class="p">(</span><span class="n">wrong</span><span class="w"> </span><span class="n">ELF</span><span class="w"> </span><span class="k">class</span><span class="p">:</span><span class="w"> </span><span class="n">ELFCLASS64</span><span class="p">):</span><span class="w"> </span><span class="n">ignored</span><span class="o">.</span>
|
||||||
|
</pre></div>
|
||||||
|
|
||||||
|
<p>Consider that WMs need a compositor to avoid some clashes with WINE. I am using x11-misc/picom with drm and opengl support.</p>
|
||||||
|
<h3>Using WINE</h3>
|
||||||
|
<p>If you have no clue about how WINE works, start by reading the <a href="https://wiki.winehq.org/FAQ#Wineprefixes">FAQs</a>.</p>
|
||||||
|
<p>The biggest considerations you have to make when using WINE are the
|
||||||
|
software dependencies of the Windows program you want to use. For the
|
||||||
|
moment I have been able to survive with only two prefixes, one for 32
|
||||||
|
bits games and one for more recent software.</p>
|
||||||
|
<p>What all of this means, is that I have two folders in my home, <code>.wine</code> and <code>.wine32</code> in which I instruct WINE to start a new program using the environment variable (that is what WINEPREFIX is all about). When I feel lazy, I select the WINE prefix using winetricks, then navigate to the game using explorer.exe.</p>
|
||||||
|
<p>It's important to remember that whenever you create a new WINE prefix, you need to symlink the correct directx dependencies, as the Gentoo ebuilds suggests:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>WINEPREFIX=/home/user/.wine setup_vkd3d_proton.sh install --symlink</code> for directx12</li>
|
||||||
|
<li><code>WINEPREFIX=/home/user/.wine setup_dxvk.sh install --symlink</code> for directx11 and earlier</li>
|
||||||
|
</ul>
|
||||||
|
<p>Usually WINE takes care of starting up necessary processes inside the
|
||||||
|
prefixes. This is done by the <code>wineboot</code> program so I suggest to read
|
||||||
|
its manpage.</p>
|
||||||
|
<p>To install software dependencies, I use winetricks. If a dependency is
|
||||||
|
not available through winetricks, it's always possible to install the
|
||||||
|
.exe as you would on Windows. Take in mind that WINE uses some Linux
|
||||||
|
specific software in place of some Windows libraries. Some key replacements include:</p>
|
||||||
|
<ul>
|
||||||
|
<li>wine-mono in place of dotnet</li>
|
||||||
|
<li>dxvk and vkd3d in place of directx</li>
|
||||||
|
<li>gallium-nine and wined3d, in place of directx but I had better experience with dxvk and vkd3d</li>
|
||||||
|
<li>wine-gecko in place of whatever web view IE was offering</li>
|
||||||
|
<li>wineconsole in place of the Windows cmd program</li>
|
||||||
|
<li>your dotnet installation is usually enough for WINE, you don't need
|
||||||
|
to install the dotnet runtimes, although I have to check this assertion on a
|
||||||
|
fresh installation</li>
|
||||||
|
</ul>
|
||||||
|
<h4>Dependencies rules of thumb</h4>
|
||||||
|
<ol>
|
||||||
|
<li>lots of games prompt you to install dependencies such as directx. Avoid it as much as possible and rely on WINE specific libraries</li>
|
||||||
|
<li>winetricks can manage most if not all of those dependencies for you. It will save you time to figure out the correct paths for each library and automate the install as much as possible</li>
|
||||||
|
<li>recent games usually want the Visual C++ libraries. You can install them all with the vcrun2022 package </li>
|
||||||
|
<li>older games usually want Visual C++ libraries, but you need to install the different yearly versions one by one</li>
|
||||||
|
<li>you can backup or modify the winetricks installers. They are in you cache directory, usually <code>~/.cache/winetricks</code></li>
|
||||||
|
</ol>
|
||||||
|
<h4>Debugging</h4>
|
||||||
|
<p>In all honesty, it's too early in this journey to write a comprehensive chapter on this topic. The <code>winedbg</code> command is still shrouded in mystery.</p>
|
||||||
|
<p>At the moment I am keeping a small set of games that are self contained and allows me to check if WINE inside the wineprefix is working as I expect.</p>
|
||||||
|
<p>I have uploaded some mostly self contained demos that you can use to test that directx and you GPU is working as it should:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/UnrealEngine4%20tech%20demo%20for%20directx12">https://archive.org/details/elemental-demo-dx-12-guru-3-d.com</a></li>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/the%20same%20demo,%20but%20for%20directx11">https://archive.org/details/ue-4-elemental-demo</a></li>
|
||||||
|
<li><a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20v1.1ATI%20Radeon%209700%20Debevec%20RNL%20Demo%20for%20directx9">https://archive.org/details/ati-radeon-9700-debevec-rnl-demo-v-1.1.7z</a></li>
|
||||||
|
</ul>
|
||||||
|
<p>You can find more video card demos at <a href="francescomecca.eu/blog/2024/2/28/wine-gentoo/soggi.org">https://soggi.org/video-cards/tech-demos.htm</a>.</p>
|
||||||
|
<p>For controllers, you can use two tools:</p>
|
||||||
|
<ul>
|
||||||
|
<li><code>wine dxdiag</code> that launches the directx toolbox, useful not only for the gpu, but also for audio and input devices</li>
|
||||||
|
<li><code>wine control joy.cpl</code>, a cool utility to see your XInput and DInput compatible hardware</li>
|
||||||
|
</ul></description><category>Gentoo</category><category>linux</category><category>videogames</category><guid>francescomecca.eu/blog/2024/2/28/wine-gentoo/</guid><pubDate>Wed, 28 Feb 2024 00:00:00 GMT</pubDate></item><item><title>About Perl packages in Gentoo</title><link>francescomecca.eu/blog/2015/9/11/about-perl-packages-in-gentoo/</link><dc:creator>Francesco Mecca</dc:creator><description><p>In this post I wish to explain a bit about Perl related ebuilds in Gentoo and how to update from perl-core to virtual/perl without conflicts.</p>
|
||||||
<p>First of all the core distribution of Perl is included in <a href="https://packages.gentoo.org/package/dev-lang/perl">dev-lang/Perl</a> along with <a href="http://perldoc.perl.org/index-modules-A.html">modules</a>.</p>
|
<p>First of all the core distribution of Perl is included in <a href="https://packages.gentoo.org/package/dev-lang/perl">dev-lang/Perl</a> along with <a href="http://perldoc.perl.org/index-modules-A.html">modules</a>.</p>
|
||||||
<p>The <a href="https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/perl-core/">perl-core category</a> in portage contains ebuilds for perl modules, some of which are included in the core perl distibution. The perl-core ebuilds overrides the perl-core modules such that you can update them without recompiling dev-lang/Perl.</p>
|
<p>The <a href="https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/perl-core/">perl-core category</a> in portage contains ebuilds for perl modules, some of which are included in the core perl distibution. The perl-core ebuilds overrides the perl-core modules such that you can update them without recompiling dev-lang/Perl.</p>
|
||||||
<p>Each perl-core module has a corrensponding virtual/perl-* package. The virtual category is used by portage when emerging to take into account that a module can be either provided by dev-lang/perl package or found in perl-core category.</p>
|
<p>Each perl-core module has a corrensponding virtual/perl-* package. The virtual category is used by portage when emerging to take into account that a module can be either provided by dev-lang/perl package or found in perl-core category.</p>
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
|
|
||||||
</header><ul class="postlist">
|
</header><ul class="postlist">
|
||||||
<li>
|
<li>
|
||||||
|
<time class="listdate" datetime="2024-02-28T00:00:00Z" title="2024-02-28 00:00">2024-02-28 00:00</time><a href="../../blog/2024/2/28/wine-gentoo/" class="listtitle">Playing videogames with WINE on Gentoo</a><a></a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
<time class="listdate" datetime="2015-09-11T12:52:25Z" title="2015-09-11 12:52">2015-09-11 12:52</time><a href="../../blog/2015/9/11/about-perl-packages-in-gentoo/" class="listtitle">About Perl packages in Gentoo</a><a></a>
|
<time class="listdate" datetime="2015-09-11T12:52:25Z" title="2015-09-11 12:52">2015-09-11 12:52</time><a href="../../blog/2015/9/11/about-perl-packages-in-gentoo/" class="listtitle">About Perl packages in Gentoo</a><a></a>
|
||||||
</li>
|
</li>
|
||||||
</ul></article><footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
</ul></article><footer class="site-footer" id="footer"><span> CC BY-SA 4.0 International.<br></span>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Giornalismo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/giornalismo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dodici brevi domande sul mondo del giornalismo nell&#8217;era digitale</title><link>francescomecca.eu/blog/2015/7/7/dodici-brevi-domande-sul-mondo-del-giornalismo-nellera-digitale/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa </span></h5>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Giornalismo)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/giornalismo.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:25 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Dodici brevi domande sul mondo del giornalismo nell&#8217;era digitale</title><link>francescomecca.eu/blog/2015/7/7/dodici-brevi-domande-sul-mondo-del-giornalismo-nellera-digitale/</link><dc:creator>Francesco Mecca</dc:creator><description><h5><span style="font-size: large;">Premessa </span></h5>
|
||||||
<p>La Rivoluzione Digitale ha toccato la societa` in tutti i suoi aspetti, e fra questi ha anche minato le fondamenta di un settore, quello dell’informazione, alle fondamenta della nostra societa`.</p>
|
<p>La Rivoluzione Digitale ha toccato la societa` in tutti i suoi aspetti, e fra questi ha anche minato le fondamenta di un settore, quello dell’informazione, alle fondamenta della nostra societa`.</p>
|
||||||
<p>La decentralizzazione delle fonti di informazione, che avviene attraverso i blog e le piattaforme online, la micro messaggistica istantanea e i tweet, i social media, ma piu` in generale tutti gli strumenti che Internet ci offre, hanno mutato radicalmente non solo il modo di fare giornalismo, ma il rapporto del cittadino digitale con l’informazione cartacea e digitale.</p>
|
<p>La decentralizzazione delle fonti di informazione, che avviene attraverso i blog e le piattaforme online, la micro messaggistica istantanea e i tweet, i social media, ma piu` in generale tutti gli strumenti che Internet ci offre, hanno mutato radicalmente non solo il modo di fare giornalismo, ma il rapporto del cittadino digitale con l’informazione cartacea e digitale.</p>
|
||||||
<p>Per questo abbiamo posto 12 domande a <a href="https://twitter.com/cidigi">Carla De Girolamo</a>, vicecaporedattore di <a href="http://panorama.it/">Panorama</a>, basandoci sulle parole di <a href="http://blog.debiase.com/">Luca de Biase</a>, il quale <a href="https://www.youtube.com/watch?v=6al_1ELORXk">afferma</a> che nel mondo dell’editoria la Rivoluzione Digitale e` stata una rivoluzione di tre nature: Francese, Copernica e Industriale.</p>
|
<p>Per questo abbiamo posto 12 domande a <a href="https://twitter.com/cidigi">Carla De Girolamo</a>, vicecaporedattore di <a href="http://panorama.it/">Panorama</a>, basandoci sulle parole di <a href="http://blog.debiase.com/">Luca de Biase</a>, il quale <a href="https://www.youtube.com/watch?v=6al_1ELORXk">afferma</a> che nel mondo dell’editoria la Rivoluzione Digitale e` stata una rivoluzione di tre nature: Francese, Copernica e Industriale.</p>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about guida)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/guida.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Guida pratica a LUKS</title><link>francescomecca.eu/blog/2015/6/1/guida-pratica-a-luks/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about guida)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/guida.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:27 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Guida pratica a LUKS</title><link>francescomecca.eu/blog/2015/6/1/guida-pratica-a-luks/</link><dc:creator>Francesco Mecca</dc:creator><description><blockquote>
|
||||||
<p></p><div style="text-align: left;">
|
<p></p><div style="text-align: left;">
|
||||||
<i>“When privacy is outlawed, only outlaws will have privacy”</i>
|
<i>“When privacy is outlawed, only outlaws will have privacy”</i>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about hacker news)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/hacker-news.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about hacker news)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/hacker-news.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
||||||
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,3 +1,3 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about handbrake)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/handbrake.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about handbrake)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/handbrake.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Late Stage Capitalism meets FOSS</title><link>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</link><dc:creator>Francesco Mecca</dc:creator><description><p><img alt="brainwashing" src="francescomecca.eu/wp-content/uploads/2017/hn_handbrake_hack.jpg"></p>
|
||||||
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
<p><a href="http://archive.is/XA3rj">source</a></p></description><category>apple</category><category>hacker news</category><category>handbrake</category><category>PesceWanda</category><category>propaganda</category><category>vendor lockin</category><guid>francescomecca.eu/blog/2017/5/7/latestage_handbrake/</guid><pubDate>Sun, 07 May 2017 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about HID arduino)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/hid-arduino.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about HID arduino)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/hid-arduino.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arduino Uno as HID keyboard</title><link>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Turin is the hometown of Arduino. I have been at the <a href="http://fablabtorino.org/">fablab</a> multiple times but I had to come all the way to America to get my hands on a simple Arduino Uno.</p>
|
||||||
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
<p>For 60$ I bought a cheap (but still good!) mechanical keyboard by Qisan, a clone of the Arduino Uno and a USB host shield.</p>
|
||||||
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
<p>Given that is 3 years since I have been using a dvorak layout and it's a pain to change layout on every machine that you have to use.
|
||||||
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
You can imagine that given this three pieces of hardware together I put together an hardware key mapper for the keyboard.</p>
|
||||||
|
@ -37,10 +37,11 @@ Every time you want to flash a new firmware the Arduino must be put in DFU mode
|
||||||
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
To do that simply create a shortcircuit using a small metal wire on the two pins near the reset button and a led will blink.
|
||||||
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
This <a href="https://www.youtube.com/watch?v=E8XyRwXQr8Q">video</a> shows the method briefly (no real need for a jumper).
|
||||||
The commands are the following and there is no risk to brick the Uno:</p>
|
The commands are the following and there is no risk to brick the Uno:</p>
|
||||||
<pre class="code literal-block">dfu-programmer atmega16u2 erase
|
<div class="code"><pre class="code literal-block">dfu-programmer atmega16u2 erase
|
||||||
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
dfu-programmer atmega16u2 flash Arduino-keyboard-0.2.hex
|
||||||
dfu-programmer atmega16u2 reset
|
dfu-programmer atmega16u2 reset
|
||||||
</pre>
|
</pre></div>
|
||||||
|
|
||||||
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
<p>After each flashing the device needs to be disconnected once. Of course you can flash the original firmware back. It is included in my repo or on the official ones.</p>
|
||||||
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
<p><img alt="Arduino and the shield" src="francescomecca.eu/wp-content/uploads/2016/IMG_20160706_011143.jpg"></p>
|
||||||
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
<p>That's it, as you can see is not difficult at all. The worst part is gathering the various info that are left dormant in blogs or forums.</p></description><category>Arduino</category><category>arduino uno</category><category>HID arduino</category><category>mechanical keyboard</category><category>PesceWanda</category><category>programming</category><guid>francescomecca.eu/blog/2016/7/5/arduino_keyboard/</guid><pubDate>Tue, 05 Jul 2016 00:00:00 GMT</pubDate></item></channel></rss>
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about huang)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/huang.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Il Big Bang dei Big Data</title><link>francescomecca.eu/blog/2015/4/5/il-big-bang-dei-big-data/</link><dc:creator>Francesco Mecca</dc:creator><description><p>“Perche` sto puntando tutto sul deep learning? Perche’ sara` il nuovo Big Bang”</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about huang)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/huang.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Il Big Bang dei Big Data</title><link>francescomecca.eu/blog/2015/4/5/il-big-bang-dei-big-data/</link><dc:creator>Francesco Mecca</dc:creator><description><p>“Perche` sto puntando tutto sul deep learning? Perche’ sara` il nuovo Big Bang”</p>
|
||||||
<p>Cosi` ha parlato il CEO di Nvidia Jensen Huang il 3 marzo scorso alla sua <a href="http://www.gputechconf.com/">GTC 2015</a>.<br>
|
<p>Cosi` ha parlato il CEO di Nvidia Jensen Huang il 3 marzo scorso alla sua <a href="http://www.gputechconf.com/">GTC 2015</a>.<br>
|
||||||
L’attenzione di Huang si e` concentrata sul deep learning e come le deep neural networks negli ultimi anni abbiano compiuto progressi impressionanti tali da superare il cervello umano nei test di analisi immagine.</p>
|
L’attenzione di Huang si e` concentrata sul deep learning e come le deep neural networks negli ultimi anni abbiano compiuto progressi impressionanti tali da superare il cervello umano nei test di analisi immagine.</p>
|
||||||
<p>Molta della ricerca negli ultimi anni, in particolare dal 2012 ad oggi, si sta concentrando sul programmare algoritmi tali da consentire alle intelligenze artificiali di processare dati in maniera gerarchica e organizzata tramite l’apprendimento progressivo dei livelli di rappresentazione.<br>
|
<p>Molta della ricerca negli ultimi anni, in particolare dal 2012 ad oggi, si sta concentrando sul programmare algoritmi tali da consentire alle intelligenze artificiali di processare dati in maniera gerarchica e organizzata tramite l’apprendimento progressivo dei livelli di rappresentazione.<br>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about identità)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/identita.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:18 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about identità)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/identita.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>La taglia unica del Web 2.0</title><link>francescomecca.eu/blog/2015/6/1/la-taglia-unica-del-web-2-0/</link><dc:creator>Francesco Mecca</dc:creator><description><p><a href="https://www.youtube.com/embed/e3Zs74IH0mc?feature=player_embedded">In questo discorso</a> al summit Web 2.0 del 2011 Chris Poole, il fondatore di 4chan, riflette sul concetto di identita` e di come stia cambiando con l’introduzione del Web 2.0.</p>
|
||||||
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
<p>Nel mare di Internet assistiamo a due spiagge molto lontane che delimitano lo spazio della nostra attivita`: l’anonimato e l’identita` virtuale (che ci identifica nel mondo reale).</p>
|
||||||
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
<p>E` un po` come misurare i due poli opposti, Facebook e Google Plus che richiedono il tuo nome vero e quindi ogni attivita` online e` un riflesso del proprio io reale, e 4chan, una delle poche risorse anonime nel Web che permette a ciascun utente di fare post anonimi e discutere quindi senza una forma di censura.</p>
|
||||||
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
<h4><span style="font-size: large;"><span style="font-weight: normal;"> </span></span></h4>
|
||||||
|
|
|
@ -185,6 +185,7 @@
|
||||||
<li><a class="reference listtitle" href="vaporwave/">vaporwave</a></li>
|
<li><a class="reference listtitle" href="vaporwave/">vaporwave</a></li>
|
||||||
<li><a class="reference listtitle" href="vendor-lockin/">vendor lockin</a></li>
|
<li><a class="reference listtitle" href="vendor-lockin/">vendor lockin</a></li>
|
||||||
<li><a class="reference listtitle" href="video-omicidio/">video omicidio</a></li>
|
<li><a class="reference listtitle" href="video-omicidio/">video omicidio</a></li>
|
||||||
|
<li><a class="reference listtitle" href="videogames/">videogames</a></li>
|
||||||
<li><a class="reference listtitle" href="virginia-omicidio/">Virginia omicidio</a></li>
|
<li><a class="reference listtitle" href="virginia-omicidio/">Virginia omicidio</a></li>
|
||||||
<li><a class="reference listtitle" href="virtualperl/">virtual/perl</a></li>
|
<li><a class="reference listtitle" href="virtualperl/">virtual/perl</a></li>
|
||||||
<li><a class="reference listtitle" href="web-20/">web 2.0</a></li>
|
<li><a class="reference listtitle" href="web-20/">web 2.0</a></li>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about instant messaging)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/instant-messaging.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Phone messaging apps comparison</title><link>francescomecca.eu/blog/2016/7/6/im-services/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I made this chart for a presentation at the <a href="https://cyber.law.harvard.edu/">Berkman Klein Center</a></p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about instant messaging)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/instant-messaging.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Phone messaging apps comparison</title><link>francescomecca.eu/blog/2016/7/6/im-services/</link><dc:creator>Francesco Mecca</dc:creator><description><p>I made this chart for a presentation at the <a href="https://cyber.law.harvard.edu/">Berkman Klein Center</a></p>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Intelligenze artificiali)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/intelligenze-artificiali.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 30 Aug 2023 15:57:17 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Può un sottomarino nuotare? Deep learning e intelligenze artificiali</title><link>francescomecca.eu/blog/2015/7/21/puo-un-sottomarino-nuotare-deep-learning-e-intelligenze-artificiali/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel <a href="https://en.wikipedia.org/wiki/De_Arte_Combinatoria">De Arte Combinatoria</a> (1666) Leibniz afferma che tutta la logica del pensiero umano non sia altro che una combinazione di pensieri piu` piccoli che a loro volta possono essere frammentati in idee semplicissime e concatenabili.</p>
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about Intelligenze artificiali)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/intelligenze-artificiali.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Può un sottomarino nuotare? Deep learning e intelligenze artificiali</title><link>francescomecca.eu/blog/2015/7/21/puo-un-sottomarino-nuotare-deep-learning-e-intelligenze-artificiali/</link><dc:creator>Francesco Mecca</dc:creator><description><p>Nel <a href="https://en.wikipedia.org/wiki/De_Arte_Combinatoria">De Arte Combinatoria</a> (1666) Leibniz afferma che tutta la logica del pensiero umano non sia altro che una combinazione di pensieri piu` piccoli che a loro volta possono essere frammentati in idee semplicissime e concatenabili.</p>
|
||||||
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
<table class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;" cellspacing="0" cellpadding="0" align="center">
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: center;">
|
<td style="text-align: center;">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about internet)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/internet.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Thu, 31 Aug 2023 10:13:31 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Three years later</title><link>francescomecca.eu/blog/2023/08/12/three-years-later/</link><dc:creator>Francesco Mecca</dc:creator><description><p>More than three years have passed since my last blogpost. I used
|
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Caught in the Net (Posts about internet)</title><link>francescomecca.eu</link><description></description><atom:link href="francescomecca.eu/categories/internet.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 <a href="mailto:francescomecca.eu">Francesco Mecca</a> </copyright><lastBuildDate>Wed, 28 Feb 2024 09:29:26 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Three years later</title><link>francescomecca.eu/blog/2023/08/12/three-years-later/</link><dc:creator>Francesco Mecca</dc:creator><description><p>More than three years have passed since my last blogpost. I used
|
||||||
to believe that a more hectic life would provide me with a
|
to believe that a more hectic life would provide me with a
|
||||||
surplus of things to write about. While that holds true, the flip side
|
surplus of things to write about. While that holds true, the flip side
|
||||||
is that I now find myself with less and less time for writing.</p>
|
is that I now find myself with less and less time for writing.</p>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue