I recently read a book called In the Days of King Alfred the Great by Eva Tappan. It was about King Alfred the Great (duh!). This book told me about his life, family, and friends. It was informative, instructive, and fun. King Alfred was a Saxon king who fought off the Dane invaders. He was most famous for the story of the cakes. King Alfred was hiding from the Danes, and he had to stay in a poor man’s house. The man’s wife didn’t know Alfred was king, and told him to watch the cakes while she was gone. King Alfred just thought about how he would counterattack the Danes. He saw burning ships in his mind, which were really burning cakes! Some think this story isn’t true, and it’s very likely it isn’t. King Alfred finally shook the Danes off of England, and everyone was happy. Overall, I think I learned a lot from this book.
1 year in London… What have I accomplished? For starters, I have lots of stamps in my passport (England, USA, Netherlands, France, Poland, Germany,I really should have Austria but I don’t). I made Homeschoolson. I started to take coding seriously. I started taking history seriously. Really seriously. Half the books that I read are Horrible History books. Other than my IQ growth,
I started playing more soccer/football. When I go go back to the States, I’ll be dancing the ball into the goal! I’ve also seen new cultures, new people, new food, and new tastes. 2014 has been an important year for me. So, what am I going to accomplish in 2015? Well, my goal is to earn 2000 dollars by the end of the year. So far I’ve been procrastinating and I haven’t earned a single penny. (Oh well, we always break those resolutions anyway.) I’ve achieved 39481 hits on this blog. I’ve read new books, made new friends, homeschooled myself with the piano (the 2 teachers either quit or got fired), memorized new things(the Tube), and had new expieriences. I don’t know what’s in store for me this year. I’ve done a lot last year. I hope this year will be the same.
Galileo Galilei by John
Galileo was a scientist who asked questions. He was the first “real” scientist. He believed in experimenting. Galileo was born in 1564 and died in 1642. He lived in Venice most of his life. He studied math, science, and astrology. He studied in Pisa. He became a professor at Pisa, even though he flunked out of college. His ideas were considered OUTRAGEOUS at the time. He was popular with the students and hated by the other professors. His most famous discovery was that the sun was the centre of the universe. Galileo invented a balance called the Hydrostatic Balance. He also made a better version of the telescope.
- His most outrageous idea was that the sun was the centre of the universe. Aristotle thought that the Earth was the centre of the universe. Galileo proved this wrong using a pendulum.
- He proved that heavier objects fell the same speeed as lighter objects as long as the objects have the same density.
- Galileo liked to look out of his telescope. When he had the idea to look up, he discovered Jupiter’s moons.
Galileo was put unjustly put on trial for saying things against the church. He was only put on trial because the bishop was losing power, and needed to do something to show his power, even if it meant losing a friend. Galileo had to spend the rest of his life on a farm in the italian countryside.
Galileo was a great man. His discoveries were vital to today’s scientists. He led the way to many important discoveries.
I got a lot of loot this Christmas. This post will show you my highlights starting with:
High Elves Army Book
20 Horrible Sciences, 4 HOrrible Histories, 10 HOrrible geographies.
But the winner has to be….
Views are the part of the app that users see. To make one, go to this path: /app/views. You will see a folder called layouts. This contains your templates. If you made a model, then you should see a folder named after it. To use the views, make 2 files: index.html.erb and show.html.erb. Erb stands for Embedded Ruby. To use embeded Ruby, write <% @e = Example.find(1) %>. This doesn’t print out, so you have to write this to print it out: <%= @e.title %> . THe equals sign is very important. But this feels dirty, writing this logic in erb. This should go inside a controller instead. We will discuss controllers in part 3.
Your previous app is great on the client side, but not on the server side. I am going to cover on how to make a rails app. The first thing you need, is rails. Once you have rails installed, go to your command line and write
$ rails new 'your app name goes here' . Then
cd into the new folder you just created. Most rails apps are centered around a database, so let’s start there. In the app you see in the picture, there are 2 models. A model is a class for the data you send in. To make these models, write
rails generate model ModelName *properties go here*. An example of the property syntax looks like this:
name:string number:integer boolean:boolean. So you made the model, but you don’t have any instances of the model. To make one, write
$ rails console. When that loads, write
ModelName.create(exampleProperty:"Hi"). This saves to the database,but doesn’t do anything yet. Your user doesn’t see anything, and there’s no server. To solve the last problem, write
$ rails s. But when you visit localhost:3000, it will throw an error. This is because you need to rake the databse by writing
$ rake db:migrate. As for the first problem, we will cover that in part 2, Controllers and Views.
When creating a web app, you will always need a backup. This is where Git comes in. First you have to download git (if you don’t have it). Then (with your command line) you
cd into your folder. Write
git init. Then look in your newly created .git folder. Once you’ve found your newly created repository, go back in to your command line and write
git clone all *repository name*. There are your backups! Now for some best practices. It is always good to minify your js files. Also, put your script tags at the bottom of your body. Here are some CSS best practices: When you want to change the content of an item when the mouse clicks, don’t use jQuery. Use some pseudo classes instead. For example:
Is better than using jQuery. If you use this, make sure you add the content value!
If you need to make a server for your app, you have to use Node.js. The first thing you need to do is install node and npm. Then, go into your Node command prompt. Then you have to change your directory. It sometimes helps to move your app into a different directory. Using the command
cd you have to go into your App folder. To go up a directory, use
Then, when you are in your App folder, write
npm install http and press enter. Then write http-server and hit enter. Wait for it to finish and you have your server! This is all you need to know to create a web app.
The picture above shows an example of a web app I am producing. It is a Christmas store I made with Angular.js. In order to add these libraries, make a folder called libs and download your libraries from the web. Save the libraries into libs. Then, in your index.html, add more of those script tags linking to those libraries. As your js starts to get complicated, you need something to debug it. This is where Google Chrome DevTools come in. Simply press F12 on your keyboard and it comes up. You can see your errors in the console. There is a lot of stuff in DevTools, but there is a course on Code School that’s free and helpful. You may need to save data on a server. This is where Node comes in, and a story for Part 3…
I’m assuming you have fair knowledge of HTML and CSS.
A good text editor is Notepad.
A few weeks ago, I went to Madrid. It was very nice! On the first day, I walked around and explored. The next day, I took a tour and went to a big park. I saw lots of big cones filled with meat (like in the picture). I would’ve gotten a Real Madrid shirt, but nobody could tell what team it was, because the shirt only said Fly Emirates. The next day, I went to the palace and took the plane back home.