長官:(走過來前輩座位旁)某人有這議題,我們一起討論開個會討論
前輩:有不了解叫他自己和我談,這會我不去開
長官:(鬼打牆。。。)某人就是不懂所以要開會呀
前輩:(大聲)有問題打電話來談,不然我對外宣稱因為某甲有疑慮所以這議題沒法繼續下去
在一旁的我聽的心驚膽顫,長官的玻璃心應該又碎了
孟婆湯
某日,孟婆找到閻王說:「我這天天給人餵孟婆湯,掌管奈何橋,太無聊了,我要轉世投胎」
閻王說好:「你把這碗孟婆湯喝了,就去投胎吧」
孟婆喝了湯之後,閻王說:「從今以後你就叫孟婆,掌管奈何橋……」
Sublime快捷鍵
- http://shunnien.github.io/2016/02/23/sublimetext-shortcuts/
- https://easonwang01.gitbooks.io/web_basic/content/sublimekuai_jie_jian.html
How to use the Microsoft Outlook Object Library to send an HTML formatted message by using Visual C#
https://support.microsoft.com/zh-tw/help/310262/how-to-use-the-microsoft-outlook-object-library-to-send-an-html-formatted-message-by-using-visual-c
using System; using System.Reflection; // to use Missing.Value // TO DO: If you use the Microsoft Outlook 11.0 Object Library, uncomment the following line. // using Outlook = Microsoft.Office.Interop.Outlook; namespace SendHTMLMail { public class Class1 { public static int Main(string[] args) { try { // Create the Outlook application. Outlook.Application oApp = new Outlook.Application(); // Get the NameSpace and Logon information. Outlook.NameSpace oNS = oApp.GetNamespace("mapi"); // Log on by using a dialog box to choose the profile. oNS.Logon(Missing.Value, Missing.Value, true, true); // Alternate logon method that uses a specific profile. // TODO: If you use this logon method, // change the profile name to an appropriate value. //oNS.Logon("YourValidProfile", Missing.Value, false, true); // Create a new mail item. Outlook.MailItem oMsg = (Outlook.MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); // Set the subject. oMsg.Subject = "Send Using OOM in C#"; // Set HTMLBody. String sHtml; sHtml = "<HTML>\n" + "<HEAD>\n" + "<TITLE>Sample GIF</TITLE>\n" + "</HEAD>\n" + "<BODY><P>\n" + "<h1><Font Color=Green>Inline graphics</Font></h1></P>\n" + "</BODY>\n" + "</HTML>"; oMsg.HTMLBody = sHtml; // Add a recipient. Outlook.Recipients oRecips = (Outlook.Recipients)oMsg.Recipients; // TODO: Change the recipient in the next line if necessary. Outlook.Recipient oRecip = (Outlook.Recipient)oRecips.Add("email address"); oRecip.Resolve(); // Send. oMsg.Send(); // Log off. oNS.Logoff(); // Clean up. oRecip = null; oRecips = null; oMsg = null; oNS = null; oApp = null; } // Simple error handling. catch (Exception e) { Console.WriteLine("{0} Exception caught.", e); } // Default return value. return 0; } } }
[Mac]如何在Mac上使用SSH
https://blog.allenchou.cc/mac-ssh/
ssh 帳號@IP 如:ssh root@192.168.1.2
Putty for Mac
Install the App
- Press
Command+Space
and type Terminal and press enter/return key. - Run in Terminal app:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
and press enter/return key. Wait for the command to finish. - Run:
brew install putty
Done! You can now use putty
.
SQL Server中獲得EXEC的值
前言:
在資料庫程式開發的過程中,我們經常會碰到利用EXEC來執行一段需要返回某些值的sql語句(通常是構造動態sql語句時使用),或者在一個預存程序中利用EXEC調用另一個有傳回值的預存程序(必須獲得傳回值),那麼如何獲得這些傳回值呢?
1.EXEC執行sql語句的情況
declare @rsql Varchar(250) declare @csql Varchar(300) declare @rc Nvarchar(500) declare @cstucount int declare @ccount int set @rsql='(select Classroom_id from EA_RoomTime where zc='+@zc+' and xq='+@xq+' and T'+@time+'=''否'') and ClassroomType=''1''' --exec(@rsql) set @csql='select @a=sum(teststucount),@b=sum(classcount) from EA_ClassRoom where classroom_id in ' set @rc=@csql+@rsql exec sp_executesql @rc,N'@a int output,@b int output',@cstucount output,@ccount output--將exec的結果放入變數中的做法 --select @csql+@rsql
–select @cstucount上面的@rc這個sql語句的功能是找出特定時間段裡所有有空的教室數量以及這些教室所能容納的學生人數,因為涉及到動態的sql語句(@csql這句裡條件中有一個列名是動態變化的)的構造,所以要放在exec裡執行,但是同時我又要返回2個結果,所以執行時的代碼為:
exec sp_executesql @rc,N'@a int output,@b int output',@cstucount output,@ccount output--將exec的結果放入變數中的做法
這樣就將傳回值放到了,@cstucount,@ccount兩個變數中,得到了我們想要的結果。
2.exec執行帶傳回值的預存程序的情況
我們來看一個簡單的預存程序:
create procedure ProTest ( @name Varchar(10), @money int output ) as begin if(@name='1') set @money=1000 else set @money=2000 end
這個只是一個簡單的示例,這個預存程序返回的是@money 這個參數的值,那麼當我們在另外一個預存程序中調用此預存程序的時候如何獲取這個參數呢,方法如下:
declare @m int ---用來接收傳回值的變數 exec ProTest @name='1',@money=@m output --一定要注名是output
就這麼簡單,我們就獲得了傳回值,然後就可以利用它了。