This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.0000f; | |
double num_double = 12345.0000; | |
decimal num_decimal = 12345.0000m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F\", CultureInfo.InvariantCulture): " + num_float.ToString("F", CultureInfo.InvariantCulture)); | |
Console.WriteLine("num_double.ToString(\"F\", CultureInfo.InvariantCulture): " + num_double.ToString("F", CultureInfo.InvariantCulture)); | |
Console.WriteLine("num_decimal.ToString(\"F\", CultureInfo.InvariantCulture): " + num_decimal.ToString("F", CultureInfo.InvariantCulture)); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.0000f; | |
double num_double = 12345.0000; | |
decimal num_decimal = 12345.0000m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F2\"): " + num_float.ToString("F2")); | |
Console.WriteLine("num_double.ToString(\"F2\"): " + num_double.ToString("F2")); | |
Console.WriteLine("num_decimal.ToString(\"F2\"): " + num_decimal.ToString("F2")); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float num_float = 12345.00f; | |
double num_double = 12345.00; | |
decimal num_decimal = 12345.00m; | |
Console.WriteLine("Current Culture (default) : " + Thread.CurrentThread.CurrentCulture.Name); | |
Console.WriteLine("num_float.ToString(\"F\"): " + num_float.ToString("F")); | |
Console.WriteLine("num_double.ToString(\"F\"): " + num_double.ToString("F")); | |
Console.WriteLine("num_decimal.ToString(\"F\"): " + num_decimal.ToString("F")); | |
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace D004.同步設計披薩製作 | |
{ | |
class Program | |
{ | |
static async Task Main(string[] args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace D008.利用TAP工作建立大量並行工作練習 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using NSubstitute; | |
using System; | |
using System.Collections.Generic; | |
using System.Data.Linq; | |
using System.Linq; | |
namespace UnitTestProject8 | |
{ | |
[TestClass] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class OrderServiceTest | |
{ | |
[TestMethod] | |
public void CreateOrders() | |
{ | |
// Arrange | |
OrderService orderService = new OrderService(); | |
List<string> names = new List<string> { "Book", "Table", "Pen", "Mouse" }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:GridView | |
ID="GridView1" | |
runat="server" | |
DataSourceID="SqlDataSource1"> | |
<Columns> | |
<asp:TemplateField HeaderText="Text"> | |
<ItemTemplate> | |
<asp:TextBox ID="Text" runat="server" Text='<%# Bind("Text") %>'></asp:TextBox> | |
</ItemTemplate> | |
</asp:TemplateField> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:SqlDataSource | |
id="SqlDataSource1" | |
runat="server" | |
DataSourceMode="DataReader" | |
ConnectionString="Data Source=DESKTOP-SMGAGD2\SQLEXPRESS;Initial Catalog=XssTest;Integrated Security=True;Connection Timeout=20" | |
SelectCommand="SELECT Text FROM Table_1"> | |
</asp:SqlDataSource> | |
<asp:GridView | |
id="GridView1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public bool HasCycle(ListNode head) | |
{ | |
// case of 0 or 1 node | |
if (head == null || head.next == null) | |
return false; | |
ListNode slowPtr = head; | |
ListNode fastPtr = head.next; | |
while (fastPtr != slowPtr && fastPtr.next != slowPtr) | |
{ |
NewerOlder