Sinatra Project Update: I Love Me Book

In seven days I have coded the ability to create a service member account, add a book to it, and an award to a book. I have not added edit and delete functionality yet. But I will have that completed this week. And at best, I will complete a simple front-end design beyond the Corneal gem’s HTML and CSS styling, which I honestly do not want to utilize. If time permits, I’ll change it and make a design of my own, perhaps, with the help of some bootstrap code. Otherwise, I’ll submit the project and improve upon it at a later time. (In all actuality, I would like for this web application to become a legitimate deployed app in the far future.)

For the TL;DR folk: Far below the reading are some screenshots of the few CRUD operations I’ve coded, which are New and Show. Otherwise, the rest are my primordial thoughts and “feelz” on this little project.


Beyond simple textfield data entry by the user (as shown below), the real deal, I believe, is to eventually add the ability to associate documents with the text information through document uploads, and easy presentation of the documents into I Love Me Book. Obviously, the implied task is to utilize cloud APIs in the direction of this app as a centralizing resource. I feel like this is a golden idea!

Why make an I Love Me Book app?

To be clear, I don’t want to thwart cloud file storage services. I think it’s smarter to leverage them through APIs to build a powerful digital binder exclusively designed and tailored to each United States military branch through a seamless application that just works. The goal is easy compilation, easy navigation, and exquisite professional military presentation of documentation that can be searched quickly, and shared via all forms of digital communication “right out of the box,” in one place.

A physical binder, which we call an “I Love Me Book,” holds an organized and tabbed record of all of a service member’s military accomplishments and personally identifying information (PII). Sadly, the army is notorious for poor record-keeping. Hence, the “I Love Me Book” practice. To this day I have yet to find a well-designed all-in-one digital application built with the ease of Facebook, the resourcefulness of Google Docs, and the business sharpness of Microsoft 365, in which to accomplish the same thing digitally in one place. One can obviously rely on a conglomerate of disparate digital cloud services to produce the digital analog to a physical binder of military career documentation—which I do presently. But as I stated in an earlier post, it isn’t a fun and intuitive process that fits the direction the whole world is taking with regards to user and data interaction.

People don’t want bells and whistles alone. They want their data to reflect the dynamism of real life. This is why I love using a digital assistant. It is my data come to life, or as close to it as presently possible.

On that last point…

To my great chagrin, I find so many people in my social circles have a Gmail account, but are agnostics towards Google’s incredibly useful cloud applications. (I admit that I was one of them.) I am discovering—based on people’s actions, despite what they claim in words—that people want think-less mobile apps versus technical productivity tools like Google Drive or Microsoft Office 365. The traditional web (desktop or laptop with a browser) is becoming the practical equivalent of still traveling to brick and mortar businesses to pay your bills in 2018 as opposed to paying them online. (No offense to those who still do the former.) People don’t want bells and whistles alone. They want their data to reflect the dynamism of real life. This is why I love using a digital assistant. It is my data come to life, or as close to it as presently possible.

For example, you can go to instagram.com to look at your “gram.” But you cannot upload anything with a web browser. Instagram is a mobile app-based platform. Why? People have been trained to want apps and they want apps that make their lives happen—that is, the app gets out of your way and blends into your way of life, and never the reverse. Technicality, with its attendant complexities, is not in vogue anymore! Apple is the master at providing the tech-less experience through both its hardware and software, thus making tech-less tech a legitimate art and science in service to life in a complex world. This is true primarily because of Apple’s superb design philosophy, which informs their hardware design, user interface (UI) and user experience (UX) design, coupled with a preternatural forward thinking for what people fundamentally need and want through a humanistic lens.

With hard work and patience, I would like to provide a person-conscious solution—not just a static tool—for service members, available on the web and mobile. Finally, I will focus primarily on the Army to start. Later down the line I will incorporate the other military branches. Although the branches have similar operational structures as the US military wing, their respective terminology, digital forms, and operations are different enough to require some intensive research and familiarization to design for them.

Anyway…

I’ll build the web app version to start, obviously.


What follows is by no means a minimum viable product! However, I have been sketching on paper a conceptual framework for how an enlisted army career and commissioned army career looks and plays out. Then I want to translate them into how the service member would need to interact with their documentation, both in the compilation process and presentation within the application. I want to build I Love Me Book to stoke feelings of accomplishment and security in knowing one has a trustworthy platform with which to store and map a career. (Yes! I am concurrently thinking ahead of my current thinking ahead. haha!)

What you see below are the beginnings of fulfilling the project’s basic requirements. It will evolve. ;)

Screenshot from 2018-09-30 11-34-45.png
Screenshot from 2018-09-30 11-35-01.png
Screenshot from 2018-09-30 14-34-34.png
Screenshot from 2018-09-30 14-29-57.png
Screenshot from 2018-09-30 14-28-47.png
Screenshot from 2018-09-30 14-39-45.png
Screenshot from 2018-09-30 14-30-17.png
Screenshot from 2018-09-30 14-30-07.png


Sinatra Project: I Love Me Book

The United States Army has a cultural tradition of encouraging its members to create what is called an “I love me book.” At first, the phrase sounded very odd to me when I was first schooled on the practice. But it is the practice that makes the name so relevant and important! Generally, I keep a lot of mymilitary paperwork in the cloud for ready access when needed. But this created a new problem. I constantly have to sort through a file system to locate the documents that I want. And although I use a fairly uniform file naming system of my own, it does not avail data in the way that I want to review them.

So I came up with the idea of building a web application (and eventually a mobile version) that provides a comprehensive order of presentation based upon the natural career progression and processes of the United States armed services. At this time, I am only familiar with the Army’s personnel records handling and other administrative data handling. But I think for now this is a good start.

I will go into more detail about my app in a later post.

But, so far, I have built the frame of my project and successfully tested creating a basic user account with my app. I’ve also set it up a live deployment as I code it on Heroku. I’ll share the link when I complete my MVP.

Screenshot from 2018-09-24 21-56-00.png


Flatiron School Self-Paced Learning Path: Checking In

#Facts

I just sat down and re-sketched my learning schedule in Google Calendar based on my new learning velocity since having returned to work. Based on how far I mapped getting through the remainder of the Learn.co curriculum, it will probably take right up to my birthday to complete (April 2019). Unfortunately, I only have enough money to cover three more months (October to December 2018). So I will probably have to quit by the time I’m about 60% of the way through the curriculum.

It is wonderful to see how far I have come. But the situation is, uh, well undeniable. I don’t have any passive income nor do I have anyone to ask for $3000 additional dollars, much less $50.

Now, there are people who say that people who cave to despair dabble in the pit of certain doom. I am not that guy. What I have stated above are facts. However, I also know that facts can change on a dime with and without any of my involvement. I am actively surveying for alternatives and options to keep me in this program.

With that said, I am not okay right now because I am justifiably concerned about my progress in the Learn.co program. But no matter what comes my way, I will be okay in the grander scheme of life.

At the end of the day, I am not catastroph-izing, in case I am not being clear enough for the reader.

Solution/Plan (Not what I want but what else is there?)

I am going to keep going, learning as much as I can. Once I’m out of money, that is it. December is my cutoff, basically.

I will resume my online degree with University of Maryland University College in Software Development and Security.

(If you read my earlier posts, you know that I postponed my software development degree to attend Flatiron School because I felt that Flatiron was a somewhat faster path to career transition and employment in the field as a junior developer—just to get my foot in the door. Also, I have never disclosed on this blog that I’m not just studying coding, but I am concurrently preparing for my IAT Level I exams which are DoD approved 8570 baseline certifications.)

IAT Level I Required Credentials

  • A+ CE

  • CCNA-Security

  • Network+ CE 

  • SSCP

Thinking intersectionally, for people like me where the deck is stacked against you, we are at best cornered into spreading our educational goals over large spans of years beyond traditional timelines as we work others jobs (if that) to remain afloat, grinding to make it in unseen and less glamorous ways. It is about survival in an economy that is increasingly a crushing fight. The years of education are sandwiched between frustrating sacrifices of self and goals (i.e. education) for family; wives, husbands, partners, and more.

Can’t get into my feelings too much because…it doesn’t help the situation. I’m just going to remain focused and keep the faith as I keep grinding #beyoncestyle (discipline and hard work). Rooting for my own damn self! :)

Wishing myself good luck!

The Case of the Sinatra Playlister

This was the most challenging and grueling lab to date! But first an anecdote.

As of today I have completed Sinatra Playlister Lab. No lie. It took me roughly a month and a half to finish it. Let me explain that I was once a full-time student with no daytime work obligations. Every single day was mine to devote to Learn.co. Then I went back to work by the time I was mid-way through the Sinatra curriculum on Learn.co. Working roughly 8 am to 4 pm workdays on top of family and social obligations with school left me with two-hour periods per night at best during the week and weekends to make headway through the curriculum.

Why share the anecdote? I want other students to get a sense of realness from me, at least. It can serve as at least one example or barometer for a working part-time student...at the risk of sounding like I'm complaining. Not sorry. This is real life folks!

At any rate, it is a wonderful relief to have struggled, striven, and thrown my computer at a wall to get this far. …Okay. I didn’t throw my computer or anything. But the Office Space computer smash GIF went through my mind on many late nights. One word: catharsis. You have to have a sense of humor as a coder. Laugh at yourself, the situation, and don't take things too seriously, lest you get in your own way.

In seriousness, here are some tips for getting through this lab without fear of a spasmodic episode of violence against your tech. (lol)

  • Follow the test specs in order!

  • You will have to create a module for two common methods; one an instance method and the other a class method.

  • Enable sessions in the application_controller.rb file, as it is a parent class to the artist, genres, and songs controllers.

  • Place the use Rack::Flash code directly within the SongController class.

  • The flash message will go in your post and patch routes of yourSongs controller.

  • The test specs have keywords that refer to the Capybara for things it will look for in your HTML forms, such as fill_in and click_on.

  • Give careful attention to the test spec lines of code that begin with expect(page), as they are clues to passing several test specs.

  • In your new.erb and edit.erb Song forms, ensure that you begin your iterator with a direct call to the Genre class as opposed to store Genre.all as an instance variable within the Songs controller. Doing the latter will produce a confusing error message that won't clue you into the former solution!

    <% Genre.all.each do |genre| %>

    --code--

    <% end %>

  • Make sure to add the correct values for the name and id attributes of each input HTML tag in your edit.erb and new.erb forms within the Songs view.

  • IMPORTANT! When you create your edit.erb form in the Songs view make sure to add the Artist attribute with its erb value from the database. Otherwise, several remaining spec tests will not pass. There are no instructions that will make this apparent, especially if you don't intuitively realize that this needs to be added!

    <input type="text name="Artist Name" id="artist_name" value="<%= @song.artist.name%>">

All of these bullet points were major delays towards completion! Maybe I didn’t remember past lessons well. Maybe I had other things on my mind. Who knows what? But I’m sharing them for any other student that wants to avoid the frustrations I ran into.

Just paying it forward! :)

Happy coding!

Also posted in Flatiron School’s Learn Magazine.

Pressing In And Pressing Onwards

Over a month and a half ago I was invited to join a beta cohort with Flatiron School.  It was totally unexpected and a real honor to be considered.  I was initially quite hesitant to embrace the opportunity because of the amount of commitments I already had going in my world.  Instead, I chose to bite the bullet and give it my best shot.

The cohort began and it was a rush of newness and close-knit learning with a set group of coding students.  I loved it!  But life hit me harder than I originally anticipated.  Sadly, I had to back out of the cohort some weeks later.

It was my intention to remain a full-time member of the cohort so that I could fast-track myself to a career change from public education.  The hurdles, however, in my personal life were higher and more frequent than I could have imagined, post-deployment. (Yes. I recently returned from a nine-month deployment overseas in Afghanistan.) So, there I was, working my butt off day and night, hunched over my computer.  It was steady going for the first two months until the object-oriented Ruby (OO Ruby) section.  Nevertheless, I pressed through the OO Ruby section hard and with more intensity.   But as time passed during my days in the cohort, my pace was stymied by some personal matters that would not relent. In fact, they have not abated.

About three weeks ago I gave notice that I would be leaving the cohort.  It really hurt my heart to have to say those words because I felt as though I was giving up and failing. I must confess that my pride was hurt because I wanted to ignore my limits to handle so much at once.  But the woo of wisdom came through and won my ear and obedience.

So what now?  Financially speaking, I accepted a teaching position as music teacher at a local elementary school to help me to continue my time with Flatiron School.  The toss-up is that what I gain in a fractional boost in monetary security, is a gaping loss in time to devote to my coding.

Unfortunately, I have not logged on to Learn.co to work for close to a month.  My heart is aching over this because starting this new job is consuming so much of my time as well as my energy and heart.  To be quite vulnerable, I want to cry my eyes out!  I need to finish my web development course at Flatiron this year!  I am determined and will not quit, so long as I have some funds left to pay for it, which is about three more months worth of money. So, again, I'll give it my best despite all the hurdles.  

I just have this dream of working on a team of coders to build amazing technologies. Some days I awake and feel as though that dream is slipping away from me, and that I'll forever be stuck here where I grew up, struggling to make ends meet as a teacher.  I know the work that I do as a teacher is important.  But it is not my passion. My passion is technology.  ...And obviously having a job that enables me to afford an apartment of my own would be nice.  Yes. The South Florida tri-county area is atrociously expensive.  The cost of living has far exceeded teacher pay.  And pay raises have been laughable and insulting scraps since the year of the 2007-2008 stock market crash.

When you're in a position where you're looking up out of a pit, all you can think about is getting out and the means to get out of it.  Every protruding stone, rock, tree root, and crevice is viewed as an opportunity or leverage to climb out of a gradually deepening hole in the earth.

I am not giving up. I'm just daunted at the moment by how quickly I can find myself financially trapped if I lose more time and money due to the hurdles I won't enumerate on this public blog. But they are legitimate even though they are negatively impacting my time to work. I recognize that I am not some victim and I am not the only person in the world struggling for comeuppance. I am not special in this way. I just recognize that I have to help myself as I pray to God for mercy, focus, and perseverance. 

Keep me your thoughts...whoever is reading this blog.

CLI Data Gem Project: True Crime Documentary "Database"

At last, I am complete with my project.  It took exactly two weeks.

Overview

The name of my project is True Crime Documentary Database. It offers a list film and television documentary film titles in the True Crime genre. 

Screen Shot 2018-06-23 at 7.03.36 PM.png

(Note: Although it indeed is not a database, its functions point in the direction of a database. The term "database" is used here loosely.)  

I used the Nokogiri gem to scrape the site crimedocumentary.com.  

Screen Shot 2018-06-23 at 7.20.39 PM.png

I created an application that scrapes the category names, the URLs, and the documentary attributes that exist within each URL path.  I had to scrape these link (image below).

Screen Shot 2018-06-23 at 7.22.56 PM.png

The program should deliver a menu of options: to browse the documentaries by category or to see a full listing of documentary titles.  

Screen Shot 2018-06-23 at 7.03.47 PM.png

Selecting category delivers a list of documentaries displayed with their title, year, category, synopsis, and full synopsis URL.  

Screen Shot 2018-06-23 at 7.04.09 PM.png

Otherwise, if list all documentaries is chosen, then the user is taken to a submenu from which to select a title.  Similarly, the selection displays the documentary’s details.

Screen Shot 2018-06-23 at 7.04.27 PM.png
Screen Shot 2018-06-23 at 7.04.41 PM.png

Building The Project

Now, based on my initial review of the HTML I felt assured that I could achieve this project based on what I had learned in the previous labs leading up to my CLI data gem.  What I hadn’t given better attention to was the layout of the site and how it delivered the data.  The categories of a film are front and center, while the documentaries generate (no HTML to scrape) in many places, except inside of category link paths in the right sidebar.  Sadly, I hadn’t noticed this quirk until long after getting approval and having coded my scraper class. (With respect to object orientation, this presents some coding challenges. It would be hard to maintain the has a/has  many object relationship that I planned.)  

IMG_20180621_174802.jpg

In the scraper class is when I realized I might run into trouble when I’d have to connect these objects in the CLI controller class.  Sure enough, that difficulty arose. I worked hard to refactor the entire project from start to finish and ended up with a better product.

Something I encountered was that the number of links I decided to scrape tacked on at least 15 to 20 seconds of load time at the start of the program. Coincidentally, in one of my recent study groups, the instructor mentioned how it might sometimes be a better option to have the data load (scrape) upon selection by the user. I thought it was an excellent idea!  However, given how far I had come and that I was already in the middle of rebuilding my program from scratch (I created a branch and merged later), it would have proven difficult timewise.  So again, the layout and coding of the site presented a hurdle that made any new idea unfeasible.


Overall, I believe that I have met the requirements of the project by demonstrating that I have a good grasp of object orientation and working confidence in coding in Ruby.  

Some Afterthoughts

  •  Simple ideas are still complicated when it comes time to code them!
  •  What you think is simple may not be simple enough.
  • *Projects fan the flames of enduring appreciation for Google search! :)
  • *This project was, *hard*! However, it I love it! 
  • *Coding is fun. Learning to code is fun and uncannily cathartic. O_O

Bottom line: The CLI data gem was a challenging project, while also gratifying!

Access the repository here.
 

CLI Data Gem Project Complete...mostly

I'll explain how it works later in the week.  But for now I'm just celebrating having made it through the toughest part, which was building it and getting it to work.  It took me a week.

Screen Shot 2018-06-20 at 1.48.20 AM.png
Screen Shot 2018-06-20 at 1.48.49 AM.png
Screen Shot 2018-06-20 at 1.49.29 AM.png

Object Oriented Ruby Final Projects: Music Library CLI

I am one lab away from the CLI Data Gem Project. Although, I have gone over it to evaluate what I need to do to complete it.

Object-oriented Ruby has been one heck of a challenge so far, and I’ve enjoyed every moment, including the parts where I was stumped. I enjoyed the Music Library CLI project the most. However, the CLI Data Gem Project appears to be the most fascinating and open! By open, I mean that I like that I get to choose the content of my project, albeit with some training wheels still attached. But I digress… What the Music Library CLI project brought to bear regarding object relation is where I struggled the most. It was hard to quickly wrap my brain around the intricacies of how the objects were to be linked via methods. Moving forward my takeaway is to draw diagrams with a flowchart of objects to get the big picture. And since I am a big picture thinker, this is almost a must! I am a visual-kinesthetic learner. I must see and touch my solutions, or at least have some physical association with what I am learning.

On the more technical side of the house, these are the methods in the Music Library CLI project that gave me the most significant challenge:

Song Class Song.new_from_filename: Learned that I had to instantiate a new instance of Song.

Artist Class artist#add_song: The key to getting this to pass was the unlessconditional statement, which is the inverse of the if conditional. It just proved to be a far more elegant and efficient means of defining the method.

Music Library Controller Class All of the trigger methods took some careful reading of the test specs and greater thinking along the lines of iterating with an index–that is, Ruby’s each_with_index method, to be more specific. It saved the day! Also, I later realized that I’d be sorting objects, which reframed my entire plan of approach to elegantly and adequately coding specific list methods. It is important to remember that we are to take advantage of the object attributes to maintain well abstracted and efficient code throughout the entire project. So I called on the list of objects stored in the @@all class variables so that I could sort them, then call on their respective attributes to define specific list methods.

Overall, everything that I have learned has challenged me to think broadly–far more than I thought I already could. And the fact that I can learn to think more broadly than I ever have with coding has nurtured both a growing excitement and hunger to learn more.

A Way to Learn As a Flatiron School Student

I began my journey as a FS Web Development student in the first week of April. I am a quarter of the way through the curriculum and would like to share some patterns that I have noticed in my learning in hopes that it will be of some help to any other beginning FS student.

What I have learned about my learning:

  • Get comfortable with being uncomfortable with broken code.  In fact, get comfortable with breaking and redoing or refactoring code to higher efficiency. In a phrase, think in drafts. Writing code is not unlike writing a paper that is too wordy, uses overused terms, or is poorly formatted.  Working code is not necessarily "good" code.  All of this is part of the ongoing process of programming.  Think: Less is more. Simplest or abstract code is the good code.  Although, I grant that for beginners that the "efficient" is relative to our experience and what little we know.  So be patient with yourself.
  • Read test specs carefully and plan accordingly.  As great as it is to have pre-written test specs, don't make the test specs a crutch.  Remember this is a learning environment intended to simulate and teach; that is, to train as you fight, figuratively speaking. This is to say, you need to learn the way a programmer is expected to program in the real world or learn  by doing as programmers do. However, Learn.co is still a teaching environment and not the real world.  Therefore, plan and think, as opposed to slipping into autopilot--because it is possible up until a big challenge comes along and appears wholly unfamiliar on top of whatever labs are supposed to be challenging all their own. Don't get me wrong! These lessons and labs are scaffolded to comprehensively challenge you.  But this does not rule out the personal responsibility to review, take some notes, and make connections to prior knowledge; assimilating knowledge, while consistently taking in entirely new experiences.
  • Strategize, strategize, strategize!  Object-oriented ruby, for example, will begin to introduce you to more realistic interaction with code, where you will code in one file while having to pause work on that file to accomplish some working code in another to enable the prior file to work.  The implied task is that you will need to understand what to code in some necessary order.  This makes the previous steps crucial.
  • Think about your thinking and approach. For example, when you make an error, and whether you are able to resolve it quickly or not, take a moment to understand how you got to that point, whether your code is passing or failing the tests specs.  In terms of a failing spec, think:  What am I missing in this method/class/lab?  What does the test spec say?  Does my code address every facet of what the spec requires? (On the latter, all but a missing piece of code could be causing an error to be thrown, demonstrating while you have to think both with and beyond the given test specs! Stated inversely, all your code is set to work if one piece of code weren't missing.)  So you kind of have to be a Sherlock who must really observe your code to embrace the possible problem that just isn't popping out at you despite having run yourself through several loops to figure out why your code is not working.  And in terms of a passing spec, ask yourself:  How did I accomplish this?  Do I know and understand what I did to achieve this success?  Implied task:  Take time to evaluate your learning, even if you are a high-speed FS student with previous experience.
  • Evaluate and document (summarize in your own words) what is being asked of you to  accomplish a particular specification(s). Although Learn.co has built-in tests for you, you still have to do the work of thinking. As you progress through the curriculum the tests will become less and less specific. There will be gaps in the logic of the test specs that require you to fill in the blanks for how you get from one end of a problem to its expected outcome or output. 
  • Remember that computer programming's technical and essential purpose:  To solve real-world problems.  You should be excited by the presentation of a problem to solve, as opposed to feeling bothered by problems.  So to further break a broken record, learn to love problems so that you can get to the place to appreciate how your work as a programmer can improve people's daily lives, because that is what it's all about at the end of the day.

Dig deep. Think. Code. Evaluate. Adapt. Keep going. :)

Originally published at http://wayofthecode.com/.