Pages - Menu

2016年5月30日 星期一

[ 編譜 | 演奏Anima's Piano Cover ] MAYDAY五月天[ 派對動物Party Animal ] 鋼琴譜pdf

演奏:





琴譜預覽:
 

有想要的其他曲子? 求譜系統連結:http://goo.gl/1fDDvn
 
追蹤Facebook,取得最新琴譜:

Youtube訂閱網址:https://goo.gl/VNHBqt

原key PDF連結 

轉貼請標明出處哦 > <

2016年5月27日 星期五

[程式開發] 解決 Vagrant destroy or up 時出現 found a tab character that violate intendation while scanning a plain scalar....

出現:
found a tab character that violate intendation while scanning a plain scalar at line 14 column 11 (Psych::SyntaxError)

也就是 Homestead.yaml 錯誤了,yaml 裡面不能出現Tab 將Tab 改成 Space 就可以了





















[程式開發] Laravel Homestead Vagrant 開發 The host path of the shared folder is missing 問題


在vagrant up 時 出現:

Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: ~/Code

就是說 沒有~/Code文件夾 解決辦法:

(1) 創一個 ~/Code 文件夾 

(2) 修改 Homestead.yaml的folder到你想要共享的資料夾位址 :

folders:
    - map: ~/Code
      to: /home/vagrant/Code











[程式開發] Homestead Vagrant 出現 rsa 問題


$ vagrant up  出現

C:/Users/Anima/Homestead/scripts/homestead.rb:108:in `read': No such file or directory @ rb_sysopen - C:/Users/Anima/.ssh/id_rsa (Errno::ENOENT)
        from C:/Users/Anima/Homestead/scripts/homestead.rb:108:in `block (2 levels) in configure'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm_provisioner.rb:72:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm_provisioner.rb:72:in `add_config'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/plugins/kernel_v2/config/vm.rb:321:in `provision'
        from C:/Users/Anima/Homestead/scripts/homestead.rb:105:in `block in configure'
        from C:/Users/Anima/Homestead/scripts/homestead.rb:104:in `each'
        from C:/Users/Anima/Homestead/scripts/homestead.rb:104:in `configure'
        from C:/Users/Anima/Homestead/Vagrantfile:28:in `block in <top (required)>'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/v2/loader.rb:37:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:113:in `block (2 levels) in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:107:in `block in load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/config/loader.rb:104:in `load'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/vagrantfile.rb:28:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:740:in `vagrantfile'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:486:in `host'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:208:in `block in action_runner'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/action/runner.rb:33:in `run'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:473:in `hook'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/lib/vagrant/environment.rb:722:in `unload'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `ensure in <main>'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.1/bin/vagrant:177:in `<main>'


解決辦法:
在 Homestead.yaml設定的keys,keys 預設是id_rsa 到~/.ssh/id_rsa 看看對應到的rsa (如果從gitHub Clone 需要改成gethub_rsa),上述錯誤就是找不到該檔案,所以將keys對應到你的rsa 檔案即可

keys:
    - ~/.ssh/id_rsa

2016年5月23日 星期一

[生活] 飛利浦PHILIPS 與 東亞照明 燈泡 通用

今天寫譜寫到一半 檯燈突然暗了 看來是燈泡壞掉 趕緊去華通書局買 

我的檯燈是東亞照明,燈泡也是 結果華通只賣飛利浦的燈泡

想了想 看了看 買了一個跟我原本大小差不多的燈泡

回去裝了下 竟然通用~

PHILIPS 型號 :PL-LJ  4P 27W/840白色  我買220左右
東亞照明 型號:FPL27D-EX 晝光色 網路價180左右


2016年5月20日 星期五

[程式開發] 解決 composer command not found 問題

一般linux 執行檔都在   /usr/local/bin  底下

composer command not found 就是因為 composer.phar 不在 那裡 所以我們把他搬過去

$ mv composer.phar /usr/local/bin/composer

這樣就可以執行 composer 指令了


[程式開發] Laravel 5 從GitHub Clone 專案 到 Raspberry pi 上 (Linux Debian)

1. 在 /var/www中(每個人Apache的路徑不太一樣)
git clone https://github.com/user_name/project_name  local_project_directory_name

2.如果是private會多要求要帳號密碼

3.由於push到github上面並不會包含 .env(裡面有重要資料) 所以要自己寫一個.env

4. 通常都會有.env.example 可以直接拿來修改 需要修改的有APP_KEY 還有 Database的資訊

5. 輸入指令建構project  並輸入資料庫

composer install
php artisan migrate

可能會遇到

[PDOException]
SQLSTATE[42000][1049] Unknown database 'name'
表示並沒有name的database 此時到資料庫程式新增一個名稱和.env設定一樣的資料庫即可

NOTFOUNDHTTPEXCEPTION IN COMPILED.PHP LINE 的問題



6. sudo /etc/apache2/sites-available/000-default.conf    的位址需要更改到此專案的/public之下

7.   sudo /etc/init.d/apache2 restart  後即可以輸入網址看到自己的專案

[程式開發] Laravel 5 出現No supported encrypter found. The cipher and / or key length are invalid. 解決辦法

出現No supported encrypter found. The cipher and / or key length are invalid.

表示說你的.env 裡面的APP_KEY是無效的

所以重新產生一個吧:

php artisan key:generate

輸入後看一下.env的APP_KEY 就會看到了

[程式開發] Laravel 5 出現 NotFoundHttpException in compiled.php line [行數] 解決方式

通常是project 從 gir clone 下來後會出現的問題

1. 首先Laravel在Apache裡面必須要開啟權限

sudo chown -R www-data storage
sudo chgrp -R www-data storage
sudo chmod -R 775 storage

2.之後輸入在project資料夾中輸入指令 即可解決

php artisan clear-compiled
php artisan optimize
php artisan cache:clear

[程式開發] 在Raspberry pi (Linux Debian) 上 安裝 Phpmyadmin

1. 安裝phpmyadmin
sudo apt-get install phpmyadmin

2.彈出視窗選擇要安裝在哪個伺服器 apache ,lighttpd 按空白建可以選

3.彈出視窗要configuration 按YES 去設定 輸入mysql的password

4.將phpmyadmin掛到 Domain/底下

sudo nano /etc/apache2/apache2.conf

在最下面加入這行: Include /etc/phpmyadmin/apache.conf

5.重啟apache
sudo /etc/init.d/apache2 restart

6.完成 此時在網址輸入 http://你的網域名稱/phpmyadmin 即可看到


2016年5月19日 星期四

[程式開發] Laravel5 如何使用 ajax post

1.Ajax 大概會長這樣

function save_user_data(id,name,email){
     $.ajax({
         headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        },
        type: "POST",
        url: './user_save',
        data: {id:id,name:name,email:email},
        success: function(data) {
            console.log(data);
            console.log("ajax success");
        }
    })
}

表示他會POST資料到URL為: 網域/user_save

2.改routes.php 決定user_save要用哪個Controller的function去處理

Route::post('/user_save', 'TestController@store');

3.在TestController.php中處理傳來的ajax

class TestController extends Controller
{
    public function store(Request $request)
    {
        $user_id = $request->id;
        $user_name = $request->name;
        $user_email = $request->email;
        
        return "OK".$user_id.$user_name.$user_email;
    }
}

4. 這樣即可以接收到値並回傳 此時Ajax會收到回傳callback資料 印出OK... 就成功了

[程式開發] Laravel5 使用 ajax post Return error 500 (Internal Server Error) 問題

如果對Laravel沒有很熟,需要看一下官方文件說明
官方文件:

1.首先在要傳出Ajax的頁面的header 加入meta Tag,Laravel會自動亂碼產生content

<meta name="csrf-token" content="{{ csrf_token() }}">
2.接下來就在jQuery的Ajax 裡面加入headers 即可以有CSRF protection的作用

$.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
});