Time of Update: 2016-06-29
標籤:mysql c linu 準備: 系統: ubuntu12.04 工具: gcc,mysql,libmysqlclient-dev測試代碼(檔案名稱:con_mysql.c):#include<mysql/mysql.h&
Time of Update: 2016-06-26
標籤:(期末考試快到了,所以比較粗糙,請各位讀者理解。。)一、 概念DBSCAN是一種產生劃分聚類的基於密度的聚類演算法,簇的個數由演算法自動地確定。低密度地區中的點被視為雜訊而忽略,因此DBSCAN不產生完全聚類。二、 虛擬碼1 將所有點標記為核心點、邊界點和雜訊點。2 刪除雜訊點。3
Time of Update: 2016-06-30
標籤: 使用word模板匯出word文檔,首先需要在word模板中插入書籤:根據建立的書籤名和位置,將需要寫入的內容插入到word檔案中。需要引用 Microsoft.Office.Interop.Word;在添加引用-程式集中搜尋可以找到。 using System;using System.Collections.Generic;using System.IO;using System.Linq;using
Time of Update: 2016-07-02
標籤: C# 6.0 加入了不少東西,C# 的 語言風格變得更好了,周末忙了一上午做了一個demo. 直接代碼上來完整代碼:#define ASYNCusing System;using System.Collections.Generic;using System.Diagnostics;using System.IO;using System.Text;using System.Threading.Tasks;using static
Time of Update: 2016-06-28
標籤:輸入每個人的中獎號碼,進行滾動顯示 //清屏 //隨即一個索引 // 根據索引列印 //等待0.1秒 Console.Write("請輸入參與者人數:"); &
Time of Update: 2016-06-28
標籤:1. string str = "32323";2. double a = (double)str ;3. double a = Convert.ToDouble(str); 第3行會轉換成功,第2行就會報錯,ToDouble方法會自動進行溢出檢查,但是為什麼第2行會失敗?轉換方法Method1: double.TryParseMethod2
Time of Update: 2016-06-28
標籤: /// <summary> /// 建立xml檔案 /// </summary> /// <param name="xmlDoc">xml</param> /// <returns></returns> public string CreateXml(string xmlDoc) { string
Time of Update: 2016-06-28
標籤:我們需要在XML與實體類,DataTable,List之間進行轉換,下面是XmlUtil類,該類來自網路並稍加修改。 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Data;using System.Xml;using System.Xml.Serialization;/// <summary>
Time of Update: 2016-06-29
標籤:Keywords: C# .NET BackgroundWorkerSource: http://txw1958.cnblogs.com/BackgroundWorker是.NET Framework 裡用來執行多線程任務的控制項,它允許開發人員在一個單獨的線程上執行一些操作。耗時的操作(如下載和資料庫事務)在長時間運行時可能會導致使用者介面 (UI)
Time of Update: 2016-07-01
標籤://定義類public class MyClass{public int Property1 { get; set; }}static void Main(){MyClass tmp_Class = new MyClass();tmp_Class.Property1 = 2;Type type = tmp_Class.GetType(); //擷取類型System.Reflection.PropertyInfo propertyInfo =
Time of Update: 2016-06-30
標籤:http://www.cnblogs.com/qingliuyu/p/3835858.html以下是C#下的日期與unix時間戳記的相互轉換:/// <summary>/// 日期轉換成unix時間戳記/// </summary>/// <param name="dateTime"></param>/// <returns></returns>public static long
Time of Update: 2016-06-26
標籤:Int ,float, double, char, string String.Length 是 唯讀, 不能賦值, string 是不可變得Stringbuilder 可以修改變數的資料 Var 實值型別和參考型別實值型別是值複製, 將一個變數複給另一個變數,會建立原始變數的記憶體副本,因此更改一個變數的值不會影響另一個變數。 方法調用時,行參不改變實參的值參考型別並不儲存值,而是儲存地址 可空修飾符: ? Int? a = null;
Time of Update: 2016-06-30
標籤:Program.cs中代碼如下:using System;using System.Collections.Generic;using System.Windows.Forms;namespace test1{ public static class Program { public static Main main; public static Main GetMain() { if (main == null
Time of Update: 2016-06-30
標籤:運行這個程式前需要先關閉Windows防火牆,Win7系統關閉防火牆的方法是在控制台的“控制台\系統和安全\Windows
Time of Update: 2016-06-28
標籤:stream為服務端接收的檔案流var bytes = new byte[stream.Length];stream.Read(bytes, 0, bytes.Length);// 設定當前流的位置為流的開始stream.Seek(0, SeekOrigin.Begin);var pathHead = HttpContext.Current.Request.PhysicalApplicationPath;if (!Directory.Exists(path))
Time of Update: 2016-06-26
標籤:寫在前面 在學非同步,有位園友推薦了《async in
Time of Update: 2016-06-25
標籤: 這次是對2.0的小修補,2.0互動幾乎沒有,這次添加了進度條,和文字框,同時由於取得的連結主要會出現錯誤是:webResponse錯誤。針對這種情況,設定了 try { webResponse = (HttpWebResponse)webRequest.GetResponse(); } catch(WebException ex)
Time of Update: 2016-06-28
標籤:劍指offer第四十七題:不能用加減乘除做加法 1 //============================================================================ 2 // Name : JZ-C-47.cpp 3 // Author : Laughing_Lz 4 // Version : 5 // Copyright : All Right Reserved 6 // Description :
Time of Update: 2016-06-25
標籤:導讀微軟開源了 Checked C ,這是一個 C 語言的擴充版本,可以用於解決 C 語言中的一系列安全相關的隱患。正如其名字所示,Checked C 為 C 語言增加了檢查,這個檢查可以協助開發人員檢查常見的編程錯誤,比如緩衝區侵佔buffer overruns、記憶體訪問越界、不正確的類型轉換等。這些編程錯誤往往是造成許多重大安全性漏洞的根本原因,比如破殼漏洞Shellshock、心臟出血漏洞Heartbleed、沙蟲Sandworm等。Checked C
Time of Update: 2016-06-25
標籤:微軟開源了 Checked C ,這是一個 C 語言的擴充版本,可以用於解決 C 語言中的一系列安全相關的隱患。正如其名字所示,Checked C 為 C 語言增加了檢查,這個檢查可以協助開發人員檢查常見的編程錯誤,比如緩衝區侵佔buffer overruns、記憶體訪問越界、不正確的類型轉換等。這些編程錯誤往往是造成許多重大安全性漏洞的根本原因,比如破殼漏洞Shellshock、心臟出血漏洞Heartbleed、沙蟲Sandworm等。Checked C 通過修改控制指標來解決這些問題,