Flatiron Blogger Magazine

REGEX Presentation by on 04/10/2018
REGEX PresentationWhat is Regex?Regex, or Regular Expressions, is a way of defining a search pattern. In more layman’s terms, it is used for finding text inside other text.Lets say that you are playing a word game, and you need a word that starts with “TH”. You have a dictionary.txt file, but you have no idea how you are going to pull the words you need. If you just do a plain search for “th”, you will find words with “th” in the middle, or at the end. So how do you code the instructions ‘Find all words that start with “th”’?With regex, this seemingly complicated request is actually rather simple. All you need to do is search with the expression /\w+”th”/.So how do we use regex, and where do we start?First of all, regular expressions start with ‘/’, and end with ‘/’.Within, there are certain components. This blog will go over several of the most commonly used ones.CHARACTER SET[] is a character set. it will look for a character that satisfies the condition in the character set. Case matters.[d] will look for a SINGLE character that satisfies the set, which in this case, is only the LOWERCASE letter “d”.[cd] will look for a SINGLE character that is either “c” or “d”[a-d] will look for a SINGLE character that satisfies the range in the set, which would be any letter between “a” and “d”.This can be chained. [d][a-d] will match da, or dd, or anything within that range. [a-zA-Z] will match a SINGLE letter; [a-zA-Z0–9] will match a SINGLE alphanumeric character.QUANTIFIERSQuantifiers affect how many characters the previous “instruction” will affect.+ is the most commonly used quantifier.attached to a [], it will match any ADJACENT characters that also match the [], continuing until it hits a character that does not match.zzzzzabcdzzzzz => [a-d]+ => abcdINDIVIDUAL CHARACTERSYou can also insert individual characters into an expression. Functioning just like a character set with only one character, like ‘[a]’, they are used to find specific strings/ characters in the expression.“cat, cot, cut, cottage” => /co/ => [co, co]“cat, cot, cut, cottage” => /c[aeiou]t/ => [cat, cot, cut, cot]CAPTURE GROUP() is a capture group. this essentially assigns whatever is inside the () into a variable.These variables can later be used as \1, \2, \3, based on their order in the code.for example, lets say that, for whatever reason, I wanted to put a period at the end of every capitalized word.‘I Want To Do This’string.gsub( /([A-Z][a-z]+)/ , ‘\1.’ )‘I Want. To. Do. This.’string = “couldn’t, shouldn’t, won’t”string.gsub( /([a-z]+)([a-z])’([a-z])/ , ‘\1 \2o\3’) =(could)_(n)o(t), (should)_(n)o(t), (wo)_(n)o(t)"could not, should not, wo not”For more reference, and an interactive sandbox, please use https://regexr.com/
How to (Not) Build a Tic-Tac-Toe AI by on 04/20/2018
… or anything else for that matterTwo weeks into my time at the Flatiron School, I had the audacious idea to build my first AI program.I was coming out of my first leg of coding bootcamp and, being emboldened by my firm grasp on beginner Ruby foundations and vague hold on SQLite and ActiveRecord, I felt like I could do anything.I had read articles in the past detailing other people’s experiences building a Tic-Tac-Toe AI as a basic introduction into AI Software, and I thought, How hard can this be?The first thing I did was furiously research and read up on all of the theories and concepts that would inform my code.Me, an intellectual: typing away blindlyThis was my first mistake.What I found were articles upon articles detailing MiniMax Algorithms, Heuristic Scores, Iterative Deepening, and Alpha Beta Pruning.A MiniMax tree template that has been Alpha-Beta Pruned using Heuristic Scores, scoped by Iterative Deepening. I could be wrong on that, so please fact-check me.While the concepts (to a certain degree) made sense, I did not know how to translate it into code. At the same time, the deadline for writing this blog post and presentation was approaching fast, so I decided to skip ahead and start coding anything down. I wasn’t sure what I was doing, but I needed to get it down on paper.Me, an intellectual: Writing code I have no understanding ofThis was my second mistake.Soon after I gave up on bs-ing code with no real knowledge of AI concepts, I remembered Oh yeah, I don’t have Tic-Tac-Toe set up…Since Flatiron’s Bootcamp Prep curriculum included a lab on building Tic-Tac-Toe, I opened it up thinking that I, the now enrolled student of a coding bootcamp with two weeks of real coding experience, could breeze through what mere prospective students were challenged with near the end of the prep program.Me, an intellectual: flexing my superior intellect before I have actually achieved anythingI think we can all guess how this went.Pictured above: me (dramatization)Like a flash of light or an urge to sneeze, the night before my presentation had come, sudden and silent.Before me I had a semi-functional CLI Tic-Tac-Toe program that could be played by two users, scrap code that I deleted in frustration, sweaty palms, weak knees, heavy arms, and if you don’t get it by now, mom’s spaghetti.So what went wrong?Well, frankly a lot of things did. But most importantly, I did not approach this through the lens of developing like an MVP.The real MVP is the MVPEric Ries, a name I was unfamiliar with until too late this week, defines the Minimum Viable Product as“…the smallest thing you can build that lets you quickly make it around the build/measure/learn loop.”The Build/Measure/Learn loop, written about in The Lean Startup by the man Eric himself, is a continuous process that developers go through in building complicated programs. It is a framework for establishing and then improving the functionality of products through a cycle of creating hypotheses, building small samples, testing and receiving feedback from potential customers, and learning from the responses.Pictured above: not Eric Ries, the true intellectualComplex programs are built in stages from the bottom up, starting with the most basic features and then leading up to the more advanced and flashy additions. The focus should be to start small, and incrementally build up after continuous measurement, reflection, and edition.Me, a fool: I know now what I do not know.The best part of being a fool is the endless amount of opportunities to learn. So here are some key lessons that I learned on how to build anything properly:Make your Goal specific, and never lose sight of itI embarked on this journey with the intent of building a Tic-Tac-Toe AI. What I did immediately was only focus on the AI portion of the project because it seemed more difficult and unfamiliar. Because of this, I ended up wasting the majority of my week researching concepts I would not be able to integrate. Undefined goals will lead to directionless effort.2. Set smaller goals that will get you to your capital ‘g’ GoalHad I remembered the original goal, I would have aimed to make my MVP being able to print out a 3 x 3 grid on my command line for Tic-Tac-Toe and building upwards from there. That way, regardless of time constraints, I would have something to show for my work. The process of approaching a Goal with smaller goals also leads to new learnings that can inform decisions on the next goal.3. Work with someone, or with a rubber duckRubber ducks are born with an inherent understanding of all programming languages and have to pass through rigorous schooling before they go out in the world. Additionally, working out loud with someone or with an inanimate object — like say, a rubber duck — will help you catch holes in your logic and force you to slow down. My biggest stumbling block was me getting ahead of myself and trying to build at massive scale. Slowing down provides a fresh perspective on the code you’ve already written and helps you catch bugs that might make for giant migraines later on.4. If you don’t get it today, you’ll get it tomorrow.Perspective is really important. I am a beginner, and I have a lot to learn.Being able to build something that works, no matter how small, is better than being stuck with a giant chunk of broken code.If I don’t get it to work today, I can try again tomorrow.
Active Record Macros aren’t magic. by on 04/20/2018
Publish Yourself. by on 04/19/2018
It’s 2018, you should have a personal website by now, really. Go to Godaddy, Host Gator, Aws or some other place and buy your domain name, really. You don’t want to end up like this guy do you?Ok, you’ve got your domain name secured, if you ever run for office or your campaign won’t Hindenburg because some hippie democrat stole your website and in some ways stifled significant campaign contributions from your cause.So you’ve got a domain name, but what are you going to do with it. Sure, you could got to some site like wordpress or squarespace, I even hear wix is popular, sure those sites look professional, they have pizazz, but sometimes they look too good. If you’re an engineer, you want a slightly grunge aesthetic, something that says, “Yeah bro, I coded this.” Take my website as an example. Is it just some Javascript listeners hiding inner html? Yeah. Did I use a font that looks eerily similar to comic sans? Yeah. Did I steal some kid’s rain gif from tumblr? Hell yeah. That shows pizazz. People respect that. I was in a bar in Brooklyn, some dude asked me what I’d done with my weekend. I told him I put up my personal website. He asked what I’d used and I casually mentioned javascript. Dude was confused at first, asking if that was a wix feature since he mainly used squarespace, but after some heavy handed explanation his eyes went wide like he’d seen his long lost father again.““You’re like a Hackerman”, he’d say while oohing. Who am I to deny it, that bad boy went up in 6 hours and I only had to go to w3schools once to steal their navbar example. Things are looking pretty goooood. Watch your back Google.So you’ve got your domain. Presumably you’ve used your elite html skills to code a static site. It’s time to put that bad-boy up on the internet. Choose a hosting service. I chose AWS because as we all know daddy Bezos will own us all one day, and when that happenings, transferring files between hosts will be a pain. So pull up AWS. you want to open up a bucket title with your domain name under its s3 feature. Good luck finding that in the literal sea of administrative services they provide constantly reminding you of how little you know as a programmer. Yeah, anyway make the bucket, set it to a static website and as hosting and make the bucket public. Dump all of your website files in the bucket; it’ll give you an endpoint. Spin up old amazon route 53, yet another, to my knowledge, inanely named service by amazon and create a hosted zone with your domain name as title. Open it up and create a new record set, set it to type “A” and select your alias target from a menu of one. In your hosted zone copy the array of name servers and paste them over the name servers your current domain name is using. Everything should be working. If it’s not shoot Ted Cruz an email. I hear he’s great with computers.
[#1] Welcome by on 12/30/2016
Hello, reader! My name is Bruno Garcia Gonzalez. Welcome to the web-space that will home my blog. A few months ago I decided that I would aspire to become a professional web developer, even though I earned an undergraduate degree in botany and not in computer science [CS].
[#2] My Roadmap: Today by on 12/31/2016
I would now like to share my roadmap with you, starting with today. Today, I am preparing to take part in a 14-week, onsite coding bootcamp. This coding bootcamp is hosted by Coding Dojo of Washington, DC, and starts on the 23rd of January. With today being the last day of 2016, I have about 20 days left of preparation before the first day.
[#3] To Bootcamp or Not To Bootcamp by on 01/02/2017
After reading many online entries about bootcamps, I decided that I could succeed through this path. There is a lot of information out there about this, and since I have yet to go through the boot camp and job search experiences, I will start us off with the following online pieces:
[#4] How I Chose A Bootcamp by on 01/02/2017
When it came to choosing a coding bootcamp, I created filters to arrive at final options to choose from. Below I share the filters I created: Filter 1: Location I knew that I wanted to stay relatively close to where I live [Maryland], and so I could limit my options to bootcamps in the upper east coast, with focus put on the DMV.
[#5] Turn of Events by on 01/12/2017
In a turn of events, I will not be taking part in the Coding Dojo coding bootcamp. Instead, I will be a graduate assistant at Frostburg State University. There, I will be teaching biology laboratory components and helping conduct research on a couple of grants, while earning a Master’s of Science in Applied Ecology and Conservation Biology. Don’t worry, Reader! I will be continuing my programming path, but it will take place during free hours.
[#6] Happy Return by on 02/25/2018
Ladies and gentlemen, I am back to coding full-time! Frostburg was a positive experience, but after a semester I knew it was not for me. I then went on to a 6-month internship with the International Union for Conservation of Nature [IUCN] and Conservation International [CI] in D.C., working with their joint-taskforce, the Biodiversity Assessment Unit. And while that was the best professional experience of my life, during that time I found myself learning python and working towards a programmer’s skill-set.
[#7] Pre-bootcamp Strategy for post- Flatiron School by on 03/07/2018
I wanted to share my current thoughts on a possible future choice of mine, in case it helps anyone in anyway: After graduating from Flatiron School, I am going to be looking for a job full-steam. But, I plan on also applying to Wester Governors University, and starting a B.S. in Software Development.
[#8] Resource: An Intro To S.E.O. by on 03/25/2018
I wanted to share the following document, by Google, since it is a nice introduction to Search Engine Optimization (SEO): Google's Search Engine Optimization Starter Guide The team at Google did a very nice job in being succinct yet informative. Below I share the the table of contents for the 32-page document:
[#9] How To Add Disqus to Jekyll Site/Blog by on 03/25/2018
Given that this blog is powered by Jekyll and I add the Disqus comment box to each of my posts, I wanted to share the process so that others can do the same: Step 1: make a free account at Disqus.
Ruby – Wanted Dead or Alive by on 04/01/2018
For those of you who don’t know, I am in the midst of a 15 week, intensive coding bootcamp at Flatiron School in Washington DC. Before making the decision to come to this school, I examined many other options and ultimately came to the decision to go to Flatiron. The school, ranked 6th globally, has great reviews and many happy graduates, but the backend language taught is Ruby with the Rails framework……wait…
Cookies…but not what you think by on 04/18/2018
If you’re anything like me, you’ve probably heard of cookies in your computer and gotten very confused. It seems like every time I’ve had an issue with my computer, someone says, “Try clearing your cache and cookies.” I then proceed to Google the process, delete my cookies (whatever that means), and hope for the best.
Take Lunch, Seriously, Take a Lunch! by on 04/12/2018
It might seem that your to-do list never ceases to grow. So much so, that you can’t possibly find the time to stop your work even for 5 or 10 minutes for something as pointless as a break. Not so fast, though. It’s important to not simply go about your day as usual, especially when you know theres a better way of doing something. Allocating time for breaks will in the long run make you happier, increase your focus, lead to better productivity and make you a better worker. The alternative can have damaging effects on your productivity and mental state.
[#1] Welcome by on 12/30/2016
Hello, reader! My name is Bruno Garcia Gonzalez. Welcome to the web-space that will home my blog. A few months ago I decided that I would aspire to become a professional web developer, even though I earned an undergraduate degree in botany and not in computer science [CS].
[#2] My Roadmap: Today by on 12/31/2016
I would now like to share my roadmap with you, starting with today. Today, I am preparing to take part in a 14-week, onsite coding bootcamp. This coding bootcamp is hosted by Coding Dojo of Washington, DC, and starts on the 23rd of January. With today being the last day of 2016, I have about 20 days left of preparation before the first day.
[#3] To Bootcamp or Not To Bootcamp by on 01/02/2017
After reading many online entries about bootcamps, I decided that I could succeed through this path. There is a lot of information out there about this, and since I have yet to go through the boot camp and job search experiences, I will start us off with the following online pieces:
[#4] How I Chose A Bootcamp by on 01/02/2017
When it came to choosing a coding bootcamp, I created filters to arrive at final options to choose from. Below I share the filters I created: Filter 1: Location I knew that I wanted to stay relatively close to where I live [Maryland], and so I could limit my options to bootcamps in the upper east coast, with focus put on the DMV.
[#5] Turn of Events by on 01/12/2017
In a turn of events, I will not be taking part in the Coding Dojo coding bootcamp. Instead, I will be a graduate assistant at Frostburg State University. There, I will be teaching biology laboratory components and helping conduct research on a couple of grants, while earning a Master’s of Science in Applied Ecology and Conservation Biology. Don’t worry, Reader! I will be continuing my programming path, but it will take place during free hours.
[#6] Happy Return by on 02/25/2018
Ladies and gentlemen, I am back to coding full-time! Frostburg was a positive experience, but after a semester I knew it was not for me. I then went on to a 6-month internship with the International Union for Conservation of Nature [IUCN] and Conservation International [CI] in D.C., working with their joint-taskforce, the Biodiversity Assessment Unit. And while that was the best professional experience of my life, during that time I found myself learning python and working towards a programmer’s skill-set.
[#7] Pre-bootcamp Strategy for post- Flatiron School by on 03/07/2018
I wanted to share my current thoughts on a possible future choice of mine, in case it helps anyone in anyway: After graduating from Flatiron School, I am going to be looking for a job full-steam. But, I plan on also applying to Wester Governors University, and starting a B.S. in Software Development.