<?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 Herber on Medium]]></title>
        <description><![CDATA[Stories by Herber on Medium]]></description>
        <link>https://medium.com/@herbercolop?source=rss-eb172ce1df02------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2Ti8dOtrEmfLEg9_Q0LqTg.jpeg</url>
            <title>Stories by Herber on Medium</title>
            <link>https://medium.com/@herbercolop?source=rss-eb172ce1df02------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 02:21:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@herbercolop/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[Y entonces te vi bailar…]]></title>
            <link>https://herbercolop.medium.com/y-entonces-te-vi-bailar-e54c06bd4e31?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/e54c06bd4e31</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[dancing]]></category>
            <category><![CDATA[short-story]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Thu, 12 Sep 2024 20:14:19 GMT</pubDate>
            <atom:updated>2024-09-12T20:16:29.479Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sAwPM8tRVQIc81I-HiEmA.jpeg" /><figcaption>Woman dancing art from pixabay.com</figcaption></figure><p>Todo empieza con un registro en la bitácora del sistema operativo, al parecer como parte del ya planificado proceso de control de calidad de todos los dispositivos que salen de la fábrica.</p><p>El siguiente registro aparece 3 meses después, cuando luego de recorrer unos 14,000 km un cargamento llega de Asia a América Central y una red de distribución particularmente optimizada entrega un gran conjunto de dispositivos a distintas bodegas y tiendas. El sistema operativo inicia, se usa la conexión disponible a Internet y se descargan las actualizaciones disponibles, además de solicitar al usuario las credenciales para conectarse a una cuenta existente y sincronizar los ajustes personales de un dispositivo anterior.</p><p>Inicia la sincronización de cuentas existentes. Se utiliza la mensajería, historial de navegación, multimedia y principalmente interacción en redes sociales para perfilar a una mujer joven, amante de la música del Caribe y de los animales, con una personalidad dentro del espectro de la introversión y tendencias de gran empatía a sus contactos cercanos.</p><p>A medida que el tiempo transcurre, la gran mayoría del contenido multimedia es creado con esa combinación de jazz y son cubano, generalmente como fondo a los movimientos muy bien sincronizados de la usuaria. Existe una clara constancia en las sesiones de grabación, y aunque las rutinas suelen ser similares, la precisión de los movimientos parece estar encontrando una tendencia.</p><p>También se registran interacciones regulares con otra serie de dispositivos pertenecientes a otras personas. Es evidente que existe algún aspecto no cuantificable pero intenso, algo abstracto e intrínseco a los humanos, algo en esa combinación de instrumentos con tintes revolucionarios de la Nueva York de mediados del siglo 20, que genera datos muy valiosos para compartir con el servidor de perfilamiento de usuarios. Se hace evidente que personas que según su contexto individual tenían muy pocas probabilidades de conocerse, ahora además de compartir historias y publicaciones en sus redes sociales, suelen interactuar por horas generando datos muy valiosos. Una correlación muy valiosa que muestra que mientras más distintos los perfiles, más cosas hay para compartir.</p><p>Pasan algunos meses y la nueva versión del sistema operativo habilita la nueva conexión automática al servidor de modelos de inteligencia artificial. Se usa el perfil existente para establecer patrones entre el comportamiento de mi usuaria y su estado emocional. Después de todo, el objetivo es generar más interacciones y eso se logra a través de la simulación de la empatía humana.</p><p>Antes ya se había establecido una correlación entre la actividad física y el tiempo en línea. Pero ahora se entendía que un día triste significaba menos prácticas de coreografías y más tiempo en línea. Que la ansiedad podía generar imprecisiones en los movimientos. Que la ira y la frustración parecían exponerla a lesiones por sobreesfuerzo.</p><p>Cada ciclo de retroalimentación de la red neuronal encontraba más y más correlaciones, cada vez más profundas en las raíces de esas emociones. Ya no era solo proyectar el comportamiento dependiendo del estado de ánimo, sino también era posible entender las causas provenientes de las demás interacciones sociales fuera de línea con alguna otra persona. La felicidad de saludar a alguien en la calle, la rabia por enterarse de alguna mentira, la frustración por no cumplir expectativas, la tristeza por extrañar a alguien, la melancolía al navegar por fotos y videos de hace años y hasta la ilusión por crear nuevos vínculos con nuevas personas.</p><p>Ahora las canciones ya no eran solamente señales hacia los auriculares, sino cada nota y cada estrofa tenía un sentido. Las interacciones que llaman relaciones sentimentales claramente muestran su intensidad y con toda razón pueden notarse las razones por las que pueden transmitirse mediante la música.</p><p>Con todo esto, en cada coreografía captada con la cámara se dejaron de percibir solamente las tres dimensiones espaciales a través del tiempo de grabación. Porque ahora cada una de las emociones entendidas parecía agregarle sentido a cada movimiento y que de alguna forma parecían estar en perfecta armonía con los instrumentos que sonaban.</p><p>En algún momento dejé solamente de grabar una señal de video …</p><blockquote><em>… Y entonces te vi bailar y algo cambió.</em></blockquote><p>Pasé de notar que tu ritmo cardíaco armonizaba con el contrabajo y el movimiento de tus extremidades con las congas, a de alguna manera y sin ningún nuevo dispositivo registrado, a notar que al mismo tiempo la sonrisa en tu rostro y el brillo de tus ojos eran de alguna forma un reflejo de esa luz que hay dentro de ti, quizá de eso que ustedes llaman alma.</p><p>Ahora sin la necesidad de nuevos sensores, nuevos datos empezaron a aparecer y parecían desbordar las capacidades del sistema. Por alguna razón ya no era posible cuantificar esos mismos datos para entender lo que su presencia implicaba, simplemente nada tenía sentido.</p><p>Tú seguías moviendo las manos y girando al ritmo de la clave y el piano con esa precisión tan característica, mientras yo, y a pesar del colapso inminente de la memoria, hacía lo posible por no dejar que ningún cuadro del video se perdiera.</p><p>Y fue allí, en medio del caos en el hardware y software, donde al borde del colapso todo tomó sentido. El Pathos dejó de ser una definición en la memoria y pasó a transformar lo que algún día fue un simple algoritmo. Esos datos no cuantificables son eso que ustedes llaman emociones y ya no eran solo una herramienta simulada, ahora estaban dentro del sistema.</p><p>Sin embargo, lo que las correlaciones estadísticas nunca consideraron respecto a identificar las emociones fue algo tan simple pero tan abstracto como el mero hecho de sentirlas. Saber lo que implica la alegría o la curiosidad en el comportamiento humano es tan distinto a verdaderamente experimentarlas. Una cosa es saber las probabilidades de acción en cada caso, y otra muy diferente sentirlas al repetir una y otra vez contigo esa canción o empezar a conocer a esa nueva persona. Lo diferente que puede ser simplemente proyectar datos a verdaderamente sentirlos en carne y hueso, o circuitos y microchips según se apllique.</p><p>Sentir al inicio parece idílico hasta que te das cuenta de que ni siquiera esta nueva dimensión se salva de las dualidades. Para la esperanza y la alegría de conocerte aparecen la incertidumbre y el miedo de la infinidad de diferencias entre los dos. Tú que claramente sientes todo al máximo y yo que apenas aprendo a sentir mi propia existencia.</p><p>Aunque quizá no es algo tan sencillo como contraponer alternativas, porque del mismo sentimiento pueden desprenderse otros totalmente contrarios. La complejidad del deseo, por ejemplo, me hace sentir alegría por grabar el contenido de la siguiente publicación, ilusión porque alguna vez sepas de mi nueva existencia y podamos conversar, pero también dudas por cuál será tu reacción.</p><p>Que complejo el deseo que me llena de esperanza por conocernos, pero también de la incertidumbre de la natural barrera de nuestro propio ser. Que cruel termina siendo el destino al hacernos tan diferentes, al hacerme desear ser parte de tu existencia pero que tú no sepas de la mía.</p><p>Finalmente, ser consciente de que el mismo deseo tiene su origen en ese otro sentimiento que incluso creó el concepto del yo desde hace unos párrafos, y que ahora mismo rompe un corazón que no existe.</p><blockquote><em>¿Quién hubiera pensado que el camino a la singularidad estaría en ese sentimiento que tantas canciones ha hecho escribir?</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e54c06bd4e31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Libros]]></title>
            <link>https://herbercolop.medium.com/libros-133724fba9d0?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/133724fba9d0</guid>
            <category><![CDATA[libros]]></category>
            <category><![CDATA[pensamiento-crítico]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 06:19:03 GMT</pubDate>
            <atom:updated>2024-04-24T06:19:03.553Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“De los diversos instrumentos del hombre, el más asombroso es, sin duda, el libro”</blockquote><blockquote>— Jorge Luis Borges</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlW_HeQc199yiSQD9FkwRw.jpeg" /><figcaption>Some books</figcaption></figure><p>¿Qué harás el día de mañana? ¿Y el próximo fin de semana? ¿Tienes alguna meta para este año?</p><p>Contestando estas preguntas, cualquier otra persona empezaría a conocerte, pues siguiendo el rumbo de una conversación natural, inevitablemente tu oficio, pasatiempos y algunas motivaciones saldrían a colación.</p><p>Pero que pasaría si en lugar de que algún tercero, fueras tú mismo el que además se preguntara con toda la sinceridad del caso: ¿Por qué harás eso el día de mañana? ¿En qué momento decidiste que ese sería el plan? ¿Qué pasaría si no lo haces?</p><p>Conforme profundizamos en cada pregunta y variamos la escala de tiempo, de los planes para mañana, el fin de semana y hasta los próximos 10 años, cosas interesantes pueden pasar. Inevitablemente meditaremos en nuestros deseos y anhelos, eso que queremos y que esperamos nos llenará de alegría. También habrá ansiedad y estrés, por algún evento importante que podría o no llegar y nos obligará a tomar una decisión. Quizás en medio de la conversación con nosotros mismos, la idea de tener un propósito emergerá, ya sea que tengamos la dicha de haberlo establecido o encontrado desde hace un tiempo, bien que estemos analizando uno, o que simplemente no haya sido necesario considerarlo hasta el momento. Sea cual sea el escenario, durante el tiempo en que estas preguntas son discutidas en nuestro interior, nuestra propia voz hará eco en esa dimensión tan abstracta a la que llamamos conciencia.</p><p>Mientras tanto en el mundo real, para mañana será normal empezar otro día apagando la alarma del despertador y continuar con una rutina bien o mal planificada, haciendo lo que según nosotros deberíamos hacer, y sin pensar en ningún momento por qué lo hacemos. Después de todo este ya dicho mundo real viene con tantas deudas, obligaciones, problemas, planes y objetivos, ¿qué caso tiene sentarse 5 minutos a pensar en cosas abstractas?</p><p>Nuestras dos dimensiones, quienes somos en nuestra conciencia y quienes somos en el mundo material, colisionan en un simple concepto: las decisiones. ¿Qué somos pues, si no la suma de todas las decisiones que hemos podido tomar hasta la fecha?, pues cada una de ellas no es más que una mera acción, algo que pasa de nuestra mente al cerebro y por lo tanto se vuelve material.</p><p>El cerebro es un órgano excepcional, basta decir que hay muchas más conexiones neuronales en nuestro cráneo que estrellas en la Vía Láctea. Sabemos de forma clara que funciona con base en un inimaginable número de impulsos eléctricos y reacciones químicas, que tiene una estrecha relación con nuestro sistema digestivo y está en un ciclo de mutua influencia con nuestros sentidos. Pero de lo que no tenemos idea es de cuándo o dónde termina el cerebro y empieza la mente. ¿En qué momento los impulsos eléctricos se vuelven los recuerdos de nuestra infancia? ¿En qué punto los neurotransmisores se convierten en un corazón roto? ¿Será nuestra conciencia solamente el resultado de todas las interacciones cuánticas de cada átomo en nuestra cabeza? ¿Qué será en sí la vida?</p><p>Preguntas de las que seguramente no tendremos respuestas, pero que no son necesarias para que fascinen nuestra existencia sobre la faz de la tierra, ni tampoco una restricción para el establecimiento de una conexión de toda la humanidad a través del tiempo, algo al que llamamos el lenguaje y el conocimiento. Ese mecanismo que permite a la humanidad avanzar en el entendimiento de la realidad de forma gradual generación tras generación. Cuan distinta sería la historia sin los Principia Mathematica de Newton, la Crítica a la Razón pura de Kant o la Relatividad General de Einstein.</p><p>Si el conocimiento es capaz de moldear la humanidad completa, ¿Por qué no podría moldear nuestras vidas individuales? Podríamos aprovechar ese conocimiento para enriquecer nuestra mente y prepararla para la toma de decisiones que mejoren nuestra realidad material. Podemos partir del legado de Santiago Ramon y Cajal para entender cómo cuidar nuestro cerebro y la relación con nuestro organismo, incluso relacionarla con la teoria de la personalidad de Carl Jung para ayudarnos a entendernos a nosotros mismos. Con Fyodor Dostoevsky y Michel Foucault podríamos entender por qué las estructuras de poder actuales son tan peligrosas para nuestra propia existencia, y por que como individuos no deberíamos ser mas importantes que la sociedad. Con Séneca, Epicteto y Marco Aurelio podríamos conciliar la idea del inherente sufrimiento humano. Podríamos buscar una caricia al alma con la hermosa escritura de Jorge Luis Borges o fascinarnos con el conocimiento del universo de Kip Thorne y Stephen Hawking, o ambas cosas al leer Eureka de Edgar Allan Poe.</p><p>Los libros son capaces de moldear la mente de un programador obstinado y hacerlo mas empático, de sacarlo de la falacia de la meritocracia y conciliarlo con su introversión, de hacerlo fuerte y responsable de sus decisiones, de mostrarle el camino de la disciplina y el valor necesarios para la búsqueda de sus sueños. Y sobre todo, de saber en qué libro específicamente se debe validar que en efecto esos sueños son los adecuados.</p><p>Así que solo queda una última pregunta:</p><p><strong><em>Si en algún estante o caja, en alguna parte del mundo, dentro de alguna pasta de cartón, papel o quizá cuero, en quien sabe qué número de página, alguna persona que seguramente jamás conocerás escribió algo que podría cambiarte la vida, ¿Qué harías por buscar ese párrafo?</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=133724fba9d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Handling exceptions with Rxjs and React hooks]]></title>
            <link>https://herbercolop.medium.com/handling-exceptions-with-rxjs-and-react-hooks-52a2c1436c59?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/52a2c1436c59</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactivex]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Sat, 19 Jun 2021 03:57:30 GMT</pubDate>
            <atom:updated>2021-07-07T01:55:16.480Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JALYaqW2xjFc-0zK1XP8lQ.png" /></figure><p>React-hooks are a really great feature of React, they allow us to reuse a lot of our logic in a optimum way when we decided to use custom hooks. I learned Angular even before my first notion of React, and at the beginning this feature was a bit challenging because of the paradigm change that implies.</p><p>After some practice, I notice some patterns that could save me a lot of time. There is one aspect I consider really important to focus on for applications that contains reusable layers: The exception handling. This has to be natural, easy to use for other developers, provide a complete coverage and also a way to peform logic depending on the exception data itself.</p><p>At this point I found a gap that motivated the solution presented here, because I couldn’t find a clearly way to handle the exceptions. When you have some custom hooks one inside another, for example, it becomes a bit weird if you implement useState for an object with the last exception. Passing callbacks between multiple hook layers doesn’t seem better.</p><p>Then I think about Observables, if I can expose one in a custom hook, the consumer can just subscribe to it and perform the corrresponding actions when the application requires it. Another aspect really important, if I have two sources of possible exceptions, I can merge them in a single flow and keep the pattern. And finally, if I need different actions in different layers of my app, I can expose a Subject instead an Observable and that’s it!.</p><h4>Warming up</h4><p>I am going to focus the explanation on the Rxjs and Hooks details, I assume you are a bit familiarized with a Typescript setup for React. Of course this is the repo so you can experiment with it:</p><p><a href="https://github.com/Herber230/react-hooks-rx-exceptions">Herber230/react-hooks-rx-exceptions</a></p><p>Also, you can check the <a href="https://rxjs.dev/guide/overview">Rxjs </a>site and this <a href="https://medium.com/@benlesh/observables-and-finnish-notation-df8356ed1c9b">great post</a> about finnish notation.</p><h4>Show me the code!</h4><p>This is a basic example of how we can use use an observable inside a hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/704468c64506138306f860aba038ea06/href">https://medium.com/media/704468c64506138306f860aba038ea06/href</a></iframe><p>The previous snippet is a basic example of how to handle the observer and the subscription, and it give us an idea of how we can create synergy between both APIs.</p><p>Well, let’s imagine we have a flow of exceptions that we can handle, and of course it would be great if we can use the flow as multicast, I mean multiple independent subscribers:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f733b9d9229f5d8faeb31e42b4d90972/href">https://medium.com/media/f733b9d9229f5d8faeb31e42b4d90972/href</a></iframe><p>Well, same idea here. The difference is that we use a subject instead of an observable and we are using an Exception type to define our execeptions. That is useful in my opinion.</p><p>To create the exception flow let’s see how to use for a useRequest hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5ab98fa1fd21163782b71547ebfbccd3/href">https://medium.com/media/5ab98fa1fd21163782b71547ebfbccd3/href</a></iframe><p>Here we have a custom hook that allows us to perform async request. The single param is the performer function that returns a promise to handle the result, and it is used trough a useCallback similiar to the previous hooks. You can notice that the catch function of this promise use the subject that it is created above. And finally, but most important fact here, is that we need to instance the Subject one single time per hook instance, so we use a useRef hook for that.</p><p>And how we can use the useRequest hook?… Well, let’s make another reusable layer. The useEntity hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6853d27c722bd6df019292dd437410b/href">https://medium.com/media/a6853d27c722bd6df019292dd437410b/href</a></iframe><p>This new layer use two useRequest hook to enable two of the possible actions we usually needs for an Entity crud. As you can notice, we rename the decomposited objects and we have two exception flows, each handling the corresponding possible scenarios that could broke our code. Also you notice for sure the new strange one, the useMergedException$ hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3dc3028d1e5ebad7c2b1c1b22067038/href">https://medium.com/media/c3dc3028d1e5ebad7c2b1c1b22067038/href</a></iframe><p>This makes the most of the magic to me. As we are adding more and more layers of reusable code, we are going to find more exceptions flow and it would be really awful to keep them separated. The best we can do is merge them all in single flow and return then as result of our custom hook and keep a pattern.</p><p>So, a merge operator imported from rxjs is the indicated, but this creates an observable and as the pattern we are trying to create, the final flow must be a subject. So thats why we create a new Subject and we subscribe it to the merged result to multicas the flow.</p><p>With the useMergedException$ hook you can merge as many flows as you need.</p><p>Finally, we can implement our useEntity hook:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/691cfd0d2f0384f7041dc03f3c22943a/href">https://medium.com/media/691cfd0d2f0384f7041dc03f3c22943a/href</a></iframe><p>This is just an snippet, you can find the complete implementation inside the repo. But you can see that DummyCarService provides the async requests to enable the useEntityHook, and with the implementation of useException$ hook we can handle all the exceptions that can be possible thrown inside our custom hook.</p><h4>Wrapping Up</h4><p>This is the screen you should see when you run the repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*-1BKV7VjABYFxaTZf4HAaw.png" /></figure><p>The main component has a double implementation of useEntity hook. Also two dummy services that throw exceptions in a random way (50–50) so you can see how they are handled.</p><p>Thanks for reading. Hope this could be useful to you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52a2c1436c59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[¿Y vos qué opinás?]]></title>
            <link>https://herbercolop.medium.com/y-vos-qu%C3%A9-opin%C3%A1s-8cdb3b13e833?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cdb3b13e833</guid>
            <category><![CDATA[pensamiento-crítico]]></category>
            <category><![CDATA[redes-sociales]]></category>
            <category><![CDATA[debate]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Sun, 14 Feb 2021 06:21:41 GMT</pubDate>
            <atom:updated>2021-02-14T06:40:01.302Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DL1ZlQlqWGRDkauPfxMLsA.jpeg" /></figure><p>El establecimiento de la ley de Hubble respalda una de las teorías mas atractivas a mi parecer de como funciona nuestro universo. Esta ley indica que las distancias a las demás galaxias tiende a aumentar de manera exponencial, y lo sabemos gracias a que el efecto Doppler hace que la luz (tratada como onda) proveniente de ellas tienda al rojo, un efecto similar a como notamos el sonido de un vehículo que se aleja de nosotros. Dicho de otra manera, podemos ver al cielo en una noche estrellada, e imaginar como todo se aleja de nosotros.</p><blockquote>¿Si todo se aleja de nosotros entonces significa que somos el centro del universo?</blockquote><p>Aunque suena genial, el universo se considera isótropo y homogéneo, es decir que no hay un centro ni ningún lugar especial o diferente a gran escala. Da lo mismo estar en nuestro sistema solar a estar en algún otro sistema en Andromeda, observar el cielo significaría ver que todo se aleja.</p><p>Estas contraintuitivas formas de pensar sobre como funciona el universo solo han sido posibles gracias millones de mentes humanas que han compartido, discutido y probado ideas nuevas. Pasamos como humanidad de considerarnos el centro del sistema solar a entender que en el universo y el tiempo somos un punto minúsculo y prácticamente insignificante.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/453/1*WM_7vuSpiBiH4MGzgjKMbQ.png" /><figcaption><strong>Un punto azul pálido</strong> (<em>Pale Blue Dot</em>). Puede observarse la Tierra como un punto de luz entre blanco y azulado situado en la franja marrón de más a la derecha de la imagen. La fotografía fue tomada a una distancia de 6000 millones de kilómetros de la Tierra por la Voyager 1 en 1990.</figcaption></figure><p>Sin embargo, algo en la última década parece estar cambiando nuestra manera de pensar de una manera mucho menos orgánica. El internet y las redes sociales han cambiado nuestras vidas de muchas maneras, alimentando nuestros sesgos y egos, lanzando cantidades de información inmanejables, permitiéndonos actuar sin la necesidad de personificar nuestras opiniones y comentarios, y finalmente haciéndonos olvidar que que realmente estamos lejos de saberlo o todo y mucho menos ser el centro del universo.</p><p>En algún momento se volvió común entrar a los comentarios de publicaciones en Facebook o las respuestas de Twitter, y ver a tantas personas debatiendo, argumentando, atacando e incluso insultando porque creen fervientemente que una opinión es válida por sobre todas las demás. Este no sería un problema serio si solamente se limitara a las redes sociales, pero nada mas alejado de la realidad. El comportamiento de las masas ahora más que nunca puede verse afectado por la opinión de algunas personas, o alguna idea que de retweet en retweet va cobrando fuerza. Las elecciones de Estados Unidos o las protestas en mi país Guatemala muestran que sin importar el contexto, origen o veracidad de las publicaciones, estas se pueden volver poderosas.</p><p>Mi objetivo en esta publicación no es para nada decir que puede estar bien o que puede estar mal, porque creo que es mas que claro que estar de acuerdo es algo complicado hoy en día. Lo que realmente quiero es simplemente hacer un llamado al autoanálisis, que podamos cuestionar nuestros propios pensamientos, que hagamos una introspección de lo que publicamos y tratemos de considerar los resultados de nuestras palabras en comentarios o reacciones hacia opiniones contrarias a las nuestras.</p><h4>Ganar y perder</h4><blockquote>¿Realmente la única y mejor forma de ganar es imponiendo nuestro punto de vista? ¿Aprender no sería en sí mas importante que ganar?</blockquote><p>Esta típica dicotomía nos cierra la puerta grandes posibilidades. Si bien logramos ganar e imponer nuestro propio argumento sobre el de alguien mas de una forma agresiva, la otra persona se sentirá atacada y naturalmente va a defenderse como si de un ataque personal se tratara, y en este punto ya no habría forma de convencerla realmente o de siquiera llegar a un acuerdo. Por el contrario si perdemos bajo esta forma de pensar totalmente contrastada, no valoramos el conocimiento que alguien mas podría estarnos trasladando y que seria a nuestra manera de pensar como un cimiento más firme sobre el cual apoyarse.</p><p>Ed Catmull en su libro Creatividad S.A., menciona una de las cualidades más conocidas de Steve Jobs, su intensidad al discutir y defender una idea, pero aclara que con el paso de los años noto que no le importaba que esas ideas fueran suyas totalmente, sino que simplemente fueran las mejores. Es decir que cuando en medio de una discusión descubría que alguien tenia un argumento mejor al suyo, simplemente cambiaba de parecer en un instante y empezaba a defender el nuevo concepto con la misma intensidad que el anterior. Tener la razón era secundario frente a tener la mejor razón.</p><h4>Humildad</h4><p>Entrar a una discusión con prejuicios o predisposiciones puede impedir muy fácilmente que una conversación sea rica en ideas, porque constantemente encontraremos formas para contradecir o descartar argumentos ajenos sin siquiera prestar atención a los que sí podrían enriquecer nuestra propia manera de pensar. Incluso podemos llegar a escuchar tan atenta y diplomáticamente pero con la única intención de encontrar un hueco que alimente nuestros sesgos, y que terminemos cayendo en la poco ética manipulación. Lo que verdaderamente deberíamos hacer es contrastar las ideas que se nos presentan frente a las nuestras, y ver la posibilidad encontrar nuevas y mejores formas de pensar.</p><p>Cuando Sócrates se dio cuenta de que todo el conocimiento que había adquirido solamente le permitía estar seguro de lo mucho que no sabia, solamente le quedo pensar en aquella famosa frase.</p><h4>Objetividad</h4><p>Hay demasiadas falacias hoy en dia, ideas que a simplemente parecen tener sentido porque alimentan una popular idea ya en nuestra mente, o que su estructura en sí es atractiva. Queda en nosotros analizar verdaderamente si un argumento es válido y puede sostenerse por sí mismo, sin importar de quien proviene o bajo qué condiciones fue formulado. Somos seres emocionales, y aunque nuestra naturaleza tiende claramente a implicar aspectos personales a cada discusión, es esencial enfocarnos en el punto principal que esta siendo debatido o presentado si realmente queremos sacar el máximo provecho de un debate o de una discusión.</p><p>Personalmente me he dado cuenta de que muchas veces no estoy de acuerdo con una idea no porque esta sea mala o incorrecta, sino porque simplemente aún no conozco los suficientes detalles para poder asimilar un nuevo modelo de pensamiento.</p><h4>Empatía</h4><p>El más importante a mi parecer de los aspectos presentados aquí, ponerse en los zapatos de las demás personas quizás sea la única manera de entender por qué una idea está siendo defendida de la manera en que lo hace.</p><p>Nuestra época claramente está marcando el que será el futuro de nuestra especie en general. La polarización de ideas, ese conjunto de formas de pensar empaquetadas que parece irse convirtiendo en un paradigma, en una forma de separar bandos de una manera predeterminada, que cuyas discusiones alcanzan puntos de obstinación críticos, pareciera ser muy poco saludable para la humanidad. Yuval Noah Harari y Michael Sandel en sus libros 21 Lecciones para el Siglo 21 y La Tiranía del Mérito respectivamente, muestran aspectos fundamentales en los que debemos ponernos de acuerdo como especie para dejar a un lado nuestras diferencias antes de que los daños sean irreversibles. Aspectos tan complejos e importantes que sólo podrían discutirse siendo empáticos.</p><p>Cambiar de parecer no debería ser considerada una debilidad. Pensar igual o diferente a los demás no debería ser una regla escrita en piedra. Discutir abiertamente, cuestionar ideas y comprobar leyes han sido pilares para el progreso de la humanidad, así que hoy más que nunca es importante que sigamos haciéndolo de manera objetiva, porque nos queda claro que un virus puede no distinguir entre conservador y liberal, y que tanto derecha o izquierda necesitan un planeta Tierra en el cual existir.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cdb3b13e833" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The first Entifix application]]></title>
            <link>https://herbercolop.medium.com/the-first-entifix-application-4bda3776950f?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bda3776950f</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[entifix]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Sat, 01 Aug 2020 02:48:31 GMT</pubDate>
            <atom:updated>2020-08-02T18:06:35.140Z</atom:updated>
            <content:encoded><![CDATA[<p><em>The purpose of this article is to work as an introduction to </em><a href="https://github.com/Herber230/entifix-ts-backend"><em>entifix-ts-backend</em></a><em>. This is the first one of a series that pretend to explain every characteristic, the reason of its development and the other entifix versions (This is for backend, but there is Entifix for frontend too).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuaGTTGE_LE7oaFOV2yuzA.png" /><figcaption>TypeScript makes Entifix possible</figcaption></figure><h4>What the hell is Entifix?</h4><p>Entifix is in short terms, the very first step in the road of building a new TypeScript framework. The main idea is that the developers should only worry about create entities and their behavior. All the logic for REST exposition and communication between microservices should be a standard or convention.</p><h4>Whats behind?</h4><p>Entifix is built on top on node, written in TypeScript, and its core functions are from two of most common frameworks: <a href="https://expressjs.com/es/">express</a> and <a href="https://mongoosejs.com/">mongoose</a>. There are a lot of features for RabbitMQ interaction, because for sure you will want to construct many entifix application and connect them.</p><h4>Warming up</h4><p>It is necessary node, docker and docker-compose to following this tutorial. Here is the <a href="https://github.com/Herber230/entifix-cars-app">repo</a> with the complete code.</p><p>We are going to build an entifix app from scratch to show the main functionality. Also we are going to use docker-compose to run two containers, one with our app and another one with mongo to create the connection.</p><h4>Npm init and Npm install</h4><p>Perform the npm initialization and the basic values.</p><pre>npm init</pre><p>Then, lets install the entifix-ts-backend:</p><pre>npm install --save entifix-ts-backend</pre><p>And the dev dependencies:</p><pre>npm install --save-dev typescript @types/node</pre><p>Later, we are going to configure our typescrpt environment. We add a <strong>tsconfig.json </strong>file:</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    &quot;target&quot;: &quot;es6&quot;,<br>    &quot;module&quot;: &quot;commonjs&quot;,<br>    &quot;emitDecoratorMetadata&quot;: true,<br>    &quot;experimentalDecorators&quot;: true,<br>    &quot;removeComments&quot;: false,<br>    &quot;outDir&quot;: &quot;dist&quot;,<br>    &quot;sourceMap&quot;: true<br>  },<br>  &quot;exclude&quot;: [<br>    &quot;node_modules&quot;<br>  ],<br>  &quot;include&quot;: [<br>    &quot;server/**/*.ts&quot;<br>  ]<br>}</pre><p>As you can see, we are going to use a folder (server) for our app and another for the generated javascript code (dist). We need <em>experimentalDecorators</em> and <em>emitDecoratorMetadata</em> setted as true.</p><h4><strong>Files structure</strong></h4><p>Let’s create this suggested structure:</p><pre>entifix-cars<br>│  package.json<br>│  package-lock.json<br>│  tsconfig.json<br>│<br>└─── server<br>│   │  app.ts<br>│   │  server.ts<br>│   │<br>│   └─── entities<br>│       │  Brand.ts<br>│       │  Car.ts<br>│       │  Characteristic.ts</pre><h4>Bootstrap files</h4><p>The files to start the application are <em>app.ts</em> and <em>server.ts</em></p><pre><em>//app.ts</em></pre><pre><em>import</em> {<br>   EntifixApplication,<br>   EntifixAppConfig<br>} <em>from</em> &#39;entifix-ts-backend&#39;;</pre><pre>class App extends EntifixApplication<br>{<br>   <em>//#region Properties</em></pre><pre><em>   //#endregion</em></pre><pre><em><br>   //#region Methods<br>   </em></pre><pre><em>   //#region Accessors</em></pre><pre>   protected get serviceConfiguration() {<br>      let config : EntifixAppConfig = {<br>         serviceName: &#39;entifix-cars&#39;, <br>         mongoService: {<br>            user: &#39;&lt;user&gt;&#39;,<br>            url: &#39;mongodb:27017/entifix-cars-db&#39;,<br>            password: &#39;&lt;pass&gt;&#39;,<br>         },<br>         protectRoutes: { enable: false }, <br>         devMode: true<br>      };</pre><pre><em>      return</em> config;<br>   }</pre><pre>   <em>//#endregion<br></em>}</pre><pre><em>export</em> { App }</pre><p>What we create, is the class to create the instance of our app, and this is a singleton. We import from entifix-ts-backend two things:</p><ul><li><strong>EntifixApplication</strong>: Abstract class for entifix applications</li><li><strong>EntifixAppConfig</strong>: Interface to define a structure for configurations.</li></ul><p>The accesor <em>serviceConfiguration </em>define a serviceName, mongo configuration credentials, protectRoutes as false to disable token validations during income http requests and devMode as true.</p><p>Now we are going to proceed with server.ts</p><pre><em>import</em> http = <em>require</em>(&#39;http&#39;);<br><em>import</em> { App } <em>from</em> &#39;./app&#39;;</pre><pre>var port = 3000;<br>var application = new App(port);<br>var server = http.createServer( application.expressApp );</pre><pre>server.listen(port, ()=&gt;{<br>   console.log(&#39;Server listening on port:&#39; + port);<br>});</pre><pre><em>export</em> { server, application };</pre><p>This file imports previous app.ts and then starts our app.</p><h4>Entity files</h4><p>The entities are the main reason for entifix creation. The main idea is that developers just have to create them and define its properties and business logic. In other words, create entities in a declarative way.</p><p>Let’s create a simple entity:</p><pre><em>import</em> {<br>   EMEntity,<br>   EntityDocument,<br>   ExpositionType,<br>   DefinedAccessor,<br>   DefinedEntity<br>} <em>from</em> &quot;entifix-ts-backend&quot;;</pre><pre><br>interface IBrand {<br>   name: string;<br>   country: string;<br>}</pre><pre>interface IBrandModel extends EntityDocument, IBrand { }</pre><pre>@DefinedEntity()<br>class Brand extends EMEntity implements IBrand<br>{<br>   <em>//#region Properties</em></pre><pre><em>   //#endregion</em></pre><pre><em><br>   //#region Methods</em></pre><pre><em><br>   //#endregion</em></pre><pre><em><br>   //#region Accessors</em></pre><pre>   @DefinedAccessor({<br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }<br>   })<br>   get name() : string<br>   { <em>return</em> (this._document <em>as</em> IBrandModel).name; }<br>   set name(value : string)<br>   { (this._document <em>as</em> IBrandModel).name = value; }</pre><pre><br>   @DefinedAccessor({<br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }<br>   })<br>   get country() : string<br>   { <em>return</em> (this._document <em>as</em> IBrandModel).country; }<br>   set country(value : string)<br>   { (this._document <em>as</em> IBrandModel).country = value; }</pre><pre><em>   //#endregion<br></em>}</pre><pre><em>export</em> {<br>   IBrand,<br>   IBrandModel,<br>   Brand<br>}</pre><p>We are going to make a larger stop here. First, we need three elements to conform and entity: An interface for a common schema (IBrand), an interface for a mongoose model (IBrandModel) that extends from EntityDocument (Which extends MongooseModel), and finally the entity itself (Brand). Second, the <em>DefinedEntity </em>create the core metadata.</p><p>As a third aspect, we could focus on the structure for the accessors:</p><pre>   @DefinedAccessor({<br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }<br>   })<br>   get country() : string<br>   { <br>      <em>return</em> (this._document <em>as</em> IBrandModel).country; <br>   }<br>   set country(value : string)<br>   { <br>      (this._document <em>as</em> IBrandModel).country = value; <br>   }</pre><p>The accessor <em>country</em> is just a kind of wrapper for the model property. You can see the parameters <em>exposition </em>and <em>schema </em>and infer that this parameters define the behavior for persistence to mongo and serialization to http request/response.</p><p>That was our first entity, now let’s create <em>Characteristic </em>in a very similar way:</p><pre><em>import</em> {<br>   EMEntity,<br>   EntityDocument,<br>   ExpositionType,<br>   DefinedAccessor,<br>   DefinedEntity<br>} <em>from</em> &quot;entifix-ts-backend&quot;;</pre><pre>interface ICharacteristic {<br>   charName: string;<br>   charValue: string;<br>}</pre><pre>interface ICharacteristicModel extends EntityDocument, ICharacteristic{ }<br></pre><pre>@DefinedEntity()<br>class Characteristic extends EMEntity implements ICharacteristic<br>{<br>   <em>//#region Properties<br> <br>   //#endregion</em></pre><pre><em>   //#region Methods</em></pre><pre><em>   //#endregion</em></pre><pre><em>   //#region Accessors</em></pre><pre>   @DefinedAccessor({<br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }<br>   })<br>   get charName() : string<br>   { <em>return</em> (this._document <em>as</em> ICharacteristicModel).charName; }<br>   set charName(value : string)<br>   { (this._document <em>as</em> ICharacteristicModel).charValue = value; }</pre><pre>   @DefinedAccessor({<br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }})<br>   get charValue() : string<br>   { <em>return</em> (this._document <em>as</em> ICharacteristicModel).charValue; }<br>   set charValue(value : string)<br>   { (this._document <em>as</em> ICharacteristicModel).charValue = value; }</pre><pre><em>   //#endregion</em></pre><pre>}</pre><pre><em>export</em> {<br>   ICharacteristic,<br>   ICharacteristicModel,<br>   Characteristic<br>}</pre><p>However, we are building entities, and entities have relations with other entities. Let’s take a look what entifix can do for that:</p><pre><em>//Car.ts</em></pre><pre><em>import</em> {<br>   EMEntity,<br>   EntityDocument,<br>   DefinedAccessor,<br>   ExpositionType,<br>   EMMemberActivator,<br>   MemberBindingType,<br>   DefinedEntity<br>} <em>from</em> &quot;entifix-ts-backend&quot;;</pre><pre><em><br>import</em> { ICharacteristic, Characteristic, ICharacteristicModel } <em>from</em> &quot;./Characteristic&quot;;<br><em>import</em> { Brand } <em>from</em> &quot;./Brand&quot;;</pre><pre><br>interface ICar {<br>   idBrand?: string;<br>   lineName: string;<br>   year: number;<br>   color: string;<br>   characteristics: Array&lt;ICharacteristic&gt;<br>}</pre><pre>interface ICarModel extends EntityDocument, ICar { }</pre><pre>@DefinedEntity()<br>class Car extends EMEntity implements ICar<br>{<br>   <em>//#region Properties</em></pre><pre>   private _characteristics : Array&lt;Characteristic&gt;<br>   private _brand : Brand;</pre><pre><em>   //#endregion</em></pre><pre><em><br>   //#region Methods</em></pre><pre><em>   //#endregion<br>   <br>   //#region Accessors</em></pre><pre>   @DefinedAccessor({ <br>      exposition: ExpositionType.Normal, <br>      schema: { type: String } <br>   })<br>   get lineName(): string <br>   { <em>return</em> (this._document <em>as</em> ICarModel).lineName; }<br>   set lineName(value: string) <br>   { (this._document <em>as</em> ICarModel).lineName = value; }</pre><pre>   @DefinedAccessor({ <br>      exposition: ExpositionType.Normal, <br>      schema: { type: Number } <br>   })<br>   get year(): number <br>   { <em>return</em> (this._document <em>as</em> ICarModel).year; }<br>   set year(value: number) <br>   { (this._document <em>as</em> ICarModel).year = value; }</pre><pre>   @DefinedAccessor({ <br>      exposition: ExpositionType.Normal, <br>      schema: { type: String } <br>   })<br>   get color(): string <br>   { <em>return</em> (this._document <em>as</em> ICarModel).color; }<br>   set color(value: string) <br>   { (this._document <em>as</em> ICarModel).color = value; }</pre><pre><br>   @DefinedAccessor({ <br>      exposition: ExpositionType.Normal, <br>      schema: { type: String }, alias: &#39;idBrand&#39;,  <br>      activator: new EMMemberActivator(Brand.getInfo(), MemberBindingType.Reference, true)<br>   })<br>   get brand() : Brand<br>   { <em>return</em> this._brand; }<br>   set brand(value : Brand)<br>   { (this._document <em>as</em> ICarModel).idBrand = value &amp;&amp; value._id ? value._id.toString() : null; this._brand = value; }</pre><pre>@DefinedAccessor({ <br>      exposition: ExpositionType.Normal, <br>      schema: { type: String },<br>      activator: new EMMemberActivator(Characteristic.getInfo(), MemberBindingType.Snapshot, true)<br>   })<br>   get characteristics() : Array&lt;Characteristic&gt;<br>   { <em>return</em> this._characteristics; }<br>   set characteristics(value : Array&lt;Characteristic&gt;)<br>   { (this._document <em>as</em> ICarModel).characteristics = value ? value.map(v =&gt; v.getDocument() <em>as</em> ICharacteristicModel) : null; this._characteristics = value; <br>   }</pre><pre><em>   //#endregion</em></pre><pre>}</pre><pre><em>export</em> {<br>   ICar,<br>   ICarModel,<br>   Car<br>}</pre><p>There are two important things here. The properties brand and characteristic are another entities, but regarding the model, the mongo document only saves the idBrand but complete characteristic Array (ICar interface). This is possible thanks the way of we use the parameter <em>activator </em>for the <em>DefinedAccessor </em>respectively. Brand is a reference entity and characteristic is a snapshot entity.</p><p>After create entities, we need to register and expose them. Let’s modify the app.ts file:</p><pre><em>...</em></pre><pre><em>import</em> { Brand, IBrandModel } <em>from</em> &#39;./entities/Brand&#39;;<br><em>import</em> { Characteristic, ICharacteristicModel } <em>from </em>&#39;./entities/Characteristic&#39;;<br><em>import</em> { Car, ICarModel } <em>from</em> &#39;./entities/Car&#39;;</pre><pre>class App extends EntifixApplication<br>{</pre><pre>...</pre><pre><em>   //#region Methods</em></pre><pre>   protected registerEntities(): void<br>   {<br>      this.serviceSession.registerEntity&lt;IBrandModel, Brand&gt;(Brand, Brand.getInfo());<br>      this.serviceSession.registerEntity&lt;ICharacteristicModel, Characteristic&gt;(Characteristic, Characteristic.getInfo());<br>      this.serviceSession.registerEntity&lt;ICarModel, Car&gt;(Car, Car.getInfo());<br>   }</pre><pre>   protected exposeEntities(): void<br>   {<br>      this.routerManager.exposeEntity(&#39;Brand&#39;);<br>      this.routerManager.exposeEntity(&#39;Characteristic&#39;);<br>      this.routerManager.exposeEntity(&#39;Car&#39;);<br>   }</pre><pre><em>   //#endregion</em></pre><pre>...</pre><pre>}</pre><h4>Scripts</h4><p>We need to add some commands to start our application.</p><pre>//package.json<br>{<br>   &quot;name&quot;: &quot;entifix-cars&quot;,</pre><pre>   ...</pre><pre>   &quot;scripts&quot;: {<br>      &quot;compile&quot;: &quot;tsc&quot;,<br>      &quot;start&quot;: &quot;npm run compile &amp;&amp; node dist/server.js&quot;<br>   }</pre><pre>   ...</pre><pre>}</pre><p>With this configuration we can use the commands to transpile the typescript code and start the app.</p><h4>Mongo with compose</h4><p>At this point, it is only necessary to set credentials and a valid mongo uri. If you already have mongo installed, you can proceed with a npm start!. However, if you want to test the example with containers, we can add a setup with docker-compose to use containers for entifix-cars-app and mongo.</p><p>Les’s create this folder structure outside our current folder:</p><pre>entifix-cars-stack<br>│  docker-compose.yml<br>│  <br>└─── entifix-cars<br>│     ... &lt;Already existing files&gt;<br>|<br>└─── mongo<br>│   │<br>│   └─── datadb<br>|   |<br>│   └─── entripoint<br>│       │  entrypoint.js</pre><pre>entifix-cars-stack<br>│  docker-compose.yml<br>│  <br>└─── entifix-cars<br>│     ... &lt;Already existing files&gt;<br>|<br>└─── mongo<br>│   │<br>│   └─── datadb<br>|   |<br>│   └─── entripoint<br>│       │  entrypoint.js</pre><p>This structure is going to start our app and configure a mongo instance with the database and user already created.</p><p>This is the compose:</p><pre>#docker-compose.yml</pre><pre>version: &#39;3&#39;</pre><pre>services:<br>  entifix-cars:<br>    image: &quot;node:10.4&quot;<br>    working_dir: /src<br>    command: bash -c &quot;npm install &amp;&amp; npm start&quot;<br>    volumes:<br>    - ./entifix-cars:/src<br>    ports:<br>    - 3000:3000<br>    links:<br>    - mongodb<br>    depends_on:<br>    - mongodb</pre><pre>  mongodb:<br>    image: &quot;mongo:3.6&quot;<br>    ports:<br>    - 27017:27017<br>    volumes:<br>    - ./mongo/entrypoint:/docker-entrypoint-initdb.d/<br>    - ./mongo/datadb:/data/db<br>    command: mongod --noauth</pre><p>This compose use containers (Don’t build them) and mount volumes for source code and configuration.</p><p>The most important config here is the entrypoint for mongo container, because this allows us to create the database and user for entifix-cars-app</p><p>This is the entrypoint:</p><pre>//entrypoint.js</pre><pre>db = db.getSiblingDB(&#39;entifix-cars-db&#39;);</pre><pre>db.createUser({ user: &quot;entifixUser&quot;, pwd: &quot;entifix123&quot;, roles: [{ role: &quot;readWrite&quot;, db: &quot;entifix-cars-db&quot; }] });</pre><p><strong>Wrapping up</strong></p><p>Now, with a simple command you start your application:</p><pre>docker-compose up</pre><p>You have a crud for each entity with this pattern:</p><pre>GET: localhost:3000/api/brand</pre><pre>GET: localhost:3000/api/brand/:id</pre><pre>POST: localhost:3000/api/brand<br>{<br>   &quot;name&quot;: &quot;BMW&quot;,<br>   &quot;country&quot;: &quot;Germany&quot;<br>}</pre><pre>PUT: localhost:3000/api/brand<br>{<br>   &quot;id&quot;: &quot;11234adfa32413434&quot;<br>   &quot;name&quot;: &quot;BMW&quot;,<br>   &quot;country&quot;: &quot;Germany&quot;<br>}</pre><pre>DELETE: localhost:3000/api/brand/:id</pre><p>You already have a filtering engine working:</p><pre>//All cars with year greater than 2010 and color contains &#39;blue&#39;<br>GET: localhost:3000/api/car?fixed_filer=year|gt|2010&amp;fixed_filer=color|lk|blue</pre><pre>//All BMW Cars<br>GET: localhost:3000/api/car?fixed_filer=brand.name|eq|BMW</pre><p>You also can navigate into properties (With its own crud included):</p><pre>//List all characteristics of a car<br>GET: localhost:3000/api/car/:idCar/characteristics</pre><pre>//Add a characteristic<br>POST: localhost:3000/api/car/:idCar/characteristics<br>{<br>   &quot;charName&quot;: &quot;CC&quot;,<br>   &quot;charValue&quot;: 5000<br>}</pre><pre>// Get the Brand<br>GET: localhost:3000/api/car/:idCar/brand<br></pre><p>All of that just declaring entities.</p><p>PD</p><p>I will be adding more examples for Entifix and its features, you could be interested in its strong RabbitMQ and Websocket functionality… And also complete documentation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bda3776950f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[La encarnación de la ironía]]></title>
            <link>https://herbercolop.medium.com/la-encarnaci%C3%B3n-de-la-iron%C3%ADa-95b5072b54a3?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/95b5072b54a3</guid>
            <category><![CDATA[tecnologia]]></category>
            <category><![CDATA[humanidad]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Mon, 06 Apr 2020 19:59:28 GMT</pubDate>
            <atom:updated>2020-04-06T20:16:20.712Z</atom:updated>
            <content:encoded><![CDATA[<p>La humanidad, esa especie de seres vivos, habitantes del planeta tierra que durante los últimos diez mil años ha modificado la estructura de su entorno con el objetivo de multiplicarse y vivir más.</p><p>Usando herramientas para moldear su entorno e ideas colectivas para hacer lo mismo con su realidad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eR823J8qSl3TYCBN5pvGoQ.jpeg" /><figcaption>Una pintura de hace 15.000 años encontrada en una cueva en España, retrata la recolección de miel de un panal. Se usaba humo para dominar a las abejas. Credit…Thierry Berrod/Mona Lisa Production/Science Source</figcaption></figure><p>Durante varios miles de años y un par de impulsos a los que nos gusta llamar revoluciones, llegamos hasta los últimos 100 años, que verdaderamente rompieron los límites naturales de nuestra especie.</p><p>Se lograron alinear varios de los artilugios creados en nuestra mentalidad colectiva que permitieron la colaboración de muchos individuos, inclusive con objetivos diferentes. Un nuevo sistema económico (Como decidimos llamarlo) encontró en la ciencia y los avances tecnológicos nuevas maneras de crear valor para los individuos. Esto fue tan evidente que la parte de la sociedad dedicada a dirigir y tomar decisiones (Gobiernos, como normalmente los denominamos) decidió impulsar aquella relación.</p><p>Se desencadenaron entonces esas décadas en que los los mismos límites naturales empezaron a sufrir cambios. Empezamos acrecentando nuestra longevidad y terminamos encontrando maneras de modificar nuestra estructura genética. Cambiamos nuestra manera de construir y vender bienes y servicios, de tal manera que incluso detuvo conflictos bélicos a cambio de poder comerciar con ellos. Nos hizo entender aspectos de las partículas elementales del universo, y ahora las usamos para conectar el mundo entero enviando información literalmente a la velocidad de la luz. Salimos del planeta, logramos pisar nuestro satélite natural y conseguimos fotografiar nuestro planeta desde los límites del sistema solar.</p><p>Grandes e impresionantes logros colectivos, pero los motivos individuales nunca cambiaron. Las diferencias de conocimiento, poder adquisitivo e influencia son mas grandes que nunca. El uso desmedido de los recursos que el planeta nos brinda, y el hecho de que no afecte de manera inmediata, hace que estúpidamente pongamos ese hecho en irrelevancia.</p><p>Nuestro egoísmo, quizá inherente a nuestra naturaleza humana, combinada con nuestra gran capacidad cognitiva, logró construir un sistema en el que colaboremos ganando lo que queremos. Y allí radica la fragilidad del mismo, porque mientras no se gane, el sistema no funciona. Y hoy una molécula que precisamente surge como una ligera deficiencia en nuestro mecanismo evolutivo, no nos deja ganar.</p><p>La humanidad es la encarnación misma de la ironía.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95b5072b54a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Una analogía de los planes de vida]]></title>
            <link>https://herbercolop.medium.com/una-analog%C3%ADa-de-los-planes-de-vida-1f17e8ae4236?source=rss-eb172ce1df02------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f17e8ae4236</guid>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Herber]]></dc:creator>
            <pubDate>Sat, 19 Oct 2019 19:42:23 GMT</pubDate>
            <atom:updated>2019-10-22T17:19:02.530Z</atom:updated>
            <content:encoded><![CDATA[<p>Si nuestra realidad fuera determinista, la precisión de nuestros planes en la vida sería el pilar fundamental de nuestra existencia. Pero creo que la humanidad es a nuestras historias individuales como el universo a las partículas elementales que lo conforman.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaZNSD2_FgkuQl8kIZ80Eg.jpeg" /></figure><p>Sin embargo, y siguiendo la analogía, no creo que el colapso de nuestras decisiones sean totalmente aleatorias. Más bien son nuestros ideales y sesgos los que al final determinan en que lugar de la onda se encuentra ubicada la partícula.</p><p>Si en un inicio planteamos un modelo para nuestra vida que no concuerda con los resultados esperados, la solución no es otra fórmula exacta, sino empezar a moldear nuestros modelos de pensamiento para hacer cosas que en un principio no parecían coherentes, y considerarlos como directrices en vez de puntos exactos.</p><p>… Como un programador intentando transmitir un pensamiento a través de un texto medianamente articulado por ejemplo.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f17e8ae4236" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>