Friday, April 4, 2014

RailsN00b: Hello World! [Entry 1]

RailsN00b: Journal of an Intern Rails Developer
Entry 1: The Obligatory "Hello, World!"

Tutorial Being Followed: "Instant Gratification" Ch. 2 of Agile Web Development With Rails 4. By: Ruby, Thomas, and Hansson.

Now that we have all the housekeeping out of the way, it's time to dive right in and make sure rails is working with the traditional "Hello, World!" test. If you rolled your eyes when you read that, you aren't alone; I also get tired of every single programming text starting with something so vanilla. So, let's spice it up a bit with a look at how Rails handles dynamic and a look at the Model-View-Controller structure of the Rails framework. Lets get started!

First we need to open up our terminal application and create a new Ruby on Rails application:

Move to whichever directory you want to create the application in. I will be creating a new director ( BlogProject ) as a subdirectory of my Work directory:

$ cd Work
$ mkdir BlogProject
$ cd BlogProject

Now we need to create a new Rails Application. I will be calling this application "demo" and use the Rake tool to examine it:

$ rails new demo
$ cd demo
$ rake about

Now we want to create (or, in Ruby on Rails, "generate") a controller called "Say" with two methods "hello" and "goodbye":

$ rails g controller Say hello goodbye

Now take a look at the new directory in your text editor of choice. Open up the file say_controller.rb found at /demo/app/controllers/say_controller.rb and add an instance variable for time in the "hello" method and user_name in the "goodbye" method. Assign time to the current time using and user_name to a string containing your name. 

The resulting code should look something like this:

class SayController < ApplicationController

# Hello method
 def hello
   @time =

# Goodbye method
 def goodbye
   @user_name = "Carl"


This is a controller. If you are new to the MVC pattern, I suggest reading the wiki page: here.

When you created the controller and it's methods via the "$ rails g" command, you also created two "views" for each method. These views can be found in demo/app/views/say/.. with the extension ".html.erb"-- meaning HTML Embedded Ruby. 

One of the cooler aspects of Rails framework is that you can inject ruby code into text the HTML by framing it with " <%= %>". You can also link pages to one another by utilizing the link_to() method which takes two parameters: a text to be displayed and a special variable in the format of class_method_path. Go ahead and add in a header and some text to these files, calling the appropriate instance variables inside "<%= ... %>". Also use link_to() to allow the user to move back and forth between the two pages.

The code should end up looking something like this:

<body align="center">
<h1> Demo Program 1: </h1>
<p> Hello there, the time is now <%= @time %> </p>
<p> Find me in app/views/say/hello.html.erb </p>
<p> Say <%= link_to "Goodbye", say_goodbye_path %> </p>

Now it's time to launch the rails server and take a look at your code. To do so, simply open your terminal (make sure you are still in the demo directory). Launch the server with the following command:
$ rails s

Now open up your browser and go to http://localhost:3000/ and you will see the Rails "Welcome aboard" message. Now go to http://localhost:3000/say/hello and you will (hopefully) see something like this:

Congratulations! You have just created a very simple Rails applications. In our next lesson we will talk a little more about the third element of the Model-View-Controller structure-- the Model, and dive a little deeper into page flow in a Rails application. 

By: Carl Bales, Twin Engine Labs
Date: 4 April 2014

Carl Bales is an Intern at Twin Engines Lab in Shreveport, LA and a Cyber Engineering student at Louisiana Tech University in Ruston, LA. He has recently made the switch to Ruby on Rails after a few years of Python, Java, C/C++, and Perl programming. He writes these posts as a way of chronicling his descent into the Ruby on Rails programming framework and help others make an easy transition into this web-app development with Rails! He tweets at @RailsNoob and can be contacted via email at . 

Tuesday, March 25, 2014

Building the Next Generation of Entrepreneurs

Today's blog topic is an issue that is extremely important to Twin Engine Labs and relevant to our work with one of our clients, Higgy Ziggy! In the past, we have written on the blog about our work with programs such as Junior Achievement and the important lessons that teaching entrepreneurship to children can instill. However, today I want to explore how community programs, classrooms, and companies can do more to not only foster the entrepreneurial spirit within our youth, but actually help them accomplish their goals and successfully bring their first projects to life. 

1. Community - The community should give young students a public forum in which to speak. The community should do all that is possible to encourage attendance at these student events both by leaders in the community and other students from local area schools. A great example of an event that has done this is 1 Million Cups Shreveport, who is supporting a student edition of their weekly event, during the local school's Spring Break week. They are hosting our client, Higgy Ziggy, as he presents his mobile game he is building with us, The Lost Tribes. The 1 Million Cups Community has been incredibly supportive of this endeavor and has been doing a lot to encourage a large crowd to hear this 12 year old speak, especially students at local schools. Giving our youth a safe environment in which to voice their ideas and get positive feedback from community leaders who have experience building businesses of their own is a vital part of our students' development of critical thinking, problem solving, and public speaking skills that will help them in all future endeavors.

2. Business Support - Businesses are particularly well-suited to help our youth succeed because often they have the expertise in a particular subject matter, the resources, or the talent needed to pull off an entrepreneurial endeavor. Our youth may have none or very few of these things when they start, but what our youth do have are ideas and new ways of looking at problems that aren't hindered by perception of how things have worked for years within an industry. The creative thinking and problem solving potential of our youth is something industry can tap into for a wealth of new solutions to old problems. There are a number of helpful ways businesses can interact with youth. They can set aside time for their employees to participate in mentor relationships; businesses can help fund projects; companies can put on education programs for youth. +Twin Engine Labs, for example, has started a new training and transfer program with BPCC, working to help college students gain the real-world programming skills necessary for jobs. Our CEO, Keith Hanson, and one of our programmers, Brandon Buck, are mentoring Senior Projects for High School students. We are also helping Luke Higginbotham learn to code, while helping him get his project off the ground and execute quickly. However, we are always looking to do more and if you are interested in partnering with us, contact us.

3. Classrooms - I believe it would be interesting if classrooms started giving students the option of what they wanted to work on, instead of telling them to create a certain thing or product. Rather, students should have the freedom to pursue what interests them. In the end, you will see students learning the foundational skills that our schools teach us but using them in their own way to pursue entrepreneurial adventures of their choice. Schools can also partner with industry and community for more programs. One example of this in the Shreveport-Bossier community is the work that Cohab is doing with local high schools in their elev8 program.

In the end, it is everyone's responsibility to help our youth develop and express themselves in ways that will serve to benefit the youth and society in the future. Entrepreneurism is a great avenue of creative self-expression for our kids and can teach them important lessons in leadership, communication, fiscal responsibility and community. That is why Twin Engine Labs wants to do whatever we can to help build the next generation of entrepreneurs. We will leave you with this video from Cameron Herald on youth and entrepreneurship, but contact us or drop us a comment below if you want to discuss these issues further.

Monday, March 24, 2014

Client Spotlight: Lynxus

Twin Engine Labs is excited to use today's blog post to shine a spotlight on one of our new clients who is in the shop. Nick Spinazze came to us a little while back with an idea to transform the news industry. He had a passion for the free flow of information via new social communication technologies, transparency, privacy, and a desire to make news more objective. Therefore, he created Lynxus. He has combined forces with his stellar co-founders Stacy Tan and Drew Johnson in order to help bring Lynxus to life. And since the initial discussions surrounding Lynxus, Twin Engine Labs and the Lynxus team have used a lean user experience and design process to iterate on the design of the app to the point where we are beginning to build the minimum viable product for Lynxus. 

Nick shares this pitch when he is describing the impetus for and functionality of the application, "Try to name an impartial news source. If you can't, you're not alone. With over 75% of Americans believing there is bias in the media, the need for a new breed of news is growing. Lynxus is a revolutionary app that fills that need by providing news without spin. We offer a platform for users to share and request first-person, unfiltered videos and photos of worlds events happening in real-time, making Lynxus a product of its users and not predetermined agendas. From sporting events to warzones, Lynxus delivers the news you want."

There are a few ways in which Lynxus helps turn the current model of journalism on its head. By allowing for both supply and demand-generated journalism, Lynxus will allow users to not only receive the same stories everyone else in the world is being fed but people will be given the power to discover the news for themselves, according to their own interests. This creates an entirely new breed of news that delivers a much more customized experience to the user. We can all become explorers and subject matter experts by using Lynxus as a window into events on the other side of the world. This model of journalism also empowers the independent journalist or the concerned citizen who want an outlet for their voices to be heard and footage to be seen without becoming a commodity used in someone's political agenda. In today's day and age when social media has fueled revolutions, Lynxus recognizes the power of images and video. Therefore, Lynxus has developed a platform where seeing is believing and what is objectively happening on the ground at events can be documented and shared without the connotative and denotative lenses of traditional news media networks. Lastly, Lynxus wants to enable the user to interact with this crowdsourced community of journalists and interested viewers via geography and place. By curating via location first and category second, the user will be able to quickly find journalists they trust in the geographic areas they care about as sporting events, wars, protests, revolutions, elections, weather events, and life happens all over. Lynxus likes to see the mobile device as a portal or window into the news occurring in our world.

+Twin Engine Labs is excited to be on this journey with Nick as he seeks to disrupt an industry that top investors are bullish on. If you want to learn more about how Twin Engine Labs can help you on your journey, CONTACT US.

Monday, March 17, 2014

RailsN00b: Journal of an Intern Rails Developer [Entry 0: Introduction]

RailsN00b: Journal of an Intern Rails Developer
Entry 0: Introduction

Introduction & Getting Started With Rails

Welcome to the first entry of Twin Engine Lab's survival guide for developers getting started with Ruby on Rails! If you're reading this, you probably want to learn to build Web Applications with Ruby on Rails-- or it's 2.00am and you clicked on one too many links on Reddit. Regardless, this series is designed to chronicle my process as I learn to build Web Apps with Ruby on Rails. In-so-doing, hopefully, you will be able to benefit from my experience and avoid making the missteps I'm sure to make. I will do my best to provide links to resources I use (via a link-dump corresponding to each entries) and keep an up-to-date GitHub source for projects, as I finish them. 

Throughout the series I will be assuming the reader has a fair amount of programming experience and an understanding of the Ruby programming language's structure and syntax. If you are new to Ruby (or new to programming in general) I would suggest going to Codecademy and working through their Ruby exercises. It would also be advisable for you to have some degree of experience with HTML and CSS-- with some JavaScript peppered in. Tutorials for these can also be found at CodeAcademy, but I found it more helpful to read through the W3 Schools sections for each. Otherwise, you should know some basics for navigating your computer through command line. I'm primarily a Mac/Linux user, so keep this in mind when it comes to any BASH/Rails-Shell code snippets you may see.

I am writing this series to be applicable to people in my position: someone with experience and formal training in Computer Science who is just starting out in the industry (as an intern or otherwise). Though these first few entries my be a bit basic, my end goal is to provide a source that eases the transition from programming as an academic exercise to programming as a professional. Basically, I'm writing the guide I wish I could have found before I made the jump from programming for a grade to programming for pay. 

Installing Ruby and Rails:

My recommendation-- after installing, tinkering, uninstalling, and reinstalling multiple times -- is to use RVM. There are other ways to get Ruby and Rails, which are fine for playing around with the basics, but RVM has made things exponentially easier when it comes to working with other peoples code--especially if the code was written using a previous iteration of Rails (e.g. Rails 3.2). 

The easiest way to install RVM (in Mac OS X) is to open up your terminal and enter the following:

$ curl -L | bash -s stable
$ rvm install 2.1.0 --autolibs=enable
$ rvm use 2.1.0
$ gem install rails --varsion 4.0.0 --no-ri --no-rdoc
$ rvm --default 2.1.0
$ rails -v

If anything goes wrong with this (and believe me, it can), RVM's website has a useful troubleshooting FAQ that can help you get started with relatively few growing pains. If you are using a Mac, you will also want to repair your disk permissions via your Disk Utility, as rails always seems to have a few files where this is an issue.

Please also note that 2.1.0 is the newest (mostly stable) iteration of Rails as of today. If a newer version has come out, by all means use that version, but I would advise also getting 2.1.0 if you plan on following the exercises that I will walk through in subsequent entries to this blog.

Hopefully, all went well and you now have installed Ruby and Rails onto your computer. In the next entry I will walk you through a simple "Hello, World!" type program to make sure there are no issues with your install (and also out of superstition). Hope you found this helpful, and if not I promise we will get to something more interesting soon enough!

By: Carl Bales, Twin Engine Labs
Date: 17 March 2014

Carl Bales is an Intern at Twin Engines Lab in Shreveport, LA and a Cyber Engineering student at Louisiana Tech University in Ruston, LA. He has recently made the switch to Ruby on Rails after a few years of Python, Java, C/C++, and Perl programming. He writes these posts as a way of chronicling his descent into the Ruby on Rails programming framework and help others make an easy transition into this web-app development with Rails! He tweets at @RailsNoob and can be contacted via email at . 


New to Ruby / New to Rails
Codecademy ( Link ) : Good place to for new programmers to learn the basics and a quick way to pick up the basics of Ruby syntax.

W3Schools ( Link ) : Learn the basics of HTML, CSS, JavaScript, SQL, XML, PHP, and more.

Treehouse ( Link ) : A subscription online library of web development videos and practice lessons.

Ruby ( Link ) : Official website for the Ruby programming language with a decent Documentation page-- relative to other languages.

Ruby on Rails ( Link ) : Official website for the Rails framework. Interesting screencasts, and a really great beginner "build your own blog" exercise.

RVM ( Link ) : Ruby Version Installer, the quick and easy way to manage multiple versions of Ruby. 

Tools of the Trade
GitHub ( Link ) : The best way to share code and browse open source programs.

BitBucket ( Link ) : Like GitHub, but cheaper for multiple user accounts.

SourceTree ( In App Store ) : GUI App for managing your git repositories from GitHub & BitBucket

Homebrew ( Link ) : If you're a Mac user, your probably want to use this terminal tool to help ease the pain that bundle install and gem install will cause with MacPort.

SublimeText ( Link ) : A great text editor. It "costs" $70.00 USD in the same way that WinZip had a price tag... I plan on paying for a license to support this editor... eventually. 

TextWrangler ( In App Store ) : Alternative to SublimeText, a lot of easy to find functionality but not quite as pretty.

Print Resource

Agile Web Development with Rails 4 by Sam Ruby, Dave Thomas, and David Heinemeier Hansson. Part of the Facets of Ruby Series. Published by Pragmatic Bookshelf. : This book is an amazing resource which I rely upon heavily.

Monday, February 24, 2014

Shreveport 1 Million Cups Launches February 26 - Be There!

Twin Engine Labs is excited to announce the launch of Shreveport 1 Million Cups on February 26, 2014. We are incredibly proud to be a sponsor/organizer of this event along with our colleagues from Cohab, Juma Labs, Ross Barrett, founder of BVM Capital, James Lambert from Lambert Applications and Hamel Interests and Private Equity, LLC. What is 1 Million Cups you may ask? 1 Million Cups is a program run by the Kauffman Foundation. The Kauffman Foundation gives the following information on 1 Million Cups. 

"1 Million Cups (1MC) is a simple way to engage entrepreneurs in communities around the world. Each week, the 1MC program offers two local entrepreneurs an opportunity to present their startups to a diverse audience of mentors, advisors, and entrepreneurs. Presenters prepare a 6 minute educational presentation and engage in 20 minutes of feedback and questioning after they present. Entrepreneurs gain insight into possible ways they can improve their businesses, gather realtime feedback, connect with a community that truly cares about their progress, and walk away feeling like they have advanced their business. The audience also learns a great deal from the presentations. Whether this is through passively listening or deeply engaging with the entrepreneurs, there is much to learn every week from these dynamic and diverse communities. The program takes place every Wednesday morning from 9:00-10:00am in locations all around the country."

On Wednesday, Cohab will be hosting Shreveport's first iteration of 1 Million Cups and we hope you join us. The guest entrepreneur for our inaugural session is an organizer of this event and is the Founder of SkyRunner, LLC, Stewart Hamel. Read more about this fantastic and innovative company coming right out of Shreveport, LA in this Fox News article. We will follow Stewart's talk with a question and answer period. We will then be moderating a session where we talk about the importance of modeling your business utilizing the lean startup business model canvas. We will conclude the event with a discussion about what we want this event to mean for our community. This is another reason that we want you to show up Wednesday. 1 Million Cups is a community-driven event and we want it to reflect our entire community. We sincerely hope you can join us Wednesday morning.