Sunday, July 17, 2016

Note taking when following a tutorial or attending something like a code school

I never took notes when following a book or online tutorial but now that I've dropped a lot of money on an online coding school, I want to make sure I type out information I'm learning. If I'm taking notes I'm kind of talking to myself as I do so that I'm going over the material a second time.  Now that I need to go back to refer to my notes, I figured out that I started out in a disorganized way.

Something that I learned when starting this school is that you can create a wiki or you can create Gists on Github.com. I'm using Gists as a note taking method. You can save each Gist as a certain file. The suggested way of taking notes (from what I've been told) is to use the Markdown language. A cheatsheet can be found here. I had heard of Markdown briefly before in some article I read but never gave it any notice. If you give your Gist a file extension of .md, it will display what you typed in as a formatted Markdown page.  Oh, because I didn't want people seeing my stupid comments and questions to myself, I flagged my notes as "secret" so that only I can see them.  If I share the link with anyone else, that would be able to see my notes as well.

Now that I'm getting into some material/topics in the online school where I'm needing to refer back to my notes, I'm wishing I had organized my notes in a completely different way.  I created a secret Gist for every single module or as Bloc calls them, checkpoints. I wish I had started a Gist for every topic. For example, I wish I had a Gist for all of my git notes, a gist for RSpec type notes, a Gist for command line notes and so on.

If I can get ahead in the material a little, I'm going to go back to combine my notes into topics rather than checkpoints.  If I could figure out how to search just my own Gists, it wouldn't be that bad but when I want to refer back to material I need to look at again, I have to remember what checkpoint Gist to go back to.

Anyway, hopefully I'll have more technical topics to share next week along with lessons learned.

Friday, July 1, 2016

Signed up for a coding school

Well, I signed up for an online coding school that's going to take me roughly 2 years to get through. Hopefully I get through it faster than that.  =)

I'm going to be learning Ruby on Rails, JavaScript, Angular and a few others. After my conference call with my instructor last night, I am now charged with creating a blog post once a week. The topics will be either a few notes I took going over the material or anything new that I've learned. The first module from what I can tell so far, covers Ruby, Markdown, Rails, Git, command line concepts and I just forked my first repository (a Jekyll template) 2 days ago and created a blogging application. Once I get more confident in knowing what I'm doing, I might move this blog over to the app that I created (well, forked, modified etc).

As far as my first post is concerned, I thought I'd give just the basic information of what I've gone over for the past 3 weeks.

I signed up with an online school called Bloc. The tuition isn't cheap by any means but so far I think it's worth it.

I'm signed up for the Software Engineering track which currently is divided up into 4 sections.

  1. Rails Web Development
  2. Front End Development
  3. Software Engineering Principles
  4. Open Source Apprenticeship

The first 2 are probably self explanatory. Number 3 entails learning more computer science type topics like data structures, algorithms, databases and SQL and design patterns. Number 4 basically has 2 sections...creating an open source project and then contributing to an existing open source project.

From what I can tell, I'm going to learn about the topics in the order that they appear in list above.

I'll post more detail about what I'm learning in my next blog entry which will probably be this weekend or if I get stuck on one of the exercises or assignments that I'm going back to now.

Cheers!

Monday, February 29, 2016

Ruby warning message: (...) interpreted as grouped expression

While following along with a tutorial I was asked to write a short program that asked the user for a sentence and then a number.  After that was complete, type out the sentence backwards the number of times that was keyed in by the user. For example when typing in a string "ABCDEF GHI" three times, I would get something that looked like this...

IHG FEDCBA
IHG FEDCBA
IHG FEDCBA

Here's the code that I typed out at first which works but I did get a warning message within Aptana Studio...


print "Type any sentence: "
sent = gets.chomp
print "Type a whole number: "
num = gets.chomp.to_i

puts "here are your sentences backwards times the number you keyed in..."
puts (sent.reverse + "\n") * num

The warning message was... 

(...) interpreted as grouped expression

After doing a google search, I came across a post that read...

"...This warning is emitted when Ruby thinks that you want an argument list but wrote a grouped expression instead. The most common cause is whitespace between the name of the message and the argument list in a message..."

...which made a lot of sense.  I don't like warnings in anything I'm coding out so I changed the code on line 7 to read...


puts "#{sent.reverse}\n" * num

After the change was made, the warning in Aptana went away.

Thursday, February 25, 2016

Installing Aptana Studio 3

Updated for Ubuntu 16.04:
I'm one that likes intellisense/code completion and the benefits of an IDE and until I can make a living as a developer, I'm using a free tool that is available called Aptana Studio 3 onto a Ubuntu 16.04 vm image.

I'll be taking most of the steps on how to install from the WordPress tutorial. In order to make Aptana work with Ubuntu 16.04, I had to make some changes to the steps mentioned in the tutorial.

https://pratapsatve.wordpress.com/2015/05/20/install-aptana-studio-3-in-ubuntu-14-04/

1. Install the dependencies
sudo apt-get install openjdk-8-jdk nodejs libwebkitgtk-1.0-0

2. Download the appropriate Aptana file from the website...
http://www.aptana.com/products/studio3/download

3. I used FireFox to download the file so it ended up in the ~/Downloads folder. Open up the terminal and navigate to the folder that it downloaded into
unzip Aptana_Studio_3_Setup_Linux_x86_64_3.6.1.zip
(change the version number to match the version you downloaded)

4. Move the newly created folder to the /opt directory...
sudo mv Aptana_Studio_3 /opt

I don't like zip files just hanging out so I remove them after unzipping them.
rm Aptana_Studio_3_Setup_Linux_x86_64_3.6.1.zip

5. Have to create an app launcher for Aptana Studio by installing gnome-panel if you haven't already done so...
sudo apt-get install --no-install-recommends gnome-panel

6. Navigate to the /opt/Aptana_Studio_3 folder and type the following...
gnome-desktop-item-edit ~/Desktop/ --create-new

7. A Create Launcher window will open. Type in a name that you want to see to open up Aptana.  I typed Aptana Studio 3.6.1 so that I'll know what version I have. Click on the browse button which should open up right in the Aptana directory and select AptanaStudio3 file and click the Open button. Click on the icon button to select icon.xpm file and click the Open button. Finally click on the OK button and you should now have an Aptana icon on your desktop.

Almost all of the above steps did come from the WordPress site mentioned above. I decided to retype all of the steps in case that site does go away at any point.

Wednesday, December 23, 2015

Step by step to install Ruby on Ubuntu 14.04 to prep for Rails

I am using the gorails.com website for most of the information but if you follow that guide, you'll undoubtedly run into errors.  I'm mostly documenting this for personal use but feel free to reference.

Here are the details to my environment...

  • Laptop/Desktop with enough ram to run virtual machines on Oracle VirtualBox.  
    • I normally give each machine 2GB of RAM and about 30GB of hard drive space.
  • Fresh install of XUbuntu or plain Jane Ubuntu 14.04

These notes are if you will be installing Ruby 2.2.4.  I'm only going up to the part on the gorails.com site where it installs Ruby before you get to the Git section. The last step on this post should get you past the errors I encountered while installing Rails.

Setup/prepwork...
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

Before performing this next step, click on the Edit menu option of your Terminal window. Click on Profile Preferences --> Title and Command tab --> Put a check mark in Run command as a login shell.  In XUbuntu it's Edit --> Preferences --> Put a check mark in Run command as login shell within the General tab.

Not on the gorails.com guide...
command curl -ssl https://rvm.io/mpapis.asc | gpg --import

Setup for RVM...
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm

I ran across a forum post to run this command or you could close your terminal window and re-open it...
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
Update RVM...


rvm requirements

RVM install...
rvm install 2.3.1
rvm use 2.3.1 --default
ruby -v

This tells Rubygems not to install documentation locally and then installs the bundler...
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
At this point, you can navigate over to the gorails.com webpage to finish your install if you plan on installing Rails. Good luck!

Ubuntu 15.10 and Rails (unable to install nodejs)

The guide I'm following gives this command as one of the steps to install Rails...

sudo add-apt-repository ppa:chris-lea/node.js
When typing that out in version 15.10, I got an error.

I read two forum posts suggesting to use 14.04 because 15.10 wasn't supported.

Rails install on XUbuntu 14.04 (ERROR: Failed to build gem native extension)

I am following the steps on this page verbatim but came across an error when I got to the point of installing Rails.  This is the error I got...

Fetching: nokogiri-1.6.7.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
 ERROR: Failed to build gem native extension.

    /home/user/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20151223-26597-j3i7to.rb extconf.rb
checking if the C compiler accepts ... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
 --with-opt-dir
 --without-opt-dir
 --with-opt-include
 --without-opt-include=${opt-dir}/include
 --with-opt-lib
 --without-opt-lib=${opt-dir}/lib
 --with-make-prog
 --without-make-prog
 --srcdir=.
 --curdir
 --ruby=/home/user/.rvm/rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)
 --help
 --clean
/home/user/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
 from /home/user/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:571:in `block in try_compile'
 from /home/user/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:522:in `with_werror'
 from /home/user/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:571:in `try_compile'
 from extconf.rb:80:in `nokogiri_try_compile'
 from extconf.rb:87:in `block in add_cflags'
 from /home/user/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/mkmf.rb:619:in `with_cflags'
 from extconf.rb:86:in `add_cflags'
 from extconf.rb:336:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /home/user/.rvm/gems/ruby-2.2.4/gems/nokogiri-1.6.7.1 for inspection.
Results logged to /home/user/.rvm/gems/ruby-2.2.4/extensions/x86_64-linux/2.2.0/nokogiri-1.6.7.1/gem_make.out
I read many forum posts where I tried a handful of suggestions and none of them worked. I finally came across a stack overflow post where the suggestion of running this command was towards the bottom...


sudo apt-get install libgmp-dev
...or...
sudo apt-get install libgmp3-dev
Many of the suggestions I found on a few different forum posts stated that I needed to run...
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
...but given the setup guide I'm following (along with a few notes I've take), I'd already installed all of those packages.  The extra package needs to be installed for XUbuntu 14.04 and the regular Ubuntu 14.04 images in order to install Rails.