ruby instance_eval 與 class_eval 差異 instance_eval 與 class_eval 從英文語意上來看感覺很簡單,一個是 instance level,另個是 class level,實際瞭解後才發現沒這麼單純,instance 也非平常所理解的 instance。 先看看以下的範例: String.instance_eval do def from_instance_eval self end end String.class_eval do def from_class_eval self end end p String.from_instance_eval
mysql C# connect to MySQL 在此分享一 C#與mysql連結的class, using System; using System.Collections.Generic; using System.Linq; using System.Text; using MySql.Data; using MySql.Data.MySqlClient; namespace SpotMap { class mysql { string dbHost = "localhost"; string dbUser = "root"; string dbPass = "