I’ve been once again trying to understand programming in a way that feels grounded. My manager suggested that solidifying first principles could be my ticket, and gave me a challenge: Nand2Tetris.
Nand2Tetris is a self paced project in which the learner creates a simple computer(in a hardware simulator) from small modules — chips.
I have endeavored upon the first chapter and corresponding tasks. Wow were they fun!
First, I learned about boolean logic and logic gates and the HDL(Hardware Description Language) I’d be using. Then I learned how to use the hardware simulator.
I went to a Ruby hacknight the other night! There, I spent an hour and a half pair-debugging what turned out to be a painfully simple issue.
The issue I was having:
I needed to generate a migration:
rails generate migration add_product_url_to_wishlists. But when I would type that into the terminal, I would get the following error:
rails consoleproduced the same error as the
rails serverran successfully.
I should mention that my view of the error message was not as it looks above. I have, before now, kept the terminal text large…
In an attempt to learn more, faster, I’m changing the style of these posts a little. I’ll be sharing notes, rather than creating micro tutorials of what I’ve learned each day.
Today I created a store application called depot:
What happens in the depot?
What do I do to prepare (after writing out user stories)?
rails new depot.
rails generate scaffold Product title:string description:text image_url:string price:decimal.
In two previous blog posts, we’ve written a smart contract using the Solidity programming language and compiled the smart contract to prepare it for deployment. Now we’ll test the code using the Mocha testing framework.
In addition to Mocha, we’ll use Ganache and Web3. Ganache will provide us with a set of unlocked accounts we will use in our local testing environment. In this case “unlocked” means that there is no need to use a public or private key to access…
The tiny “Hello World” app has two pages that link to each other. It works!
Now to break it so I can see why it works.
First I added a typo in the code:
Time.now()(a Ruby method on a
Time object) to
Time.know()(a nonsense method on a
In the browser, the following appeared
I have this tiny “Hello world” app.
It has one page.
Now I will give it another page.
Each page will correspond with a separate
view. For this new page I will use a new action method (
goodbye) which will be in the same controller I’ve been working with(
New action method. Same controller. Here we go.
goodbye.html.erb so that it will show “Goodbye”. That’s fine but I’d really like to add links between both pages, too.
For links I will use a helper method!
link_to() creates a hyperlink to an action.
So in my
Today was review day. This is all pertaining to my tiny “Hello World” app.
Here’s how it werks:
saypart of the URL is taken as the controller name and Rails creates an instance of the
hellopart of the URL identifies an action. Rails invokes the method of that name in the controller.
hellomethod creates a new
Timeobject and saves it in the
Today, I learned about adding dynamic data to my “Hello World” app.
A Rails app, like any other web app, is associated with a URL. When someone points to the URL, they’re communicating with the application code.
I navigated to http://localhost:3000/say/hello and I saw the following:
First thing! Here’s the video of the movement as promised in the blog post before this:
I liked to compare functions to phrases of movement. In dance, we’ll have a phrase of movement, let’s say it’s 1 minute long. And the way we know to begin that phrase is because we hear a musical cue, or see a movement cue, or hear a vocal cue. …
I’m just a girl, standing in front of some code, asking it to love her.