<?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 Sumaiya Tabassum on Medium]]></title>
        <description><![CDATA[Stories by Sumaiya Tabassum on Medium]]></description>
        <link>https://medium.com/@sumunchies?source=rss-35211adb3767------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*9C6223PmkhwGCpqOhPrYsg.jpeg</url>
            <title>Stories by Sumaiya Tabassum on Medium</title>
            <link>https://medium.com/@sumunchies?source=rss-35211adb3767------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 09:33:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sumunchies/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[Excess GitHub Repos?]]></title>
            <link>https://medium.com/@sumunchies/clean-up-your-repos-excess-github-repos-d2ba6e9c36c9?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2ba6e9c36c9</guid>
            <category><![CDATA[delete]]></category>
            <category><![CDATA[delete-data]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Tue, 14 Jan 2025 20:05:45 GMT</pubDate>
            <atom:updated>2025-01-24T20:57:30.337Z</atom:updated>
            <content:encoded><![CDATA[<p>Cleanup Your Excess GitHub Repositories with Repo Remover!</p><p><em>I created this blog post because for the past few months, I have been searching for ways to bulk remove GitHub repositories that I no longer needed. It became challenging as I had hundreds of unnecessary repositories. On top of that, some of the solutions were not very straightforward and not to my liking. Soon enough, I came across a tool online that helped me quickly and easily delete (or archive) multiple GitHub repositories.</em></p><h4>Be 100% Sure You Want to Delete</h4><p>Be 100% sure that you want to delete the repositories you choose delete, because…the deletion process is irreversible! If you are 100% sure that you DO NOT need your data / repository, then you may proceed.</p><h4><strong>Why Remove Repositories?</strong></h4><p>It may just be a personal choice, but for me, since I was updating my resume recently, I wanted to link my GitHub profile to my resume and reflect projects and code that accurately reflected my skills. There were too many repeated repositories or just unnecessary repositories that clogged up my profile.</p><h3><strong>THE TOOL — Repo Remover</strong></h3><p>The tool, created by Zaahir Moolla, will help you remove excessive/unnecessary repositories that you no longer wish to keep.</p><p><a href="https://reporemover.xyz/">https://reporemover.xyz/</a></p><p>The application is free to use, open source, and MIT licensed. The code is available on <a href="https://github.com/moollaza/repo-remover">GitHub</a>.</p><p><strong>How Does It Work?</strong></p><p>“Repo Remover uses the GitHub API and a user-generated Personal Access Token, to get a list of your repos, and displays them in a table where you can search, filter, and select the repos you want to delete (or archive). Before making any changes Repo Remover requires you to confirm your changes (by typing in your username) to prevent any accidents from happening.” — <a href="https://www.quora.com/How-do-I-delete-multiple-repositories-from-GitHub-at-once">Zaahir Moola</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2ba6e9c36c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Technica 2022]]></title>
            <link>https://medium.com/@sumunchies/technica-2022-c3b73cd13518?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3b73cd13518</guid>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[technology-news]]></category>
            <category><![CDATA[stem]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Thu, 01 Dec 2022 02:25:47 GMT</pubDate>
            <atom:updated>2022-12-01T02:37:21.809Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In 2017, I attended my first hackathon, Technica. I had a positive and a memorable experience. After 5 years, as a masters graduate student, about a month and a half ago, I decided to attend Technica again along with two other undergraduate students to enjoy the Technica hacker experiences.</em></p><p><em>Note: For information on future Technica events, keep an eye out for updates on their </em><a href="https://gotechnica.org/"><em>Technica</em></a><em> website or follow </em><a href="https://medium.com/u/a8c64c0aa9b5"><em>Technica</em></a><em>. To learn more about hackathons and attend them, or about other tech. oriented events to get involved in the hacker community, visit </em><a href="https://mlh.io/"><em>Major League Hacking’s (MLH)</em></a><em> website or follow </em><a href="https://medium.com/u/173a584048a"><em>Major League Hacking</em></a><em>.</em></p><h3><strong>About &amp; Venue</strong></h3><p>Technica is hosted each Fall semester, specifically for underrepresented genders in the tech. world, by students from <a href="https://www.umd.edu/">The University of Maryland</a> located at College Park, Maryland. Students from across the country and globe attend the hackathon, with majority attendees from the United States. Previously, the in-person hackathon was hosted on campus at <a href="https://www.umd.edu/">The University of Maryland</a>. In 2020, with the spread of the COVID-19 pandemic, the hackathon switched from an “in-person” to “online” format. In 2021, Technica switched to a “hybrid” format, allowing both in-person attendees as well as online attendees. The only difference for the in-person event in 2021, was the change in venue from on campus to <a href="https://www.thehotelumd.com/">The Hotel UMD</a>! In 2022, the event was also held in “hybrid” format at the <a href="https://www.thehotelumd.com/">The Hotel UMD</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*KDJR1Ls38l_BfnkbUMJVYQ.png" /><figcaption>In 2022, the event was also held in “hybrid” format at the <a href="https://www.thehotelumd.com/">The Hotel UMD</a>.</figcaption></figure><h3>Teams &amp; Tracks</h3><p>There are several tracks students can choose from at the Technica hackathon. In 2022, there were 4 tracks: General, Beginners, Research, and Startup. Alongside the 4 tracks which participants were allowed to choose from, there were specific challenges students could enter, posted on the <a href="https://technica2022.devpost.com/?ref_feature=challenge&amp;ref_medium=discover">Technica DevPost</a>. In 2022, each team was allowed to have up to 4 team members.</p><h3>My Team Project</h3><p>As this year’s participant, my final team comprised of 3 participants. To begin, we divided our roles based on each of our strengths. I was the Project Manager and Developer, another teammate was the UX Designer and content creator, the final team member was responsible for market research and putting together our presentation slides. Initially, we aimed to compete for the Startup track only, but we eventually submitted our project for various categories with a focus on finance and design. Our winning project, <a href="https://devpost.com/software/budgy-jb7t2n">Budgy</a>, placed 1st for FinTech and 2nd for Best UX Design.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V32Dyhl94SOsKj67BZo5vg.jpeg" /><figcaption>Our winning project, <a href="https://devpost.com/software/budgy-jb7t2n">Budgy</a>, placed 1st for FinTech and 2nd for Best UX Design.</figcaption></figure><h4>Project/Application Overview</h4><p>As we only had 3 members in our team, we divided the tasks accordingly. One person was the developer (myself), another team member was responsible for the design, and the final team member was responsible for documentation and research. The back-end was created using Rails, to establish object relationships so we could understand functionalities that could take place between the user and other models. For the mockup, we used for the initial mockup Samsung Notes, and completed our design of the application using Figma.</p><p>We decided to create a financial application, with a primary target market of college students, allowing users to keep track of their financial spendings through itemized lists. Users enter an initial budget. There are 3 alert areas which users need to be aware of: overspent, underspent, or spent just the right amount. Overspending would indicate a red alert, underspent would raise a green alert, and a yellow alert would symbolize spending the exact amount as budgeted.</p><p>An additive feature to our application that differs from other application in the market is the “buddy” system. This feature enables users to have a buddy (another user) to remind them how their spendings are going or if they notice something that they would want to alert their buddy friend about. For example, if a user spent too much money on textbooks, their buddy would inform them that they spent too much money on text book. The goal of the application is to make it more user friendly by having the socializing feature of the buddy system.</p><p>Due to time constraints of the 24 hours hackathon, we were unable to have a fully functional app. We were able to complete a working prototype, and a rails back-end to establish model and database object relationships.</p><h3>Other Opportunities</h3><ol><li><strong>Mentor &amp; Volunteer:</strong> You can sign up to mentor students by sharing your knowledge or sign up to volunteer to help out with event operations at Technica!</li><li><strong>Fellowship Program: </strong>For rising college freshman students who sign up and are accepted to the Technica Fellowship Program, they are allowed to work on a coding project impacting Technica. Students (Fellows) gain industry experience and impact thousands of users!</li><li><strong>Ambassadors Program: </strong>Students who sign up and are accepted as a Technica Campus Ambassador have the unique opportunity to help foster the hacker community beyond the Technica hackathon weekend. As a representative of the student’s home school, the Technica Campus Ambassador will spread the word about Technica on campus and promote inclusion in STEM!</li><li><strong>Accommodations</strong> (Travel and/or Hotel and Food)<strong>: </strong>For students needing to travel to the hackathon Technica can reimburse travel fees or can arrange busses for students residing in the United States. Typically, hackers sleep at the hacking area, however, Technica does provide a limited number of hotels to eligible students (in reference to 2021 &amp; 2022 hackathon)! Also, food is provided at the hackathon from breakfast, lunch, to dinner! Hackers with dietary restrictions are also accommodated!</li></ol><h3><strong>Prizes &amp; Sponsors</strong></h3><p>Technica 2022 had many sponsors of various levels including: Partner, Platinum, Gold, Silver, Bronze, and Starter. Many of the challenges were sponsored challenges and the value of all of the prizes summed to a total of $20,308. For the prize categories my team won, each team member from my team received a portable monitor from T. Rowe Price for winning their sponsored challenge of Best FinTech Hack. For second place in Best UX design, each team member from my team received a $50 Apple gift card!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IsN43w_KbHJfcwZ4Fv09ww.png" /><figcaption>Each team member from my team received a portable monitor from T. Rowe Price for winning their sponsored challenge of Best FinTech Hack.</figcaption></figure><h3><strong>Closing &amp; Swag</strong></h3><p>There were many cool swag handed throughout the event from registration to closing. Cool stickers, tote bags, water bottles, and much more were given! Technica was a wonderful event and I hope many hackers that were unable to attend can attend next year!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3b73cd13518" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Full Stack Project Using a Custom Built Rails API]]></title>
            <link>https://medium.com/swlh/building-a-full-stack-project-using-a-custom-built-rails-api-15de32d423f9?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/15de32d423f9</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Tue, 20 Oct 2020 02:30:53 GMT</pubDate>
            <atom:updated>2020-10-23T18:32:39.887Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Full Stack Project Using a Custom-Built Rails API</h3><p>The following blog post is a tutorial on building a Full Stack project using JavaScript and a Rails API. The link to the GitHub repository is down below:</p><p><a href="https://github.com/stabassum/student-course-rails-js">stabassum/student-course-rails-js</a></p><p>Note: The following tutorial will be updated as needed.</p><h3>Intro: JavaScript &amp; Rails</h3><p>JavaScript is a powerful object oriented programming language that can be used to build web applications. JavaScript is a multipurpose and a convenient programming language that allows for both front-end and back-end development.</p><h3>Project Domain:</h3><p>The domain for the Full Stack application project in the following tutorial is a course registration project. This project mimics a registration application in which an administrator (Admin) would register a student into a particular course.</p><h3>Project File Structure:</h3><p>When building an application, it is important to understand the flow of the application and the file structure. Keeping folders and files organized in a structured manner will allow the developer to understand the application structure and refer to a particular section of code faster. This allows for easier debugging.</p><p>For the Full Stack project, we will divide the user interface from the application logic, in other words, the front-end from the back-end of the application. Below is the file structure of the application:</p><pre>student-course-rails-js<br>├── student-course-backend<br>│   ├── app<br>│   │   ├── controllers<br>│   │   │   ├── courses_controller.rb<br>│   │   │   └── students_controller.rb<br>│   │   ├── models<br>│   │   │   ├── course.rb<br>│   │   │   └── student.rb<br>│   │   └── views<br>│   └── db<br>│       ├── migrate<br>│       │   ├── 20200928184552_create_courses.rb<br>│       │   └── 20200928184626_create_students.rb<br>│       ├── schema.rb<br>│       └── seeds.rb<br>│<br>├── student-course-frontend<br>│   ├── src<br>│   │   ├── course.js<br>│   │   ├── index.js<br>│   │   └── student.js<br>│   ├── style<br>│   │   └── style.css<br>│   └── index.html<br>└── README.md</pre><h3>What are APIs?</h3><p>The acronym ‘API’ stands for ‘Application Programming Interface’. An API allows for one system to communicate easily with an external system. APIs can generally be sources of data that can be used for building applications, such as movies for a particular theatre, weather information, number of people affected by a particular disease (example: COVID-19) based on geographical location and much more.</p><p>Rails is a multi-functional framework and one of its special features is to allow the creation of an API from scratch. If there are particular information that you would like to share, you can build an API that just shares that information and deploy it to the web. The data in an API can be organized in a particular way.</p><h3>Rails Backend API</h3><p>Before working with Rails, make sure you have<strong> </strong><a href="https://rubyonrails.org/"><strong>Rails </strong></a>installed into your local machine. To create a Rails API from scratch, run the following command on your terminal:</p><pre><strong>rails new student-course-backend --api</strong></pre><p>The ‘api’ flag creates a rails api with all of the files necessary for creating an api. The <strong>student-course-backend </strong>represents the name of the api. When using the api flag, in contrast to not using it, certain files that are generally included when creating a rails application are excluded when creating a Rails api, as these files are not necessary for an api.</p><p>The backend api file structure should look something like this :</p><pre>back-end<br>|__app<br>|__bin<br>|__config<br>|__db<br>|__lib<br>|__log<br>|__public<br>|__storage<br>|__test<br>|__temp<br>|__vendor<br>|__config.ru<br>|__Gemfile<br>|__Gemfile.lock<br>|__Rakefile</pre><p>The folders that we will be working on for the backend api are the following:</p><ul><li>app</li><li>config</li><li>db</li></ul><p>We will also work with the Gemfile. In the Gemfile, uncomment the gem ‘rack-cors’.</p><pre><strong>gem &#39;rack-cors&#39;</strong></pre><p>The visibility of the above gem will allow the host of the application to interact with the api.</p><p>We will now focus on the database portion of the application. Navigate to the “db” folder and create a “migrate” folder to store migration files. The migration ruby files are the following, located beneath the migrate folder. You can either use shortcut command or manually create them. Either is fine.</p><pre><strong>db<br>|__migrate<br>   |__</strong><strong>20200928184552_create_courses.rb<br>   |__</strong><strong>20200928184626_create_students.rb</strong></pre><p>Within each migration file, add the necessary information needed to create the schema file.</p><p>The file, 20200928184552_create_courses.rb has the following code:</p><pre><strong>class CreateCourses &lt; ActiveRecord::Migration[6.0]<br>      def change<br>          create_table :courses do |t|<br>             t.string :name<br>             t.string :description</strong></pre><pre><strong>t.timestamps<br>          end<br>      end<br>end</strong></pre><p>The file 20200928184626_create_students.rb the following code:</p><pre><strong>class CreateStudents &lt; ActiveRecord::Migration[6.0]<br>      def change<br>          create_table :students do |t|<br>             t.string :full_name<br>             t.string :email<br>             t.string :time_preference<br>             t.references :course, null: false, foreign_key: true</strong></pre><pre><strong>t.timestamps<br>          end<br>       end<br>end</strong></pre><p>Once the migration files have been created, save the files and run <strong><em>rails db:migrate</em></strong> on your terminal to create your schema file. Once the schema file is created, under the “db” folder, create a seed.rb file to input dummy data to work with your application:</p><p>Once the code has been added, return to your terminal screen and run the following command:</p><pre><strong>rails db:seed</strong></pre><p>To confirm if the seed data has been inserted into the database, run the <strong><em>rails console</em></strong> command on your terminal to open up the console.</p><p>To view all of the courses or students for data seeding confirmation, you can run either one or both of the following commands in the console:</p><pre><strong>Courses.all</strong></pre><pre># or run the following command in the console</pre><pre><strong>Students.all</strong></pre><h3>Models</h3><p>After the database has been set up, move on to the models folder located within the app folder. Here we’ll create model files, course.rb and student.rb and established the relationship between the two.</p><pre><strong>class Course &lt; ApplicationRecord<br>      has_many :students<br>end</strong></pre><pre><strong>class Student &lt; ApplicationRecord<br>      belongs_to :course</strong></pre><pre><strong>validates :full_name, presence: true<br>      validates :email, presence: true<br>      validates :time_preference, presence: true<br>end</strong></pre><p>The above established relationship will have the necessary methods to interact with the database by inheriting from ApplicationRecord, which inherits from Active Record (an Object Relational Mapper).</p><p>To ensure user inputs entries in a form for certain fields such as full name, email, and time preference before submission, we can use validations. Validations will ensure that the user must input some text in that field before submitting the form.</p><h3>Serializers &amp; Controllers</h3><h3>Serializers</h3><p>When coding, it is best practice to keep your code as DRY (“Don’t Repeat Yourself”) as possible. This means, redundant code that appears throughout your program, must somehow be “summarized” and/or reduced.</p><p>In our controllers, there may be occasions in which both the index and show method, or any other method, use the same lines of code over and over. We can store these recurring codes in serializers and later call them in our controllers.</p><ol><li>In the app folder, create folder titled “serializers”.</li><li>Create two files in the serializers folder and write the following code:</li></ol><pre># File Name : course_serializer.rb</pre><pre><strong>class CourseSerializer<br>    include FastJsonapi::ObjectSerializer<br>    attributes :name, :students<br>end</strong></pre><pre># File Name : student_serializer.rb</pre><pre><strong>class StudentSerializer<br>    include FastJsonapi::ObjectSerializer<br>    attributes :full_name, :email, :time_preference, :course<br>end</strong></pre><p>** Note: Be sure to include the “fast_jsonapi” in your gemfile in order to use the serializers.**</p><h3>Controllers</h3><p>The controllers allow for the communication between model classes, databases, and the functionalities to be carried out on the front-end. We will set up two controllers for the purpose of this application along with a few controller methods. The methods will be implemented in our application for use on the frontend portion of the project.</p><pre># create a file under the controllers folder:<br># courses_controller.rb<br># Add the following code in the controller</pre><pre><strong><em>class CoursesController &lt; ApplicationController</em></strong></pre><pre><strong><em>def index<br>        courses = Course.all<br>        render json: CourseSerializer.new(courses)<br>    end</em></strong></pre><pre><strong><em>def show<br>        course = Course.find_by(id: params[:id])<br>        render json: CourseSerializer.new(course)<br>    end</em></strong></pre><pre><strong><em>def destroy<br>        course = Course.find_by(id: params[:id])<br>        course.destroy<br>    end</em></strong></pre><pre><strong><em>end</em></strong></pre><pre># create another file under the controllers folder:<br># students_controller.rb<br># Add the following code in the controller</pre><pre><strong><em>class StudentsController &lt; ApplicationController</em></strong></pre><pre><strong><em>def index<br>        students = Student.all<br>        render json: StudentSerializer.new(students)<br>    end</em></strong></pre><pre><strong><em>def show<br>        student = Student.find_by(id: params[:id])<br>        render json: StudentSerializer.new(student)<br>    end</em></strong></pre><pre><strong><em>def destroy<br>        student = Student.find_by(id: params[:id])<br>        student.destroy<br>    end</em></strong></pre><pre><strong><em>end</em></strong></pre><h3>Routes</h3><p>The next folder we need to work with is the config folder. Within the config folder we must ensure that our routes are defined in the <strong><em>routes.rb</em></strong> file.</p><pre># The following will allow all of the controller paths</pre><pre><strong>resources :students<br>resources :courses</strong></pre><p>Once the paths are defined in the routes, let us locate to the <strong><em>cors.rb</em></strong> file in the <strong><em>initializers</em></strong><em> </em>folder under the config folder.</p><p>Uncomment the code starting from “Rails.application …” and paste the following :</p><pre>Rails.application.config.middleware.insert_before 0, Rack::Cors do<br>   allow do<br>      origins &quot;*&quot;</pre><pre>resource &#39;*&#39;,<br>        headers: :any,<br>        methods: [:get, :post, :put, :patch, :delete, :options,  :head]<br>end</pre><pre>end</pre><p>The above will work with the uncommented gem “<strong>gem rack-cors</strong>” allowing the host of the application to interact with the api.</p><p>(<strong>Note</strong>: Majority of what we have done up to this point with the back-end rails API structure of the application can be automatically done by rails generators. However, for better understanding of files and structure, some manual work was shown in the tutorial).</p><h3>Frontend</h3><p>Once the backend is set up and working, we can use the data and logic to communicate with the frontend and display content to the browser. While building on the frontend portion of the application, there are a few steps from diagramming, to writing HTML and CSS content, to finally bringing interactivity to the site through JavaScript.</p><h3>Draft Diagram</h3><p>Before going straight into coding, it is good practice to outline, or at the very least diagram a draft of the application. Diagramming will help the developer get a visual idea of what to code in HTML faster. Despite knowing what functionalities a developer may want to add to an application based on the developed backend, a diagram can always be useful.</p><p>Below is the draft diagram of what the user would interact with on the frontend with the expected functionalities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8nKnG1VkwiCwEwW-SW3Wjg.png" /><figcaption>“…it is good practice to outline, or at the very least draft a diagram of the application.”</figcaption></figure><h3>HTML</h3><p>Based on the diagram, the user inputs information in one form, and depending on the input information, a “card” is displayed for a particular course a user registers for. The input for itself is static in that a user is directed to some input form as soon as they enter the website. The information that is entered by the user which is displayed is dynamically generated through JavaScript.</p><p>So, for the HTML, let us build the user input form:</p><pre><strong>&lt;!DOCTYPE html&gt;</strong></pre><pre><strong>&lt;html</strong> lang=&quot;en&quot;<strong>&gt;</strong></pre><pre><strong>&lt;head&gt;</strong></pre><pre>&lt;!-- make sure to have all of the meta tags --&gt;         <br><strong>&lt;title&gt;</strong>Bootcamp Registration<strong>&lt;/title&gt;<br>&lt;link</strong> rel=&quot;stylesheet&quot; href=&quot;style/style.css&quot;<strong>&gt;</strong>               <br><strong>&lt;script</strong> type=&quot;text/javascript&quot; src=&quot;src/course.js&quot;<strong>&gt;&lt;/script&gt;</strong>        <strong>&lt;script</strong> type=&quot;text/javascript&quot; src=&quot;src/student.js&quot;<strong>&gt;&lt;/script&gt;</strong>        <strong>&lt;script</strong> type=&quot;text/javascript&quot; src=&quot;src/index.js&quot;<strong>&gt;&lt;/script&gt;</strong></pre><pre><strong>&lt;/head&gt;</strong></pre><pre><strong>&lt;body&gt;</strong></pre><pre><strong>&lt;div</strong> id=&quot;container&quot;<strong>&gt;</strong></pre><pre><strong>&lt;form</strong> id=&quot;card-form&quot; class=&quot;card-registration-form&quot;<strong>&gt;</strong></pre><pre><strong>&lt;h3&gt;</strong>Technology Bootcamp Registration Portal<strong>&lt;/h3&gt;</strong></pre><pre><strong>&lt;p&gt;&lt;em&gt;<br>     &lt;b&gt;&lt;u&gt;</strong>Admin View : Permission to Register Students<strong>&lt;/u&gt;&lt;/b&gt;</strong><br><strong>&lt;/em&gt;&lt;/p&gt;</strong></pre><pre><strong>&lt;label&gt;</strong>Full Name:<strong> &lt;/label&gt; </strong>               <br><strong>&lt;input</strong> id=&#39;full-name&#39; type=&quot;text&quot; name=&quot;fullname&quot; value=&quot;&quot; placeholder=&quot;Full Name&quot; class=&quot;input-text&quot;<strong>&gt;</strong>                <br><strong>&lt;br&gt;&lt;br&gt;</strong></pre><pre><strong>&lt;label&gt;</strong>E-mail:<strong> &lt;/label&gt;</strong>                <br><strong>&lt;input</strong> id=&#39;email&#39; type=&quot;text&quot; name=&quot;email&quot; value=&quot;&quot; placeholder=&quot;Email&quot; class=&quot;input-text&quot;<strong>&gt;</strong>                <br><strong>&lt;br&gt;&lt;br&gt;</strong></pre><pre><strong>&lt;label&gt;</strong>Time Preference: <strong>&lt;/label&gt;</strong>                <br><strong>&lt;input</strong> id=&#39;time-preference&#39; type=&quot;text&quot; name=&quot;timepreference&quot; value=&quot;&quot; placeholder=&quot;Time Preference&quot; class=&quot;input-text&quot;<strong>&gt;</strong>                <strong>&lt;br&gt;&lt;br&gt;</strong></pre><pre><strong>&lt;label&gt;</strong>Bootcamp Selection<strong>&lt;/label&gt; </strong>                <br><strong>&lt;select</strong> id=&quot;bootcamps&quot; name=&quot;bootcamps&quot;<strong>&gt;</strong><br>                    <br><strong>&lt;option</strong> value=&quot;software_engineering&quot;<strong>&gt;</strong><br>Software Engineering Bootcamp<br><strong>&lt;/option&gt;</strong></pre><pre><strong>&lt;option</strong> value=&quot;cybersecurity&quot;&gt;Cybersecurity Bootcamp<strong>&lt;/option&gt;                    &lt;option</strong> value=&quot;data_science&quot;&gt;Data Science Bootcamp<strong>&lt;/option&gt;                &lt;/select&gt;                                <br>&lt;br&gt;&lt;br&gt;</strong></pre><pre><strong>&lt;input</strong> id=&quot;create-button&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Register&quot; class=&quot;submit&quot;<strong>&gt;            <br>&lt;/form&gt;</strong></pre><pre><strong>&lt;/div&gt;</strong></pre><pre><strong>&lt;br&gt;         <br>&lt;div</strong> id=&quot;cards&quot;<strong>&gt;            <br>&lt;h3</strong> style=&quot;text-align: center;&quot;&gt;Currently Enrolled Students<strong>&lt;/h3&gt;        &lt;/div&gt;</strong></pre><pre><strong>&lt;/body&gt;</strong></pre><pre><strong>&lt;/html&gt;</strong></pre><h3>CSS</h3><p>Once the HTML is coded, the CSS file can be set up with some initial code to style. Most of the styling for this application was done through inline CSS (styling within HTML elements).</p><h3>JavaScript</h3><p>To allow behavior and communication within the application, we want to use pure JavaScript for this particular application, rather then Ruby. To do this, allowing the database objects to talk and bring a dynamic site, we want to write object-oriented code in JavaScript. Let us first organize our files, and separate the logic into three JavaScript files under the <em>src</em> folder:</p><pre><strong>course.js<br>student.js<br>index.js</strong></pre><p>Having three separate script files will allow to focus on specific concepts. The course.js file can focus specifically on course objects, student.js can focus on student objects, and the index.js file can focus on what happens on the browser based on the users interactivity with the application in relation to the student and course objects. Below, we can summarize what is happening in the respective files for the JavaScript:</p><pre><strong>// course.js</strong></pre><pre>// class Course {}<br>// Implement course as a class data structure</pre><pre><strong>// student.js</strong></pre><pre>// class Student()<br>// Implement student as a class data structure</pre><pre><strong>// index.js</strong></pre><pre>const firstEndPointOfAPI = &quot;some URL&quot;;<br>const secondEndPointOfAPI = &quot;some URL&quot;;</pre><pre>document.addEventListener(&quot;DOMContentLoaded&quot;, ()=&gt;{</pre><pre>// code implementation of form submission<br>// render data to form</pre><pre>})</pre><pre>// Add additional functions to create and delete instances</pre><h3>AJAX (Asynchronous JavaScript XML) Calls</h3><p>AJAX prevents the constant load and reload so that users do not navigate away from a website or application due to long waiting time. AJAX techniques allows the HTML and CSS to be rendered to the browser and allow additional behavior to run on the application. Using <strong><em>fetch()</em></strong> calls helps apply AJAX techniques in which loading additional data is presented after information is presented to the user. In our JavaScript we used fetch() multiple times to retrieve data. In general, the format is as follows:</p><pre><strong>// fetch() call</strong></pre><pre>fetch(&quot;string URL to retrieve data&quot;)<br>.then(resp =&gt; resp.json())<br>.then(json =&gt; console.log(json));</pre><h3>Conclusion</h3><p>The Rails framework has many features that makes application development faster. One key feature of Rails is that it allows developers to build custom restful APIs for their applications. The API can interact with frontend development tools such as HTML, CSS, and JavaScript through fetch() calls — AJAX implementation, and make user-friendly applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15de32d423f9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/building-a-full-stack-project-using-a-custom-built-rails-api-15de32d423f9">Building a Full Stack Project Using a Custom Built Rails API</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[An Introduction to HTML & CSS]]></title>
            <link>https://medium.com/swlh/an-introduction-to-html-css-4084c798e5f?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/4084c798e5f</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[html-css]]></category>
            <category><![CDATA[webdev]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Sat, 22 Aug 2020 03:51:29 GMT</pubDate>
            <atom:updated>2020-08-24T22:51:23.605Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A beginners guide to web development</em></p><p>At the heart of any general website or web page are lines of code in HTML and CSS. HTML, the web development language to render content and CSS, which styles the content.</p><p>HTML, the acronym representing <em>Hypertext Markup Language</em>, is the language the web browser reads to generate textual content onto browsers. This type of language is made up of components called tags. Tags define particular elements in the document and is human-readable. For example, <strong><em>“p” </em></strong>referncing paragraph, <strong><em>“img”</em></strong> referencing image, and <strong><em>“li”</em></strong> referncing list item. HTML files are saved with a <strong><em>.html</em></strong> file extension.</p><p>With that out of the way, let’s dive into creating our first web page to render it onto the browser using HTML!</p><h3>Getting Started</h3><p>When building anything, there are specific set of tools required. In relation to web development, the software tools to build a website are:</p><ol><li>Code Editor (i.e. NotePad++, eclipse, atom, etc.)</li><li>Understanding of Basic HTML</li><li>Understanding of Basic CSS</li></ol><h3>Intro to HTML</h3><p>Using a code editor, create a file named <strong><em>index.html</em></strong><em> </em>where you will store your webpage’s code.</p><p>Your basic structure in creating a webpage using html will represent a <strong><em>sandwich like structure</em></strong><em>.</em></p><p>The first line of code will specify the document type to the browser that the file is a html document. The html tags can be treated like the 2 buns in a sandwich and the head and body tags can be thought of as the meat of the sandwich.</p><pre>&lt;!DOCTYPE html&gt;</pre><pre>&lt;html&gt;<br>     &lt;head&gt;<br>          &lt;title&gt;An Intro to HTML&lt;title&gt;<br>     &lt;/head&gt;</pre><pre>     &lt;body&gt;<br>     &lt;/body&gt;<br>&lt;/html&gt;</pre><p>Note : data between the head tags are not directly displayed on the the screen. The title tag is displayed on the tab bar of the website and external files such as .css and script files are placed between head (which work in the background and bring out action or style to the page). Any tags or text in between the body tags are displayed onto the screen.</p><p>Type the above html code in a text editor and save the file.</p><p>Once saved, double click the file and see what appears on the screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*av9xwuKRRy7A4IBQFfaGfA.png" /><figcaption>Notice the title bar with “An Intro to HTML”</figcaption></figure><p>Though there is an empty webpage, notice the tab with the title.</p><p>Now, let’s add text to the body of the web page. Add the following code to the body:</p><pre>&lt;body&gt;</pre><pre>     &lt;h1&gt;An Introduction to HTML and Web Content&lt;/h1&gt;</pre><pre>     &lt;p&gt;This is my first webpage where I will display some content to the webpage. &lt;/p&gt;</pre><pre>     &lt;p&gt;Below are the web languages I am trying to learn: &lt;/p&gt;</pre><pre>     &lt;ul&gt;</pre><pre>         &lt;li&gt;HTML&lt;/li&gt;<br>         &lt;li&gt;CSS&lt;/li&gt;<br>         &lt;li&gt;JavaScript&lt;/li&gt;</pre><pre>     &lt;/ul&gt;</pre><pre>&lt;/body&gt; </pre><h3><strong>Some Popular Tags</strong></h3><ul><li>paragraph : &lt;p&gt;&lt;/p&gt;</li><li>image : &lt;img&gt;</li><li>ordered list : &lt;ol&gt;&lt;/ol&gt;</li><li>unordered list : &lt;ul&gt;&lt;/ul&gt;</li><li>list item : &lt;li&gt;&lt;/li&gt;</li><li>divider : &lt;div&gt;&lt;/div</li><li>anchor : &lt;a&gt;&lt;/a&gt;</li><li>heading : &lt;h1&gt;&lt;/h1&gt; (up to h6)</li></ul><p>We have added some of the above tags to our html document.</p><p>If your file is open on the web browser, refresh the page and notice what is displayed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*UIuL1z9-pNwW_LOnoY-bcg.png" /></figure><p>The content typed onto the webpage is displayed and notice the content is displayed in different forms depending on the tag(s) used.</p><p>CSS, the acronym representing <em>Cascading Style Sheets</em>, is the language that compliments the content represented in HTML by styling it into more attractive and beautiful presentation.</p><p>The keyword <strong><em>selector</em></strong> is important to understand in relation to CSS. This keyword is used to finding (or “selecting”) the HTML element (tag) you want to style. At the very basic level, when using CSS to style HTML elements, the element tag is typed followed by curly braces.</p><p>In between the curly braces is the detail of the specific styling method. Below is an example of CSS used to style the above index.html file.</p><pre>h1 {<br>   color: red;<br>}</pre><pre>ul {<br>   font-style: italic;<br>}</pre><p>The above lines of CSS code will turn the heading (text inside h1 tag) red and the unordered list (ul) content into italicized.</p><p>The above code of CSS will not be reflected on the html file until it is <strong><em>linked </em></strong>inside the head tag. First, save the above code into a separate css file titled <strong><em>style.css</em></strong> and link it to the html file with the following code below the <strong><em>title </em></strong>tag:</p><pre>&lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot;&gt;</pre><p>If you click on the index.html file or refresh the page, you will see the following CSS implement onto your index.html file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*I6sncxLS4zpUjQTESlPFuA.png" /></figure><h3>IDs, Classes, and CSS</h3><p>There are two types of CSS selectors that are important to understand, id and class. When either on of these two selectors are used, it makes specific styling of certain tags much easier than styling by calling HTML tags. For example, there may be a case where you may want to style one item in a list a certain way, while styling rest of the items or a few other items another way.</p><ol><li>class : The <strong><em>class attribute does not need to be unique</em></strong> for HTML tags. You can have the same class attributes for multiple HTML tags. Class attributes are defined within HTML tags by typing : class= “…” (In between the parenthesis, type the class name). The syntax in CSS to refer to a class is the dot character (.).</li><li>id : The <strong><em>id attribute must be unique</em></strong> for a paritcular HTML element. The id attribute is defined within a particular HTML tag by typing : id= “…” (In between the parenthises, type the id name). The syntax in CSS to refer to an id is the hash character (#).</li></ol><p>To implement class and id, let us implement the following HTML and CSS code to our index.html and style.css files.</p><p><strong><em>index.html file :</em></strong></p><p>In our index.html file, add the following class and id <strong><em>attributes</em></strong> to the list items.</p><pre>&lt;li class=&quot;basicweblang&quot;&gt;HTML&lt;/li&gt;<br>&lt;li class=&quot;basicweblang&quot;&gt;CSS&lt;/li&gt;<br>&lt;li id=&quot;behavior&quot;&gt;JavaScript&lt;/li&gt;</pre><p><strong><em>style.css file :</em></strong></p><pre>h1 {<br>   color : red;<br>}</pre><pre>.basicweblang {<br>   font-style: italic;<br>}</pre><pre>#behavior {<br>   color: blue;<br>}</pre><p>Make sure both of your files are saved. Refresh your index.html page or open the file and you will see the following in your browser :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*tj7zAQP0TwT-2ubHQPORFw.png" /></figure><h3>Summary</h3><p>We see that few lines of HTML and CSS codes are at the heart of any basic webpage. HTML is reponsible for the content of the website, whereas CSS is reponsible for styling that HTML content. CSS can select particular HTML tags and change the phsyical appearance as to how the HTML content is presented onto the webpage.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4084c798e5f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/an-introduction-to-html-css-4084c798e5f">An Introduction to HTML &amp; CSS</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[The DOM & JavaScript : Intro]]></title>
            <link>https://medium.com/analytics-vidhya/the-dom-javascript-intro-23bdf08a412?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/23bdf08a412</guid>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programmer]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Wed, 06 May 2020 07:49:45 GMT</pubDate>
            <atom:updated>2024-07-25T03:06:36.201Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript Intro: The DOM</h3><p>If you have written code in JavaScript, you should be familiar with something called the <strong>Document Object Model (DOM)</strong>. You can think of the DOM as a hierarchical structure of objects, with the window object at the very top, followed by the document object. The window object is essentially a container holding all of the objects in JavaScript, immediately followed by the document object containing all of the HTML elements (nodes).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*ddZuQc7w9ZB21XeXlKfVqA.png" /><figcaption>“You can think of the DOM as a hierarchical structure of objects…” (Image Source : geeksforgeeks.org)</figcaption></figure><p>JavaScript is an object oriented and a functional programming language, in which, everything inside of a JavaScript program is treated like an object. As the window in the DOM acts as the container to hold everything in a JavaScript program, the <strong><em>document object</em></strong> plays a very important role in JavaScript. <strong><em>The document object, in the DOM, allows for the access and manipulation of contents residing within it via JavaScript.</em></strong> A simple example to access a property within the document object would be the document’s URL. Writing a simple line of code such as <strong><em>document.URL</em></strong> will return the url of the current document (website page you are on). The URL is a property of the document object, similar to a human object having the gender and age properties.</p><p><em>Note: You can view the DOM through Chrome’s developer’s tools.</em></p><p><strong>HTML Elements as Nodes in the DOM</strong></p><p>The DOM contains many HTML content. When talking about HTML, we know that HTML makes up the webpage and its contents. When referring to the DOM, <strong>nodes</strong> are all of the components that make up the webpage. In short, <strong><em>the HTML elements are the nodes represented in the DOM</em></strong><em>. </em>DOM nodes generally have a starting tag and an ending tag (sounds familiar?), where the outer nodes are referred to as the parent nodes.</p><p><strong>A Tree Like Structure</strong></p><p>The DOM can be thought of a “tree-like structure” as there is a clear hierarchal representation in the DOM. For instance, examine the code below :</p><pre>&lt;body&gt;</pre><pre>      &lt;div&gt;</pre><pre>            &lt;p&gt; <br>                This is a nested paragraph, inside of a div element,            <br>                inside of a body element. <br>            &lt;/p&gt;   <br>          <br>      &lt;/div&gt;</pre><pre>&lt;/body&gt;</pre><p>In the above code, the child node is the p tag, and the parent of the p tag is the div tag. Finally, the body is the parent of the div tag. Each of the elements are nested within each other.</p><p><strong>Manipulating the DOM using JavaScript</strong></p><p><em>So, what happens when we update the DOM and how do we update the DOM?</em></p><p>Note: To test the manipulation of the DOM, there are 2 ways — via JavaScript or the developers console through Google Chrome. You can click on a node and delete using the developer console, or write JavaScript code to do the same thing. The developer console will allow you to view the DOM representation of the HTML source the browser loads.</p><p><em>The below examples are generalized examples and refer to no particular webpages.</em></p><p><strong><em>Practice using Chrome DevTools:</em></strong></p><p>Clicking on the menu bar on a Chrome browser, and then clicking on “View”, then selecting “Developer”, and finally “Developer Tools” will allow you to work with DOM. Make sure to click “Elements”. If you click on a specific HTML element or a DOM node, see what happens if you press delete on the keyboard. The element is deleted! But <strong><em>has the source code changed? Absolutely not!</em></strong> If you refresh the page, you will notice the page is back to its original state. Manipulating the DOM only manipulated what is viewed on the browser.</p><p><strong><em>Practicing with JavaScript:</em></strong></p><p>The same exact behavior as above, in deleting an html element / DOM node, can be done using JavaScript.</p><p>In order to do a simple deletion, the place where the elements / nodes are held, must be selected : The DOM. Because the DOM is an object, and objects contain properties, methods can be called on the DOM to manipulate or retrieve the objects.</p><p>Now we call on a method to select an element in the document object. We do this by “speaking” JavaScript with the DOM. Type the following:</p><pre>document.querySelector(&#39;p&#39;)</pre><p>The above code will select the <strong><em>p object </em></strong><em>(paragraph object)</em> within the document object. Here, we are selecting the HTML element through the JavaScript keyword ‘querySelector’. Because the the p is an object, we can call a method on it, to remove the p from the browser. Type the following:</p><pre>document.querySelector(&#39;p&#39;).remove()</pre><p>The above code removes the <strong><em>p</em></strong> element<strong><em> </em></strong>from the browser! The “.” dot notation was used to chain the calls. In other words, we were able to do multiple actions via chaining:</p><ol><li>Select the document object</li><li>Within the document object we selected the p element using the “.” dot notation on the document object.</li><li>On the p object, we called on the method, by using the “.” dot notation on p.</li></ol><p><em>If you click “refresh”, you will notice the p was not deleted, it was just a “visual affect” by the browser, and the source code remained the same.</em></p><p><em>Note : If you notice, the word remove is followed by parenthesis (). Every method calling is followed by a parenthesis.</em></p><p>This was a very basic example of using JavaScript to talk to the DOM. It is important to understand that the DOM and JavaScript work together to allow the user for browser interaction.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23bdf08a412" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/the-dom-javascript-intro-23bdf08a412">The DOM &amp; JavaScript : Intro</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[Creating a Rails Application]]></title>
            <link>https://medium.com/@sumunchies/creating-a-rails-application-eb7f8cee2971?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb7f8cee2971</guid>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 02:12:43 GMT</pubDate>
            <atom:updated>2020-08-25T23:25:34.841Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-LAOoPHs63XCSd3VDJ2Eg.png" /></figure><p><em>Before building a rails application, make sure you have the proper technologies installed: ruby &amp; rails</em></p><p><em>GitHub Repository with the full code — in reference to the blog post:</em></p><p><a href="https://github.com/stabassum/00_rails_project_event_registration">stabassum/00_rails_project_event_registration</a></p><p>Note: <em>This blog post will be updated frequently to present the details of the application more clearly.</em></p><h3>Starting a rails applications</h3><p>To start your rails application, type the following command on your terminal:</p><p><strong>rails new</strong> <em>name-of-rails-application</em></p><p>The above command shows how to create a new rails application. The bolded words, <em>“rails new” are the key words required to create a new project in rails</em>. The italicized words <em>“name-of-rails-application” represents the name of the project</em>. By convention, each word is separated by a hyphen (“-”).</p><p>Once you have created your new rails project, you will notice, <strong><em>unlike a Sinatra application, your file structures have been created for you</em></strong> — saving you a ton time, reducing manual work!</p><p><em>For the purpose of our demo let’s create a event registration application by typing the following command in our terminal:</em></p><p><em>rails new 00-rails-project-event-registration</em></p><p>The purpose of this application would be to allow a registered to register for events.</p><p><strong><em>Fun-fact: Built-in Rails Methods</em></strong></p><p><em>Rails comes with many built-in functions. One of which is pluralize. Methods such as this will take in 2 arguments, the first argument a number and the second argument a string. If the word you pass in for instance is pencil, and the number is 1, “1 pencil” will be returned. However, if you pass in a number such as 2 or larger, “2 pencils” or whatever number greater than 2 you entered will be returned along with the pluralized word “pencils”. This is one of the “magical” features of rails!</em></p><h3>Model-View-Controller (MVC) Architecture</h3><p>It is important to understand that the separation of concerns is very important as it makes the job of a developer easier. Easier to debug code and quickly refer to a particular part of the application. MVC allows for code to be written in a structured manner where code regarding the models (class and application logic in relation to the database) is focused in one folder with multiple sub-files, the views (the front-end portion that the user sees) in another folder with sub-files, and finally the controllers (the portion of the code that acts as an intermediary between the views and models to communicate the data via requests called ‘HTTP’) in another folder with sub-files. Writing all of the code in one file with multiple logic makes it difficult for a developer to debug and locate code when they want to make changes.</p><h3><strong>Setting up our data and logic — the models and database:</strong></h3><p>You can choose the database software of your choice, but for this specific project, I will be using sqlite3.</p><p><em>(Note: The gemfile will manage all of your dependencies)</em></p><p>While thinking about your application design, it is important to consider the association relationships you will be dealing with. For this project, we will be working with a many-to-many relationship between the models. The model classes we will be working with, named in ruby files are: <strong>user</strong>.rb, <strong>event</strong>.rb, and <strong>registration</strong>.rb. The registration.rb file will be the join model between the user and event classes. We can set up our relationships in our model classes the following way:</p><pre>class User &lt; ActiveRecord::Base</pre><pre>     has_many :registrations</pre><pre>     has_many :events, through: :registrations</pre><pre>end<br></pre><pre>class Event &lt; ActiveRecord::Base</pre><pre>     has_many :registrations</pre><pre>     has_many :users, through: :registrations</pre><pre>end<br></pre><pre>class Registration &lt; ActiveRecord::Base</pre><pre>     belongs_to :user</pre><pre>     belongs_to :event</pre><pre>end</pre><p>The above code establishes the relationships between the models for the application. These files should be created under the models folder.</p><p>Database files such as “migration files” should be set up. Files should be named as below, under the “db” folder create a sub-folder titled “migrate” under which you will create migration files. The migration files should be numbered accordingly :</p><ol><li>001_create_users.rb</li><li>002_create_events.rb</li><li>003_create_registrations.rb</li></ol><p>To have the database schema setup, the following code should be written in each of the files. The code represents the creation of a database table with the variables for the application.</p><pre>class CreateUsers &lt; ActiveRecord::Migration[5.2]</pre><pre>   def change</pre><pre>      create_table :users do |t|</pre><pre>        t.string :email</pre><pre>        t.string :username</pre><pre>        t.string :password_digest</pre><pre>        t.timestamps null: false</pre><pre>     end</pre><pre>   end</pre><pre>end</pre><pre>class CreateEvents &lt; ActiveRecord::Migration[5.2]</pre><pre>     def change</pre><pre>       create_table :events do |t|</pre><pre>         t.string :name</pre><pre>         t.string :date</pre><pre>         t.integer :location</pre><pre>         t.string :description</pre><pre>         t.timestamps null: false</pre><pre>      end</pre><pre>    end</pre><pre>end</pre><pre><br>class CreateRegistrations &lt; ActiveRecord::Migration[5.2]</pre><pre>      def change</pre><pre>         create_table :registrations do |t|</pre><pre>           t.string :task_category</pre><pre>           t.string :task_descriptions</pre><pre>           t.string :shirt_size<br> <br>           t.integer :user_id</pre><pre>           t.integer :event_id</pre><pre>           t.timestamps null: false</pre><pre>         end</pre><pre>      end</pre><pre>end</pre><p>Once the migration files are created, run “rake db:migrate”. Running this command will create the “schema.rb” file in the “db” folder. Now the database is setup to work with!</p><p><em>Notice the code above, both the model class files and migration files are inheriting from ActiveRecord. ActiveRecord will provide many built-in methods to work with which saves the developer time from manually writing the methods. One example would be querying methods to talk to the database (instead of writing ‘select * from table_name’, to select all of entries for a particular model, you can call on the .all method on the class name, i.e. User.all).</em></p><h3>Controllers &amp; Routes</h3><p><strong><em>RESTful Routes: </em></strong><em>Before coding our routes, it is important to understand REST (REpresentational StateTransfer). REST is a standard way web applications should structure their URLs. Using standardization allows easier communication. Because of REST, we can familiarize what certain URLs represent, as opposed to being confused. When URLs are not standardize, they may be random characters and strings.</em></p><p><strong><em>CRUD: </em></strong><em>Almost every applications has at least one or more of these actions. CRUD — Create, Read, Update, and Delete. These actions can be represented through routes (HTTP requests) in an application which are mapped to the controllers of the application.</em></p><p>With REST and CRUD in mind, we can think about features of our application and code out our routes and map them to the application.</p><p>For now, let us name three controllers : <strong>users_controller</strong>.rb, <strong>events_controller</strong>.rb, and <strong>registrations_controller</strong>.rb. For the controller : users_controller.rb all of the CRUD functionalities will be implemented. The registrations_controller.rb will implement the four CRUD functionalities. The events_controller.rb, we will only implement the “Read” functionality.</p><p>In rails, methods are written in the controller file(s) and mapped to the routes (the routes are under config folder in routes.rb file) firing http requests.</p><p>The following http request (get, post, patch, and destroy) corresponds to the appropriate rails controller methods (index, show, new, create, etc.) :</p><ol><li><strong><em>get</em></strong> → <strong>index</strong> : retrieve all records for that class</li><li><strong><em>get</em></strong> → <strong>show</strong> : retrieve one record based on id provided</li><li><strong><em>get</em></strong> → <strong>new</strong> : a form to create a new object should be shown</li><li><strong><em>get</em></strong> → <strong>edit</strong> : a form to edit an existing object should be shown</li><li><strong><em>post</em></strong> → <strong>create</strong> : a new object is created</li><li><strong><em>patch</em></strong> → <strong>update</strong> : an existing object is edited</li><li><strong><em>destroy</em></strong> → <strong>delete</strong> : an existing object is deleted</li></ol><p><strong><em>Note:</em></strong> The get request is static as it does not manipulate any data, rather it just displays/retrieves information to show on the webpage.</p><p>All of the routes can be “magically” generated in Rails by calling on the keyword <strong><em>resources</em></strong>. In the routes.rb file, writing the following lines of code will draw out all 7 routes for both the registration and user models. To specify which routes should be drawn, use the “only” keyword:</p><pre>Rails.application.routes.draw do</pre><pre># For details on the DSL available within this file, see                            # https://guides.rubyonrails.org/routing.html</pre><pre>    resources :users</pre><pre>    resources :registrations</pre><pre>    resources :events, only: [:index, :show] # shows only 2 routes</pre><pre>end</pre><p><strong><em>After drawing out the routes, in the controllers, we write the action methods for the corresponding routes.</em></strong></p><p>In the events_controllers.rb we can draw the two action methods that we need, which correspond to its routes. The index and show methods.</p><pre>class EventsController &lt; ApplicationController</pre><pre>    def index</pre><pre>      @events = Event.all</pre><pre>    end</pre><pre>    def show</pre><pre>      @event = Event.find(params[:id])</pre><pre>    end</pre><pre>end</pre><p>In the above methods, index refers to the page where all of the records of that particular user model are displayed. <strong><em>ActiveRecord is allowing the usage of the “.all” method to be called on the Event class to retrieve all of the Event records and stores them in an instance variable called “events”</em></strong>.</p><p>The show method on the other hand is storing one instance of the Event in an instance variable called event (the “@” is referring to instance variable). ActiveRecord method “find” is being called on the Event class to locate a particular instance of event by passing in parameters “params” for a particular id (“:id”). Using “.find” and “.all” saves the developer from using hard coded SQL statements into the code.</p><p>We can do something similar for the remaining controllers with additional action methods:</p><pre>class UsersController &lt; ApplicationController</pre><pre>    def index</pre><pre>       @users = User.all   </pre><pre>    end</pre><pre>    def show</pre><pre>       @user = User.find(params:[id])   </pre><pre>    end</pre><pre>    def new</pre><pre>       @user = User.new  </pre><pre>    end</pre><pre><br>    def create</pre><pre>    end</pre><pre><br>    def edit</pre><pre>       @user = User.find(params[:id])</pre><pre>    end</pre><pre><br>    def update</pre><pre>    end</pre><pre>    def destroy</pre><pre>    end</pre><pre>end</pre><h3>Views</h3><p><strong>Form Helpers: </strong>When we want to render some sort of image on to the browser in addition to receiving input from the users when building we applications, we focus on the “<strong><em>views</em></strong>” of the MVC pattern. Using regular html code like &lt;form&gt;&lt;/form&gt; along with other tags used to retrieve and post input data onto pages can be a lot of code to write. <strong><em>Fortunately, rails comes with form helper methods</em></strong> to aide us with the development process. Two helpers that we will focus on are <strong><em>form_tag and form_for</em></strong>.</p><p><strong>form_tag : </strong>The basic form helper is the form_tag.</p><p><strong>form_for :</strong> Works directly with the instance/object and the model class. This DRYs (referring to the <strong><em>Don’t Repeat Yourself concept</em></strong>) up the code significantly AND works dynamically as opposed to the form_tag. The form_for will allow developers to use the instance variable as objects in the form. There is a lot of rails “magic” behind the helper form_for. We can write the new and edit form very similarly in the using the form_for helper.</p><p>Below is an example of using form_for in creating the form for user accepting inputs for email, username, and password:</p><pre>&lt;%= form_for(@user) do |u| %&gt;                          </pre><pre>      &lt;%= u.label :email %&gt;        <br>      &lt;%= u.text_field :email %&gt;&lt;br&gt;         </pre><pre>      &lt;%= u.label :username %&gt;        <br>      &lt;%= u.text_field :username %&gt;&lt;br&gt;         </pre><pre>      &lt;%= u.label :password %&gt;        <br>      &lt;%= u.password_field :password %&gt;&lt;br&gt;     <br> <br>&lt;%= u.submit %&gt; </pre><pre>&lt;% end %&gt;</pre><p>There will be certain webpages that will have very similar funcationalities. For instance, the sign-up page and the edit page for a user has very similar fields if you examine closely. The main difference is, in a sign-up page, you are submitting information to create a brand new user, in an edit page, you are just typing new information in the same fields. Similarly, there are many other code, such as title and website logo that are same throughout multiple webpages for a single application. So, instead of writing the same code over and over on different .erb files, we<strong><em> use partials and layouts to DRY out the code!</em></strong></p><h3><strong>Partials, Layouts, &amp; Strong Params</strong></h3><p><strong><em>(Note : Please check back later for updates)</em></strong></p><h3><strong>Validations</strong></h3><p>There can be a lot of bad data the user enters and this type of data can get very messy once saved into the database. To prevent unwanted data from being saved into the database, we have <strong><em>validations</em></strong>! Validations prevent bad data from being saved into the database and checks the data before the data even tries to enter the database. For validations to work, in the route, there should be some sort of a save method (e.g. the create action and/or update) since we are validating data before a save to the database. The validations are working on the model classes and not the database itself. If we can prevent bad data from going into the database, we don’t have to worry too much about the database itself with unwanted data.</p><p>An example of a validation, which we will be using in our application is that for the user model, <strong><em>we do not want users signing-up with duplicate email addresses</em></strong>.</p><h3><strong>Validations with Error Messages :</strong></h3><p><strong><em>(Note : Please check back later for updates)</em></strong></p><h3><strong>Routes &amp; Nested Routes :</strong></h3><p><strong><em>(Note : Please check back later for updates)</em></strong></p><h3><strong>Authentication :</strong></h3><p>The next part of our application is the authentication process. We want to make sure a user is verified to use the application. <strong><em>Once verified, the user will have the capacity to access the features of the application.</em></strong> If a user is not verified, they can try logging in again or have the option to create a new user account to use the application.</p><p>The authentication process is essentially doing a few things (which we will see in code soon) through a login form:</p><ol><li>Identity claim — a user types their username, telling the application who they are.</li></ol><p><strong><em>(Please check back later for code updates)</em></strong></p><ol><li>Verification — the user types in their password to let the application verify who they are claiming to be.</li></ol><p><strong><em>(Please check back later for code updates)</em></strong></p><h3><strong><em>Understanding cookies:</em></strong></h3><p>It is important to understand the HTTP requests are “stateless”. Meaning, once you have made a request and it has been executed, it is no longer remembered by the time the next request is made. For instance, in our controller file, once the user requests to see the index page, after that action has been fired by the controller, it will no longer rememeber what action was fired right after. Then, say for example, a request to see an individual (show) page is fired and makes the “http get request”, this request will no longer be remembered once an individual page is shown. For example, examine the controller code below:</p><pre>def index</pre><pre>    @users = User.all</pre><pre>end</pre><pre><br>def show</pre><pre>   @user = User.find(params[:id])</pre><pre>end</pre><p><strong><em>Once the action method for “index” ends, the application does not conserve this anywhere</em></strong>. The user simply just moves on to the next action method he or she desires. After the method executes after the “end” statement, the action simply ends there.</p><p><strong><em>(Note : Please check back later for updates)</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb7f8cee2971" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[General Overview of Building a Basic Sinatra Application using the MVC Pattern]]></title>
            <link>https://medium.com/@sumunchies/general-overview-of-building-a-basic-sinatra-application-using-the-mvc-pattern-ee8f4811c065?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee8f4811c065</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[sinatra]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Sat, 21 Dec 2019 05:18:28 GMT</pubDate>
            <atom:updated>2025-01-24T22:37:35.310Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sinatra Application Overview</h3><h3>Vacation Budget Tracker</h3><p>The following blog post is a general overview of how to use the Sinatra web framework. For a deeper look into the “Vacation Budget Tracker” application created using Sinatra, refer to the video and GitHub link below.</p><p>Preview of Application:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FeO8uojdq0nM%3Fstart%3D5%26feature%3Doembed%26start%3D5&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DeO8uojdq0nM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FeO8uojdq0nM%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/27f8eca873e435f15c323a3049e00177/href">https://medium.com/media/27f8eca873e435f15c323a3049e00177/href</a></iframe><p>GitHub Repository of Code:</p><p><a href="https://github.com/stabassum/sinatra-project-vacation-budget-tracker-.git">stabassum/sinatra-project-vacation-budget-tracker-</a></p><p>Traveling is something many of us do often, whether it’s for the holidays, a tech conference, or to just explore the world we live in. It’s certainly something I enjoy, and like many enjoyments that come with a cost, so does traveling.</p><p>I was thinking to myself, <strong><em>why not build an application that keeps track of spendings for particular travel vacations?</em></strong> An application that can keep track of the departure location, destination location, the date travelled, as well as the budget and actual cost of the trip. <strong><em>These pieces of information would provide some correlation between travel dates, costs, destination, and even the departure location</em></strong>. Most importantly, an application such as this would be a very basic way to keep track of expenses.</p><p>So, let’s get an <strong><em>overview of</em></strong> how to build a basic ‘<strong><em>Vacation Budget Tracker</em></strong>’ application!</p><p>First and foremost, we need to be clear of what tools would be required to build such a web application. For our purposes, we will focus on <strong><em>the Ruby programming language and the Sinatra framework for the backend tools and .erb files consisting of HTML and CSS code for the front-end portion of the application</em></strong>.</p><h3>What is Sinatra?</h3><p>Sinatra is a lightweight web framework designed to provide its users with the bare minimum and abstractions for building simple and dynamic Ruby web applications. It is important to note that <strong><em>having a basic understanding of the Ruby programming language is important before building Sinatra applications</em></strong>.</p><p>The reason for using Sinatra as opposed to more powerful web frameworks, such as Rails, is to have a good understanding of how the basic features in an application works. After understanding how the basic features work using a lightweight tool for building applications, it would be more practical to move onto more complex tools, such as Rails.</p><h3><strong>General Application Features</strong></h3><p>At the very least, an application should consist of some data and logic that a user deals with. Adding images would bring better user interaction. There should also be some sort of link between the display on the screen and the data, a connection for data transfer from the server side, to the screen on the client side. <strong><em>These concepts of data and logic, display on screen, and link between data and display can be better explained through the MVC pattern</em></strong>.</p><h3><strong>What is the MVC Pattern?</strong></h3><p><strong><em>In web applications, MVC stands for Model-View-Controller.</em></strong></p><p><strong><em>MVC</em></strong> is a software design pattern which separates the logic when building an application — in other words, <strong><em>MVC emphasizes the separation of logic in our application</em></strong>.</p><p>The <strong><em>M</em></strong> — the <strong><em>models</em></strong>, in our application serves as the main logic and contains the data required for our applications. The models can be represented through classes which interact with the database to store data. To work with our model classes efficiently, it is important to familiarize with <strong>Active Record ( </strong><a href="https://guides.rubyonrails.org/active_record_basics.html">https://guides.rubyonrails.org/active_record_basics.htm )</a> as it is used in building Sinatra applications. Active Record is an Object Relational Mapper (ORM) providing predefined methods will allow the developer to communicate the model classes with the databases — saving the developer plenty of time in application development.</p><p>The <strong><em>V </em></strong><em>— the </em><strong><em>views</em></strong><em>, in our application is the interface in which the user interacts with our application. The views consist of our HTML, CSS, and JavaScript code.</em></p><p><em>Lastly, the </em><strong><em>C </em></strong><em>— the </em><strong><em>controllers</em></strong><em>, </em>in our application is the “middle-man” that talks to our models and database to render some feature successfully to our browser, based on the <em>request</em> (sign-in, sign-out, create account, etc.) the user made to the application. In the simple Sinatra application mentioned above, “Vacation Budget Tracker”, the MVC pattern would be used.</p><h3><strong>File Structure</strong></h3><p>The following would be one of many ideal file structures to use for the application :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/157/1*uxFSmGownhapaM0xrEReww.png" /></figure><p>Having a clear file structure when building an application is very important as developers (yourself or others) should be able to locate code when needed to modify/debug. At the very minimum, for approaching the current application, we need to <strong><em>create a folder called “app”</em></strong> which will contain sub-folders of the MVC structure. Beneath the “app” folder, <strong><em>three additional folders titled “models”, “views”, and “controllers” should be created</em></strong>.</p><p>Additional folders such as <em>“</em><strong><em>db</em></strong><em>”</em><strong><em> </em></strong>should be created. A sub-folder beneath the db folder, titled “<strong><em>migrate</em></strong>”, should also be created. These folders will allow data storage and interaction with the database.</p><p>The <strong>config.ru</strong> file is one the most important files in our application as it allows our models, views, and controllers to interact with one another. Basically, it is the file that allows communication between multiple files. The Gemfile would contains all of the Ruby gems used in our application, and the Rakefile would allow the developer to easily interact with the database.</p><p>(Refer to the file structure image above for reference)</p><h3><strong>Database &amp; Model-Relationships set-up</strong></h3><p>Before building out any application features, it is important to understand what the data relationships in our application will be. For instance, we know for sure that the application will have a user who would want to perform some action while using the application.</p><p><strong><em>A user may want to create a new “Vacation”, which will be stored as an object in our database</em></strong> (remember, Ruby is an object oriented programming language). The vacation will have some associated properties such as a brief description, date, departure, destination, budget, and spending. In order for a user to complete this type of action, a specific vacation would need to <strong><em>belong to</em></strong> a user after they create a vacation. To allow a user to repeat this action, creating a vacation, multiple times, a user would need to have a <strong><em>has many</em></strong> vacations relationship.</p><p>These two examples, vacation belongs to a user <strong>and </strong>a user has many vacation would be establishing relationships in an application. These relationships are defined in model classes, which would be mapped to the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*ez4AcOmtqR49eyJPMmfIzA.png" /><figcaption>“a user would have a has many vacations relationship”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/371/1*3fPiA2Ijj3n2N-qF8E6eYQ.png" /><figcaption>“a specific vacation would need to belong to a user”</figcaption></figure><p>These relationships defined in model classes also create methods via ActiveRecord, which users would not have to define manually in the model classes.</p><p>A general method would be the <strong><em>.all </em></strong>method, which would be used if a User would like to see all of his/her Vacations. Simple call, <strong><em>User.all</em></strong> and the vacation records for that user would be displayed.</p><h3><strong>Views</strong></h3><p>Logic is very important to our application, however, so are the views — what the user sees. Without the views, there is absolutely no way a user can interact with the application. It is important to understand that the users <strong>only </strong>gateway to the application are the “views”.</p><p>In general static websites, HTML files with “.html” extensions are used to display information to users. In a Sinatra application, our views will be rendered through embedded ruby (erb) files with “.erb” extensions. These files will allow developers to insert Ruby code into html code. The Ruby code, defined in the .erb file will call on the model class objects. In the “Vacation Budget Tracker” application, many .erb files are used, allowing the user to successfully navigate through the application.</p><p>The <strong><em>index.erb</em></strong> file <strong><em>refers to the homepage of the application</em></strong>. We also need the <strong><em>login.erb</em></strong> file to render a user login page to the application, and a <strong><em>signup.erb </em></strong>file to render a signup page for the user to signup to use the application if the have not already done so. A logout button is also required for the user to logout of the application, so for that feature, a form can be used to fire the logout button (in other words, end the user’s session).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*xvTg8DiRt4eRgjXHs8cVbA.png" /><figcaption>The <strong><em>index.erb</em></strong> file <strong><em>refers to the homepage of the application</em></strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*M5Qi1N-WWmr9Vf9Epf429g.png" /><figcaption>The above image shows what would be rendered to the screen from the code in the index.erb file</figcaption></figure><h3><strong>Controllers</strong></h3><p>We went over our model classes and it’s relationship with the database, and we also went over our views, rendering content to the browser using .erb files. Now the question arises, how does the model classes, in connection with the database communicate with the views?</p><p><strong><em>Controllers!</em></strong> The Controllers are the “middle-man” in our application that takes a request from a user via the views, and takes the request to check the model classes interacting with the database to respond to the request. <strong><em>These requests are defined through HTTP methods — the most commonly used HTTP methods are GET requests and POST requests</em></strong>.</p><p>In a Sinatra application, the Controller would inherit from Sinatra::Base to allow the developer access to all of the methods related to the controller’s actions. An example in which the controller would fire an HTTP request in the “Vacation Budget Tracker” would be when a user tries to login with an incorrect password. Once this action is made by the user, the controller would send a request from the user to the server to check if the password stored in the database for the specific username is matched with what the user entered. Once the pair of username and password returns to the controller and verifies that the username and password stored in the database does not match, a response would be sent back user, re-directing the user to the login page. This will then send the message to the user that the login credentials that were entered were incorrect.</p><h3><strong>RESTful Routes</strong></h3><p>Following conventions is always necessary to build a good application. When we use an online web application, there are certain patterns we notice. To give an example, it will be through the routes. In nearly all website, if we pay close attention to the URL, the https://www.<strong>index.html</strong> generally shows the home page, and the <a href="https://www.logout.html/">https://www.<strong>logout.html</strong></a><strong> </strong>would log the user out of the application. The routes defined in our controllers would direct the user to specific URLs. <strong><em>For each HTTP verb, a route is associated to an action defining the purpose of the route</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/546/1*1kBIaMEEW3uT8i2iOH2j-Q.png" /><figcaption>The image above shows the HTTP VERB associated with a specific Route and Action and what it’s used for.</figcaption></figure><h3><strong>Summary</strong></h3><p>MVC is a simple pattern in the development of software or web applications to separate logic during the development phase. This pattern can be implemented through web frameworks, such as Sinatra, when building a web application. The Vacation Budget Tracker is one of many applications that uses the Sinatra Framework allowing users to keep track of finances and other details for their vacation(s).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee8f4811c065" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Top 5 things to do at TechTogether New York]]></title>
            <link>https://medium.com/techtogether/top-5-things-to-do-at-techtogether-new-york-52b7f534f250?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/52b7f534f250</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[new-york]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 23:43:20 GMT</pubDate>
            <atom:updated>2026-07-28T20:15:56.135Z</atom:updated>
            <content:encoded><![CDATA[<h3>Top 5 Things To Do at TechTogether New York</h3><p><em>Brought to you by TechTogether New York 2019 Founding Chapter Director and New York Local, Sumaiya Tabassum</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/486/1*UnVEV0_lFM2KogEde8kqzQ.png" /><figcaption>“TechTogether New York’s mission is to help those gender marginalized groups thrive and be more successful, confident, and prepared for the tech field.” Visit <a href="https://newyork.techtogether.io/">https://newyork.techtogether.io</a> to get involved!</figcaption></figure><p>We know there is a huge gender gap in tech — TechTogether New York’s mission is to help those gender marginalized groups thrive and be more successful, confident, and prepared for the tech field. TechTogether New York (TTNY) is planning on giving the best experience to hackers, and what better way than to allow participants to network with a wonderful group of people, attend a variety of workshops in different topics, attend panels, and partake in fun activities! These range from skincare, to a dance lesson, and much more! TTNY will be a unique event with a ton of activities, workshops, and panels.</p><h3><strong>#1. PANELS</strong></h3><p>We want participants to feel more comfortable about the field of technology and be aware of the opportunities and challenges within the industry. We believe the most effective way to do this is through meaningful dialogue with panelists directly involved in technology. The panels at TTNY would give participants a chance to talk to both industry professionals and innovative student leaders passionate about technology through the Q&amp;A sessions.</p><h3><strong>#2. NETWORKING</strong></h3><p>One of the primary focuses of TTNY is ensuring that participants have the opportunity to network with a diverse group of people. As members of gender marginalized groups, many times we don’t have the same access to important career networks or feel actively supported in our networking efforts. TTNY is devoted to cultivating an encouraging atmosphere for connecting with our incredible community. Attendees have the opportunity to learn from each other’s diverse backgrounds and explore options for their career through networking not only with participants, but with mentors, volunteers, organizers, sponsors, and special guests as well. Our event will be a safe space to talk about future goals, ask for advice, see what career options participants have, all while encouraging hackers and supporters to keep in touch after the event. Having access to students, mentors, non-traditional participants, recruiters, university representatives, and more will allow participants to feel more confident and realize that there are many opportunities available to them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRjVMwBOj2EU-LWYGEtDrw.jpeg" /><figcaption>The participants are gathered and excited to receive their prizes!</figcaption></figure><h3><strong>#3. WORKSHOPS</strong></h3><p>TTNY will have numerous workshops for hackers to choose from. The workshops are organized around three central themes: Mentorship, Skill Building, and Community Growth. As the themes suggest, there will be a range of technical and non-technical workshops with topics that range from intro/intermediate to web development, python, sponsor workshops, machine intelligence, game development, and a whole host of self-care and personal development workshops. We believe that it is important for hackers to get extensive support through mentors and workshops to succeed in building their hack — but we at TTNY recognize the importance of understanding self-care as it plays an essential role in helping one succeed on both a personal and professional level. With that in mind, we will be hosting some mindfulness workshops (along with activities) for hackers to relax and learn stress management skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*uE2-MFCCysCEXYp0vglhdw.png" /><figcaption>“From skincare — to cup stacking, dance lesson session s— and much more, there’s something for everyone.”</figcaption></figure><h3><strong>#4. ACTIVITIES: SKINCARE AND MUCH MORE!</strong></h3><p>TTNY will also have fun-filled activities! From skincare — to cup stacking, dance lesson session s— and much more, there’s something for everyone. Participants are suggested to reserve their spot in advance, as there will be very limited slots for certain activities. As you compete for our challenge prizes, we will be raffling out participation prizes throughout the event, so make sure you’re following us on instagram @techtogethernewyork to stay on top of those exclusive giveaways!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*N3_-YhSju-o4XMix64GKBw.png" /><figcaption>“…there are a ton of places to visit while in New York City!”</figcaption></figure><h3>#5. EXPLORATION!</h3><p>And of course, there are a ton of places to visit while in New York City! TTNY is nestled in the heart of Queens — and there are plenty of diverse restaurants and parks to explore nearby. College Point, Kissena Park, and Queens Botanical Garden, to name a few, are some of the local nature spots to visit. Some of the local dine-ins such Pamir Kabab House &amp; Grill, Gino’s of Kissena, Tel Aviv Kebab House, Sushi Tokyo, and Fidela’s Restaurant are only a few blocks away! Love bubble tea? Chatime Bubble Tea is also close by! The event will also be a few subway rides away from Manhattan! With public transportation being extremely close to the venue, there are unlimited shopping possibilities, tourist activities, and other wonderful places to visit.</p><p><em>I’m very excited to share some of the wonderful things that will be brought to this event and to bring TechTogether New York to New York City! The event will take place on October 25–27, 2019 at Queens College, Dining Hall — save the date and register!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52b7f534f250" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techtogether/top-5-things-to-do-at-techtogether-new-york-52b7f534f250">Top 5 things to do at TechTogether New York</a> was originally published in <a href="https://medium.com/techtogether">TechTogether</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning a New Language]]></title>
            <link>https://medium.com/@sumunchies/learning-a-new-language-f717e5d4836?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/f717e5d4836</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[sofware-engineering]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Thu, 01 Aug 2019 14:00:13 GMT</pubDate>
            <atom:updated>2020-08-25T00:20:57.113Z</atom:updated>
            <content:encoded><![CDATA[<h3>Programming Languages</h3><p>There is no such thing as “the best programming language”. Each programming language, comes with its own strengths and weaknesses, and should be regarded as a tool for solving particular problems. <strong><em>Some languages may be more suitable to solve a specific problem over another</em></strong> — for example, finance companies may prefer something different for their software solution as opposed to the military. Once you have clearly defined your problem and see what tools are at your disposal, you can make a judgement as to what would be the best approach and tools to use to solve that problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*mOiCf1HTd6aCw4zFRGf0ZA.png" /><figcaption>The above picture shows that for a specific task, a specific animal can accomplish — event though it is the “same” exam — that exam is not suitable for everyone. The monkey in this case can pass the exam with the best scores — (and of-course birds can’t climb, they fly) however, if there was the same test to swim across a big body of water — it’s obvious that the fish would win.</figcaption></figure><p>Examine the image above, the task is to climb the tree. The only animal capable completing the task is the monkey. However, if the task was to swim in water, the same monkey would not be able to do so. If all of the animals were assigned a general task such as eating, they would be able to complete the task in the manner that would be best for them. <strong><em>Programming works similarly</em></strong>.</p><p>Many programming languages can perfom similar tasks, yet their approach to completing that task may differ from one language to another.</p><p>Below is a link to a chart showing different properties of programming languages and what each may be good to use for:</p><p><a href="https://en.wikipedia.org/wiki/Comparison_of_programming_languages">Comparison of programming languages - Wikipedia</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07PiE5KYpQ73ItHBZBR-Ow.png" /><figcaption>Certain programming languages have certain functions. Some are great for application building while others are not. Some may be object oriented languages while others may not be — however, each is designed to complete certain tasks. Just because one language may not have the features of another does not mean they are any better or worse than the other.</figcaption></figure><p>Examining different languages:</p><ol><li>See what commonalities each languages have — focus on the concepts — that’s how we can <strong><em>make relations</em></strong>.</li><li>Don’t just look for direct translations — converting a sentence directly from English to Spanish is not a good idea — the same goes for programming languages. <strong><em>The idea is to understand how each is working </em></strong><em>and not just converting “cout” in C++ to “System.out.print()” in Java</em>.</li><li>Use the new language as a tool. Know in what situation each is good to use. For instance, for game development and computer graphics — I would use C++ or C#.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*7-8V3GbqwUZzdkN3AigIIQ.png" /><figcaption>This is a code snippet from a project of mine where I used C++ with the OpenGL Framework to make an image. For a project like this — I would not think of using Java or Ruby. C++ would be the best tool in this situation to handle graphics. And of course — tools are very important — in this case, my background my previous Linear Algebra background helped me a lot. Who said college isn’t useful!?</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*k73gISY8abJ7kCiNoDyswA.png" /><figcaption>Using C++ &amp; OpenGL Framework to create images</figcaption></figure><p>For instance, if you are trying to build an operating system, you’d be better off using C++ or C, or a combination of both languages. And in particular for ray tracing — I cannot think of a better tool (language) to use other than C++.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*-QvcwR63Gpi4kO1Ns7TOFg.png" /><figcaption>I can’t think of a better tool to use for ray tracing than C++. (Ray Tracing -In computer graphics, <strong>ray tracing</strong> is a rendering technique for generating an image by <strong>tracing</strong> the path of light as pixels in an image plane and simulating the effects of its encounters with virtual objects. — source: Google)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*UI2shk55XKDKi0XY__bs0A.png" /><figcaption>Java is great for building Desktop Applications</figcaption></figure><p>In certain situation, I would feel comfortable to use tools like Ruby to build web application and Java for desktop applications. <strong><em>Both Java and Ruby are great for building web applications but depending on the requirements and needs — you’d make a decision on what language to use for that particular project</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/316/1*YXNz7nEfN7a6vm3IVMRivQ.png" /><figcaption>Hulu — uses Ruby on Rails</figcaption></figure><p>After all — engineers are given a set of tools to figure out what would be best to use for certain products. Think about it — <strong><em>if you are building a house, certain nails may not be good to use as opposed to the other nails</em></strong>. However, both nails can be equally useful for the specific task they are assigned to.</p><p>And of-course…some computer science concepts will always be there:</p><ul><li>Make sure to watch out for memory space</li><li>See what data structure would be best to solving a problem</li><li>Database Concepts — <strong>C</strong>(reate)<strong>R</strong>(ead)<strong>U</strong>(pdate)<strong>D</strong>(elete)</li><li>AND MANY MORE!</li></ul><p>Remember the high level and low level languages (more instruction and specific) — the division of computer programming languages? They all have connections. Yes, high level is computer readable and low level is machine readable — but, think of Assembly Language, which is closer to machine language. If we can trace Assembly Language to human readible programming languages (high level languages) with some math and logic, we can see some of the connections between the two. <strong><em>Making connections is very important!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*FhqpynnW5pUCGJbvYBoFZg.png" /><figcaption>We can trace back to binary through our tools!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f717e5d4836" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Girls Who Code — Session 1 @ Tech Incubator at Queens College]]></title>
            <link>https://medium.com/@sumunchies/girls-who-code-session-1-tech-incubator-at-queens-college-bfebe83d9ea3?source=rss-35211adb3767------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfebe83d9ea3</guid>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[coding-style]]></category>
            <category><![CDATA[girls-who-code]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[women-in-tech]]></category>
            <dc:creator><![CDATA[Sumaiya Tabassum]]></dc:creator>
            <pubDate>Tue, 09 Oct 2018 04:13:15 GMT</pubDate>
            <atom:updated>2020-08-24T22:42:06.882Z</atom:updated>
            <content:encoded><![CDATA[<h3>Girls Who Code — Session 1 @ Tech Incubator at Queens College</h3><p>Sunday October 7, 2018 — What better way to spend your time on <strong>Sunday morning </strong>than to<strong> </strong>facilitate a session of <strong>Girls Who Code for two hours</strong>? This was the first time, in a long time, I went back to teaching younger students. The <strong>last time</strong> I remember <strong>teaching younger students was about 3 years ago</strong> — <strong>but</strong> it was <strong>not in coding</strong>, rather it was preparing elementary grade school students for state examinations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NfHRIecvlz3Zon2OpiRTog.jpeg" /><figcaption>“What better way to spend your time on Sunday morning than to facilitate a session of Girls Who Code for two hours?”</figcaption></figure><p>Initially, it was a bit of a challenge when I saw the students range from 4th grade to 12th grade.</p><p>Even though there are two sessions, the first for 3rd-5th graders, while the other for 6th-12th graders, Sunday morning being the first session — students from lower level grades had the opportunity to attend. I thought “Hmm, <strong>how am I going to manage someone in 4th grade all the way to someone in the 11th grade in the same session?</strong>”.</p><p>To my surprise, after the ice breaker and formal introductions, the students were much easier to handle. I think just the fact of interacting and making each other feel welcomed despite the age gaps made it a lot easier. Through the ice breaker and introduction — <strong>I myself learned a thing or two</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HhAXNLwysE0Cnlh8EWXW6A.jpeg" /><figcaption>“In fact, I learned quite a bit from them while teaching!”</figcaption></figure><h3><strong>The Lessons Were Not the Traditional Lectures</strong></h3><p>We did activities! The best way to remember and <strong>have fun while learning, is doing activities</strong>. I had asked my students what they thought of Computer Science and coding — and some of them gave totally different answers from others. We all started drawing on pieces of paper describing what we thought of Computer Science and coding. Afterwards, <strong>we all shared our ideas</strong>. The more everyone shared — the more we were all <strong>able to connect our thoughts and understanding</strong>.</p><p>We then watched a short video so the girls could get a visual sense of Computer Science and the things revolving around it.</p><p>We then did a few more activities — some coding related, and the girls were introduced coding concepts while brainstorming potential projects. Examples of previous projects were shown — and in the end, students were grouped into one of the <strong>three categories:</strong></p><ol><li><strong>Game</strong></li><li><strong>Chatbot</strong></li><li><strong>Web Design/Development</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_LKNbx-n6Wczn0b4FB-QVQ.jpeg" /><figcaption>We did many activities…the girls got a better understanding of Computer Science and coding…and after much brainstorming, we came up with three categories of projects for the girls to work on.</figcaption></figure><p>It was definitely <strong>fun and engaging</strong> — and some of the characteristics and terms mentioned during the session to keep in mind were: <strong>Bravery, Resilience, Creativity, and Purpose</strong>! It was important for us to understand these four words and to know what they meant to us while continuing the learning journey.</p><h3><strong>Small Treat</strong></h3><p>As <strong>the girls finished their lesson earlier than planned </strong>— they were given a small treat for their accomplishment. We walked to the room next door, allowing the girls to explore the Raspberry Pis, and it was the first time any of them had actually the chance to use one! We wrapped up the final portion of the class allowing them to play with the Raspberry Pis and it seemed like <strong>the girls were already looking forward to the following Sunday’s session! :)</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfebe83d9ea3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>