<?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 Antonio Mignano on Medium]]></title>
        <description><![CDATA[Stories by Antonio Mignano on Medium]]></description>
        <link>https://medium.com/@antoniomignano?source=rss-3ab28690b2ed------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vqFluQDWkUV8wZ74CeXcvw.jpeg</url>
            <title>Stories by Antonio Mignano on Medium</title>
            <link>https://medium.com/@antoniomignano?source=rss-3ab28690b2ed------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 17:24:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antoniomignano/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[PokéGPT — A custom GPT]]></title>
            <link>https://antoniomignano.medium.com/pok%C3%A9gpt-a-custom-gpt-903150d79c15?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/903150d79c15</guid>
            <category><![CDATA[open-api]]></category>
            <category><![CDATA[node]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[pokemon]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 11:37:08 GMT</pubDate>
            <atom:updated>2024-02-07T11:37:08.706Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Poké</strong>GPT — A custom GPT</h3><p>Creating a custom GPT model capable of fetching and integrating real-time data from external sources like APIs can significantly enhance its versatility and applicability across various domains.</p><p>In this tutorial, we’ll see how to set up a <strong>Node</strong> server on <strong>Runkit</strong>, an online environment for running Node.j<strong>s</strong> applications, to interact with the <strong>Pokémon API</strong>. This server will serve as a bridge between the GPT model and the Pokémon API, allowing the model to retrieve Pokémon data based on name or type. We’ll also expose an OpenAPI specification for better integration with GPT models or other services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glk_m63-qErg6zXY60fF6w.jpeg" /></figure><h3>Prerequisites</h3><ul><li>Basic knowledge of JavaScript and Node.js</li><li>An account on Runkit (it’s free)</li><li>A GPT4 account (paid)</li></ul><h3>Step 1: Setting up Your Runkit Notebook</h3><p>If you want all the code at once you can copy it from this <a href="https://pastebin.com/H8nGPKWE">Link</a>.</p><ol><li>Go to <a href="https://runkit.com/">Runkit</a> and create a new notebook.</li><li>In your new notebook, require the necessary packages by adding the following lines at the top:</li></ol><pre>const express = require(&#39;express&#39;);<br>const axios = require(&#39;axios&#39;);<br>const bodyParser = require(&#39;body-parser&#39;);</pre><p>Runkit automatically installs these packages when you run the notebook.</p><h3>Step 2: Creating the Express Server</h3><ol><li>Initialize your Express app</li></ol><pre>const app = express();<br>app.use(bodyParser.json()); // for parsing application/json</pre><p>2. Define the routes to fetch Pokémon data:</p><ul><li>Fetch Pokémon by Name</li></ul><pre>app.get(&#39;/pokemon/name/:name&#39;, async (req, res) =&gt; {<br>  const { name } = req.params;<br>  try {<br>    const response = await axios.get(`https://pokeapi.co/api/v2/pokemon/${name}`);<br>    res.json(response.data);<br>  } catch (error) {<br>    res.status(404).json({ message: &quot;Pokémon not found&quot; });<br>  }<br>});</pre><ul><li>Fetch Pokémon by Type</li></ul><pre>app.get(&#39;/pokemon/type/:type&#39;, async (req, res) =&gt; {<br>  const { type } = req.params;<br>  try {<br>    const response = await axios.get(`https://pokeapi.co/api/v2/type/${type}`);<br>    const pokemonList = response.data.pokemon.map(p =&gt; p.pokemon.name);<br>    res.json({ type: type, pokemon: pokemonList });<br>  } catch (error) {<br>    res.status(404).json({ message: &quot;Type not found&quot; });<br>  }<br>});</pre><h3>Step 3: Exposing the OpenAPI Specification</h3><ol><li>To help GPT models and other services understand how to interact with your API, define an OpenAPI (formerly Swagger) specification for your server. You can serve this JSON from another path:</li></ol><pre>app.get(&#39;/openapi.json&#39;, (req, res) =&gt; {<br>  res.json({<br>    openapi: &quot;3.0.0&quot;,<br>    info: {<br>      title: &quot;Pokémon API for GPT&quot;,<br>      version: &quot;1.0.0&quot;,<br>      description: &quot;This API allows you to fetch Pokémon by name or type.&quot;,<br>    },<br>    servers: [{<br>      url: &#39;https://&lt;your-runkit-notebook-url&gt;.runkit.sh&#39;,<br>      description: &#39;Primary server&#39;<br>    }],<br>    paths: {<br>      &quot;/pokemon/name/{name}&quot;: {<br>        get: {<br>          operationId: &quot;getPokemonByName&quot;,<br>          summary: &quot;Get Pokémon by name&quot;,<br>          parameters: [{<br>            name: &quot;name&quot;,<br>            in: &quot;path&quot;,<br>            required: true,<br>            description: &quot;The name of the Pokémon&quot;,<br>            schema: { type: &quot;string&quot; }<br>          }],<br>          responses: {<br>            200: { description: &quot;Successful operation&quot; },<br>            404: { description: &quot;Pokémon not found&quot; }<br>          }<br>        }<br>      },<br>      &quot;/pokemon/type/{type}&quot;: {<br>        get: {<br>          operationId: &quot;getPokemonByType&quot;,<br>          summary: &quot;Get Pokémon by type&quot;,<br>          parameters: [{<br>            name: &quot;type&quot;,<br>            in: &quot;path&quot;,<br>            required: true,<br>            description: &quot;The type of Pokémon&quot;,<br>            schema: { type: &quot;string&quot; }<br>          }],<br>          responses: {<br>            200: { description: &quot;Successful operation&quot; },<br>            404: { description: &quot;Type not found&quot; }<br>          }<br>        }<br>      }<br>    }<br>  });<br>});</pre><h3>Step 4: Running Your Server</h3><p>After defining the routes for fetching Pokémon data and setting up the OpenAPI specification, you need to start the Express server to make it listen for incoming requests. This final step will make your server live and ready to interact with the custom GPT and the Pokémon API.</p><p>Add the following code snippet at the end of your Runkit notebook:</p><pre>// Define the port to listen on<br>const port = process.env.PORT || 3000; // Runkit will provide a port<br><br>// Make the app listen on the port<br>app.listen(port, () =&gt; console.log(`Server is running on port ${port}`));</pre><p>In Runkit, you don’t need to worry about specifying a port number as you would in a traditional development environment. Runkit automatically assigns and manages the port for you. Once you add this code and run your notebook, Runkit will activate the server, making it accessible through a unique Runkit endpoint URL.</p><p>How to Access Your Server:</p><ul><li>Upon running your notebook, Runkit displays a URL at the top of the page. This URL serves as the base address for your API.</li><li>To interact with your API, append the specific paths you’ve set up (/pokemon/name/:name or /pokemon/type/:type) to this base URL.</li><li>You can test these endpoints directly in your browser or using tools like Postman to ensure they’re working as expected before integrating them with your custom GPT model.</li></ul><h3>Step 5: Creating Your Custom GPT</h3><ol><li>On your <a href="https://chat.openai.com/">ChatGPT</a> interface click on the bottom-left profile icon and then “My GPTs”: <a href="https://chat.openai.com/gpts/mine">Link</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuFp0cuJZf2FeVJV7ddXww.png" /></figure><p>2. You can now click on “Create a GPT” where you can give you GPT a Name, Description and some Instructions.</p><p>3. To implement the functionalities we just implemented on our node server we need to add the correspondant <a href="https://platform.openai.com/docs/actions/introduction"><strong>Actions</strong></a>. At the bottom of the page find a button “Create new action”</p><p>4. Once in the action editor pnale, click on the “Import” button which will allow us to import the openapi.json our server provides at the url: https://&lt;your-runkit-notebook.url&gt;.runkit.sh/openapi. Paste this url and the click import.</p><p>5. Now the schema of the API should be imported and we should be able to see the available actions in the interface</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlTrzjXU58Q9uopFPAI9tw.png" /></figure><p>6. Click on Save, top right corner. I suggest to publish with “Only me” for the moment.</p><p>7. Now it is possible to query our GPT on the right side of the interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pHwoKOvNZpprfuSyX2rgrw.gif" /></figure><h4>Note</h4><p>An adjustment was made to the response of the endpoint /pokemon/name/:name, because of the length of its output ChatGPT wasn’t capable of handling all of it, hence the response was limited to 5 moves.</p><pre>res.json(response.data.moves.splice(0,5));</pre><h3>Conclusion</h3><p>You’ve now created a simple yet powerful Node.js server on Runkit that interfaces with the Pokémon API, capable of fetching Pokémon data by name or type. Moreover, by exposing an OpenAPI specification, you’ve documented your API in a standard format, making it easier for others and automated systems to understand and use your API.</p><p>This setup demonstrates the potential of combining GPT models with dynamic data sources, paving the way for more interactive and responsive AI applications. Whether for educational purposes, application development, or data analysis, integrating GPT with real-time data opens up a world of possibilities.</p><p>Are you an AI expert now? No :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=903150d79c15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Arduino Nano & ESP8266 Web Server]]></title>
            <link>https://antoniomignano.medium.com/arduino-nano-esp8266-web-server-5f74e9753989?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f74e9753989</guid>
            <category><![CDATA[smartphones]]></category>
            <category><![CDATA[wifi]]></category>
            <category><![CDATA[light]]></category>
            <category><![CDATA[arduino]]></category>
            <category><![CDATA[web-server]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Sun, 10 Jan 2021 16:21:08 GMT</pubDate>
            <atom:updated>2021-01-10T16:21:08.916Z</atom:updated>
            <content:encoded><![CDATA[<h4>Simple light control through web page</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-Mf7Q9RZkud3bugyv16vw.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*S809QZ_FF3Un1LBT5bsATg.jpeg" /><figcaption>Amazon Arduino-Nano Compatible: <a href="https://amzn.to/3nz7rNk">https://amzn.to/3nz7rNk</a></figcaption></figure><p>During the holidays I decided I wanted to make a light control to allow me leave some lights on while reading at nighttime and turn them off automatically in case I’d fall asleep, hence I decided to go back to my ol’ Arduino and found <a href="https://amzn.to/3nz7rNk">this compatible version of the Arduino Nano on Amazon</a> at a very low price: 3 for 14$.</p><p>Since I wanted others to control the lights, even those with an iPhone I couldn’t just use bluetooth and make an experimental app for the smartphone so I decided to use WiFi instead and instantly looked for an Arduino module: <strong>ESP8266</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/188/1*6XucJEsh4QZyC7H9nU1YDw.jpeg" /><figcaption>Amazon ESP8266: <a href="https://amzn.to/2LD5SAV">https://amzn.to/2LD5SAV</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/186/1*ggqMktTlROdFWBAZKayYGw.jpeg" /><figcaption>Amazon AMS1117–3.3: <a href="https://amzn.to/35nTkEf">https://amzn.to/35nTkEf</a></figcaption></figure><p>The module works with a tension of 3V3 but the Arduino Nano is not powerful enough to provide the correct current so that required a 3V3 regulator.</p><p>As last thing, of course, the lights: I bought some at a Flying Tiger but they can be easily found everywhere (e.g.: <a href="https://amzn.to/35rUO0r">Amazon</a>). It can also be a simple white led or maybe a <a href="https://amzn.to/3qbfcuN">relay</a> for something bigger.</p><h3>How it works</h3><h4>1 — Init Phase</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jc-ayNUN3kj9BgFrjyL06g.gif" /><figcaption>1 — Initialization</figcaption></figure><p>During this phase the Arduino configures the ESP8266 sending some commands:</p><ol><li>Reset the module</li><li>Connect to AP</li><li>Set WiFi mode to station mode</li><li>Show IP</li><li>Accept multiple connections</li><li>Start server on port 80</li></ol><p>Each one of this command has a timeout which may be too little, that’s why I highly advise to be careful during this phase and do a lot of debug with the serial monitor.</p><h4>2 — Get control</h4><p>The <em>/control</em> page provides a static html webpage with a simple form to perform an HTTP request to the <em>/light</em> endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNaVvS-zu1B2in6Kgoybyw.gif" /><figcaption>2 — Control page request</figcaption></figure><h4>3 — Send command</h4><p>With the help of jQuery after the OK button is pressed an HTTP request is made to the /<em>light</em> endpoint with two params: <em>power </em>and <em>timeout</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sspXwHJQHDuWyxTs9B9rQ.gif" /><figcaption>3 — Send command</figcaption></figure><p><em>power </em>is the value 0–255 for the analogWrite on the light port and <em>timeout </em>is a value expressed in seconds after which the lights will turn off. If the timeout is 0 no timer will be set.</p><h3>Wiring</h3><h4>Prerequisite</h4><p>Before starting with the code it is necessary changing the <strong><em>baudrate</em> </strong>of the ESP8266 which is <strong>115200</strong> by default. We will set it to <strong>9600</strong>, to do so simply upload the <a href="https://www.arduino.cc/en/Tutorial/BuiltInExamples/BareMinimum"><em>BareMinimum</em></a><em> </em>code and connect the ESP as follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*1XLqmNTPX9OAZQ45juoeMg.png" /><figcaption>Baurdate change wiring</figcaption></figure><p>After that, open the serial monitor and after setting line ending with Both NL &amp; CL, and baudrate to 115200 send the command:</p><blockquote>AT+UART_DEF=9600,8,1,0,0</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*mJEvz2iw__VVDvWgQ5lC1Q.png" /><figcaption>Serial monitor</figcaption></figure><h4>Final wiring</h4><p>Now we can finally connect the TX/RX ports of the WiFi module to different pins on the Arduino to differenciate the communication between PC&lt;-&gt;Arduino and Arduino&lt;-&gt;ESP, and also connect the lights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*pNkFNp-8eMWknnrmNiipiw.png" /><figcaption>Final wiring</figcaption></figure><h3>The code</h3><p><a href="https://github.com/Xfox1/ArduinoNanoWebServer">Xfox1/ArduinoNanoWebServer</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05b3c0c5cc7dc2affe356c6922c2307b/href">https://medium.com/media/05b3c0c5cc7dc2affe356c6922c2307b/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBDLJk2PvNVOlMdr8D5K0g.jpeg" /></figure><h3>Focus on…</h3><h4>… different handling for /control &amp; /light</h4><p><strong>Memory difference<br></strong>The <em>/control </em>page has to only serve a static content wich is almost 1KB in size, that’s why it was stored inside the Flash Memory (32KB) instead of the SRAM (2 KB), see line #17. Same was done for the HTTP header (line #16), used by <em>/light</em>, which is copied to a buffer (500B) and then modified every time it is needed.</p><p>The <em>/light </em>endpoint, instead, has the sole purpose to get some data and store it inside some variables that will be later used to command the lights.<br>An HTTP call without any data given back is not cool to see, that’s why I added a JSON response.</p><p><strong>Sending mode<br></strong>The real difference between the two pages is that for <em>/control</em> all the data, including the header is sent directly to the WiFi module without storing anything inside the SRAM, that’s how you serve a big static content, while for the <em>/light</em> the header is first copied into a variable, modified (changing CONTENT-LENGTH and CONTENT-TYPE headers) and then the content is appended to it.</p><p><strong>Content-length<br></strong>Another difference between <em>/control </em>and <em>/light </em>is the way in which the client receives the content. With <em>/light</em> the header holds the content-length, that’s how the client understands when all the data was transfered, with <em>/control</em> there’s not explicit length hence the client knows all the data was trasfered when the connection is closed (line #157).</p><p>This was done just to prove it would work either way, it’s very easy to add the content length to a static content.</p><h4>… memory</h4><p>Yes, handling memory was a real pain in the neck.</p><p>Every once in a while the code stopped running and without a proper way of debbugging, if not with prints on the serial monitor, figuring out the problem was really hard. There is a function, <em>availableMemory()</em>, that returns the available memory when called. It tries to allocate memory with a malloc, starting from 2048B downward.</p><p>It was using this very simple function that I figured out that I had some memory leaks with dynamics <a href="https://www.arduino.cc/reference/en/language/variables/data-types/stringobject/">Strings</a>.</p><p><strong>F(“String”)<br></strong>Some may not now but printing on the serial monitor static strings occupy SRAM memory. Using F(“String”) instead of “String” stores the value in the Flash memory and helps save some space.</p><p>Of course the memory/time thradeoff comes in, but it’s better to see a log 20ms later than not seeing it at all.</p><p>It is possible to see in the code that it was randomly used but it could be used everywhere.</p><h4>… simple advice</h4><p>In case you’d try to develop the same thing be careful when using a breadboard. Be sure everything is properly wired and always check for correct power management, in fact the WiFi module was going crazy just because I slightly touched some connections.</p><h4>What can be done better?</h4><p>There’s always space for improvement.</p><ol><li>Better logging</li><li>Better errors handling</li><li>Handling OK/KO messages from ESP8266</li><li>Improve code structure and avoid code repetition</li><li>Using libraries (yes, there are libraries that do what I’ve done)</li></ol><h3>Final touches</h3><p>To complete the project it was needed to move everything from the breadboard to an actual “pcb”. Well, I couldn’t wait for a pcb to be printed so I decided to use what it’s called “millefori” in Italian. A simple prototype board like this one: <a href="https://amzn.to/3bp7pVQ">https://amzn.to/3bp7pVQ</a></p><p>Using <a href="https://easyeda.com/">EasyEDA</a> I drawn the printed circuit and then replicated on the board (not successfully though, the components weren’t placed as in the image below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JE4EkePCLwXRFXkj1hhDPw.jpeg" /></figure><p>Note that the ground of the ESP module is not connected and a jumper was required. I bet there’s some other way to wire everything wihtout jumpers and using just one layer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*8nNsZ9U0ILUQ9b_ZY2XP8Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Bph2ECX2RDr1rf7R_5mOdg.gif" /></figure><p>Last thing to be done would be 3D printing a package for it.<br>Maybe I’ll find the time.</p><p>Hope you enjoyed this article! 😃</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f74e9753989" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js, Socket.io, Express: Tic Tac Toe]]></title>
            <link>https://antoniomignano.medium.com/node-js-socket-io-express-tic-tac-toe-10cff9108f7?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/10cff9108f7</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[tic-tac-toe]]></category>
            <category><![CDATA[socketio]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Mon, 23 Dec 2019 16:13:59 GMT</pubDate>
            <atom:updated>2019-12-30T10:17:49.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*pEYUUn_36gv2VfFVmP3Z3A.png" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Tic-tac-toe">https://en.wikipedia.org/wiki/Tic-tac-toe</a></figcaption></figure><p>Tic Tac Toe is a fun game everyone enjoyed when was young. The concept is quite simple: two players, each one signing one of the 9 cells every turn with a symbol which can be either a X or a O (or whatever else).</p><p>Today we are going to create an online version using <strong>Node.js</strong> and <strong>Socket.io</strong>.</p><p>The full project can be found in my repository here:</p><p><a href="https://github.com/Xfox1/tic-tac-toe">Xfox1/tic-tac-toe</a></p><h3>Step 1: Setup the project</h3><p>We need a Node environment so let’s create a folder and with a terminal opened inside it run:</p><pre>npm init</pre><p>and now le’ts install the dependencies: <strong>Express </strong>to create a webserver and serve the HTML page (and javascript) for the clients and <strong>Socket.io </strong>in order to have real-time message exchanged between client and server.</p><pre>npm install express socket.io</pre><p>We’re done with the setup. That was easy, wasn’t it?</p><h4><strong>Step 1.1: Folder structure</strong></h4><p>This is easy. Let’s create two folders to better organize our structure: ‘server’ and ‘client’.</p><h3>Step 2: Server</h3><p>Let’s start from the server, exactly 95 lines, here it is:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1604acf151c5096d5213664b892343cc/href">https://medium.com/media/1604acf151c5096d5213664b892343cc/href</a></iframe><p><strong>Lines 1–9:</strong> simple imports of the dependencies.<br><strong>Lines 12–18:</strong> Express configuration for serving static files such as <em>index.html </em>(the page with the game board) and <em>script.js</em> which contains the client logic.<br><strong>Line 20: </strong>This variable is used to contain the players object. Each player has an <strong><em>id </em></strong>which is the same generated (by socket.io) for the socket, an <strong><em>opponent</em> </strong>which is nothing more than another player id and a <strong><em>symbol</em> </strong>that can be ‘X’ or ‘O’.<br><strong>Line 21: </strong><em>unmatched </em>is a variable used to pair players. It’s first value is ‘undefined’ (boolean false). The first player (player1) will have a ‘undefined’ opponent (line 79), but that’s not a problem. The value of the variable will be set to the player id. On the next player’s connection (player2), player2 will have player1’s id as opponent value.</p><h4>Lines 25–69:</h4><p>Here the magic happens. Once a player connects different events are binded to its socket.</p><p><strong>Line 29:</strong> adds to clients the socket just to have a structure containing all the connected players (even if it is not really used in the code).</p><p><strong>Line 31–35: </strong>binds the ‘disconnect’. It simply shows a message on the console, delete the client from the <em>clients</em> connected and emits a broadcast message to all the other clients. (This event is not used on the client side, yet)</p><p><strong>Line(s) 37 (72–88): </strong>calls a function that initialize the player object. It uses the variable <em>unmatched</em> as explained before (line 21).</p><p><strong>Lines 39–47:</strong> if the current player has an opponent the game can begin and the event <em>game.begin</em> is sent to the clients, containing their respective symbol to be used within the game.</p><p><strong>Lines 51–67</strong>: bind to the event <em>make.move. </em>Here some validation can be done on server side. When triggered, this event will emit a new one, <em>move.made</em>, which will be used by the clients to render the move. The event will be emitted both for the player who made the move and the opponent.</p><p><strong>Lines 90–95: </strong>this simple function returns the socket of the opponent given a socket.</p><h3>Step 3: Client</h3><p>The client is obviously composed by an interface (<em>index.html</em>) and the logic (<em>script.js</em>). I’ll leave to you the understanding of the interface (9 simple buttons rendered as 3x3 matrix, here you go).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*cLDcDV_5EoU6OMi0T5X0Ig.png" /><figcaption>Game board</figcaption></figure><p>Each cell is a button with id equal to the ones shown in the picture above. Initially there is no text inside the button (the image just shows the ids).</p><p>And here it is the logic:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05095cf7510fd0c9a6a5ee150944bfaf/href">https://medium.com/media/05095cf7510fd0c9a6a5ee150944bfaf/href</a></iframe><p>Le’ts dive straight to the action here.</p><p><strong>Lines 7–19: </strong><em>getBoardState(),</em> this function returns an object containing 9 attributes. Each attribute has the name of a cell of the board (r0c0, r0c1, …, r2c2). The value of each attribute is the text within the cell (which is a button) or an empty string.</p><p><strong>Lines 21–45:</strong> <em>isGameOver()</em>, this function returns whether the game ended or not. The variable <em>rows</em> is nothing more than an array containing strings built out of the possible winning combinations: each line, each column and the two diagonals. Looping to each value of the <em>rows</em> variable looking either for ‘XXX’ or ‘OOO’ we are able to say if there was a winner or not.</p><p>Note: the draw case wasn’t considered. I challenge you to take it into account for your project.</p><p><strong>Lines 47–55:</strong> <em>renderTurnMessage()</em> simply render the message on the appropriate div to show whose turn is this.</p><p><strong>Lines 57–70:</strong> <em>makeMove(e)</em> is the function binded to buttons’ click. It will emit the event <em>make.move</em> containing the symbol of the player and the position of the click on the game board.</p><p><strong>Lines 73–91:</strong> bind to the event <em>move.made.</em> Here we receive the information from the server to render the last move (either if it was made from one player or the other). Inside this function, the game board is also activated or deactivated.</p><p><strong>Lines 95–99: </strong>bind to the event <em>game.begin</em>. In this function we initialize the game, we assign the symbol (sent by the server) to the player and decide who begins.</p><p><strong>Lines 102–105:</strong> bind to the event <em>opponent.left</em>. It simply shows a message when the opponent leaves the game.</p><p><strong>Lines 108–111:</strong> Here we disable the game board when the page is initialized and bind the <em>makeMove</em> function the the buttons’ click.</p><h3>That’s it. We are done.</h3><p>P.S.<br>You got me, I used jQuery.</p><p>I really hope this tutorial was helpful for you. There are a lot of improvements that can be made. An example may be to let players decide a username; consider the case in which the game ends as a draw, let the player choose the opponent and a lot more.</p><p>Again, the repository with the full project:</p><p><a href="https://github.com/Xfox1/tic-tac-toe">Xfox1/tic-tac-toe</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10cff9108f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to create a Telegram BOT]]></title>
            <link>https://blog.chatbotslife.com/how-to-create-a-telegram-bot-bbdeb3ad8f0?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/bbdeb3ad8f0</guid>
            <category><![CDATA[bots]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[telegram]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Sun, 21 Apr 2019 14:45:56 GMT</pubDate>
            <atom:updated>2021-10-23T06:29:26.516Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to create a Telegram BOT step by step typing no code</h3><h4>Simple autoresponder to entertain your friends</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WwNtWdWJMKTV04VL" /><figcaption>Photo by <a href="https://unsplash.com/@christianw?utm_source=medium&amp;utm_medium=referral">Christian Wiediger</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Telegram is one of the most used program for instant messaging and it is known for the possibility to have <a href="https://chatbotslife.com/">bots</a> that interact with user privately or within groups.</p><p>Some of these bots are very useful and some of them are just meant to be fun.</p><p>In this tutorial we are going to create our own bot <strong>without worring about any code</strong>.</p><h3>1) Install Node.js</h3><p>We will need this in order to run the bot on our computer (or for the ones a little bit nerdier on a Raspberry).<br>So, let’s download it from here: <a href="https://nodejs.org/en/download/">https://nodejs.org/en/download/</a></p><h3>2) Download project</h3><p>This is the link from GitHub where to download all the material needed to configure and run the bot: <a href="https://github.com/Xfox1/telegrambotautoresponder/archive/master.zip">Download</a></p><p>The whole project (let me call it this way, I don’t want to use the word “code” to not scare anyone) is on GitHub:</p><p><a href="https://github.com/Xfox1/telegrambotautoresponder">Xfox1/telegrambotautoresponder</a></p><h3>3) Create a BOT with <em>BotFather</em></h3><p>In order to create a <a href="https://chatbotslife.com/">bot</a> we need to obtain an official code from Telegram (called API token), and for that we have to contact <em>BotFather</em>: <a href="https://t.me/botfather">https://t.me/botfather</a></p><p><em>BotFather </em>is the one bot to rule them all. Use it to create new bot accounts and manage your existing bots.</p><p>Just type the command <em>/newbot</em> and follow the istructions given by <em>BotFather</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*KBYxDA5Wye1JGIV2pCvggw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*vXTYRyyUubRPHTd3yIg7gQ.png" /></figure><p>Another important step we better do now is to <strong>disable</strong> the <strong>privacy </strong>of the bot to <strong>allow </strong>it inside <strong>group </strong>chats.</p><p>Simply send the command <em>/setprivacy </em>to Botfather, select your bot and click/tap on disable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*atBNAHFd4RNoqnISq76j0w.png" /></figure><h3>4) Configure your token</h3><p>If you haven’t done it yet unzip the project inside a folder then <strong>rename .envExample</strong> to <strong>.env</strong> (see later if you’re on Windows) and edit the following line, inserting your <em>API token</em> given by <em>BotFather</em>:</p><pre>TELEGRAM_TOKEN=”&lt;YOUR_TOKEN_HERE&gt;”</pre><p><strong>If you are on Windows:<br></strong>You may have trouble renaming the file, simply open the start menu and type “cmd” then open the “Command Prompt” and do as this image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-6DulipyEpB_MHwuDGEfxg.png" /></figure><h3>5) Configure your answers</h3><p>Now it’s time to be creative.<br>Open the file <strong>answers.json </strong>and let’s give a look at it.</p><p>Here’s where all the answers are stored, it’s easy to see the structure, a concatenation of these “objects” that contain the triggers and the replies to each of those triggers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0db27808495666c618dfe747b64f87b1/href">https://medium.com/media/0db27808495666c618dfe747b64f87b1/href</a></iframe><p>Of course this is just an example with 3 answers, you can have a lot more.</p><p>Let’s analyze how it is composed:</p><ul><li><strong><em>triggers</em></strong>: concatenation of strings that trigger that answer</li><li><strong><em>replies</em></strong>: concatenation of a “sub-ojects”</li></ul><p>Each one of the replies has</p><ul><li><strong><em>reply</em></strong>: which is what is meant to be sent as message</li><li><strong><em>type</em></strong>: it specify the type of the reply, can be “<em>text”</em>, “<em>audio” , </em>“<em>image” or “response”</em></li></ul><p>Depending on the <strong><em>type</em></strong>, the reply should have a meaningful value: in case the type is equal to <strong>audio </strong>or <strong>image </strong>the value of <em>reply</em> must be a valid path to a file on your computer even if it is highly suggested to put these kind of media inside the folder <em>“media”</em>.</p><p>As for now the extentions tested for media are “.jpg”, “.gif” and “.mp3”.</p><p><strong>Edit October 2021:</strong> introduced type “response”, in which the bot will quote the message it is answering to. It is also possible to inser hyperlinks in HTML format.</p><h3>6) Dowload dependencies</h3><p>On a Command Prompt type the following command (inside the folder of the project) in order to download all the dependecies needed by the <a href="https://chatbotslife.com/">bot</a>:</p><pre>npm install</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riM2ySiPbi8kP40QH7rdRg.png" /></figure><h3>7) Start the bot</h3><p>We are almost done, now that everything is set up with can finally start our bot. In the same <em>console </em>we used to install all the dependencies we have to run:</p><pre>npm start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uyClMFWMDZtUYWMrru31Lg.png" /></figure><p>And this is the result</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*ls3SI7ELOCeLFu5h0kEA4g.png" /></figure><p>You may notice that in the console there are some [INFO] messages, those help you keep track of who is using your bot, the same information are stored inside a file you’ll find in the project folder called <strong><em>debug.log</em></strong>.</p><p>The bot can be stopped and rerun without any problem<br>In case you want to run it on a headless machine, like a Raspberry, you may want to find a way to have it not interfering with other application, read my other article about Unix Screen:</p><p><a href="https://medium.com/@antoniomignano/unix-screen-the-very-few-commands-you-should-know-26bb487de0ca">Unix Screen, the very few commands you should know</a></p><h3>Well, that’s it, have fun!!!</h3><h3>Don’t forget to give us your 👏 !</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*K0FfyJWUcMpzsYxf" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2F3e59ef%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2F3e59ef&amp;image=http%3A%2F%2Fapi.screenshotlayer.com%2Fapi%2Fcapture%3Faccess_key%3Dfe59908dad3baab69ffab249a2224b03%26viewport%3D1024x612%26width%3D1000%26url%3Dhttps%253A%252F%252Fupscri.be%252F3e59ef%253Fscreenshot&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href">https://medium.com/media/7078d8ad19192c4c53d3bf199468e4ab/href</a></iframe><figure><a href="https://chatbotslife.com/bot-communities-mastermind-group-d2dae9876709#.53x0py6ou"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*6XUspT9JOSq0w0Fi35HIaA.png" /></a></figure><figure><a href="https://m.me/ChatbotsLife"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*c1LDMH5vbnIz9rmAka8Hwg.png" /></a></figure><figure><a href="https://chatbotslife.com/chatbot-development-hire-top-ai-chatbot-developers-c8b45ef7f207"><img alt="" src="https://cdn-images-1.medium.com/max/255/1*D0Jf3dI6ZThtqcfwDYY7mg.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbdeb3ad8f0" width="1" height="1" alt=""><hr><p><a href="https://blog.chatbotslife.com/how-to-create-a-telegram-bot-bbdeb3ad8f0">How to create a Telegram BOT</a> was originally published in <a href="https://blog.chatbotslife.com/">Chatbots Life</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unix Screen, the very few commands you should know]]></title>
            <link>https://antoniomignano.medium.com/unix-screen-the-very-few-commands-you-should-know-26bb487de0ca?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/26bb487de0ca</guid>
            <category><![CDATA[tutorial]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[screen]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Sun, 31 Mar 2019 14:02:26 GMT</pubDate>
            <atom:updated>2019-03-31T14:02:26.374Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how to autorun different screen on startup</h4><p><em>GNU Screen</em> is a terminal multiplexer which means it is an application that allow a user to access multiple separate login session inside a single terminal windows or detach and reattach sessions from a terminal.</p><p>I, personally, use it with my <em>Raspberry Pi</em> to start different tasks without terminating them when closing the ssh session.</p><p>It was a little bit messy when I started using it but then I learned few commands that were the basic to control this very powerful tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ktqgEyYK7c0G9I80" /><figcaption>Photo by <a href="https://unsplash.com/@hidd3n?utm_source=medium&amp;utm_medium=referral">Kevin Horvat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Of course, if you don’t have it, install it:</p><pre>apt-get install screen</pre><h3>Commands</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea5a7ee152152cf8c10b640e37e74271/href">https://medium.com/media/ea5a7ee152152cf8c10b640e37e74271/href</a></iframe><p><strong>Note</strong>: After splitting, you need to go into the new region and start a new session via [Ctrl+a][c] before you can use that area, you can also resume another screen.</p><p>For a complete reference to screen, see the <a href="https://www.gnu.org/software/screen/manual/screen.html">user’s manual</a>.</p><h3>Autorun different screens on startup</h3><p>There are different ways to do this, the one I’m gonna explain implies the creation of a bash script, as simple as this one:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b251e32124d81b5dbe521cad714e8f19/href">https://medium.com/media/b251e32124d81b5dbe521cad714e8f19/href</a></iframe><p>Let’s make it executable:</p><pre>chmod u+x &lt;script_name&gt;.sh</pre><p>Now we’re ready to put it in the “autorun sequence”.</p><p>We simply have to add the script to <em>/etc/rc.local </em>before the <em>exit 0</em>:</p><pre>#!/bin/sh -e<br>#<br># rc.local<br>#<br># This script is executed at the end of each multiuser runlevel.<br># Make sure that the script will &quot;exit 0&quot; on success or any other<br># value on error.<br>#<br># In order to enable or disable this script just change the execution<br># bits.<br>#<br># By default this script does nothing.</pre><pre># Print the IP address<br>_IP=$(hostname -I) || true<br>if [ &quot;$_IP&quot; ]; then<br>  printf &quot;My IP address is %s\n&quot; &quot;$_IP&quot;<br>fi</pre><pre>sh /home/&lt;user&gt;/&lt;path_to_script&gt;/&lt;script_name&gt;.sh</pre><pre>exit 0</pre><p>Save it and <strong>it’s done.</strong></p><p>The last thing that we have to do is</p><pre>reboot</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26bb487de0ca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install Jupyter on a server]]></title>
            <link>https://antoniomignano.medium.com/how-to-install-jupyter-on-a-server-94eced97e0d7?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/94eced97e0d7</guid>
            <category><![CDATA[guides-and-tutorials]]></category>
            <category><![CDATA[jupyter]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[raspberry]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Thu, 21 Mar 2019 23:30:36 GMT</pubDate>
            <atom:updated>2019-03-23T09:54:24.385Z</atom:updated>
            <content:encoded><![CDATA[<h4>Even on a Raspberry Pi</h4><blockquote>The <strong>Jupyter Notebook</strong> is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. Uses include: data cleaning and transformation, numerical simulation, statistical modeling, data visualization, machine learning, and much more.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/375/1*YfJIKfeF4G0UZT1-PEKHuQ.png" /><figcaption>Source: h<a href="https://en.wikipedia.org/wiki/Project_Jupyter">ttps://en.wikipedia.org/wiki/Project_Jupyter</a></figcaption></figure><p>You may wonder why you should install Jupyter on a server and allow remote access to it. Well, let me say I had the need to use it on different devices and allow all of them to see and use the beautiful interactive interface of jupyter along with an online shared space (and also because I was trying to avoid working).</p><p>I installed it on a <strong>Raspberry Pi 3</strong> and used with <a href="https://linux.die.net/man/1/screen"><strong><em>screen</em></strong></a> to detach the session and have it running endless.</p><h4>Prerequisites</h4><ul><li><em>Python: </em><a href="https://www.python.org/downloads/">https://www.python.org/downloads/</a></li><li><em>pip: </em><a href="https://pip.pypa.io/en/stable/installing/">https://pip.pypa.io/en/stable/installing/</a></li><li>Python <em>venv¹</em>: you can get it with a basic “sudo pip install virtualenv”</li></ul><h4>Steps</h4><ol><li>Create a directory where you want to base your Jupyter installation and move to that folder</li><li>Create a virtualenv in the same folder and activate it</li></ol><pre>user@server:~/myFolder $ virtualenv &lt;virtualEnvName&gt;<br>user@server:~/myFolder $ source &lt;virtualEnvName&gt;/bin/activate</pre><p>3. Install Jupyter</p><pre>(venv) user@server:~/myFolder $ python3 -m pip install jupyter</pre><p>4. Edit Jupyter config file to allow external connections</p><pre>(venv) user@server: ~/myFolder $ nano /home/&lt;user&gt;/.jupyter/jupyter_notebook_config.py</pre><p>edit the following lines</p><pre>c.NotebookApp.allow_origin = &#39;*&#39; #Allow all origins<br>c.NotebookApp.ip = &#39;0.0.0.0&#39; #Listen on all IPs<br>c.NotebookApp.port = &lt;portNo&gt; #If needed to change default (8888)</pre><p>5. Launch Jupyter notebook</p><pre>(venv) user@server: ~/myFolder $ jupyter notebook</pre><p>Pay attention to the output of this last command (I’m not gonna spoiler you that), it will give you the token to access the server which could be changed into a “human-remindable” password.</p><p><strong>That’s it</strong>, now you’re ready to enjoy your remote Jupyter server by simply connecting on your server IP address.</p><h4>Bonus</h4><p>Instead of changing the configuration of Jupyter to allow remote access you can use <strong>ssh tunneling</strong> by executing the following command on <em>Linux </em>or <em>macOS</em></p><pre>ssh -L 8000:localhost:8888 &lt;user&gt;@&lt;serverIP&gt;</pre><p>which will let you connect to <a href="http://localhost:8000/">http://localhost:8000</a> to use the remote Jupyter installation. Remember to change the default port 8888 if you changed it on the Jupyter configuration.</p><p>If you’re on <em>Windows </em>you can use <strong>PuTTY </strong>to configure a tunnel.</p><p>References:<br>¹ <a href="https://virtualenv.pypa.io/en/latest/">https://virtualenv.pypa.io/en/latest/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94eced97e0d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best quotes from people in tech]]></title>
            <link>https://antoniomignano.medium.com/best-quotes-from-people-in-tech-ca9395f28db2?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca9395f28db2</guid>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[quotes]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[entrepreneurship]]></category>
            <category><![CDATA[motivation]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Tue, 12 Mar 2019 10:59:08 GMT</pubDate>
            <atom:updated>2019-03-13T19:28:29.877Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yzp6In4dIFOQGDcE5ZesJw.jpeg" /></figure><p>I think we’re living in an extraordinary era in which great men are existing.</p><p>With this article I’d love to share some of the quotes of these men who really inspire me and are helping me achiving a <strong>doer mindset</strong>.</p><h3>Elon Musk</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*Com_TvUiJ_8f_nzfEJxMFg.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Elon_Musk">https://en.wikipedia.org/wiki/Elon_Musk</a></figcaption></figure><ol><li>“<em>If you get up in the morning and think the future is going to be better, it is a bright day. Otherwise, it’s not.</em>”</li><li>“<em>The first step is to establish that something is possible; then probability will occur.</em>”</li><li>“<em>I could either watch it happen or be a part of it.</em>”</li><li>“<em>Some people don’t like change, but you need to embrace change if the alternative is disaster.</em>”</li><li>“<em>Persistence is very important. You should not give up unless you are forced to give up.</em>”</li></ol><h3>Jeff Bezos</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*xQaKRHyIrr3RfaNc97FBXg.jpeg" /></figure><ol><li>“<em>If you double the number of experiments you do per year you’re going to double your inventiveness.</em>”</li><li>“<em>The great thing about fact-based decisions is that they overrule the hierarchy.</em>”</li><li>“<em>It’s not an experiment if you know it’s going to work.</em>”</li><li>“<em>If you’re not stubborn, you’ll give up on experiments too soon. And if you’re not flexible, you’ll pound your head against the wall and you won’t see a different solution to a problem you’re trying to solve.</em>”</li></ol><h3>Warren Buffet</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*Osy4KonLZnoCI7jOfMaQhA.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Warren_Buffett">https://en.wikipedia.org/wiki/Warren_Buffett</a></figcaption></figure><ol><li>“<em>It’s better to hang out with people better than you. Pick out associates whose behavior is better than yours and you’ll drift in that direction.</em>”</li><li>“<em>It is not necessary to do extraordinary things to get extraordinary results.</em>”</li><li>“ <em>Someone’s sitting in the shade today because someone planted a tree a long time ago.</em>”</li><li>“ <em>Chains of habit are too light to be felt until they are too heavy to be broken.</em>”</li><li>“<em>Opportunities come infrequently. When it rains gold, put out the bucket, not the thimble.</em>”</li></ol><h3>Bill Gates</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*44dSxRGDd054C6AVCDbVNw.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Bill_Gates">https://en.wikipedia.org/wiki/Bill_Gates</a></figcaption></figure><ol><li>“ <em>Life is not fair; get used to it.</em>”</li><li>“<em> As we look ahead into the next century, leaders will be those who empower others.”</em></li><li>“ <em>Technology is just a tool. In terms of getting the kids working together and motivating them, the teacher is the most important.”</em></li><li>“<em>Be nice to nerds. Chances are you’ll end up working for one.”</em></li></ol><h3>Jack Ma</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*bT-94GApqY5cM866-83wkA.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Jack_Ma">https://en.wikipedia.org/wiki/Jack_Ma</a></figcaption></figure><ol><li>“<em>Never give up. Today is hard, tomorrow will be worse, but the day after tomorrow will be sunshine.</em>”</li><li>“<em>We are never in lack of money. We lack people with dreams, who can die for those dreams.</em>”</li><li>“<em>Once in your life, try something. Work hard at something. Try to change. Nothing bad can happen.</em>”</li><li>“<em>If you have different mindset, you will have a different outcome.</em>”</li></ol><h3>Sundar Pichai</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*vlnNZTdZSJFv9eRJ2H0G8Q.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Sundar_Pichai">https://en.wikipedia.org/wiki/Sundar_Pichai</a></figcaption></figure><ol><li>“<em>As a leader, It is important to not just see your own success, but focus on the success of others.</em>”</li><li>“<em>A person who is happy is not because everything is right in his life, He is happy because of his attitude towards everything in his life is right.</em>”</li><li>“<em>Let yourself feel insecure from time, It will help you grow as an individual.</em>”</li></ol><h3>Steve Job</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*JKOZ_wBlIu2auEayjTQSWA.jpeg" /><figcaption>Source: <a href="https://en.wikipedia.org/wiki/Steve_Jobs">https://en.wikipedia.org/wiki/Steve_Jobs</a></figcaption></figure><ol><li>“<em>Sometimes life is going to hit you in the head with a brick. Don’t lose faith.”</em></li><li>“<em>It’s really hard to design products by focus groups. A lot of times, people don’t know what they want until you show it to them.”</em></li><li>“<em>Sometimes when you innovate, you make mistakes. It is best to admit them quickly, and get on with improving your other innovations.”</em></li><li>“<em>Innovation distinguishes between a leader and a follower.</em>”</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca9395f28db2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Be Succesful — Best Of]]></title>
            <link>https://antoniomignano.medium.com/how-to-be-succesful-best-of-a24ebf9a14f?source=rss-3ab28690b2ed------2</link>
            <guid isPermaLink="false">https://medium.com/p/a24ebf9a14f</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[inspiration]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[success]]></category>
            <category><![CDATA[self-motivation]]></category>
            <dc:creator><![CDATA[Antonio Mignano]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 16:08:00 GMT</pubDate>
            <atom:updated>2019-02-18T16:08:00.335Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To Be Successful — Best Of</h3><p>I decided to write this article after reading a blog post from <strong>Sam Altman</strong>, which I really recommend reading (<a href="http://blog.samaltman.com/how-to-be-successful">http://blog.samaltman.com/how-to-be-successful</a>) and on which this article is based on.</p><p>I’m going to analyze some of the 13 points of the post and say what I think.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QmqHgg4hA9kTVANshDGxfw.jpeg" /><figcaption><a href="https://www.freepik.com/free-vector/business-progress-graphic_759118.htm#term=success&amp;page=1&amp;position=1">Image credit</a></figcaption></figure><p><strong>2. Have almost too much self-belief</strong></p><p>This is one of the point in which I believe most, even though, the way we display this self-belief could be crucial in our relationship, sometimes it could be exchanged for arrogance or presumption.</p><p><em>Never forget to stay humble.</em></p><p><strong>3. Learn to think independently</strong></p><p>The part I love to focus on is the following:</p><blockquote>“I will fail many times, and I will be really right once” is the entrepreneur’s way. You have to give yourself a lot of chances to get lucky.</blockquote><p>I and a friend were discussing this point, no one is paying enough attention to the fact you need to fail a lot before “getting lucky” even if you can hear this in every motivational speech.</p><p>It’s like you’re watching Netflix for 12 hours a day and then suddenly luck happens. It just doesn’t work that way.</p><p><strong>4. Get good at “sales”</strong></p><p>I always link this phrase to “you got to be good at <strong>selling yourself</strong>” told me once during one of my first interviews (which brutally failed btw).</p><p>One of the greatest skills that should be always present in our “portfolio” is this one, be good at selling ourselves.</p><p>Not always our CV or the things we’ve done can fully represent us and for that it is important to always have a clear view of who we are and what we’re aiming at.</p><p>Of course there could be the case in which we are facing a moment in our life when we don’t have enough answers to say who we are and where we want to head. This is the moment in which we have to try everything that could help us find our way.</p><p>Speak with random people, do interviews for positions you won’t take, the worst thing that can happen is that you get a little bit of extra experience in selling yourself and a boost in your self-confidence.</p><p><strong>5. Make it easy to take risks</strong></p><blockquote>It’s often easier to take risks early in your career; you don’t have much to lose, and you potentially have a lot to gain.</blockquote><p>There’s not much to say here. Same concept of the last point. Just throw yourself in uncomfortable situations, the more you do it the more you’ll gain self-confidence and be willing to take risks.</p><p><strong>8. Be bold</strong></p><p>This connects with the point 4 (Get good at “sales”), not always the ideas we’re producing are seen as bold as we are figuring them in our mind. Sometimes it is important to have an idea of what the others may want to hear and may need to be stimulated.</p><p><strong>11. Build a network</strong></p><blockquote>A particularly valuable part of building a network is to get good at discovering undiscovered talent. Quickly spotting intelligence, drive, and creativity gets much easier with practice. […] Remember that you are mostly looking for rate of improvement, and don’t overvalue experience or current accomplishment.</blockquote><p>Getting to know people is never a waste of time.</p><p>You have the chance to have someone else’s point of view, share your experience and even obtain some.</p><p>Let me close with this:</p><blockquote>Success is not a good teacher, failure makes you humble.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a24ebf9a14f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>