博文

Comparison of C Sharp and Java

If you only take care about technical details, please read directly: https://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java. The following contents based my learning curve and work background show the difference between them.  I am a software engineer, not research and development(R & D) personnel ( the former is like a construction worker ). The technical support documents and tools are important for software projects and application development. The developer and after-sales service all need the technical support documents; Good tools are sure be better for working performance efficiency and construction quality. For the technical support documents, intuitive feelings are Microsoft's better than Oracl's.  Microsoft's documents is easy to read and to get started. The implementation in documents is described in the table below. Microsoft Oracle (Sun) Who (is the reader) Grade 6 must be a bachelor's degree or more ...

MySQL tips

1. no sub select ok: select t1.* from t1 join t2 on t1.id = t2.id no: select * from t1 where id (select id from t2 where name='anyname') 2. no function ok: select * from t1 where d>='2019-01-11' no: select * from t1 where YEAR(d) >= 2019 3.in better than or ok: select * from t where col1 in (30,10,20) no: select * from t where col1 =30 or col1=10 or col1=20 4.like no double %% ok: select * from t where name like 'n%' no: select * from t where name like '%n%' 5.select * from t where 1=1 limit 10; 6. select * from t where id=200 7.select  id,count(*) from t group by id ORDER BY NULL; 8. order by ok: select * from t where id>=ceil(RAND()*1000) limit 6; no: select * from t where 1=1 order by RAND() limit 6; 9. select count(*) from t left join t2 on t.id=t2.id 10.insert into t (id,name) values (1,'n1'),(2,'n2'),(3,'n3') CONVERT(char(10), [created], 120) = CONVERT(char(10), GETUTCDATE(), 120) mysql> use...

convertdatatypes

Today found 2 interesting web sites: 1. http://www.convertdatatypes.com/ 2. https://ascii.cl

ReWriteURL and Redirect in net core 2.1

Container: public class HomeController : Controller     {         public IActionResult Index()         {           //1 and 2 are without changing the URL in broswer           //1. HomeController aController = new HomeController();                 return aController.About();           //2.//"PageNotFound" must be in Shared view folder.               return View("PageNotFound").          //3 other changing the URL                 return View("Calls");            ...

Utils in Java

1.java.lang.System   https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html 2.org.apache.commons.lang.SystemUtils uses it. . getJavaHome().getJavaIoTmpDir().getUserDir().getUserHome() .JAVA_VERSION.OS_NAME.USER_TIMEZONE 3.org.apache.commons.lang.math.NumberUtils   http://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/math/NumberUtils.html  4.org.apache.commons.lang.StringUtils https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringUtils.html 5.org.springframework.beans.BeanUtils https://docs.spring.io/spring-framework/docs/5.1.3.RELEASE/javadoc-api/org/springframework/beans/BeanUtils.html 6.org.apache.commons.beanutils http://commons.apache.org/proper/commons-beanutils/javadocs/v1.9.3/apidocs/index.html http://commons.apache.org/proper/commons-beanutils/

JSON & C#

1. System.Text.Json.Utf8JsonReader ref: https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0  https://github.com/ysharplanguage/FastJsonParser#Overview 2. Newtonsoft.Json library  using NewTonsoft.Json; //Using Manage NuGet Packages installs Newtonsoft.Json .  Cat cat2 = new Cat(){name="hik",age=3};  string s1= Newtonsoft.Json.JsonConvert . SerializeObject (cat2);   Cat   cat3 = JsonConvert . DeserializeObject <Cat>(JSONstr);   string outStr2 = JsonConvert.SerializeObject(cat2); private string CapitalFirstLetter(string s)  {             try             {                 string rs = char.ToUpper(s[0]) + s.Substring(1);                 return r...

center element

<link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.aspnetcdn.com/ajax/bootstrap/3.3.7/bootstrap.min.js"></script> <style> .cssAmount{font-size:2em;} .col-center-block {     float: none;     display: table;     margin: 0 auto;     /* margin-left: auto; margin-right: auto; */ } .img-fluid{max-width:100%;height:auto} .rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important} .rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important} .rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}. rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important} .rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0...