<?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 Iran Macedo on Medium]]></title>
        <description><![CDATA[Stories by Iran Macedo on Medium]]></description>
        <link>https://medium.com/@IranNeto?source=rss-e52db14f61d9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RiCJuui_lOlwhOFb.</url>
            <title>Stories by Iran Macedo on Medium</title>
            <link>https://medium.com/@IranNeto?source=rss-e52db14f61d9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:15:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@IranNeto/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[Java Bean vs Spring Bean]]></title>
            <link>https://medium.com/@IranNeto/java-bean-vs-spring-bean-ead74081e34e?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ead74081e34e</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[concepts-for-beginners]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[spring]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Fri, 09 Feb 2024 16:28:36 GMT</pubDate>
            <atom:updated>2024-02-09T16:28:36.873Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A green set of beans on a table" src="https://cdn-images-1.medium.com/max/1024/0*y9Uwh5v3SkX7XxsN" /><figcaption>Photo by <a href="https://unsplash.com/@rachaelgorjestani?utm_source=medium&amp;utm_medium=referral">Rachael Gorjestani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A good way to dive into this introduction is to have in mind the concept of POJO — let&#39;s assume you don&#39;t know what it is and introduce it here so you can compare and assimilate the sutil differences between the terms we will discuss. Please, bear with me for a second.</p><p>POJOs are ordinary Java Objects that do not require a framework to use, nor need to be run in an application server environment. A POJO <strong>may or may not</strong> have naming conventions for properties and methods. For example:</p><pre>public class <strong>SuperHeroPojo</strong> { <br>    public String firstName;<br>    public String power;<br>   <br>    public <strong>EmployeePojo </strong>(String firstName, String power) { <br>        this.firstName = firstName; <br>        this.power = power;<br>    } </pre><pre>    public String <strong>name</strong>() { <br>        return this.firstName; <br>    }</pre><pre>    public String <strong>getPower</strong>() { return this.power; } <br>}</pre><p>By having the freedom to avoid following conventions, it is difficult for frameworks and other applications to use them. This section of <a href="https://www.baeldung.com/java-pojo-class#reflection-with-a-pojo">Baeldung&#39;s article</a> shows that Reflection has no effect on a POJO class. Some conventions were introduced by JavaBean many years ago.</p><h3>What is a Bean according to JavaBean?</h3><p>In the early days of Java&#39;s ecosystem development, it was born the concept of <strong>JavaBean — </strong>primarily for use in visual GUI but also useful for regular applications.<strong> </strong>According to the official documentation created by SunMicrosystems in 1997:</p><blockquote>The goal of the JavaBeans APIs is to define a software component model for Java, so that third party ISVs can create and ship Java components that can be composed together into applications by end users.</blockquote><p><strong>A JavaBean is still a POJO but introduces a strict set of rules around how we implement it.</strong></p><p>In summary, a JavaBean is a standard that aims in creating and shipping Java components (classes) into different applications. Beans are important pieces in modern libraries until today commonly used to store, access, and modify application states.</p><p>The three most important features of a Java Bean are:</p><ol><li>All properties are private (use <a href="http://en.wikipedia.org/wiki/Mutator_method">getters/setters</a>)</li><li>A public <a href="http://en.wikipedia.org/wiki/Nullary_constructor">no-argument constructor</a></li><li>Implements Serializable.</li></ol><p>That’s it. It’s just a convention. Lots of libraries depend on it though — such as Spring as we gonna dive into here.</p><p>An example of SuperHeroPojo as a JavaBean</p><pre>public class SuperHeroPojo implements Serializable { <br>   <br> private static final long serialVersionUID = -3760445487636086034L;<br>    public String firstName;<br>    public String power;<br>    <br>    public SuperHeroPojo(){}<br><br>public SuperHeroPojo (String firstName, String power) { <br>        this.firstName = firstName; <br>        this.power = power;<br>    }<br><br>public String getFirstName() { <br>        return this.firstName; <br>    }<br><br>public String setFirstName(String firstName) { <br>        this.firstName = firstName;<br>    } <br><br>// other setters and getters</pre><p>Looking at the <a href="https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/beans.html">official Spring Documentation</a> we can understand how Spring container utilizes Beans to implement the Inversion of Control (IoC) or Dependency Injection (DI). Quoting the docs:</p><blockquote>It is a process whereby objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to a factory method, or properties that are set on the object instance after it is constructed or returned from a factory method.</blockquote><p>Spring Container, therefore, can be similar to a factory where it will create the beans and injects the dependencies according to the user&#39;s configuration.</p><blockquote>In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC <em>container</em> are called <em>beans</em>. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the <em>dependencies</em> among them, are reflected in the <em>configuration metadata</em> used by a container.</blockquote><p><strong>Wait. So beans are conceptually different from Spring and JavaBean?</strong></p><p>Yes. And <strong>this can be a tricky question</strong>. But before diving into Spring&#39;s beans scopes let&#39;s summarize those concepts.</p><p>Quoting here a great <a href="http://www.shaunabram.com/beans-vs-pojos/">Shaun Abram&#39;s article</a></p><blockquote>POJO&#39;s are ordinary Java Objects that do not require a framework to use, nor need to be run in a application server environment.</blockquote><blockquote>Can Spring beans be POJOs? Yes, and they usually are (although they don’t have to be — e.g. Spring can be used with ‘heavyweight’ Java objects, such as EJBs).</blockquote><blockquote>Can Spring beans be JavaBeans? As I have said, yes and again they often are but don’t have to be.</blockquote><blockquote>None of the 3 terms discussed are mutually exclusive. A Java object can be a JavaBean, a POJO and a Spring bean all at the same time.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ead74081e34e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spring Framework: From the very beginning]]></title>
            <link>https://medium.com/@IranNeto/spring-framework-from-the-very-beginning-f440cd2bad6a?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f440cd2bad6a</guid>
            <category><![CDATA[server-architecture]]></category>
            <category><![CDATA[spring-framework]]></category>
            <category><![CDATA[j2ee]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Mon, 06 Dec 2021 19:28:39 GMT</pubDate>
            <atom:updated>2021-12-09T17:02:18.252Z</atom:updated>
            <content:encoded><![CDATA[<h4>From Java creation and J2EE components to Spring&#39;s architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gbgaAxJSW91WAJUb" /><figcaption>Photo by <a href="https://unsplash.com/@neonbrand?utm_source=medium&amp;utm_medium=referral">NeONBRAND</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p><strong>Disclaimer</strong></p><p>This is part of my journey to deeply understand Spring and its related technologies. It&#39;s a 3000+ word article so if you want to do better use of this, don&#39;t read it on a mobile screen. Also, bookmark this so it can be a reference whenever you need it. It&#39;s been an awesome reference for me.</p><p><strong>This article covers</strong></p><ul><li>Java and JVM historic background</li><li>J2EE history and architecture</li><li>J2EE components description</li><li>Spring history and architecture</li><li>Spring&#39;s components description</li></ul><p>I have always liked to search for the true inspiration and history of something I desire to truly understand. I think this is the best way for knowing something. For software development, understanding the history of the technologies you&#39;re using is gaining the power to best use them. We are going to check a little of history with Java and JVM to understand in which scenario J2EE was created and why is it so important to Spring.</p><h3>Background</h3><p>Born in the mid-90s, Java was a language created by Sun Microsystems Inc whose main idea was the possibility of using it for any platform or media through the Java Virtual Machine. “Write Once, Run Anywhere” (WORA) was divulged as an ideal for the applications of the future. In a time of large production and social acceptance of various media as Personal computers (PCs), Palmtops, and cell phones, the possibility of developing just one code base being executed for all types of media emerged as a gigantic revolution. Let’s remember that the technologies of the time were directly dependent on the type of media executed as they were compiled languages.</p><p>The most used languages ​​before Java in the 90s were: C, C++, Fortran, Visual Basic, Ada, Pascal, <a href="https://en.wikipedia.org/wiki/History_of_programming_languages">among others</a>. They all needed a compiler to run. As the compiler transforms the source code into machine-level operations this makes it intrinsically dependent on the platform (or machine) that will run the application. Because languages ​​like Assembly had specific commands to be executed in specific hardware architectures. A particular compiler was made for particular hardware. But then how did Sun Microsystems allow one code base to become the same for all infrastructures?</p><p>The big innovation brought by Sun and Java was the JVM (Java Virtual Machine). JVM is a virtual machine whose purpose is to be the interface between the Java application and the real machine’s hardware. Therefore, it was not necessary to know the hardware specifications to develop a Java application, as topics such as memory management (garbage collector) or concurrent processing were led by the JVM, taking these responsibilities present in compiled languages ​​from the time out of the developer’s hands. The JVM was responsible for compiling the base code and transforming it into bytecode, a format that was recognized only by the JVM itself. Once the bytecode is ready, it is validated if there are no faults and then executed. Despite critics and disbelievers that this change wouldn’t be the future of software development, companies at the time were massively adopting from the perspective of the productive increase of the development team.</p><p>Thanks to this versatility, Java had three well-known environments: JSE (Java Standard Edition — used in most cases for native applications and other computers), JEE (Java Enterprise Edition — used for network, internet, and intranet communication), and JME (Java Micro Edition — dedicated to the development of mobile applications such as PDA and mobile). J2EE or JEE is an important part of Spring development as we dive into J2EE.</p><blockquote>In order to understand Spring&#39;s characteristics and functionalities are necessary to spend some time analyzing and understanding what is Java Enterprise Edition and how does it work.</blockquote><h3>Java Enterprise Edition (J2EE)</h3><p>Java2 Enterprise Edition (J2EE or JEE) was massively adopted by the market in the early 2000s, a scene where companies needed their applications connected and available on the Internet for the entire world to be able to access, do online shopping, among other activities. According to Oracle’s <a href="https://docs.oracle.com/cd/E19159-01/819-3680/abfar/index.html">documentation</a>, J2EE is an environment with a set of standard specifications that describe application components, APIs, runtime containers, and services of an application server. The platform’s purpose is to handle the lower-level complexity of the application allowing developers to focus on the business logic itself. J2EE was used to develop web applications with HTML pages or even specific <a href="https://en.wikipedia.org/wiki/Applet">applets</a>.</p><p>Some of the key <a href="https://www.educba.com/what-is-j2ee/#:~:text=It%20provides%20one,by%20J2EE%20technologies">benefits</a> are:</p><ol><li>It provides one of the key functionality of cross-platform portability.</li><li>Like any other Java-based technology, open-source libraries are available easily for the common developer.</li><li>Handling some big enterprise-level applications for deploying on the server-side easily.</li><li>Always maintained and covered the maximum global W3C Standard by J2EE technologies.</li><li>Business logic is organized into <strong>reusable components</strong> and the J2EE server provides underlying services in the form of a container for every component type.</li></ol><p>But, how does J2EE works underneath? Let’s analyze each part to understand how it worked.</p><h4>Architecture &amp; Components</h4><p>J2EE was built to use a <a href="https://www.javastudypoint.com/2018/12/java-2-platform-enterprise-edition-j2ee.html">multi-tier</a> (generally considered <a href="https://www.educba.com/j2ee-architecture/">3 tiers</a>) distributed application model to manage the configurations and infrastructure: Client, Middle, and Enterprise data tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/0*BQzYcJnMK162-51n" /><figcaption>J2EE Multi-tier interaction</figcaption></figure><h4>Client tier</h4><p>The client tier consists of user programs that interact with the user for request and response. Usually, they are located in a different machine from the server. Client tier prompts the user inputs into user requests then forwarded to the J2EE server then processed results returned to the client. A client can be a web browser, standalone application, or server that runs on a different machine such as Applets, GUI applications, among others.</p><h4>Middle tier</h4><p>The middle tier is also known as the server-tier where enterprise beans and the web service encapsulates distributable business logic for the application. Consisted basically of web components such as Servlets, Java Server Pages, or a Java Standalone application.</p><p><strong>Web Components</strong></p><ul><li><a href="https://www.educba.com/jsp-vs-servlet/">JSP (Java Server Pages)</a></li></ul><p>JSP is a server-side technology that allows the creation of dynamic and platform-independent methods for web-based applications. It benefits from all Java APIs including Database communication (JDBC) to access enterprise databases (In general, accessing a database from a JSP page is a bad idea). The main idea is to <strong>handle dynamic content</strong>. This helps programmers to embed Java code into JSP tags that were rendered to the client on the web.</p><blockquote>Dynamic content was very accepted by the developers and companies. Today, we have lots of frameworks javascript working with this principle.</blockquote><ul><li><a href="https://www.educba.com/what-is-servlet/">Servlet</a></li></ul><p>Being very simplistic, Servlet is a java program that runs on a web server used to make or create dynamic applications and web pages extending server capabilities.</p><p>Let’s follow how it would happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*95WKhz5pQV7kkwbG" /></figure><ol><li>A web browser through the GET HTTP method requests a page to a server.</li><li>The server receives, validates the request (in detail in the next sessions), and communicates with the servlet which page needs to be returned.</li><li>The Servlet (web app) takes the requested page, processes the dynamic content needed, and gives it back to the server.</li><li>The server then returns the page to the browser with the content ready to be read by the browser.</li></ol><p><strong>EJB Component</strong></p><p>EJB stands for Enterprise Java Beans meaning the components that handle business code to solve particular business domains such as banking, management, finance, among others present in this business tier. It can</p><ul><li>Receive data from client processes and, if necessary, send it to the enterprise information system for storage.</li><li>Retrieve data from storage, process it, and send it back to the client tier.</li></ul><p>There are 3 kinds of beans:</p><ul><li><a href="https://www.informit.com/articles/article.aspx?p=28795&amp;seqNum=2">Session bean</a>: Used for a conversation with the client. As the name says, it is similar to an interactive session,<strong> not shared</strong> but individual for each client and not persistent. When the client terminates, its session bean appears to terminate and is no longer associated with the client. We can have stateless or stateful session beans.</li></ul><blockquote>Because stateless session beans can support multiple clients, they can offer better scalability for applications that require large numbers of clients. Typically, an application requires fewer stateless session beans than stateful session beans to support the same number of clients.</blockquote><ul><li><a href="https://www.informit.com/articles/article.aspx?p=28795&amp;seqNum=3">Entity bean</a>: Represents a business object, typically with an underlying table in a particular persistent storage mechanism (relational database). Once the server shutdowns or the client finishes its execution, entity bean data is preserved. Entity beans are persistent, allow shared access, have primary keys, and may participate in relationships with other entity beans.</li></ul><blockquote>There are two types of persistence for entity beans: bean-managed and container-managed. With bean-managed persistence, the entity bean code that you write contains the calls that access the database. If your bean has container-managed persistence, the EJB container automatically generates the necessary database access calls. The code that you write for the entity bean does not include these calls.</blockquote><ul><li><a href="https://docs.oracle.com/cd/A97329_03/web.902/a95881/mdb.htm">Message Driven Bean</a>: The message bean combines the properties of Session Bean and JMS using the asynchronous nature of a JMS listener with the advantages of the EJB container.</li></ul><h4>Data tier</h4><p>Also known as the Enterprise Information System (EIS), it consists of database servers, enterprise resource planning systems, and other data sources. These resources are typically located on a separate machine than the J2EE Server and accessed by components on the business tier.</p><ul><li><a href="https://www.infoworld.com/article/3388036/what-is-jdbc-introduction-to-java-database-connectivity.html">Java Database Connectivity API (JDBC)</a>: The Java API that manages connecting to a database, issuing queries and commands, and handling result sets obtained from the database released as part of Jaa 1.1 in 1997. JDBC is the common API that your application code interacts with. Beneath that is the JDBC-compliant driver for the database you are using.</li><li><a href="https://stackoverflow.com/questions/11881548/jpa-or-jdbc-how-are-they-different">Java Persistence API</a>: JPA is a standard for Object Relational Mapping. This is a technology that allows you to map between objects in code and database tables. This can “hide” the SQL from the developer so that all they deal with are Java classes, and the provider allows you to save them and load them magically.</li><li><a href="https://objectcomputing.com/resources/publications/sett/may-2002-java-connector-architecture">Java Connector Architecture (JCA)</a>: A JCA Resource Adapter serves as a software driver for an EI system by providing standardized means to integrate with Enterprise Integration Systems (EIS) such as Enterprise Resource Planning Systems (SAP, PeopleSoft, Baan), Transaction Monitors (CICS, Tuxedo) and Database Management Systems (Oracle, Sybase).</li><li><a href="https://www.progress.com/tutorials/jdbc/understanding-jta">Java Transaction API (JTA)</a>: The Java™ Transaction API (JTA) allows applications to perform distributed transactions, that is, transactions that access and update data on two or more networked computer resources. The JTA specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the application, the application server, and the resource manager that controls access to the shared resources affected by the transactions.</li></ul><p>Despite J2EE bringing a lot of innovation and ease to the way, developers write their code, over time some <a href="https://dzone.com/articles/history-of-spring-framework-spring-boot-framework#:~:text=Writing%20code%20became,slowed%20down%20applications">problems</a> have arisen with the widespread adoption of J2EE.</p><ol><li>Writing code became more and more complex, as developers had to draw on countless XML files and work with several different types of configurations.</li><li>Components proved exceedingly frustrating to work with, as developers had to hard-code all the dependencies each component required.</li><li>All of Java EE’s features were supported and thus needed to be configured. This led to very bloated code that slowed down applications.</li></ol><p>As an answer to the complexity of creating and maintaining J2EE applications. Rod Johnson, Australian consultant developer, at the release of one of his best practices books with J2EE, called attention to the benefit of using dependency injection and POJOs in J2EE applications. His work included nearly 30k lines of code showing how this would work in J2EE. The community at the time loved the idea and started to adopt Rod’s code in their applications. In 2004 under the Apache license, the first production version of this code called Spring was released. It’s important to note that for Rod Johnson and his other co-authors <a href="https://docs.spring.io/spring-framework/docs/current/reference/html/overview.html"><strong>Spring Framework</strong></a><strong> was not created to be a competitor to J2EE but a complement</strong>.</p><h3>Spring</h3><p>The way J2EE inspired Spring&#39;s creation can be observed in Spring&#39;s design philosophy with emphasis on items 1 and 2.</p><ol><li>Provide choice at every level. Spring lets you defer design decisions as late as possible. Despite J2EE in which required lots of configuration beforehand.</li><li>Accommodate diverse perspectives. Spring embraces flexibility and is not opinionated about how things should be done.</li><li>Maintain strong backward compatibility.</li><li>Care about API design.</li><li>Set high standards for code quality</li></ol><p>The Spring programming model does not embrace the Java EE platform specification; rather, it integrates with carefully selected individual specifications from the EE umbrella making it versatile and lightweight for developers and maintainers such as:</p><ul><li>Servlet API (<a href="https://jcp.org/en/jsr/detail?id=340">JSR 340</a>)</li><li>WebSocket API (<a href="https://www.jcp.org/en/jsr/detail?id=356">JSR 356</a></li><li>Concurrency Utilities (<a href="https://www.jcp.org/en/jsr/detail?id=236">JSR 236</a>)</li><li>JSON Binding API (<a href="https://jcp.org/en/jsr/detail?id=367">JSR 367</a>)</li><li>Bean Validation (<a href="https://jcp.org/en/jsr/detail?id=303">JSR 303</a>)</li><li>JPA (<a href="https://jcp.org/en/jsr/detail?id=338">JSR 338</a>)</li><li>JMS (<a href="https://jcp.org/en/jsr/detail?id=914">JSR 914</a>)</li><li>as well as JTA/JCA setups for transaction coordination, if necessary.</li></ul><h4>Spring Architecture</h4><p>Let&#39;s have a look at <a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/overview.html">Spring architecture</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*Qq1gyf6fNRO6tqy8cMzyhg.png" /><figcaption>Spring&#39;s architecture</figcaption></figure><p><strong>Core Container</strong></p><ul><li>Core: Let&#39;s define here container as a group of one or more modules. The Framework&#39;s heart is the Core Container where resides the base class and tools and everything was built upon. Zooming in further to the core module of the core container we should see the very base of Spring Framework, the behaviors that made outstand from J2EE: Dependency Injection and Inversion of Control. No matter which type of Spring Application you are building, you will always have direct or indirect dependency over Spring Core. <strong>This is the base.</strong></li></ul><blockquote>In software engineering, dependency injection is <strong>a technique in which an object receives other objects that it depends on</strong>, called dependencies. And, Inversion of Control (IoC) means <strong>to create instances of dependencies first and latter instance of a class (optionally injecting them through constructor)</strong>, instead of creating an instance of the class first and then the class instance creating instances of dependencies.</blockquote><ul><li>Bean: Spring bean is a module responsible to manage beans. <em>Remember EJB</em>? Beans are Java classes that represent something to the application. The Spring Bean module has a BeanFactory<em> </em>which creates bean instances, resolves bean to bean dependencies, and auto wires the beans based on the name, or type. The BeanFactory is a sophisticated implementation of the factory pattern. It removes the need for programmatic singletons and allows you to decouple the configuration and specification of dependencies from your actual program logic.</li><li>Context: Most of the time the Spring Context is started when a Spring Application starts and is hence called as ApplicationContext. Context module is a means to access objects in a framework-style manner that is similar to a JNDI registry. The Context module inherits its features from the Beans module and adds support for internationalization (using, for example, resource bundles), event-propagation, resource-loading, and the transparent creation of contexts by, for example, a servlet container (Checkout the servlet definition on J2EE section).</li><li>Expression language: A powerful expression language used for querying and manipulating an object graph at runtime. An example of this typical use is the integration of SpEL into creating XML or annotated-based bean definitions. Despite the fact it is a Spring tool, it&#39;s not tied to Spring being possible to manipulate it alone.</li></ul><p><strong>Web Container</strong></p><ul><li>Web and Servlet: Provides the features for building web applications such as multipart file-upload functionality and the initialization of the IoC container using servlet listeners and a web-oriented application context. Spring Web provides a Web Application Context that is similar to the context seen in the Core container. The <em>Web-Servlet</em> module contains Spring’s model-view-controller (<a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-introduction"><em>MVC</em></a>) implementation for web applications. Spring’s MVC framework provides a clean separation between domain model code and web forms and integrates with all the other features of the Spring Framework.</li><li>Struts: The <em>Web-Struts</em> module contains the support classes for integrating a classic Struts web tier within a Spring application. Note that this support is now deprecated as of Spring 3.0</li><li>Portlet: The <em>Web-Portlet</em> module provides the MVC implementation to be used in a portlet environment and mirrors the functionality of the Web-Servlet module.</li></ul><p><strong>Data Container</strong></p><p>The <em>Data Access/Integration</em> layer consists of the JDBC, ORM, OXM, JMS, and Transaction modules. We already have covered JDB, JMS, and JTA (Transaction modules) in the J2EE section. Also, we&#39;ve already mentioned them as some of the protocols Spring brought from the Enterprise environment. So let&#39;s provide more information to ORM and OXM.</p><ul><li>ORM: Object-relational mapping (ORM) module provides integration layers for popular ORMs APIs, including <a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/orm.html#orm-jpa">JPA</a>, <a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/orm.html#orm-jdo">JDO</a>, <a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/orm.html#orm-hibernate">Hibernate</a>, and <a href="https://docs.spring.io/spring-framework/docs/3.0.x/spring-framework-reference/html/orm.html#orm-ibatis">iBatis</a>. Using the ORM package the developer can focus only on mapping the relational database aspects with the code and raw operations and configurations are done by the module with all of the other features Spring offers, such as the simple declarative transaction management feature.</li><li>OXM: It provides an abstraction layer that supports Object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX, and XStream.</li></ul><p><strong>Other modules</strong></p><ul><li>AOP and Aspects: An Aspect is any secondary task which an object needs to perform. Each object in Java has a dedicated responsibility apart from this it may have to do some secondary things like logging, or exception handling. Aspect-Oriented Programming provides a mechanism for taking such secondary responsibilities out of the objects and giving them to proxy objects which doubles the original objects. Aspect-oriented programming implementation allows you to define, for example, method-interceptors and pointcuts to <strong>cleanly decouple code that implements functionality that should be separated</strong>. Using source-level metadata functionality you can also incorporate behavioral information into your code. For example, check out for controller advisors. We have learned what is Aspect-Oriented Programming. Spring Aspects provides a uniform way of integrating with other Aspect-Oriented Programming implementations like AspectJ.</li><li>Instrumentation: The Spring Instrumentation module provides support for class instrumentation in certain application servers. The instrumentation is used for monitoring the performance of an application. It monitors various objects to diagnose application problems and log them.</li><li>Testing: The <em>Test</em> module supports the testing of Spring components with JUnit or TestNG. It provides consistent loading of Spring ApplicationContexts and caching of those contexts. It also provides mock objects that you can use to test your code in isolation.</li></ul><blockquote>Check out more about testing containers in this <a href="https://www.youtube.com/watch?v=v3eQCIWLYOw">video</a></blockquote><h3>Conclusion</h3><p>With Spring Java Web Development evolved a lot throughout the 2000s. The way to build complex and robust web applications became faster and with a lot less complexity due to hard configuration choices to be made in J2EE. But it&#39;s still important to know and compare how these two environments were built to comprehend applications that use both and better handle J2EE to Spring&#39;s migration.</p><p>Spring started to gain real popularity in 2013 when the Spring Boot project was released but this is a topic for a whole different article where we will touch on Application Servers and other stuff.</p><p>More references:</p><p><a href="https://www.amitph.com/spring-framework-architecture/">https://www.amitph.com/spring-framework-architecture/</a></p><p>Hi everyone, my name is Iran Macedo and I&#39;m a Brazillian consultant software engineer working for Avenue Code in Brazil. Any comments, hints, or additional information is very welcome. Feel free to do so.</p><p>Don&#39;t forget to share!<br>Linkedin: <a href="https://www.linkedin.com/in/iran-macedo-bezerra-neto/">https://www.linkedin.com/in/iran-macedo-bezerra-neto/</a><br>Twitter: @IranMacedo3<br>iranmacedo.bneto@gmail.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f440cd2bad6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a RESTful API With GO and PostgreSQL]]></title>
            <link>https://medium.com/swlh/building-a-restful-api-with-go-and-postgresql-494819f51810?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/494819f51810</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[rest-api]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Sun, 16 Aug 2020 17:57:26 GMT</pubDate>
            <atom:updated>2020-08-30T22:01:07.442Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_moPd9vIT_WlbhJy" /><figcaption>That’s a Gopher — Golang mascot</figcaption></figure><p>Hey everyone! Here I come adventuring in a new language that I’ve never tried before. I couple days ago the team I work with came up with the idea of developing a brand new project with languages, technologies or frameworks that we don’t work daily as a propose to get out of the box and the comfort zone. That’s I nice idea mainly because we can be more creative and have more fun.</p><h3>Golang</h3><p>Go or Golang is a programming language created at Google in 2009 with the help of <strong>Ken Thompson</strong>, <strong>Rob Pike</strong> and <strong>Robert Griesemer. </strong>Back in these days Google were searching ways to achieve 4 pillars:</p><ul><li>Speed or Efficiency</li><li>Reliability</li><li>Scale</li><li>Simplicity</li></ul><p>Keeping the efforts to achieve all the pillars that could give developers the possibility of writing a scripting (interpreted) language like <strong>Python</strong> or <strong>JavaScript</strong> (simple but not very efficient or reliable) and at the same time provide characteristics of low-level compiled programming languages like <strong>C</strong> or <strong>C++ </strong>(fast and reliable but not simple).</p><p>Go has tons of core libraries that provides almost everything we’ll need to create any application. So let’s dig into the example.</p><h3>Routes</h3><p>We’re going to build an simple API with 2 routes</p><pre>List all person record <br>GET /  </pre><pre>Persist a person<br>POST /insert</pre><p>So create a standard <strong>main.go</strong>. It should look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*UKC5ELg2XDCy3hcWCxPTDg.png" /><figcaption>Standard main.go</figcaption></figure><p>To expose our routes and define the handlers to each route we’re going to use the http core lib which provides HTTP client and server implementations. Docs: <a href="https://golang.org/pkg/net/http/">https://golang.org/pkg/net/http/</a></p><p>Following our specs above our application should be like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*8H0IJ4V_BzmGFoKHWNTpHQ.png" /></figure><p>Let’s understand what each line means. Line 9 and 10 uses the <strong>HandleFunc </strong>method from http library that adapts to allow the use of ordinary functions as HTTP handler binding with an route. <strong>GETHandler</strong> and <strong>POSTHandler </strong>are functions that we are going to create to handle the requests with the related route. Line 11 uses golang core log library with <strong>Fatal() </strong>method which is equivalent to Print(). Inside it <strong>ListenAndServer </strong>starts an HTTP server with a given address and handler which in this case is going to be <strong>localhost</strong> at port <strong>8080</strong>.</p><h3>Database</h3><p>To this example, and as the title says, we’re going to use PostgreSQL database. In order to avoid using unnecessary machine resources and dive into setups, permissions, etc we’re going to run a Docker container with our database. Let’s set it up.</p><blockquote>To this part I’ll assume that you know what is a docker container and you have it installed at your machine. If you don’t, that’s not a problem at all follow this tutorial and come back after that.</blockquote><blockquote>Docker for Mac/Unix — <a href="https://docs.docker.com/docker-for-mac/install/">https://docs.docker.com/docker-for-mac/install/</a><br>Docker for Windows — <a href="https://docs.docker.com/docker-for-windows/install/">https://docs.docker.com/docker-for-windows/install/</a></blockquote><pre>#Download postgres latest image<br>docker pull postgres:latest</pre><pre>#Create and run a container with postgres image<br>docker run --name [container_name] -e POSTGRES_PASSWORD=[your_password] -d postgres</pre><pre>#Connect to Postgres in docker container<br>docker exec -it [container_name] psql -U [postgres_user]</pre><p>At PSQL terminal create yout database, schema or table. To this project we will not create a new database but instead use the default one.</p><pre>\c postgres<br>create table person(name varchar(40), nickname varchar(40))</pre><p>Let’s add this information to our to code in order to connect the API to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/416/1*2Mn7KH18j8-9mP74l2Txig.png" /></figure><p>Here we add Person type to represent a record from our table with name and nickname as strings. Also it’s important to do the json annotations to handle requests and response data. From line 18 to 24 we are declaring values to use to connect with the database.</p><p>Golang itself doesn’t natively deal with database communication, thus, a driver will be necessary to this. To do that download pq library from github using <strong>get</strong> command from go and add in main.go imports.</p><pre>go get -t github.com/lib/pq</pre><p>After that, we need to build a function to open connection with database and import database/sql core library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*S_WtHfMXZUHqBxj4WgDokA.png" /></figure><p>On line 27 we’re formatting a credentials setup string to perform the connection at line 31. If some error happens at opening the connection ,or if the database isn’t available, the code panics the error and shutdown the API (Line 32 and 36). If everything goes right the function return the db service.</p><h3>Handlers</h3><p>Now let’s code our the handlers to each route. According to net/http library documentation a handler must have to arguments: the response writer and the request.</p><h4>GET /</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*ALaATu8Cga91Hya8gfG9IQ.png" /></figure><p>Using <strong>OpenConnection</strong> method we built before we are going to open a database connection and store it in db variable to, on line 47, execute a query selecting all rows in the person table. If there is no errors (line 48) we go through the list, scan all values at the columns and store than at person variable. At line 57 we add the person into the list.</p><p>To parse it into a json structure we’re going to import golang json library. Doc: <a href="https://golang.org/pkg/encoding/json/">https://golang.org/pkg/encoding/json/</a>. At line 60 the list with person structure is parsed into a json as []byte andafter that is written in the response at line 63. At the end we need to close rows variable and the connection with database.</p><h4>POST /insert</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*Xocf7X1nPbN56JzQ38cfOg.png" /></figure><p>As <strong>GETHandler </strong>function mentioned before we will store the database connection at db variable. At line 73 we use json library to store the request body into Person variable. After that execute the insert method passing the values according to its position and if there isn’t any errors write a HTTP 200 response. To assert if the insertion succeed execute a GET in / to see the list of person with the new value.</p><p>And that is it! Let’s checkout the complete main.go</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/96e81c3c6f9e7a688376fd11c24837dc/href">https://medium.com/media/96e81c3c6f9e7a688376fd11c24837dc/href</a></iframe><h3>Tests</h3><p>Let’s do some testing and see if all is working as expected. Let’s assume already has a person record at database. You can use the browser itself or any REST client to test it. I’m using Insomnia REST client to do some request at out API.</p><blockquote>More information about Insomina at <a href="https://insomnia.rest/">https://insomnia.rest</a></blockquote><p>As shown at the image bellow the GET route method list to us all records at the person table. To assert it let’s use out POST route method to add a new person at database and use GET route again to assure it was added and we are listing truly all person records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mr6l8DbmfVFaQwqH2EdzYQ.png" /></figure><p>So, let’s insert a new person. Take a look bellow and realize that we need to pass a new json value with this configuration in order to out POST method decode it into a new person type. Send it and it should return a 200 HTTP code with no body.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RrJ09VFcdvJWphE31-T84Q.png" /></figure><p>Execute again the GET method and see our two records returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fbhEb_K4c07oLhzC0cZQg.png" /></figure><h3>Hope you all enjoy it!</h3><h4>Any comments or hints about my english or the code are more than welcome.</h4><p>See you</p><p>Linkedin: <a href="https://www.linkedin.com/in/iran-macedo-bezerra-neto/">https://www.linkedin.com/in/iran-macedo-bezerra-neto/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=494819f51810" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/building-a-restful-api-with-go-and-postgresql-494819f51810">Building a RESTful API With GO and PostgreSQL</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing a Graph bipartition checker in Python]]></title>
            <link>https://medium.com/analytics-vidhya/implementing-a-graph-bipartition-checker-in-python-364b619a3d29?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/364b619a3d29</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[bipartite-graph]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[code-challenge]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Sat, 21 Mar 2020 20:07:45 GMT</pubDate>
            <atom:updated>2020-03-26T09:20:19.878Z</atom:updated>
            <content:encoded><![CDATA[<h3>Implementing a Graph bipartite checker in Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bfDv-jAMeso4QBsI" /><figcaption>Photo by <a href="https://unsplash.com/@alinnnaaaa?utm_source=medium&amp;utm_medium=referral">Alina Grubnyak</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a software developer I try make a routine that includes the practicing of my skills to solve mathematical/algorithm problems. Some days ago I found out a Google annual code competition called Code Jam and the very first problem I saw puzzled me (I will talk about it). After some research I was able to solve it through a graph bipartition checker algorithm and decided to write the path I took to come up with the solution. <br>Let’s do it.</p><h3>Graph</h3><p>A Graph is a non-linear abstract data structure well known in mathematics. They are used to model pairwise relations between objects through structures/concepts as nodes (or simply <em>“points”</em>) and edges (also called <em>“links”, “arcs”</em> or <em>“lines” </em>that connects two nodes<em>) </em>[1][2]. The study of graphs and its properties is called Graph Theory and was developed by <a href="https://pt.wikipedia.org/wiki/D%C3%A9nes_K%C3%B6nig">Dénes König</a> in 1936, a brilliant mathematician which wrote the very first book about graph theory [3]. Graphs are used to model lots of situations that happens in real world like most efficient airplane path from x to y or shortest distance between two points of a city (GPS algorithms), and so on.</p><h3>The problem</h3><p>2014 Grad Test — Practice round.</p><p><strong>Bad Horse Problem<br></strong>As the leader of the Evil League of Evil, Bad Horse has a lot of problems to deal with. Most recently, there have been far too many arguments and far too much backstabbing in the League, so much so that Bad Horse has decided to split the league into two departments in order to separate troublesome members. Being the Thoroughbred of Sin, Bad Horse isn’t about to spend his valuable time figuring out how to split the League members by himself. That what he’s got you — his loyal henchman — for.</p><blockquote><a href="https://code.google.com/codejam/contest/2933486/dashboard">https://code.google.com/codejam/contest/2933486/dashboard</a></blockquote><h3><strong>Solution</strong></h3><p>After reading the description some ideas came to my mind before initiate to code a possible solution.</p><p>First, I will have to <strong>store pair’s names</strong> and somehow <strong>represent the relation between then</strong>. Also, I have to be able to check the possibility to separate the pairs into 2 groups — No pair should be in the same group. With a bit more searches I’ve found out that this is classic problem of <strong>graph bipartite</strong>.</p><blockquote>I’ve realized it’s a important step before start coding in super matrix hacker style. Analyse it, get into problem’s head.</blockquote><h3>Bipartite Graph</h3><p>A bipartite graph is a graph which all its nodes can be separated in two groups so that each element of one group is only related to elements of the other group. It’s also knows as bicolored graph (each group would represent a color, so every element in the graph is only related to another color element). They are very used in Petri Networks (Concurrency Systems resources simulation) and others real world situations [4].</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*N_9gwjfzOsKrblWmhzqvhg.jpeg" /><figcaption>Example of bipartite graph</figcaption></figure><h3>Algorithm</h3><p>The algorithm to check a graph bipartition can be very similar to DFS in trees data structures (Depth First Search). DFS algorithm it’s used to find the depth of a tree and works by choosing the root element and dive into their neighbors until there aren’t no element’s child or leaf.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*SE0iNV24-6hkUCZ-9-inFA.gif" /><figcaption>How DFS algorithm works</figcaption></figure><blockquote>Curious fact: Every tree is a graph bipartite</blockquote><p>To add the function of bipartition check we need to initiate another structure to store the group (or color) information of each element. Besides that, it’s necessary also to check the groups belonging to each graph node given its neighbors group</p><p>The pseudocode analysis will be divided in two parts to a better understanding.</p><h3>Pseudocode — Controller</h3><p>Let’s check the pseudo algorithm.</p><p>The first part will function as a initialize or “controller” assuring that the routine will be executed for all nodes in graph.</p><blockquote>To explain the pseudocode I’m going to assume the following constants</blockquote><blockquote>V = graph node<br>C1 = group 01 value<br>graph = the data structure represented in code<br>C2 = group 02 value</blockquote><pre>FOR each graph node V<br>    Initialize V group value C = C1<br>end FOR</pre><pre>FOR every graph node V<br>    IF group C is C1:<br>        IF NOT SET_GROUP_VALUE(graph, V, C1)<br>            return FALSE<br>        end IF<br>    end IF<br>end FOR</pre><pre>return TRUE</pre><p>At the first loop we’re going to initiate all nodes with group 01 value. At the second loop for every node that has the group 01 value we’re going to check its neighbors and, if possible, set it a different group value.</p><h3>Pseudocode — Recursive Search</h3><p>The second part is the recursive algorithm that holds the logic to check if a node can be part of a different group than his neighbors</p><pre>-- Start a routine SET_GROUP_VALUE(graph, V, C) -- Ignore this line</pre><pre>SET the group of V as C</pre><pre>FOR every neighbors W of V<br>    IF group value C of W is neutral<br>        IF NOT SET_GROUP_VALUE(graph, W, C2)<br>            return FALSE<br>        end IF<br>    ELSE<br>        IF group value of W is C<br>            return FALSE<br>        end IF<br>    end ELSE<br>end FOR</pre><pre>return TRUE</pre><p>The first loop start to dive into the subset of V nodes (subtree with root in V). If V’s neighbor W have group 01 value then the algorithm will check if it’s possible to give group 02 value.</p><h3>Implementation</h3><p>As described in the problem, our goal is to execute <strong>T</strong> test cases of <strong>M</strong> element pairs described in a file. The first line of this file will contain the <strong>T</strong> value followed by <strong>M</strong> number of pairs, thus, the next <strong>M</strong> lines will contain the <strong>M</strong> pairs information. The output will be also a file that describes the test case number and if the set of <strong>M</strong> pairs names can be divided into two groups, or, if the set of pairs can be represented as a bipartite graph.</p><pre>-- Input file example -- Ignore this line</pre><pre>2<br>1<br>Dead_Bowie Fake_Thomas_Jefferson<br>3<br>Dead_Bowie Fake_Thomas_Jefferson<br>Fake_Thomas_Jefferson Fury_Leika<br>Fury_Leika Dead_Bowie</pre><pre>-- Output file example -- Ignore this line</pre><pre>Case #1: Yes<br>Case #2: No</pre><p>There are some ways to represent a graph in code [5], one of them is an adjacency matrix and that is how it’s gonna be represent in this article, but with some small modifications the solution can be able to work as well. Here, I will represent it as a python dictionary: The keys will be the nodes and the key’s value will be a list of all its neighbors. Here’s an example</p><pre>g = { <br>    “a” : [“d”],<br>    “b” : [“c”],<br>    “c” : [“b”, “c”, “d”, “e”],<br>    “d” : [“a”, “c”],<br>    “e” : [“c”],<br>    “f” : []<br>}</pre><h3>Code</h3><p>Let’s check my implementation of pseudocode.</p><blockquote>OBS: color = group value</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f08b6ae7cbc6624de4b2c45f3a03659/href">https://medium.com/media/9f08b6ae7cbc6624de4b2c45f3a03659/href</a></iframe><p>From line 1 to 27 is implemented the algorithm we’ve seen before in the pseudocode. In line 31, I’m getting from input file (which was in the same directory of this code) the number of tests which will be done.</p><p>From line 35 until the end of the file we’re going to:</p><ul><li>For each test case (<strong>iTestCase</strong>), retrieve the number of pairs (<strong>nPairs</strong>) that’s going to be analyzed.</li><li>For each pair, we’re going to get the names described.</li><li>From line 40 until 50, it’s going to construct the dictionary based on the pair connection described in file.</li></ul><p>The output tell us which test case is represents a bipartite graph or not</p><p>I’m a Junior software developer in Brazil and I just fascinated by technology and programming.</p><p>So please, any doubts, hints or comments are more than welcome!</p><p>Follow me in <a href="https://github.com/IranNeto">Github</a>, <a href="https://twitter.com/IranMacedo3">Twitter</a> or <a href="https://www.linkedin.com/in/iran-macedo-bezerra-neto/">Linkedin</a></p><h3>References</h3><p>[1] https://mathworld.wolfram.com/Graph.html<br>[2] https://en.wikipedia.org/wiki/Graph_theory<br>[3] https://pt.wikipedia.org/wiki/D%C3%A9nes_K%C3%B6nig<br>[4] https://pt.wikipedia.org/wiki/Grafo_bipartido<br>[5] https://www.geeksforgeeks.org/graph-and-its-representations/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=364b619a3d29" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/implementing-a-graph-bipartition-checker-in-python-364b619a3d29">Implementing a Graph bipartition checker in Python</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns to beginner developers]]></title>
            <link>https://medium.com/@IranNeto/design-patterns-to-beginner-developers-381eb0423a64?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/381eb0423a64</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-career]]></category>
            <category><![CDATA[developer-tools]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Sat, 14 Dec 2019 18:35:45 GMT</pubDate>
            <atom:updated>2019-12-14T18:35:45.348Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cH_4SAo2FRfrqLHu" /><figcaption>Photo by <a href="https://unsplash.com/@arianismmm?utm_source=medium&amp;utm_medium=referral">Arian Darvishi</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As a beginner developer and fresh graduated boy I’ve started to look into some base concepts of programming in order to keep growing up as a professional. I realized that there are dozens of concepts that students usually take for granted and are really important in “real life”. One of them is Design Patterns.</p><h4>Design Patterns</h4><p>Design Patterns aren’t the silver bullet that solve all your problems. After years of programming languages been used in the world, software developers noticed that some logical solutions have been used repeatedly over and over again. In 1995, four developers published <a href="https://www.amazon.com/gp/product/0201633612/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0201633612&amp;linkCode=as2&amp;tag=refactoringgu-20&amp;linkId=17a8a39a2c8d1ef784ca97c483723eed"><strong>Design Patterns: Elements of Reusable Object-Oriented Software</strong></a><strong> </strong>with<strong> </strong>23 patterns solving various problems of object-oriented design and became a best-seller very quickly. Nowadays it’s known by the GoF book. GoF = Gang of Four.</p><p>That’s what make Design Patterns really important, they’re manuals of how to deal with logical problems in programming. If you’re a developer you should know and study about it because during your carrer you will face this problems every day.</p><p>Every design pattern can be described in terms of three aspects:</p><ul><li><strong>Intent </strong>briefly describes both the problem and the solution.</li><li><strong>Motivation</strong> explains the problem and the solution the pattern makes possible.</li><li><strong>Structure</strong> shows each part of the pattern and how they are related.</li></ul><p>Patterns also can be classified into groups of intents</p><ul><li><strong>Creational patterns</strong> provide object creation mechanisms that increase flexibility and reuse of existing code.</li><li><strong>Structural patterns</strong> explain how to assemble objects and classes into larger structures, while keeping the structures flexible and efficient.</li><li><strong>Behavioral patterns</strong> take care of effective communication and the assignment of responsibilities between objects.</li></ul><p>References:</p><p><a href="https://refactoring.guru/">https://refactoring.guru/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=381eb0423a64" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning 101: k-NN]]></title>
            <link>https://medium.com/@IranNeto/machine-learning-101-k-nn-520b2c3eea01?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/520b2c3eea01</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[knn]]></category>
            <category><![CDATA[kaggle]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Wed, 10 Apr 2019 15:01:28 GMT</pubDate>
            <atom:updated>2019-04-10T15:01:28.765Z</atom:updated>
            <content:encoded><![CDATA[<h4>A theoretical and practical introduction to one of the easiest methods in ML</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-EQBQ6YU2Zur2Oan" /><figcaption>Photo by <a href="https://unsplash.com/@nousnou?utm_source=medium&amp;utm_medium=referral">nousnou iwasaki</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Overview</h3><p>This is a series of articles that will cross on machine learning methods and algorithms. In this article we’re going to introduce k-NN (k-Nearest-Neighbors) which is among the simplest algorithms for pattern recognition used since the 70’s. It’s based features’ proximity/distance and considers that similar observations are clumped together in a n-dimensional feature space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*b0VxrKPtexg-wTciqZQCNg.png" /><figcaption>Font: Datacamp</figcaption></figure><blockquote>In this article distance means euclidean distance. There are others distance functions which can improve k-NN performance depending on the dataset and the data type (continuous, categorical, binary, etc). In this <a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4978658/"><strong>article</strong></a><strong> </strong>some medical domain problems are used to test the effect of different distance functions on k-NN algorithm.</blockquote><p>k-NN is non-parametric or distribution free. This means it doesn’t fully belong to a Poisson, Gaussian or Binomial distribution but is possible to do statistical inference (infer properties based on the observation analysis).</p><p>This method is large used to regression or classification without many changes. Considering a new observation, it can be labeled with the class that is the majority in the k nearest neighbors set (classification) or some continuous feature can be estimated by selecting a k closest neighbors subset.</p><h3>Algorithm</h3><p>Let’s observe the pseudo algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*3lc7MYWuGu_RqpAC39iLDA.png" /><figcaption>Font: <a href="https://www.researchgate.net/figure/Pseudo-code-for-the-Brute-Force-k-NN-Algorithm-The-run-time-complexity-of-the-algorithm_fig1_230769875">https://www.researchgate.net/figure/Pseudo-code-for-the-Brute-Force-k-NN-Algorithm-The-run-time-complexity-of-the-algorithm_fig1_230769875</a></figcaption></figure><p>The algorithm begins by taking the distance between the reference point (or the set of reference points) and the others observations in the feature space. After that, all the distances are sorted and the k closest observation are selected to continue the process of regression or classification as we talked before. It’s only by this stage that the algorithm can change depending on the final goal.</p><h4>Complexity</h4><p>The complexity of an algorithm can be determinant to the application performance. As we can see in the pseudo code, there’s an external for loop selecting each observation in a dataset.</p><p>Also, let’s mention how euclidean distance works. An observation has x and y coordinates in an 2 dimensional space, so considering <strong>N </strong>the number of dimensions, the observation will have N coordinates. This means a complexity of O(N) to compute distance between points and O(N * Total dimensions) (in a linear search) to the algorithm. It’s possible to conclude that the algorithm performance increase inversely to the number of observation features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*4Fm3QMuHw3A8WZvoh74yvA.png" /><figcaption>Euclidean distance function</figcaption></figure><h4>Some information additional information:</h4><ul><li>Some articles say that the ideal k is log(n) or sqrt(n), with n equals to the number of observations.</li><li>It’s preferential to choose an odd number to k to avoid draw in case of classification method.</li><li>k-NN can be useful to non linear data</li><li>The training stage is faster when compared to other methods but is slower in testing.</li><li>It requires large amount of memory to store all the training dataset for prediction.</li><li>As we mentioned before, k-NN doesn’t performance properly when the number of dimension increases to much.</li></ul><h3>Study case</h3><p>The objective here is to build a classifier to determine a person has an income of bigger or smaller than 50k dollars based and features like gender, education level, native country, etc. This Python kernel bellow show all the process of EDA, cleaning data, building a model and predicting. The dataset is from kaggle.</p><h4><a href="https://www.kaggle.com/iranneto/a-simple-knn-application">https://www.kaggle.com/iranneto/a-simple-knn-application</a></h4><h3>Bonus</h3><p>Take a look at this class from MIT. Although it doesn’t comment about technical aspects of k-NN method, it describes an introduction of learning processes in a general context.</p><ul><li><a href="https://www.youtube.com/watch?v=09mb78oiPkA">https://www.youtube.com/watch?v=09mb78oiPkA</a></li></ul><p>It’s an easy algorithm to implement and use. Hope you all enjoyed!</p><p>Any critics, tips or hints will be welcome too :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=520b2c3eea01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing the Particle Swarm Optimization (PSO) Algorithm in Python]]></title>
            <link>https://medium.com/analytics-vidhya/implementing-particle-swarm-optimization-pso-algorithm-in-python-9efc2eb179a6?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9efc2eb179a6</guid>
            <category><![CDATA[particle-swarm]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Mon, 24 Dec 2018 21:00:44 GMT</pubDate>
            <atom:updated>2018-12-26T07:18:37.488Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HqmkZNappDjjbUvG" /><figcaption>Photo by <a href="https://unsplash.com/@johnnyafrica?utm_source=medium&amp;utm_medium=referral">Johnny Chen</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There are lots of definitions of AI. According to the <a href="https://www.merriam-webster.com/dictionary/artificial%20intelligence">Merrian-Webster </a>dictionary, Artificial Intelligence is a large area of computer science that simulates intelligent behavior in computers. Based on this, an algorithm implementation based on <a href="https://en.wikipedia.org/wiki/Metaheuristic">metaheuristic</a> called <strong>Particle Swarm Optimization </strong>(originaly proposed to simulate birds searching for food, the movement of fishes’ shoal, etc.) is able to simulate behaviors of swarms in order to optimize a numeric problem iteratively. It can be classified as a swarm intelligence algorithm like Ant Colony Algorithm, Artificial Bee Colony Algorithm and Bacterial Foraging, for example.</p><p>Proposed in 1995 by J. Kennedy an R.Eberhart, the article “Particle Swarm Optimization” became very popular due his continue optimization process allowing variations to multi targets and more. Consisting in the constant search of best solution, the method moves the particles (in this case represented as a (x,y) position) with a certain velocity calculated in every iteration. Each particle’s movement has the influence of his own the best known position and also the best known position in the space-search. The final result expected is that the particle swarm converge to the best solution. It’s important to mention that PSO doesn’t use Gradient Descent, so it can be used to non linear problems once it doesn’t require that the problem have to be differentiable.</p><h3>Algorithm</h3><p>Let’s observe the pseudo algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*zLmYH2QiwttYcjUMhvKWcA.png" /><figcaption>Uploaded by <a href="https://www.researchgate.net/profile/Ganesh_Venayagamoorthy">Ganesh K. Venayagamoorthy</a></figcaption></figure><p>At first, in the 2 for loops, it initializes the particles’ positions with a random uniform distribution within a permissible range for all its dimensions (Some problems require handling to several dimensions). After that, for each particle, it calculates its fitness value and compared with his own best position (The p_best value is the best position of that specific particle has ever been) and then it chooses the best position of all particles in g_best.</p><p>Let’s take a closer look to the equation that defines the velocity of the next iteration of a particle dimension:</p><ul><li>Vᵢ(k+1) is the next iteration velocity</li><li>W is an inertial parameter. This parameter affects the movement propagation given by the last velocity value.</li><li>C₁ and C₂ are acceleration coefficients. C₁ value gives the importance of personal best value and C₂ is the importance of social best value.</li><li>Pᵢ is the best individual position and Pg is the best position of all particles. In the equation, is measured the distance of each of these parameters to the particle’s actual position.</li><li>rand₁ and rand₂ are random numbers where 0 ≤ rand ≤ 1 and they control the influence of each value: Social and individual as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*Y1DFdUEBX3vVeuZVpM11fA.png" /><figcaption>Google images</figcaption></figure><p>After that is calculated the new particle’s position until the number of iterations specified or an error criteria be reached.</p><h3>Implementation</h3><p>Our goal is to find the minimum point of a certain function. In this case, the function is <em>f(x,y) = x² + y² + 1. </em>Thus, the algorithm will work with 2 dimensions positions arrays and the fitness value will be the Z-coordinate. Also, we know that our target is to find the coordinates [0,0] which is the minimum of <em>f(x,y).</em></p><p>To implement the algorithm in python was used an OOP (at this point it’s been considered that you know the basics at it) to help us to implement and understand all steps in code. Here, it’s used the numpy library (check more information <a href="http://www.numpy.org/">here</a>) to handle array operations once we work with a multidimensional space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*MiPvsl6sCX6ovLYX" /><figcaption>3D graphic of x²+y² (Wolframalpha)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/0*5tPBP48U0oD3-yps" /><figcaption>Contour plot of x² + y² (Wolframalpha)</figcaption></figure><p>Let’s begin with the Particle class.</p><h4>Particle</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rfEcPy7wT4RSuwKgNonZJw.png" /><figcaption>Particle Class</figcaption></figure><p>When a Particle is initiated automatically we sort 2 position limited in range -50 to +50. The <strong>pbest_position</strong> (which is the best individual position of that particle) is initiated with the initial position, also, as we’re looking for the minimum value, the <strong>pbest_value</strong> is initiated with +inf (could be any larger value). It’s also defined a method <strong>__str__</strong>() just to print the actual position and the best individual value. The <strong>move</strong>() method add the positional vector and the dimensions’ velocity calculated in the searches as we gonna see ahead.</p><h4>Search Space</h4><p>The Search Space is the entity which controls the algorithm routine. In this implementation, it is responsible to keep all the particles, identify and set the individuals best position values of all particles, manage the target error criteria, calculate the best global value and set the best global position. In resume, it encapsulate all principal steps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*gkSgOAkKudNugNxEyjgMGA.png" /><figcaption>Space State Class</figcaption></figure><p>The methods <strong>set_pbset</strong> and <strong>set_gbest</strong> have similar implementation ways. At first it go through all the particles and calculate the fitness value of the particle position and compare to the best individual position (at <strong>set_pbest</strong>) and the best global position (at <strong>set_gbest</strong>).</p><p>The method move_particles calculate the new vector velocity to each particle in each dimension as it was explained before.</p><h4>Main loop</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*tEUpf7OjYrpejbzEYOENYw.png" /><figcaption>Main loop</figcaption></figure><p>At first, it’s initiated a Search Space with target at 1. This target represents the target at fitness value, this means that the target is <em>f(x,y) = 1</em>. The algorithm then will find which values of <em>x </em>and <em>y </em>gives a result equals 1 as shown before at the function shape that we want to find the minimum. The Contour plot also show us that the value we want to find out is [0,0]. The target error and the number of particles (n_particles) it will be set by the user. Then with a list generator it’s initiated all the particles and after initiated the iterations.</p><p>In all iterations at first, it’s found the best individual position and the best global position to evaluate the target error criteria. If this criteria doesn’t achieve the minimum error, the particles will calculate the velocity to move and then stop at a new position until the number of iterations or the minimum error criteria be reached. The last line just print out the best result found.</p><p>Check out the full code below</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e0b1ca4c2b66ef609a312a7a7bded51d/href">https://medium.com/media/e0b1ca4c2b66ef609a312a7a7bded51d/href</a></iframe><p>The values of W, C₁ and C₂ are chosen by hand so be careful with them because they can get the longer.</p><h3>Results</h3><p>Using python interpreter we enter with the values of number of iterations, target error criteria and number of particles into the swarm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*YYwWiBsHg7KKg72JITAX2A.png" /></figure><p>Then, it prints out the best found result:</p><pre>The best solution is: [ 5.06237850e-04 -1.14851873e-05] in n_iterations: 22</pre><p>It’s an easy algorithm to implement and use. Hope you all enjoyed!</p><p>Any critics, tips or hints will be welcome too :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9efc2eb179a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/implementing-particle-swarm-optimization-pso-algorithm-in-python-9efc2eb179a6">Implementing the Particle Swarm Optimization (PSO) Algorithm in Python</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Simon (Genius game) on the BeagleBone with Python]]></title>
            <link>https://medium.com/@IranNeto/building-simon-genius-game-on-the-beaglebone-with-python-d371c2bacbed?source=rss-e52db14f61d9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d371c2bacbed</guid>
            <category><![CDATA[adafruit]]></category>
            <category><![CDATA[beaglebone-black]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Iran Macedo]]></dc:creator>
            <pubDate>Wed, 05 Sep 2018 04:12:02 GMT</pubDate>
            <atom:updated>2018-09-05T15:17:56.359Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello everyone, this is my very first article!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*wVVap9Zig6GzVs5ZIW9y-Q.jpeg" /></figure><p>In this project we’re going to practice concepts about real time systems. Event time measurement to be more specific. Hope you all enjoy!</p><p>The code complete is at the end if you want to jump tutorial.</p><p>Do you all remember Simon? Simon was a very popular game in the 80’s and 90’s in Brazil (Simon game was known as Genius game in Brazil) although he began to be sold in other countries about the 70’s (Pretty old, huh?!). The game was based in memorize and reproduce a sequence of colors and sounds that takes longer and longer every round, if you pushed the wrong color or took to long to push a button, you’re out and the game started again. You can find more information in this link: <a href="https://en.wikipedia.org/wiki/Simon_(game)"><em>https://en.wikipedia.org/wiki/Simon_(game)</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*UB7AZFQ81RZ-rGc7r78SmA.jpeg" /><figcaption>Image from <a href="https://en.wikipedia.org/wiki/Simon_(game)"><em>https://en.wikipedia.org/wiki/Simon_(game)</em></a></figcaption></figure><p>So, if you are looking for an easy project to train your DIY or Python abilities this is absolutely for you.</p><p>In this tutorial we will use:</p><ul><li>BeagleBone Black (Or any other board that you have that runs Python)</li><li>4 Colorfull LEDs</li><li>4 buttons</li><li>8x 330 Ohms Resistors</li><li>Some jumpers</li></ul><p><strong>Now, let’s do it!</strong></p><h3>Building the Toy</h3><p>Beaglebone has lots of resources to work with, but we will only use the GPIOs pins project this game. Take a look at the schematics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oH9nwJwd0ij6pOqnw5ZOKQ.png" /></figure><p>After plug everything let’s go to the Code</p><h3>Coding the game</h3><p>BeagleBone has support to many programming languages that could be used to code the game. With BlackLib is possible to develop codes in c++, for example. I had tried to code this game in c++ before trying Python but I got lots of bugs everywhere and no reason why. This sucks! So I decided to search for other ways to do. And then I found Python… But it doesn’t mean that is the best way to do.</p><p>We’re gonna use Python’s Adafruit Library: <br>[1] — <a href="https://adafruit-beaglebone-io-python.readthedocs.io/en/latest/">Documentation </a><br>[2] — <a href="https://github.com/adafruit/adafruit-beaglebone-io-python">Repository</a>.</p><p>This isn’t a instalation tutorial, so you can check how to do on github link and any doubt about the methods, just check [1]. Ok, no more talking. Let’s code!</p><h3>Step 1: Constants declaration</h3><p>As mentioned before we gonna need 4 pins to the buttons and more 4 pins to the leds so we gonna first declarate which pins are going to be INPUT and OUTPUT as the schematics. (Check BeagleBone’s pinout)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*zzDkgc9kSs_W5WpHJv2cew.png" /><figcaption>Importing modules and doing the setup fo GPIO pins</figcaption></figure><h3>Step 2: Game loop</h3><p>The game loop contains the game sequence and to get a clean code I tried to named the functions to be easier to indentify the propose by its name.</p><p>At first is necessary to the player understand that the game/round is initiating after some action. In this case, the action that begin the game is to press any button. Before that the while True ensures that the game never ends (evil laughs). Flag function as mentioned before is a way to show the player that the round is initiating. In next steps is showed the other function’s implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*aHjlVqCkcnX9FoIKHnf_Iw.png" /><figcaption>game loop</figcaption></figure><h3>Step 3: Functions</h3><p>After initiated the game has to generate sequences that start with one led and then on every round will be added a new led on the sequence. So in the fuction to generate_current_round uses random to get a new led mapped in LEDS vector and add at the game_sequence that store the sequence vector of that match.</p><p>Now it’s time to the game capture player’s play. To do that we have to detect which button was pressed. I couldn’t implement this functionality throught GPIO’s event (check documentation) cause once the event is set, is set forever. So we’re checking in lines below every pin if it is high or low. This routine keeps going on until the time to answer ends. Number_of_plays count how many buttons was pressed and the sleep function works as a debounce interval.</p><p>The validation is made comparing item by item the game’ sequence and player’s sequence.</p><p>OBS: Important to mention that where are the while True loops with a eternal blink indicate that the game ended by player’s mistake or he/she surpassed the limit time to make a move.</p><blockquote>In our case the limit time to make a move is 3 seconds (line 76)</blockquote><blockquote>(Ignore the lines which been already shown, focus on the variables not showed before as game_sequence and player_sequence)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/1*EXO01t3JRi5MqQTFxKv6eA.png" /></figure><h3>It’s DONE!</h3><blockquote>Any doubt or sugestion please post a comment or send me an email :)</blockquote><h3>Complete code</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/33aa60aced87b58030a700d04d19d46d/href">https://medium.com/media/33aa60aced87b58030a700d04d19d46d/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGXWGrcEF85w%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGXWGrcEF85w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FGXWGrcEF85w%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f8c2444b9667e72f050c00f8015fdbbb/href">https://medium.com/media/f8c2444b9667e72f050c00f8015fdbbb/href</a></iframe><p>My linkedin: <a href="https://www.linkedin.com/in/iran-macedo-bezerra-neto/">https://www.linkedin.com/in/iran-macedo-bezerra-neto/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d371c2bacbed" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>