2017年4月13日 星期四

年輕不是重點,所屬的年代才是

看了全聯事件,深深覺得...我也是老人了 XD。
說點自己的想法吧
其實我也很好奇,為什麼薪資上不去?
大家說房價跟薪資比多年前(估且說是六十年好了)是5萬vs9千,現在是2000萬vs2.5萬,就數字看起來很嚇人,彷彿過去這六十年被下蠱了,現在才驚醒。
是下蠱嗎?
這,顯然是自家的老爸在當年的世界沒努力,現在才沒辦法當富爸爸幫你補上缺少的1976萬,滿合理的。另一種可能,則是當時的老爸們,有的努力賺錢,賺到錢後去炒地皮賺更多的錢,但自家的老爸賺到錢後不知道拿去哪了(也許是老爸的老爸在更早的時空也沒賺到錢?),沒跟上炒地皮,自然就看不到車尾燈一路敗到現在了
那麼現在這個屬於你的世界,要做什麼,才能讓六十年後,不用繼續怪自己老爸沒有1976萬?
當你在喊22K,請別忘了,是第一年;第二年開始,你應該會發現自己的朋友開始有人領超過22K了,也許十年後,你的朋友默默地領60K,然後跟你一樣拿iPhone,二十年後,也許開始有朋友領超過100K,然後跟你一樣有空就吃大餐犒賞自己,而你,是否覺得你跟上了呢?
我是覺得年輕人就是不喜歡被講,畢竟是自己的人生,為什麼要被講的一副自己是傀儡的樣子;但往往經過歲月的洗禮之後,才發現原來走的路跟那些老人,真的沒什麼不同...;就像玩迷宮遊戲,總想著自己是最快走出來的,卻沒注意到,這遊戲有成千上萬人玩過,大致上怎麼走比較快,早就有參考了,也許迷宮受限遊戲規則不能看別人怎麼走的,但自己的人生呢?
人類多年智慧的累積,並不是靠年輕這樣一個屬性,就可以加速超越的,你的年輕不是重點,你所屬的年代才是重點,這個年代的“努力賺錢”指的是什麼?你愈年輕搞懂,就愈有機會去實現
當然啦,還有一種可能:聯合次要敵人打擊主要敵人;比如說,酸徐先生只是為了讓身旁的人誤以為自己真的不認同,然後減少身旁人的競爭力,自己也就不用那麼辛苦了。這..在我們的年代,是策略的一種... 冏

年輕人,你是對的,你這個世界的苦只有你懂,但苦之外,只有更苦嗎?

2017年2月13日 星期一

中央大學EMBA 105級 校園生活點滴

中央大學EMBA 105級 年度鉅獻
主演 - 熱火天團
參與 - 全體同學(105)
導演 - 黃維桐
地點 - 中央大學(中大) 管二館

劇中的教室為宏致講堂,耗資近千萬打造
採弧形劇場結構、約可容納七十人,是中央最優質的教室之一
引用的課程橋段則來自資訊管理與科技課程,陳炫碩老師指導
透過分組個案研討,讓小組成員就像是在職場遇到問題一般
充份討論及整理
最後歸納出結論與建議,是EMBA教學的核心價值
也是一般課程無法取代的

歷時半年的準備
透過黃大導演精心策劃及整理
將中央EMBA求學過程,正式公開

黃導現代化的拍攝手法
是追求新知,精益求精的體現
而四位主角,則是完美演繹EMBA充滿自信的一面
輔以同學們的歡笑與熱情

我們的中央時代,讚!

2015年8月13日 星期四

Windows平台 MySQL 的備份與還原

備份 
1.先進入cmd
2.切換到下列目錄(依據不同MySQL版本,路徑可能不同)
C:\Program Files\MySQL\MySQL Server 5.1\bin

3.執行下列指令
mysqldump -uroot -pa12345 -hlocalhost --default-character-set=utf8 -A > backup.sql

root:代表使用root帳號
a12345:此處請自行改為root的密碼
localhost:代表要備份本機的MySql資料庫
backup:備份完成的檔案名稱
utf8:請先進到MySQL Command line Client 輸入status或\s查詢

完成後會在相同目錄下出現backup.sql,把這個檔案存起來即可

--------------------------------------------------------------------------------------------------------

還原
同上步驟1及2
3.執行下列指令
mysql -uroot -pa12345 < backup.sql

紅字部份同上

資料參考來源: Acoak Blog

2013年6月12日 星期三

MSSQL 比對ROW是否一樣

除了寫迴圈去跑之外,意外找到這個不錯的方法:

SELECT * FROM
    (SELECT *, CHECKSUM(*) AS chk FROM tbl1) a
INNER JOIN
    (SELECT *, CHECKSUM(*) AS chk FROM tbl2) b
ON a.pkey = b.pkey AND a.chk <> b.chk

紅色的部份記得改為自己需要的TABLE及TABLE NAME。
目前測試的結果,好像在2008以上,才可以使用這種方式,不是很確定2005行不行。

2013年2月6日 星期三

沒有發票機,透過網路型出單機開錢櫃的解決方法


  這段實在很重要,對於VB6的程式來說,要開錢櫃,在有接發票機的情形下,直接輸出LPT即可,,沒有發票機時只能透過熱感式出單機協助。但現在有些熱感式出單機是網路型的,直接輸出LPT就沒用了。

  所以,當你的電腦接網路,網路接出單機,而出單機再接錢櫃時,下列的範例就是很好用的C#程式,以我的狀況是,用C#寫一支下列程式,呼叫下面這個Class,打開錢櫃後就自動結束程式;接著在VB6呼叫這隻程式,就可以很開心的在沒有發票機的狀況下打開錢櫃啦~

PS:很抱歉,這段資料的來源我忘了保留下來了,如果有人知道,也可以告訴我,我會立即補上出處的,感謝~
using System;
using System.Drawing;
using System.Drawing.Printing;
using System.IO;
using System.Windows.Forms;
using System.Runtime.InteropServices;
class RawPrinterHelper
    {
        // Structure and API declarions:
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
        public class DOCINFOA
        {
            [MarshalAs(UnmanagedType.LPStr)]
            public string pDocName;
            [MarshalAs(UnmanagedType.LPStr)]
            public string pOutputFile;
            [MarshalAs(UnmanagedType.LPStr)]
            public string pDataType;
        }
        [DllImport("winspool.Drv", EntryPoint = "OpenPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool OpenPrinter([MarshalAs(UnmanagedType.LPStr)] string szPrinter, out IntPtr hPrinter, IntPtr pd);

        [DllImport("winspool.Drv", EntryPoint = "ClosePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool ClosePrinter(IntPtr hPrinter);

        [DllImport("winspool.Drv", EntryPoint = "StartDocPrinterA", SetLastError = true, CharSet = CharSet.Ansi, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool StartDocPrinter(IntPtr hPrinter, Int32 level, [In, MarshalAs(UnmanagedType.LPStruct)] DOCINFOA di);

        [DllImport("winspool.Drv", EntryPoint = "EndDocPrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool EndDocPrinter(IntPtr hPrinter);

        [DllImport("winspool.Drv", EntryPoint = "StartPagePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool StartPagePrinter(IntPtr hPrinter);

        [DllImport("winspool.Drv", EntryPoint = "EndPagePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool EndPagePrinter(IntPtr hPrinter);

        [DllImport("winspool.Drv", EntryPoint = "WritePrinter", SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        public static extern bool WritePrinter(IntPtr hPrinter, IntPtr pBytes, Int32 dwCount, out Int32 dwWritten);

        // SendBytesToPrinter()
        // When the function is given a printer name and an unmanaged array
        // of bytes, the function sends those bytes to the print queue.
        // Returns true on success, false on failure.
        public static bool SendBytesToPrinter(string szPrinterName, IntPtr pBytes, Int32 dwCount)
        {
            Int32 dwError = 0, dwWritten = 0;
            IntPtr hPrinter = new IntPtr(0);
            DOCINFOA di = new DOCINFOA();
            bool bSuccess = false; // Assume failure unless you specifically succeed.

            di.pDocName = "My C#.NET RAW Document";
            di.pDataType = "RAW";

            // Open the printer.
            if (OpenPrinter(szPrinterName.Normalize(), out hPrinter, IntPtr.Zero))
            {
                // Start a document.
                if (StartDocPrinter(hPrinter, 1, di))
                {
                    // Start a page.
                    if (StartPagePrinter(hPrinter))
                    {
                        // Write your bytes.
                        bSuccess = WritePrinter(hPrinter, pBytes, dwCount, out dwWritten);
                        EndPagePrinter(hPrinter);
                    }
                    EndDocPrinter(hPrinter);
                }
                ClosePrinter(hPrinter);
            }
            // If you did not succeed, GetLastError may give more information
            // about why not.
            if (bSuccess == false)
            {
                dwError = Marshal.GetLastWin32Error();
            }
            return bSuccess;
        }

    }

Then use the following method to open the cash drawer
private void openCashDrawer()
        {
            //下面這行請改成錢櫃的指令
            byte[] codeOpenCashDrawer = new byte[] { 27, 112, 48, 55, 121 };
            IntPtr pUnmanagedBytes = new IntPtr(0);
            pUnmanagedBytes = Marshal.AllocCoTaskMem(5);
            Marshal.Copy(codeOpenCashDrawer, 0, pUnmanagedBytes, 5);
            //下面這行的第一個參數"EPSON xxxx" 請改成印表機名稱,名稱哦~~很方便的
            RawPrinterHelper.SendBytesToPrinter("EPSON TM-T88V Receipt Invoice", pUnmanagedBytes, 5);
            Marshal.FreeCoTaskMem(pUnmanagedBytes);
        }

iPhone iOS 6.1 JB + AppSyn 安裝極簡心得



0.把iPhone連接好電腦
1.先備份相片、音樂、通訊錄
2.先更新到 iOS 6.1 (之前就有JB的,在這裡可能會失敗,接著就只能還原重裝)
3.到 http://evasi0n.com 下載 JB程式 evasi0n
4.執行evasi0n,按下開始
5.evasi0n執行到一半會要求你 unlock,請記得是unlock,不是unplug...
6.unlock 完會要你去按一個icon,我忘了叫什麼了...
7.請先到Cydia去更新一個項目,同樣地,我也忘了名稱..

8.到此JB就算完成。


9.但 JB的人不會就這麼滿足的,比方說:我
10.到Cydia,搜尋並下載SBSetting
11.到Cydia,搜尋並下載Activator
12.到Cydia,增加軟體源 http://Cydia.myrepospace.com/Bl00dra1n
12-1.是 Bl零零dra壹n,不是Bl歐歐dra哀n,還有,這個網站有點慢,有時會加不太進去
13.加完之後,一樣在Cydia搜尋並下載AppSync for iOS 6
13-1.裝完後,拔出連接線再接回去,讓iTune可以開始同步
14.完成,這樣之前用Installous安裝,並且存在iTune的ipa,就可以再傳回iPhone用了~
14-1.有可能會出現要你輸入帳號密碼的畫面,按取消就好了

後記:
1.Background Remover 目前好像還不正常,會閃退,滿可惜的
2.我用的是iPhone 4,升級前版本是5.1.1 JB with RedSn0w。

20130216:Background Remover已修正了,到Cydia裡搜尋Remove Background,可以找到兩個,
一個是Remove Backgrounder,另一個Remove Backgrounder SBSetting,兩個都裝就可以一鍵清除背景程式了~


MS-SQL 無法刪除使用者 - 資料庫主體在資料庫中擁有 結構描述 且無法卸除。(Microsoft SQL Server, 錯誤: 15138) 在設定MSSQL時,很常把結構描述跟成員資格搞錯 這是結構描述 這是成員資格 成員資格是設定權限用的,結構描述...我不太清楚 X...