Wednesday, August 21, 2019
ASP.NET 中的 Form
可能有些 old-school,現在我們都 post json format 到 server,但 project 裏有遇見過 form data 處理速度比 json 快的事例 (我還懵懂的在奇怪為甚麼 project 裏的 post request 在 network 的 xhr section 裏甚麼也看不到,多按幾次才發現按 "all" 就找到了,原來變成了 form data 在傳輸 ...),本着熟習 .net 的心態來學一下 form。
首先我們為一個 form 的頁面 (一個 view) 定義以下 ViewModel:
首先我們為一個 form 的頁面 (一個 view) 定義以下 ViewModel:
Tuesday, August 20, 2019
GULP
https://www.youtube.com/watch?v=vyI-Ko6fvKU
第一次接觸 gulp,項目都在用 webpack 壓縮才看得到結果,最後還是得研究 webpack,發現 --watch 這個 flag,再仔細查一下 gulp 如何啟用 watch 選項,最終{watch: true} 保全家 (不用只作小修改,整個 project 都得再壓縮一次)。 終於可以安心寫 jsx 了...
第一次接觸 gulp,項目都在用 webpack 壓縮才看得到結果,最後還是得研究 webpack,發現 --watch 這個 flag,再仔細查一下 gulp 如何啟用 watch 選項,最終{watch: true} 保全家 (不用只作小修改,整個 project 都得再壓縮一次)。 終於可以安心寫 jsx 了...
Saturday, August 17, 2019
For Code-First Approach in Entity Framework 6.0:
1 Setup. Entity Framework is more or less an analogue of Knex.js that accesses the database with "sequel like" methods. In knex we have
yarn knex migrate:make, yarn knex migrate:latest, etc, and they all have a counterpart in .net framework.
If our application is chosen to be "NO AUTHETICATION", we need to add a class file written as:Wednesday, August 14, 2019
Useful Links for my Work:
- Handle json file in C# using dynamic type:
https://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object
json format that C# framework can accept:"{test:\"test\",test2:2}" - Throughout introduction to MVC:
https://ithelp.ithome.com.tw/users/20105694/ironman/1329 - LINQ to SQL
https://dotblogs.com.tw/tsxz2009/2013/05/08/103155
Tuesday, August 13, 2019
Blog 復活
由以前研究數學,到突然想當美術,再到去大陸當美術之前,這個 blog 累積了不少內容。現在在香港當 developer,想嘗試把所學的東西整合放在這裏,也為了方便自己工作做個紀錄。例如怎様 init 一個 react project 都已經忘了 ...,如果以前有在這邊做紀錄的話就可以直接 copy and paste 了。也由於有在上 data science course 的關係,基於自己的數學背景沒有辦法不執着背後定理的證明(接受不了把定理當成理所當然),所以也會順便把有深入研究到的相關證明寫到這裏。
看到以前那些不堪入目的畫作 ...,練畫真的有血有淚啊。
為了熟習 C# 的 syntax 所以做了一些簡單的 Leetcode 題目,
以下測試 syntaxhighlighter,我的 code 是解答這題:
https://leetcode.com/problems/longest-substring-without-repeating-characters/
看到以前那些不堪入目的畫作 ...,練畫真的有血有淚啊。
為了熟習 C# 的 syntax 所以做了一些簡單的 Leetcode 題目,
以下測試 syntaxhighlighter,我的 code 是解答這題:
https://leetcode.com/problems/longest-substring-without-repeating-characters/
using System;
using System.Collections.Generic;
namespace Leetcode
{
public class Solution
{
public int LengthOfLongestSubstring(string s)
{
if (s.Length < 2)
{
return s.Length;
}
else
{
var resultingLengths = new List<int>();
for (int i = 0; i < s.Length - 1; i++)
{
int count = 1;
string substring = Convert.ToString(s[i]);
for (int j = i + 1; j < s.Length; j++)
{
if (substring.IndexOf(s[j]) != -1)
{
break;
}
else
{
substring += s[j];
count++;
}
}
resultingLengths.Add(count);
}
return resultingLengths.Max();
}
}
}
}
Friday, August 9, 2019
Subscribe to:
Posts (Atom)



