<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by giuseppe de marco on Medium]]></title>
        <description><![CDATA[Stories by giuseppe de marco on Medium]]></description>
        <link>https://medium.com/@demarco.giu?source=rss-15705ec66467------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*B21-IWOqG8HaO49r79gxhA.jpeg</url>
            <title>Stories by giuseppe de marco on Medium</title>
            <link>https://medium.com/@demarco.giu?source=rss-15705ec66467------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 15:37:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@demarco.giu/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To Not Get Stucked With Docker]]></title>
            <link>https://medium.com/@demarco.giu/how-to-not-get-stucked-with-docker-3cd500613cde?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cd500613cde</guid>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 13:31:59 GMT</pubDate>
            <atom:updated>2023-12-06T13:31:59.495Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, you understood the Docker tech.</p><p>You created your first image.</p><p>You started your first container.</p><p>But, what? Nothing is happening. You then run:</p><pre>docker ps</pre><p>And…empty!</p><p>Where are your containers?</p><p>First thing first.</p><ol><li>Check if the containers exited. Show all containers, also those exited:</li></ol><pre>docker ps -a</pre><p>If your cointainer exited, you have to understand why. Try to start the container in interactive mode:</p><pre>docker run -dit &lt;your image&gt; --name &lt;a funny name&gt;</pre><p>2. Then try to enter inside the container:</p><pre>docker exec -it &lt;the funny name&gt; bash</pre><p>In this way you could check what is happening.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cd500613cde" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Servers To Services]]></title>
            <link>https://medium.com/@demarco.giu/from-servers-to-services-88667afa3f3a?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/88667afa3f3a</guid>
            <category><![CDATA[single-responsibility]]></category>
            <category><![CDATA[services]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Sat, 21 Oct 2023 07:37:41 GMT</pubDate>
            <atom:updated>2023-10-23T07:12:56.963Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2GI91emL_jQnsTZYbfUyA.jpeg" /></figure><p>Suppose you build an awesome Web application which works hand-by-hand with a mysql database. You used some ORM and coded all the data models in your codebase.</p><p>Well.</p><blockquote>What happen if the database of your app must be accessed also by other services?</blockquote><p>For example, in your database (DB) you have a table called <strong>Payments </strong>which lists all the payments to do to your employees. You wrote a service in <em>python </em>to crunch all the payments and check for duplicates or some strange values (better to not pay lesser than due!).</p><p>No problem. You have two ways: 1) connect to DB from your python code or 2) expose an endpoint into the Web app which retrieves the table’s data.</p><p>So far so good.</p><blockquote>But what happens if you realize that you need a change in the <strong>Payments </strong>table?</blockquote><p>For example, you would put a custom field to track the validity of the payment.</p><p>You have two ways. 1) Ask the guy who wrote the web app (maybe yourself!) to change the DB schema for that table. Or, 2) do it yourself if you have full permission to the database. In both ways, this breaks the <strong>responsibility principle</strong>: Only one entity should be in charge to change one thing.</p><p>Things get worse if you, the Web app developer, decide to change or eliminate some table. You should call the python guys (yourself) and tell them: “<em>Eh guys I just delete this tabl</em>e”.</p><p>This again breaks the <strong>single responsibility principle</strong> and it is unaffordable in contexts where you have tens of services or tens of guys.</p><blockquote>The solution? <strong>Use services, not servers</strong>. Introduce a service, or a microservice, which is the only interface to the DB.</blockquote><p>The service will have some (REST)endpoints, well documented and versioned. Changes underneath the DB will be hidden to others.</p><p>In this way, you can have multiple versions of the service and you have not to worry about to communicate the schema changes or allow DB access to other teams, reducing the risk of DB corruption made by other teams (trust me: it happens!)</p><p>A typical example is BigQuery. The ML team needs data. The Web team needs data. The Optimization team needs data. The brutal solution would be give to every team access to BigQuery service of GCP. This increases DB corruption risk,indeed; similarly, some team might be tempted to introduce nonwellformed queries (and they cost a lot if not written in the right way!), and so on.</p><blockquote>The solution? From server to service:</blockquote><p>Make a microservice which is the only interface to the BigQuery engine. All other teams will interact with this service.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=88667afa3f3a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why You Shoul’d Not Accept Coding Projects or Tests for Your Interview — Except Google]]></title>
            <link>https://medium.com/@demarco.giu/why-you-should-not-accept-coding-projects-or-tests-for-your-interview-except-google-8985b2ed0bcd?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/8985b2ed0bcd</guid>
            <category><![CDATA[code-interview]]></category>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Fri, 08 Jul 2022 13:53:51 GMT</pubDate>
            <atom:updated>2023-05-10T10:19:32.392Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why You Shoul’d Not Accept Coding Projects Tests for Your Interview — Except Google</h3><p>Simple said, because no one will pay for the time you’ll consume on your homeworks but yourself.</p><p>Once, I decided to explore other job opportunities — and there are a lot, really. So, I applied to a couple of big enterprises (multinational).</p><p>Some of them replied to me positevely. But: I was asked to solve a coding project in a couple of days. Another one said that I have to pass an on-line test.</p><p>Well, with a high demanding daily job, it was really unresponsible to find the time to do both. But, I love challenges, so I eventually cut some spare time from my absent spare time.</p><p>Tests were not so difficult — I admit, I had to brush out some my knowledge of Computer Science, but at the end I did it.</p><p>Surpise of surprise: the day before the first interview call, an email said “We are sorry but we have decided to not move forward to your application….bla bla bla…”</p><p>You made your best to succeed; you made room for your code challenging, and for what? For nothing! Just for the glory.</p><p>And to say the truth: If you have not had the opportunity to exercise yourself with code optimization, complexity, scaling problem of algorithms,it is quite to switch your mind from daily work to different and abstract world.</p><p>So, in my opinion, except you are committed to work for Google or similar ones, go ahead with your life and enjoy what you have.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8985b2ed0bcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Best Book on Machine Learning]]></title>
            <link>https://medium.com/@demarco.giu/the-best-book-on-machine-learning-942f5dd476c5?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/942f5dd476c5</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[book-review]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Fri, 06 Mar 2020 09:02:33 GMT</pubDate>
            <atom:updated>2023-10-21T07:43:15.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*k_XGujo0zu2H6PLz565V3w.png" /><figcaption><a href="https://d2l.ai/">https://d2l.ai/</a></figcaption></figure><p>Ladies and gentlemen, eventually I found the best book on Machine and Deep Learning.</p><p>Recently, I was seeking for a book able to gain my “wow!” moment, a book to rule them all, a book for engineers, one you could find in universities.</p><p>It was challenging, because in this field there are a great many inventions I’d say daily!.</p><p>Of course, I read books by: Bengio et al., Guillet, Bishop, and so on.</p><p>But, honestely, they are either too much abstract or practical. We engineers are not coders or developers! We need to 1) understand the problem and 2) having a smattering of available tools.</p><p>I found it! And what a shame not getting it some say 6 months ago.</p><p>The only weakness is that it is not an hardcopy book…but it would be unfeasible printing 1000 pages of a book which is constantly updated….</p><p>So: if you are an engineer like me, forget Coursera, forget Bengio, forget Manning and start with this book first.</p><p>https://d2l.ai/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=942f5dd476c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dumb Smart Home]]></title>
            <link>https://medium.com/@demarco.giu/dumb-smart-home-4fbcc813c962?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/4fbcc813c962</guid>
            <category><![CDATA[smart-home]]></category>
            <category><![CDATA[energy]]></category>
            <category><![CDATA[climate-change]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Sat, 19 Jan 2019 10:29:48 GMT</pubDate>
            <atom:updated>2020-06-11T07:50:10.731Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*HVztmXs2lP_ZczdxNN5xoQ.jpeg" /></figure><p>The Smart Home: Well everyone knows what I’am talking about. Nice.</p><p>But, from which point of view your smart home is so smart? Let me analyze it.</p><h3>Energy saving</h3><p>With your smartphone you can control the opening of windows, the brightness of lamps, the scheduling of your fans and so on. You could tell your smart controller to dim down lamps and heaters when nobody is present in some rooms. Good. In this way you can reduce joules consumption and the planet will appreciate that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*InE6A7lreaF2L-fDnn95AQ.jpeg" /><figcaption>Smart Home requires very costly devices.</figcaption></figure><p>But, wait a minute: I have to install an hub or a gateway to control the smart devices; I have to install additional (and costly) devices which consume energy; I have to replace their batteries sometimes, and so on. So, in order to reduce the energy consumption, I have to spend more energy (and more money)!</p><p>Clearly, we are talking of a very lazy inhabitant who can’t afford to walk one meter and switch off his appliances. In this case, the smart home could be called “home for stupid men”. In this case, the smart home will reduce the impact of having such a men: Instead of 2kWh, he will consume much lesser.</p><h3>Comfort vs Energy</h3><p>OK. But for normal operations? For example. let assume that I installed a smart switch to turn on/off my TV from the bed. In this case, there is no benefit from the energy point of view because I consume more (at least I have to consider the stand by or sleeping energy consumed by the devices AND SURE by the hub).</p><blockquote>Smart Home is not so smart from the energy point view. Think about it.</blockquote><p>It adds some marginal efficiency control but with high costs which, if we consider the global impact by scaling the number users, we must consider also the cost and the damage of increased production, increased e-waste management, and so on.</p><h3>Climate Change</h3><p>Smart Home is another bad solution (like electric cars) to real problems (like climate change) and it is has never been considered as a candidate to climate related problems. See the works by <a href="https://en.wikipedia.org/wiki/Vaclav_Smil">Vaclav Smil</a> for a better understanding of what I’am talking about.</p><p>For the curious, and in regard of finding new solutions to the problem of climate change related to energy resources, I suggest also to read carefully the following well written reports.</p><p>[<a href="https://spectrum.ieee.org/energy/environment/a-critical-look-at-claims-for-green-technologies">A Critcial Look at Claims for Green Technologies</a>, V. Smil, IEEE Spectrum 2018]</p><p>[<a href="https://spectrum.ieee.org/static/special-report-blueprints-for-a-miracle">Blueprints for a Miracle</a>, IEEE Spectrum Special Report, Jun 2018]</p><p>Smart building is another story.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/232/1*hB_5saFPcVF4BPdG2mOGyQ.jpeg" /><figcaption>IEEE Blueprints for a miracle, report.</figcaption></figure><h3>My Two Cents Solution</h3><p>Very simple. We must consume lesser. Instead of having two cars, let use one. Instead of buying everything from Amazon every day, try to find the same thing (if you really need it!) near to you. Instead of using your cars to make 100 meters, try to walk. Instead of using paper hanky, use the cloth tissue; instead of using per bottles, use glass bottles; instead of using plastic or disposable things, try to use re-usable ones. Instead of change your smartphone every year, don’t do it. Instead of buying chocolate, eat cookies. And, sure, instead of send every minute a useless and/or redundant (copy-pasted) picture of your life to social networks, take a breath, keep calm and enjoy the surroundings. Last and maybe foremost, instead to consume your dinner or launch at any industrial food chain like McDonalds, packed with mix of beaf or fish (?), try a pizza! Sane, enjoyable, sutainable!</p><p>But this is impossible to do, because our mass economy is radically based on consumption — of energy, of resources, of electricity and more importantly of food produced by animal (chicken, cows,…). The old economy was basically a local economy and parsimonious econmy with some exceptions and I think that it never will come back, unless some catastrophe (human or natural) will happen.</p><p><strong>Update</strong></p><p>During the 2020 CoVid lockdown, we see that a natural catastrophe can do a game change in the plante, indeed. The CO2 global production decreased by 5,5% in 3 months!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4fbcc813c962" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[La finde della politica moderna]]></title>
            <link>https://medium.com/@demarco.giu/la-finde-della-politica-moderna-319752819176?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/319752819176</guid>
            <category><![CDATA[politica]]></category>
            <category><![CDATA[menefrego]]></category>
            <category><![CDATA[migranti]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 06:53:45 GMT</pubDate>
            <atom:updated>2018-12-27T06:54:57.977Z</atom:updated>
            <content:encoded><![CDATA[<h3>La fine della politica moderna</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d5FYVbkbUufg_Spn.jpg" /><figcaption>La guerra, H. Rousseau</figcaption></figure><h3>Dove siamo</h3><p>In Italia — ma vale ovunque — assistiamo a un nuovo modello di demagogia. Il demagogo in generale è sempre stato un ignorante. Non è mai stato un uomo di buon senso, un mite, un letterato, un generoso. Abbiamo avuto re e regine con queste qualità, soprattutto nel Medioevo (parola orrenda che ancora oggi trae in inganno su un periodo sì controverso ma di grande innovazione!).</p><p>Il demagogo — che in gergo moderno, assomigliando più a un attore di palcoscenico, si potrebbe chiamare showman — si nutre della folla. Del consenso. Il volto del demagogo è il volto della sua folla. Siccome la folla è una bestia cieca senza coscienza, a volte, purtroppo, anche le parole e le azioni del demagogo somigliano alla tenebrosa fanciulla che cavalca questo bestia cieca, come nel quadro di Rousseau.</p><p>Oggi, nell’epoca in cui il 70% del traffico Internet è consumato dalla pornografia accessibile a tutti, ma proprio a tutti! e dove la gente — la gente comune, quella che fa la massa critica dei voti alle elezioni — sta circa 6 ore al giorno sui cosiddetti (a)social network, la politica fatta di confronto, dialogo, rispetto e cultura, è finita. I politici eletti, in sé, non hanno nulla (speriamo) di cattivo: essi rappresentano la massa. Essi — e se ne vantano — rappresentano la massa, i cosiddetti “milioni” di elettori che li hanno votati. Ed è proprio così. La massa dei “milioni” di elettori è la stessa massa di gente dell’epoca moderna, un’epoca radicata — forse per molto tempo ancora — nell&#39;individualismo pragmatista narcisista, e quindi edonista. In poche parole, il centro del mondo sono “io”, degli altri “menefrego”. Non a caso, in Italia, c’è stato un movimento cosiddetto rivoluzionario che portava la gente in piazza con i ben noti “vaffaday” (fuck days). Il ricorso a un gergo da postribolo la dice tutta sul senso di esasperazione frammisto a ignoranza di questa massa di “milioni di elettori”. I politici sono la sintesi televisiva di questa massa. Una massa affetta dall&#39;individualismo, la cui prima malattia è il cosiddetto FOMO, <em>Fear Of Missing Out</em>.</p><p>Grazie ai nostri cari nonni e bisnonni che hanno visto forse il massimo dell’orrore nel secolo ‘900, possiamo dire che il pericolo della dittatura imposta è quasi nullo, ma, di contro, il pericolo costante della dittatura generata è sempre vivo. La dittatura generata può nascere anche nelle più floride democrazie. Si guardi ad esempio alle varie invasioni belliche degli States operate negli ultimi venti anni. Le dittature generate sono le azioni legittimate da una parte del potere in nome di qualche principio superiore.</p><p>Le dittature generate sono il risultato più tangibile delle menzogne del potere, non esisterebbero senza una vera e propria arte della menzogna. Negli Stati Uniti ancora c’è l’associazione di Bin Laden dietro agli attacchi del 2001, così come ancora persiste l’associazione diffusa dei secoli bui (medioevo) all’assenza della mano divina nella storia. Basta dire una menzogna bene, per richiamare dal fondo degli abissi l’embrione dormiente della dittatura, che oggigiorno trova il terreno fertile della democrazia: ognuno ha diritto a parlare e a dire la sua. Ma certe idee non sono idee, ma crimini! Il <em>fascismo </em>non è un’idea è un <strong>crimine</strong>. Invadere un paese con armi pesanti non è guerra preventiva ma un crimine. Non accogliere dei disperati senza più nulla non è protezione dei confini ma pura crudeltà o incapacità a interpretare i segni dei tempi.</p><p>Demagogia, mezzi di comunicazione di massa, linguaggio acchiappa-tutto costituiscono il terreno fertile della dittatura generata. Per cui, la massa è permeata di uno stato di tensione e gli individui si trattano sempre più come minaccia reciproca. Più prosegue una società simile più il collasso è vicino, a meno di imprevisti, a meno di personalità impreviste come può essere il papa Francisco.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=319752819176" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quando il male minore è il peggiore]]></title>
            <link>https://medium.com/@demarco.giu/quando-il-male-minore-%C3%A8-il-peggiore-edd9dcc37ee8?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/edd9dcc37ee8</guid>
            <category><![CDATA[fascismo]]></category>
            <category><![CDATA[razzismo]]></category>
            <category><![CDATA[difesa]]></category>
            <category><![CDATA[male]]></category>
            <category><![CDATA[scontento]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Thu, 27 Dec 2018 05:37:44 GMT</pubDate>
            <atom:updated>2023-10-21T07:50:02.647Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*htmGhed2yib3T-0tHi6CsA.jpeg" /><figcaption>piazza Venezia</figcaption></figure><p>Occorre scendere giù, in fondo, nella valle, tra il popolo per capire che aria tira.</p><p>Eravamo in taxi, a Roma. Destinazione il bellissimo Pantheon. Passando da piazza Venezia, uno dei colleghi, il più giovane, con tutta la sua ingenuità di giovane, chiede al tassista: “<em>Dov’è il balcone da dove si affacciava il duce per dichiarare guerra?</em>”. Il tassista, prontamente, in romanesco, indica l’infame balcone. E aggiunge, in romanesco: <em>“Quello sì ch’era uno bono, altro che ‘sti zozzoni che stanno ar governo</em>”. E aggiunge altri epiteti che tralascio.</p><p>“La razzìa di ebrei nel ghetto romano se la ricorda?” aggiungo io, con la stessa prontezza.</p><p>“Ma che c’entra! So’ stati e’romani traditori a fa’ quello!”</p><p>“E per caso si ricorda anche le leggi razziali emanate e poi firmate dal re?”</p><p>“Che c’entra che c’entra…nun era perfetto, ma ha fatto tante cose bbone. Quarcuna non gl’e venuta. Ma ha fatto tante cose bbone”.</p><p>“Lo sa che lei, se ci fosse ancora il fascismo, non potrebbe esprimere queste idee? Non avrebbe addirittura la libertà di esprimerle, o di pubblicarle sui blog, o di leggerle sui giornali? Sa cos’è la libertà di pensiero, di parola, di stampa, di confessione? Ecco oggi lei non ce l’avrebbe”.</p><p>Il clima si era infuocato e si deve infuocare quando di fronte c’è una ignoranza arrogante. Ma vorrei riprendere il fatto, perché avevo notato — spero di sbagliarmi — una certa accondiscendenza dei miei colleghi verso il tassista. Per loro ho formulato questo esempio.</p><p>Supponiamo che venga a cena a casa vostra, su vostro gentile invito. Mi comporto bene, sto attento a rispettare tutte le norme del <em>savoir-faire</em>, tutti i modi gentili che si possono immaginare in casa d’altri; sono loquace e amabile nella conversazione; se uso il bagno, cerco di non lasciare nessun tipo di goccia fuori posto; eccetera eccetera. Ma prima di andarmene, sgozzo vostra madre. Ora, secondo il criterio dell’ignorante e del menefreghista arrogante di cui sopra io ho fatto, ipoteticamente, 99 cose buone e solo una orrenda. Se avessi fatto 100 azioni, ne avrei commesso solo una brutta. Il criterio del male minore vorrebbe che la passassi liscia. Molto probabilmente la famiglia che mi ha invitato non la penserà come voi. Il meno che potrebbe succedermi è un linciaggio in seduta stante con attrezzi da cucina.</p><p>Il criterio del “si stava meglio quando si stava peggio” non funziona, perché è un criterio frettoloso prodotto dall&#39;istinto di scontentezza materiale o, in casi ancora più gravi, dal puro gusto di protagonismo che cavalca la vibrazione adolescenziale del proibito. Il criterio del male minore è una pura crudeltà se il valore assoluto del male minore è maggiore della somma di tutti i mali potenziali in assenza dei benefici prodotti. Può avverarsi ancora, certo, il ricorso a questo criterio del male minore, e forse già sta accadendo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FX-JoCCTYn9mjqERudCTqw.jpeg" /><figcaption>Ministo dell Difesa italiana, Elisabbetta Trenta.</figcaption></figure><p>Ad esempio, per calmare la fame di contentezza materiale e di sicurezza psicologica si strumentalizza senza pietà il flusso disumano di persone inermi, affamate, misere, i cosiddetti migranti — come se fosse un sinonimo di viaggio di piacere. E’ bastata una parola messa in circolazione dai nostri politici: “invasione” per alimentare questo fuoco dell’intolleranza che pensavamo spento. Un’altro ministro, Trenta, ministro della Difesa ha addirittura detto questo pubblicamente: “<a href="https://www.tgcom24.mediaset.it/mondo/migranti-trenta-regolamentare-flussi-rischio-arrivino-jihadisti_3154041-201802a.shtml">migranti e terrorismo sono due facce della stessa medaglia”</a>. Il TG fa vedere solo una parte dell’intervento, sottolineando l’equazione migranti=terrorismo. La massa applaude, una massa di ignoranza che applaude un ministro che non conosce l’uso delle parole, nonché la realtà dei fatti. Spero che il ministro l’abbia detto in buona fede e pensando a un contesto molto molto specifico (la Libia), ma quel ministro dovrebbe almeno sapere che tutti tra gli atti terrroristici commessi dal 2015 ad oggi, solo tre sono stati commessi da persone arrivate con i veicoli dell’invasione: barche e gommoni carichi zeppi di carne umana in mezzo alle onde. Una invasione degna di questo nome dovrebbe almeno essere equipaggiata con torpedinieri, aerei, soldati… Su 1 milione di immigrati “irregolari”, per far valere l’equazione della ministra, dovremmo avere un milione di atti terroristici. I fatti parlano da sé. Ma la massa dell’ignoranza, la massa italiana della soap-opera, della continua novità, preferisce i proclami.</p><p>Oggi la competenza, paradossalmente, è diventata rappresentativa: se il popolo ti ha votato sei un competente, e quello che dici è oro. Peccato che quando si ha bisogno di un chirurgo si preferisca qualcuno che abbia fatto la necessaria gavetta certificata e non uno eletto dal consiglio degli anziani del quartiere.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edd9dcc37ee8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PhD: Doing or Not Doing]]></title>
            <link>https://medium.com/@demarco.giu/phd-doing-or-not-doing-1a141f137e1?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a141f137e1</guid>
            <category><![CDATA[phd]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 15:57:10 GMT</pubDate>
            <atom:updated>2018-10-17T15:57:10.745Z</atom:updated>
            <content:encoded><![CDATA[<p>Well, let’s put it simply: Doing a PhD is a real mistake! Obviously, I am joking. But take the assertion seriously. I should say that a PhD is a very intriguing challenge for oneself; that you will learn new things; that you will meet extraordinary people who will enjoy sharing their visions and doing something for the world, the future… I’d says that something like that will happen, yeah, something we see in NetFlix movies. But if you start your PhD with these sentiments, soon you’ll judge your decision a mistake!</p><p>Let me tell what I experienced at the first. For a pure “fortune” I got my PhD application accepted — we are talking about PhD in Italy, although I think same patterns are everywhere.</p><p>Until leaving my country for doing research abroad, or rather, before meeting the right person in the right moment, I had an unconscious underestimation of myself. I always doubted of my capacities/skills. That was the very common behaviour of (young) people who escape before face the battle. Why? Because I overestimated the importance of comparison with my college mates or colleagues.</p><h3><strong>First error</strong></h3><p>Never, never,never compare your results with those of others for a pure competition or ambition to stay ahead. Stay focused on what you like, and what you want. Many environments, from kindergarten to academia, are invaded by the (Darwinian) theory of competition: You will be stressed by the problem of staying up to your nearby humans. This is wrong, and many discoveries in history took place by cooperation and not competition.</p><p>This is the first thing to remember,indeed, but also the first problem. Because: I shall tell you how to understand what you like and what you want. I can tell you simply: You must stay in a very motivated, polite and gentle group. In every University, there are groups. But usually, these groups lost their initial goal: Sharing knowledge, improving society by means of examples, and be committed to education. Everywhere I have been, I saw the contrary, a kind of Darwinian evolution within the behavior of academic groups: The best will succeed! Succeed in what? Getting the permanent job?</p><p>Let me tell you an example. The very first years of my PhD, nobody told me what to do. From every side, I heard something like: “Do whatever you want”. It was like: “I don’t care about you”. This is the first disappointment: the lack of positive education from the masters. Doctorate is about transferring a vision of the human relationships, before any specialization. Same for degrees. Nowadays, it become a kind of isolated genius-like minds which compete one another, and most of the time the PhD is a kind of investment of the University in order to get more funds or publicity.</p><p>Once I discussed these point of views with one of the best PhD student at that time — now he is a professor. He told me that I suffer of “sentimentalism” or “paternalism”. “ <em>If you are not good, give up</em>” — he told me.</p><h3><strong>Second error</strong></h3><p><em>publish or die</em>. This kind of motto comes from the States, we know. Unfortunately, it’s a kind of stain of our times, and, more unfortunately, it holds. If you do not publish you will never get considered by no one. At least, do not waste times to publish shit, or publish copies of copies of your papers.</p><h3>Third error</h3><p>If you do not have a focus on what you like, soon you’ll waste energies. Or, rather, you’ll try to trick your life within the group in order to survive. Your work will be of poor quality. Let me, again, tell you my experience.</p><p>My office was stacked between two departments. The upper dept. was the Signal Processing Dept. Great engineers, more closed to mathematicians than engineers. By the way, people who loved formulas and deep formalism.</p><p>The lower dept. was filled by Computer Science people, from academia and industry. These people kept warning me: <em>You have to produce simulators and working code.</em> Upstairs people kept telling me the contrary: <em>Are you crazy? You have to produce formulas and models. </em>Both depts. never told each other. Both were concentrated in their profit. The first were interested in getting more papers. The seconds, were interested in presenting prototypes to industry. But at the end both were really interested to me, from a pure human point of view.</p><p>So, my suggestion? Stay focused in what you prefer, formulas or demo and go ahead. Do not care other voices, judges, and so no.</p><p>However, I cannot blame my period there, because thanks to PhD I had the opportunity to travel around the world and admire other people reasoning way. Comparison is good to deep our knowledge, but not for power desires.</p><p>If I had not made those errors, maybe my work would be more useful and my mind more relaxed….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a141f137e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Mistakes On Floats Comparison]]></title>
            <link>https://medium.com/@demarco.giu/common-mistakes-on-floats-comparison-517c6fabedfc?source=rss-15705ec66467------2</link>
            <guid isPermaLink="false">https://medium.com/p/517c6fabedfc</guid>
            <category><![CDATA[numbers]]></category>
            <category><![CDATA[floating-points]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[giuseppe de marco]]></dc:creator>
            <pubDate>Thu, 12 Apr 2018 10:45:20 GMT</pubDate>
            <atom:updated>2018-05-06T07:55:01.275Z</atom:updated>
            <content:encoded><![CDATA[<p>I wrote and reviewed a lot of code in my life, and I am surprised to see that some problems are not well stored in the brain of new generation of developers. One of these problems is the comparison of floating-point numbers. We have been told many times by our old-school professor to rise a warning flag when we have to compare numbers in any computer-based language, because numbers have a representation which depends on the application domain. In the Math domain everything is fine, but in Computer domain things change.</p><p>For humans and Math it’s simple to understand what <em>a&lt;b</em> means.</p><p>For example, <em>2.5 &lt; 3.6</em>. And <em>0.1 &lt; 0.2</em>. But in the Computer domain, those numbers are converted to binary representation with some degree of approximation. If the language you are using do not provide you with “smart” comparison operators, you must take care of any operations about number comparison. It sounds trivial, but problems related to this “ignorance” usually are the root of many hard-to-discover bugs.</p><p>Let’s make some simple functions in PHP which handles these problems easily.</p><p>The first function we need is a comparison for equality.</p><pre>namespace MyMath;</pre><pre>// Check if $a = $b<br>function eq($a=0, $b=0, $epsilon = 0.000000002)<br>{<br>   return abs($a -$b) &lt; $epsilon;<br>}</pre><p>This function checks if two numbers are equals. In the Computer domain, this means to check whether their absolute difference is smaller then an <em>epsilon. </em>Here, <em>epsilon</em> is a small number, for example 0.000000002. But there is a problem: If the numbers are “very small” the epsilon will not be “really small” and the comparison will return “true”. Similarly, if the numbers are very large, the comparision will return “false”.</p><p>A better way could be that to compute the relative error, e.g. <em>abs(($a-$b)/$b)</em>, but this will cause problems for small numbers. For a complete review of the cases can happen, I suggest to take a look at the link at the end of the article. The main rationale is:</p><blockquote>Check the range of numbers in your application before applying any of the suggested methods.</blockquote><p>Sometimes, the simple function <em>eq()</em> will be enough. When numbers are too small, you can try to multiply by a factor (scaling).</p><p>With this function in hand, let’s proceed.</p><pre>// Check if $a &gt;= $b<br>function geq($a=0,$b=0,$epsilon = 0.000000002)<br>{<br>   return ($a -$b) &gt; $epsilon || eq($a,$b);<br>}</pre><pre>// Check if $a &gt; $b<br>function gr($a=0,$b=0,$epsilon = 0.000000002)<br>{<br>   return ($a -$b) &gt; $epsilon ;<br>}<br>// Check if $a &lt;= $b<br>function leq($a=0,$b=0,$epsilon = 0.000000002)<br>{<br>   return ($a -$b) &lt; $epsilon || eq($a,$b);<br>}</pre><pre>// Check if $a &lt; $b<br>function lt($a=0,$b=0,$epsilon = 0.000000002)<br>{<br>   return ($a -$b) &lt; $epsilon ;<br>}</pre><p>It should be trivial to understand these functions . For example, <em>geq()</em> tests if two numbers <em>a</em> and <em>b</em> are equals or they are an interval <em>[a,b]</em>.</p><p>Therefore:</p><pre>echo gr(2.5,3.5)  ; // <br>echo geq(3.5,3.5) ; //<br>echo lt(2.5,3.5)  ; // <br>echo leq(2.5,2.5) ; // </pre><p>As a final suggestion to this very short and experimental writing of my own on Medium, I’d say to new comers in the world of computer programming languages: READ THE MANUAL, ALWAYS!</p><p>Suggested reading</p><ol><li><a href="http://floating-point-gui.de/errors/comparison/">Floating Point Comparions</a></li><li><a href="http://php.net/manual/en/language.types.float.php">PHP Manual</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=517c6fabedfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>