原创 C#List轉字符串,字符串轉List,字符數組轉Int數組,字符串轉string,取某一位置字符等

List轉字符串 [C#] 純文本查看 複製代碼 01 02 List<string> List = new List<string>(); string strArray = string.Join(",",

原创 leetcode 3 : Longest Substring Without Repeating Characters 最長無重複子串 (C# 語言版)

Given a string, find the length of the longest substring without repeating characters. For example, the longest substri

原创 記第一次面試——求職在路上

    2016.04.25,我參加了生涯第一次工作面試。面試公司是清華同方威視,是一家專門做安檢硬軟件的公司,在該領域的造就還不錯。去之前其實很猶豫要不要去,因爲這家公司對我的邀請完全是機緣巧合。之前我曾投遞實習簡歷到另外一家公司,這家

原创 關於C# math的用法

最近在用.net寫樸素貝葉斯算法時,發現所有關於Math的函數參數值類型都爲double,這樣在進行浮點運算時精度無法得到保證。需要轉爲decimal。總結方法如下:<span style="font-size:14px;">for(in

原创 leetcode 15:3 Sum (C#語言版)

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in

原创 leetcode 16: 3 Sum closest (C#版)

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Retur

原创 C# 窗體Show和ShowDialog 方法的區別

轉自藍色閃電博客 http://bluelightning.blog.163.com/blog/static/58165320101272172456/ CenterParent                     窗體在其父窗體

原创 分類算法之樸素貝葉斯分類(Naive Bayesian classification)

1.1、摘要       貝葉斯分類是一類分類算法的總稱,這類算法均以貝葉斯定理爲基礎,故統稱爲貝葉斯分類。本文作爲分類算法的第一篇,將首先介紹分類問題,對分類問題進行一個正式的定義。然後,介紹貝葉斯分類算法的基礎——貝葉斯定理。最

原创 leetcode 344: Reverse String (c#版)

Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "ol

原创 leetcode 7: Reverse integer (C#版)

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 這題最初的思路是採用list的reverse功能,

原创 leetcode 14: Longest Common Prefix (C#版)

Write a function to find the longest common prefix string amongst an array of strings. 返回某字符串數組中最大的公共前綴字符串,比如(“my”,“myh

原创 C# 編程遇到An object reference is required for the non-static field, method, or property錯誤

在窗體代碼中創建靜態方法時,源代碼是這樣的 public int imageNum=0; 。。。。。。 public static int button1_clicknum() { retur

原创 leetcode 1:TwoSum (C#語言版)

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may ass

原创 leetcode 2: Add Two Numbers (C#語言版)

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each

原创 Python如何應用cx_Oracle獲取oracle中的clob字段

最近在用Python編寫連接數據庫獲取記錄的腳本,其中用到了cx_Oracle模塊。它的語法主要如下: cx_Oracle.connect('username','pwd','IP/HOSTNAME:PORT/TNSNAME') i