Skip to content

Commit

Permalink
fixes issues where styling wasn't applied to headers
Browse files Browse the repository at this point in the history
  • Loading branch information
RabeaGleissner committed Aug 5, 2016
1 parent a6dc17c commit 5fd3ca4
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.sass-cache
_site
_site
.jekyll-metadata
12 changes: 6 additions & 6 deletions apprenticeship/_posts/2015-12-02-day-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Last week I did a screen recording of my performance of the Roman Numerals kata.

Here's the list of improvements:

##Use more keyboard shortcuts
## Use more keyboard shortcuts

As a developer, we should use the keyboard as much as possible, as using the mouse slows us down. Although that is only true, if all the shortcuts are in your muscle memory and you don’t need to think about them anymore. And how do the shortcuts get into your muscle memory? By using them all the time.

Expand All @@ -26,20 +26,20 @@ Another shortcut that I have started using more is `alt + tab` to jump between t

I’ve also been using the mouse to right-click on a tab of an open file in IntelliJ to split the window, so that I could have the test file on the left and the code file on the right. Felipe showed me the vim shortcut `ctrl + w + v`, which does the same thing and also works in IntelliJ because I am using the vim plugin.

##Change existing code rather than writing new code
## Change existing code rather than writing new code

There is a step in the Roman Numerals kata where I have several if statements that can be replaced by a while loop. The way I’m going about the implementation is to copy another while loop and change the values in it. However, Felipe noticed that it would have been easier to change the “if" into a “while” in one of the existing if statements. Not only is it easier, but it also makes it clearer how the tests help to transform the code - going from specific to more generic. There's a blog post by Uncle Bob about how certain elements in the code transform as the code becomes more generic. And one of the examples is that if statements transform to while loops. So from now on I’ll try to make these transformations more obvious when performing a kata.

##Don’t delete code too early
## Don’t delete code too early

During the Roman Numerals kata screen recording I implemented a while loop to replace several if statements. Once I had written the code for the while loop I then delete the if statements and run the tests again. Felipe advised me that I should run the tests first and only delete the old code if the tests are green. This won't work for every kata but in this case it worked because the arabic number is decreased in every loop and the if statements only run if the arabic number is greater than a certain number. By the time the arabic number gets to the old if statements, it is already zero, so the if statements won't run.

##Increase font-size
## Increase font-size

When watching my screen recording on iPlayer on my laptop, I thought it was easy to see the font. However, when I uploaded the video to YouTube, I realised that the font was a bit too small. So next time I do a screen recording, I will zoom in a bit to make the font more legible.

##No need for git commits
## No need for git commits

During each IPM my mentors asked me to make many small commits. So I also made these small commits during the screen recording. However, it’s not necessary to record commits. I’ll skip those for my next recording. The commits were actually a bit distracting and I think without them it'll be easier to perform a kata.

Felipe's feedback was really useful and I’ll try to keep all the above mentioned points in mind for my performance of the Coin Changer kata on Friday. Especially the keyboard shortcuts!
Felipe's feedback was really useful and I’ll try to keep all the above mentioned points in mind for my performance of the Coin Changer kata on Friday. Especially the keyboard shortcuts!
6 changes: 3 additions & 3 deletions apprenticeship/_posts/2015-12-03-day-14.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ Today I spent the morning practising the Coin Changer kata over and over again a

In the afternoon I continued working on my Rock, Paper, Scissors game in Java. It is so much fun to work on a slightly larger (compared to the katas) application again and figure out how to make it all work. The hours fly by almost too quickly. I also really enjoy discovering a new language and researching how to use it.

##Test doubles
## Test doubles

I implemented test doubles again. One for the console, similarly to how I did it for the echo server application. And the other double I implemented for the random generator of moves that the computer player uses. It randomly chooses rock, paper or scissors. But it is hard to test something if you don’t know what it returns. So I implemented a FakeRandomizer class which I use for the tests. And when that class is used, I can tell the computer player which move to use. I connected the fake and the real randomizer classes through an interface and can now use either of the classes for the computer player.


##Enums
## Enums

Yesterday, Felipe gave me the tip to look at Enums and see how I can use them for this application. I did some research and came to the conclusion that Enums are something like constants which are born in their separate little area of my application. A little bit like a class.


I had originally used strings for the options rock, paper and scissors but then changed those throughout my application to Enums. I had to make a change in almost every file. But I think, if an Enum changes, IntelliJ will be able to automatically change it across all files if I use the magic shortcut `shift + F6` to change the variable. So if I need to change the options for some reason, it should be a lot more straight forward. At least that's what Maël told me. She helped me a little with this and explained that strings live in the wild but Enums are a bit tamer.

I’m glad I’ve tamed my application a little bit.
I’m glad I’ve tamed my application a little bit.
8 changes: 4 additions & 4 deletions apprenticeship/_posts/2015-12-15-day-22.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ In my Rock, Paper, Scissors application I was in a situation where I needed a me

I chose to use static class variables to store the two data types which has some pros and cons. Before going into the details, I will try to define what a static variable is and what an instance variable is.

##Static variable
## Static variable

Static variables, also called class variables, are associated to the class directly. They can be used without creating instances of the class. If there are instances of the class, then they all share the exact same variable. For example, if there is a person class with a name being a static variable, then any instance of the person class would have the same name. They are basically like a global variables. The life time of a static variable is the entire run time of the application.

##Instance variable
## Instance variable

An instance variable is also defined in a class and outside of methods but each instance of the class has its own copy of the variable. So every time a new object is instantiated, a new copy of the instance variable is created. Similarly they are destroyed when the object is destroyed.


##Pros and cons of using static variables
## Pros and cons of using static variables

I used static variables in my code because on first glance I thought it would be easier to refer to the variables in other parts of my application without having to create a new instance of the class. I didn't see the necessity to create instances when all I needed was to store and access the different data types.

Expand All @@ -37,7 +37,7 @@ Another contra argument for using static variables is the fact that the static v

In summary, there are a lot more negative side-effects to using static variables than benefits. In future I'll stick to instance variables.

##When to use static variables
## When to use static variables

I was curious on when you would actually use static variables, seeing that Java provides them. I did some internet research to find out more. But the only use case that I could find is for constants (when using they keyword "final").

Expand Down
17 changes: 8 additions & 9 deletions apprenticeship/_posts/2015-12-16-day-23.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ So how to decide for one? Here’s my thought process.

Let's start with the facts.

##What the internet says about Maven vs. Gradle
## What the internet says about Maven vs. Gradle

###Maven
### Maven

- has been around for longer

Expand All @@ -34,7 +34,7 @@ Let's start with the facts.

- the build configuration file is written in XML

###Gradle
### Gradle

- is newer than Maven

Expand All @@ -52,7 +52,7 @@ Let's start with the facts.

- has a wrapper which you can use so that anyone can compile and run the code without having Gradle installed

##What my colleagues say about Maven vs. Gradle
## What my colleagues say about Maven vs. Gradle

- Maven is used in most older projects and you'll find Gradle in more recent projects

Expand All @@ -67,15 +67,14 @@ Let's start with the facts.
- approach it chronologically - start with Maven and then use Gradle for the next project


##Trying out both
## Trying out both

To help form my own opinion on each tool, I decided to try them out. I followed some quick tutorials to set up a project with both build tools. Both were fine, to be honest. Ultimately both are new to me and I'd need to get used to either, no matter which one I choose. Gradle reminds me a bit more of the JavaScript task runners that I'm familiar with but other than that, it's all new to me.

I liked that Maven had the option to use an archetype, which is kind of like a template that generates a basic structure to begin with. I also found that the XML language wasn't as confusing as I thought it would be.
I liked that Maven had the option to use an archetype, which is kind of like a template that generates a basic structure to begin with. I also found that the XML language wasn't as confusing as I thought it would be.

When I was following the Gradle tutorial I realised that it was referring to the MavenCentral repository of plugins. So it seems like Gradle builds on Maven or at least uses Maven assets. Another pro argument for using Maven is that I heard that a lot of Java projects follow the Maven project structure as a standard.
When I was following the Gradle tutorial I realised that it was referring to the MavenCentral repository of plugins. So it seems like Gradle builds on Maven or at least uses Maven assets. Another pro argument for using Maven is that I heard that a lot of Java projects follow the Maven project structure as a standard.

##The decision
## The decision

That's why I decided to start with Maven and use that for my next project. Once I know it a bit better, hopefully it will make it easier to use Gradle, which I'm planning to use for a future project.

6 changes: 3 additions & 3 deletions apprenticeship/_posts/2016-01-04-post-26.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Last week, during my IPM, Felipe reviewed my Tic Tac Toe code and found a bug wi

<!--break-->

##The bug
## The bug

The application showed an error and quit when Felipe chose position 10 to place his mark on the TTT board. As you can see in the image below, you can only choose a position between 1 and 9.

Expand All @@ -20,15 +20,15 @@ The expected behaviour was that when the user entered a wrong number, they would

![expected behaviour](/../../public/images/ttt-expected.png "what should have happened")

##Debugging step 1 - replicate the error
## Debugging step 1 - replicate the error

The first thing I did instinctively was to check if I could replicate the error on my machine. Yep, I could. It wasn't Felipe who had hacked my code. Just making sure.

So I went and looked at my code. I knew approximately where the methods were that were called to show the warning about the unavailable position and prompt the user again.

But Felipe stopped me. He wanted me to take a different approach: write a failing test! Of course, that made sense. I'd have to write a test that failed exactly in the same way that the application failed when the user entered 10.

##Debugging step 2 - write a failing test
## Debugging step 2 - write a failing test

So I wrote a test for the getUsersPosition() method in UseInterface. My thinking was that it’s the first method that is called to return a user’s choice, so let’s start there.

Expand Down
38 changes: 19 additions & 19 deletions apprenticeship/_posts/2016-01-11-post-31.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ There were a lot of things that I already knew how to do but I also learnt sever

I made notes of all the new commands that I learnt (including how to deal with hunks):

##.gitignore understands negation with !
## .gitignore understands negation with !
If I wanted to git ignore all java files except hello.java, I can write this in my .gitignore file


Expand All @@ -23,67 +23,67 @@ If I wanted to git ignore all java files except hello.java, I can write this in
`!hello.java`


##git can move files
## git can move files
To move a file called hello.html into a directory called lib do this:

`git mv hello.html lib`

##git can add stuff to the most recent commit without any hassle
## git can add stuff to the most recent commit without any hassle
Forgot to include a file in the most recent commit? Stage the file and then

`git commit --amend`

##you can trick git into thinking that today is not today
## you can trick git into thinking that today is not today
make a commit with a different date from now

`git commit -m “some message" --date "Wed Jan 6 23:00:00 2015 +0300”`

(time and year seems to be optional)

##git branches can be tagged
## git branches can be tagged
I have to admit that I didn't know this at all. Apparently the tags are used to mark a specific point in time for a branch, for example a release of a version.

Checkout a specific tag like this:

`git checkout tags/tag_name_goes_here`

##it's never too late to create a branch
## it's never too late to create a branch
Create a branch from a previous commit

`git branch new_branch HEAD~1`

or HEAD~2 or 3… depending on how many commits you want to go back

##sometimes you need to clean git
## sometimes you need to clean git
I had never heard of this at all and I have never cleaned any of the repos I worked on. Apparently this command optimises how the repo is packaged and removes any redundant packages.

`git gc`

##cherry-pick the best
## cherry-pick the best
Copy a commit from another branch onto master branch

On master branch: `git cherry-pick theShaOfTheCommitFromAnotherBranch`

##rename an older commit
## rename an older commit
`git rebase -i HEAD~3` —> get the list of the last 3 commits

From the list, change the word “pick” to “reword” for the commits that need to be reworded. Save and close.
Follow the instructions on the following files that open. Done.

##squash several commits together
## squash several commits together
`git rebase -i HEAD~3` —> get the list of the last 3 commits (déjà vu!)

Replace the word “pick” with the word "squash". Save and close. Follow the instructions.

##merge a branch as a single commit
## merge a branch as a single commit
`git merge —squash feature-branch`

This will add all changes to the current branch. Then make a commit to commit all at once.

##reorder commits
## reorder commits
Use the rebase command and reorder the commits in the vim editor by copy and pasting.

##git can tell you where your bug is
## git can tell you where your bug is
This is a really interesting one! With the help of git you can find the commit that introduced a bug.

`git bisect start`
Expand All @@ -94,11 +94,11 @@ This is a really interesting one! With the help of git you can find the commit t

Then it will ask you for each commit if it’s god or bad. Answer with:

`git bisect good` or `git bisect bad`
`git bisect good` or `git bisect bad`

and ultimately it will narrow down to the commit that introduced the bug. Nice job git!

##stage that hunk
## stage that hunk

One of my favourite things in SourceTree is to click the button that says "stage hunk". The word hunk just always makes me giggle.

Expand All @@ -108,7 +108,7 @@ Unfortunately the git command is not as much fun.

It will ask you for each hunk if you want to stage it (y/n/q).

##stage only one line (when your hunk is too big)
## stage only one line (when your hunk is too big)

`git add -p`

Expand All @@ -119,18 +119,18 @@ In the editor
- delete added lines that you don’t want to commit
- put a space in front of deleted lines that you don’t want to add

##git knows what you did before
## git knows what you did before
Go back to the branch I worked on last

`git checkout -`

##revert a commit and show the world that you reverted it
## revert a commit and show the world that you reverted it

Revert a commit by creating a new commit that reverts the previous commit (useful when you've already pushed to a remote and others might have pulled the changes).

`git revert shaOfTheCommitYouWantToRevert`

##I accidentally deleted a commit!
## I accidentally deleted a commit!

When you accidentally deleted a commit with git reset —hard, you can undo the deletion.

Expand Down

0 comments on commit 5fd3ca4

Please sign in to comment.