Last active
March 6, 2016 06:29
-
-
Save Naggi-Goishi/cbc399b5909d604cc33e to your computer and use it in GitHub Desktop.
メンター試験解答 ref: http://qiita.com/Naggi-Goishi/items/f75b35ded190cbef3ea1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
問題3. Rails記述問題 | |
1. RailsでActiveRecord::Baseを継承すればfind,newなどのDatabaseに関わる様々なメソッドが使えるようになる。 | |
2. mergeメソッドは二つの配列を合成するためのメソッドである。 | |
3. n+1問題とはSQL文を発行しすぎることの問題である。これはcontrollerで取り出した情報のリレーションされているものをviewファイルで取り出すときにもう一度SQL文が走ってしまうことに原因があるので、controllerで取り出すときにincludeメソッドで同時にリレーションするものもひとつのSQL文でまとめて取り出すことで解決する。 | |
4. deviseは会員登録の機能を実装するためのgemである。 | |
5. kaminariを導入すればページネーションを簡単に実装することができる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
問題4. Javascrip問題 | |
1. console.log("Hello World"); | |
2. var number = 0 | |
3. メソッド | |
4. function square(number) {console.log(number * number);} | |
5. Javascripを使うことで非同期通信、つまりはJavascriptとサーバーとだけのやりとりでビューを画面遷移なしで変える事ができる。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content { | |
height: 500px; | |
width: 500px; | |
background-color: red; | |
text-align: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<link rel="stylesheet" type="text/css" href="test.css"> | |
<title>html_question</title> | |
</head> | |
<body> | |
<div class="contents clearfix"> | |
<div class = "left_content"> | |
<p> | |
left_content | |
</p> | |
</div> | |
<div class="right_content"> | |
<p> | |
right_content | |
</p> | |
</div> | |
<div class = "bottom_content"> | |
<p>bottom_content | |
</p> | |
</div> | |
</div> | |
</body> | |
</html> | |
| |
説明 | |
floatをright_contentとleft_contentにあてることによりこれらが文字どうり浮き、二つの高さが認識floatされていないボックスから認識されなくなる。故に、floatがあてられていないbottom_contentはright_contentとright_contentの高さを認識しないのでそれら二つを無視し入り込ものがひとつと、contentの高さはautoなので中にあるボックスに依存するがbottom_contentは認識するのでそれの高さになるのが二つ目のバグの利用である。 | |
これらのバグを解消するのには2通りある、clearfixをcontentにあてるか、clearプロパティをbottom_contentにあてるかである。clearfixをcontentにあてる場合はcontentクラスにさらにclearfixと言うクラスをつけ、cssファイルでclearfixクラスに:afterという疑似要素でそのcontentの末尾を選択するし、contentプロパティで空の文字列を入れ、さらにfloatとされているものの高さを認識させるclearプロパティはインライン要素に使えないので、displayプロパティでブロック要素に変える。二つ目は、bottom_contentにclearプロパティを当てれば良い。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Gitとは自分もしくはチームでつくっているソースコードの変更履歴、バージョンなどを管理するためのツールである。 | |
2. git clone | |
3. リポジトリとはバージョン履歴を保管する場所であり、リモートリポジトリとローカルリポジトリがある。リモートリポジトリとはインターネット上でおくレポジトリである。 | |
4. Sourcetreeは本来ターミナルから操作するgitを視覚化し使いやすくしたアプリであるので、見やすくわかりやすくGitを操作することができる。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment