(&:odd?)について
> a, = (1..5).partition(&:odd?) => [[1, 3, 5], [2, 4]] > a = (1..5).partition(&:odd?) => [[1, 3, 5], [2, 4]] > a, b = (1..5).partition(&:odd?) => [[1, 3, 5], [2, 4]] > b => [2, 4]
> a, = (1..5).partition(&:odd?)
↑なぜaの後ろに「,」が入っていたのか不思議だったが下記のコードで納得
> a, b = (1..5).partition(&:odd?) => [[1, 3, 5], [2, 4]] > b => [2, 4]
a, = (1..5).partition { |num| num.odd? }
SQLについて
SQLとは?
データベース言語の一つ データベースの定義や操作を行うことができる ISO(国際標準化機構)で規格が標準化されている。 一度学習すればほかのデータベースでもほぼ同じように操作可能 「シークェル」または「シーケル」と呼ばれている SQLという名称は公式には何の略でもないとされる IBMの操作言語「Structured Query Language」の略だと言われる事もあるようだがなんの略でもないらしい。 公式には、「Structured Query Language」という略称はIBM社の言語についてのもの。 標準規格のSQLの方は公式には何の略でもないということになっている
参考URL
vagrantからDockerの構築まで(備忘録)190610 21:28:44
vagrantからDockerの構築までの流れをまとめておくための記事
//フォルダまで移動してから $ vagrant up
しかしエラー発生
There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["startvm", "0", "--type", "headless"] Stderr: VBoxManage: error: Could not open the medium '/Users/〜/VirtualBox VMs/〜_default_〜〜/box-disk1.vmdk'. VBoxManage: error: VD: error VERR_FILE_NOT_FOUND opening image file '/Users/〜/VirtualBox VMs/〜/box-disk1.vmdk' (VERR_FILE_NOT_FOUND) VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component MediumWrap, interface IMedium
190610 21:57:30
調べてみた。
どうやらエラーの原因はversionにあるようだ。
一度virtualBoxのアプリをアンインストールし入れ直した
↓ソフトウェアの読み込みが弾かれた場合に対処法
rails cがエラーになった時の対処方法
【mysqlで文字コードをutf8にする設定】
【mysqlで文字コードをutf8にする設定】 mysql -u root -p mysql> show variables like "chara%"; $ sudo vi /etc/my.cnf [mysqld] ... character-set-server=utf8 #mysqldセクションの末尾に追加 [client] default-character-set=utf8 #clientセクションを追加 :wq $ sudo service mysqld status mysqld (pid 8535) is running... $ sudo service mysqld stop Stopping mysqld: [ OK ] $ sudo service mysqld startStarting mysqld: [ OK ] $ sudo service mysqld status mysqld (pid 12850) is running... $ sudo service mysqld stop
Mysql 設定方法
190708 16:23:20 Mysql 設定方法
【状況】 ・アプリgit clone後 Mysqlのパスワードの設定 $ mysql -u root mysql> update user set authentication_string=password(“パスワード“) where user=‘root’; mysql> flush privileges; mysql> exit $ mysql -u root -p Enter password: パスワード入力 ログインできたら終了
Cloud9 MySQLの設定でのトラブルと解決策
190708 16:54:17 url:https://qiita.com/emahiro/items/1a63d676be9fc4975759
$ bundle install →error An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling. $ git checkout -b test_miyagaki $ gem install mysql2 -v '0.5.2' →error エラー内容 ----- mysql client is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again. ----- $ sudo yum install -y mysql-devel $ bundle install ******************************************************************************** →成功