原创 c# wpf 通過控制檯打印輸出的兩種方法

1.用trace 開頭加 using System.Diagnostics; 中間使用 Trace.WriteLine(“text”); 2.改wpf工程的屬性 右鍵單擊項目,“屬性”,“應用程序”選項卡,將“輸出類型”更改爲“控

原创 python pandas 清空一個DataFrame表,保留表頭

有兩種寫法 df=df.drop(index=df.index) 或 df.drop(df.index, inplace=True) 這兩種都可以

原创 datetime的timedelta居然沒有hour和 minute

t1=datetime(2018,4,13) t2=datetime.now() print(type(t2-t1)) print("seconds",(t2-t1).seconds) print("days",(t2-t1).day

原创 c# 讀取json 的嵌套或多層嵌套數據的簡單姿勢

看了一些資料,感覺都很垃圾,或者廢話多,將自己搜尋的比較簡單的方法寫下。需要用NuGet安裝Newtonsoft.Json庫 json文件爲configWRC.json如下內容 {   "JiDianQi_IP": "192.168.1.

原创 python 刪除 DataFrame表的最後一行的正確方法

import pandas as pd import numpy as np df = pd.DataFrame(np.arange(12).reshape(3,4), columns=['A', 'B', 'C', 'D']) pri

原创 常見符號的對應英文

period:句號 comma:逗號 semicolon:分號 parentthesis:圓括號 exclamationpoint:感嘆號 apostrophe:撇號 quotemarks:引號 hyphen:連詞號 dash:中橫線 b

原创 asp.net獲得網站的當前目錄

        string sPath = System.Web.HttpContext.Current.Request.MapPath("/");//網站根目錄         string strReadFilePath = sPa

原创 c# 模擬qt的信號和槽的例子

用慣了qt的信號和槽,轉到c#覺得很彆扭。微軟擅長把簡單的東西設計的很複雜。不過吐吐也就習慣了。 下面的例子是一個公司裏面有職員和hr,職員要加薪,發射信號給hr和公司的例子。同時用到了平行傳遞和向上傳遞信號。 using System

原创 c# 使用console.writeline居然遇到阻塞

udp server裏接收數據裏的一段代碼           while (true)             {                               if (cts) break;              

原创 c# tcpclient 連接超時的設置

  比如timeOut爲1秒,BeginConnect是異步連接 var client = new TcpClient(); var result = client.BeginConnect("remotehost", this.Por