星期一, 6月 18, 2018

[閃電] 飲食控制 0Y6M

回診時營養師推薦的餅乾和蛋糕,原來製作師傅的小朋友本身也有閃電症,所以請教營養師並合作製作適合的餅乾、蛋糕,製作過程營養師也都有參與,所以她是直接發 mail 告知大家可以安心訂購,買來當成生日蛋糕,總算是熬過 3 歲啦,健康地過完 4 歲吧

4 歲生日

營養師推薦的另一款產品,油粉做成的布丁,查了一下,發現台灣目前還沒有賣,只能在日本買,Orz

布丁

星期日, 5月 20, 2018

2018 綠建築 - 行程

實際行程
  • 0518 高雄 => 車埕 => 午餐-澄石 心天畝 => 老五民宿 => 民宿夜間生態介紹、瑜珈課程
  • 0519 老五民宿 => 日月老茶廠 => 午餐-水社碼頭 => 散步的雲 => 晚餐-濃情莊園 => 頭社生態步道賞螢 => 散步的雲
  • 0520 散步的雲 => 頭社金針花園區 => 向山遊客中心 => 午餐-水里鵝肉大王 => 回程
老五民宿
IMG_0367

散步的雲

IMG_0430

星期五, 5月 11, 2018

[閃電] 飲食控制 0Y5M

打從開始飲食控制,硯就沒有長高過,已經從中下段,快要掉到最後 5%,曾聽親戚分享過,要長高除了營養均衡外,還需要胰島素幫忙,而飲食控制剛好會抑制胰島素分泌,Orz

某天晚上量身高,發現似乎有長高,還嚴格要求他背要完全靠牆、雙腳併攏,反覆量了幾次,確定有長高,不過隔一天量卻又沒有變化,後來是回診時用儀器量,確定是從 96.7cm 長到 97.4cm

身高尺

要擔心的事情怎麼好像越來越多,永無止盡的感覺,>.<

星期二, 5月 08, 2018

[LINQ] Pivot

在 Line 群組上看見有人發問,基本上就是 TSQL Pivot 轉置就可以完成的需求,故意用 LINQ 來練習看看
namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            List<Leave> Data = Leave.GetData();

            var result = Data.GroupBy(g => g.Employee)
                .Select(g => new
                {
                    Employee = g.Key,
                    Personal = g.Where(w => w.Kind == "事假").Sum(s => s.Hours),
                    Sick = g.Where(w => w.Kind == "事假").Sum(s => s.Hours),
                    Company = g.Where(w => w.Kind == "公假").Sum(s => s.Hours),
                    Paternity = g.Where(w => w.Kind == "陪產假").Sum(s => s.Hours)
                });

            Console.WriteLine(" 員工 - 事假 - 病假 - 公假 - 陪產假");
            foreach (var item in result)
            {
                Console.WriteLine($"{item.Employee} - {item.Personal.ToString("00.0")} - {item.Sick.ToString("00.0")} - {item.Company.ToString("00.0")} - {item.Paternity.ToString("00.0")}");
            }
        }
    }

    public class Leave
    {
        public string Employee { get; set; }
        public DateTime Date { get; set; }
        public string Kind { get; set; }
        public decimal Hours { get; set; }

        public static List<Leave> GetData()
        {
            return new List<Leave>()
            {
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,1) , Kind = "事假" , Hours = 3.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,2) , Kind = "事假" , Hours = 8.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,3) , Kind = "事假" , Hours = 4.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,10) , Kind = "病假" , Hours = 8.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,20) , Kind = "病假" , Hours = 1.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,25) , Kind = "公假" , Hours = 8.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,26) , Kind = "公假" , Hours = 8.0m} ,
                new Leave() { Employee = "AAAAA" , Date = new DateTime(2010,10,27) , Kind = "公假" , Hours = 8.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,1) , Kind = "事假" , Hours = 6.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,9) , Kind = "病假" , Hours = 8.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,19) , Kind = "病假" , Hours = 8.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,25) , Kind = "陪產假" , Hours = 8.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,26) , Kind = "陪產假" , Hours = 8.0m} ,
                new Leave() { Employee = "BBBBB" , Date = new DateTime(2010,10,27) , Kind = "陪產假" , Hours = 8.0m}
            };
        }
    }
}
[LINQ] Pivot

星期一, 5月 07, 2018

[LINQ] XML Delete

學習 LINQ to XML 筆記,該篇是紀錄如何利用 Remove() 來移除 XML 檔案內的 Element

Employee Class
namespace Helper
{
    public class Employee
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public bool Gender { get; set; }
        public int Salary { get; set; }
    }
}
DataHelper Class
namespace Helper
{
    public static class DataHelper
    {
        public static string XMLPath = @"D:\Temp\XMLDemo.xml";

        public static List<Employee> GetEmployees()
        {
            return new List<Employee>
            {
                new Employee {ID = 1, Name = "張三", Gender = false, Salary = 50000},
                new Employee {ID = 2, Name = "李四", Gender = true,  Salary = 45000},
                new Employee {ID = 3, Name = "王五", Gender = false, Salary = 65000},
                new Employee {ID = 4, Name = "丁六", Gender = true,  Salary = 28000}
            };
        }

        public static void XMLFileExist()
        {
            if (File.Exists(XMLPath) == false)
            {
                throw new FileNotFoundException(XMLPath);
            }
        }
    }
}