博文

目前显示的是 2020的博文

Android-Command line tools

 Android-Command line tools 1.mkdir Hello 2.cd Hello\ 3.mkdir src\dom\domain 4.vim src\dom\domain\SayingHello.java vim >  package dom.domain; import android.widget.TextView; public final class SayingHello extends android.app.Activity { public void onCreate( final android.os.Bundle activityState ) { super.onCreate( activityState ); final TextView textV = new TextView( SayingHello.this ); textV.setText( "Hello world" ); setContentView( textV ); } } vim > :wq 5.vim AndroidManifest.xml vim >  <?xml version='1.0'?> <manifest xmlns:a='http://schemas.android.com/apk/res/android' package='dom.domain' a:versionCode='0' a:versionName='0'> <application a:label='Saying hello'> <activity a:name='dom.domain.SayingHello'> <intent-filter> <category a:name='android.intent

Await - Async in C#

  await - async  in C# WPF Sample1:  without UI controll var webclient = new WebClient(); var downThread = new Thread( ()=> { var result = webclient.DownloadString("http://www.google.com"); MessageBox.Show(result); }); downThread.Start(); Sample2: still without UI controll. runButton.IsEnabled= false; var webclient = new WebClient(); var downThread = new Thread( ()=> { var result = webclient.DownloadString("http://www.google.com"); MessageBox.Show(result); }); downThread.Start(); runButton.IsEnabled= true; Sample3: error. runButton.IsEnabled= false; var webclient = new WebClient(); var downThread = new Thread( ()=> {     var result = webclient.DownloadString("http://www.google.com");     MessageBox.Show(result);     runButton.IsEnabled= true;  // is going to crash. error . }); downThread.Start(); Sample4: Dispatcher.Invoke runButton.IsEnabled= false; var webclient = new WebClient(); var downThread = new Thread( ()=> {     var result = webclien

Jackson in Java for JSON

Jackson, https://github.com/FasterXML/jackson Jackson has been known as "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java". Jackson 3 core libs:streaming,databind,annotations. Jackson version: 1.x: org.codehaus.jackson.xxx;  2.x: com. fastxml .jackson.xxx To capitalize the first letter, you need the following: 1. Maven adds: <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.5.3</version> </dependency> 2. Add to the attributes: @JsonProperty( "Code") 3. Add to the Getter method: @JsonIgnore To implement toString()  import com.alibaba.fastjson.annotation. JSONField ; import com.fasterxml.jackson.annotation. JsonIgnore ; import com.fasterxml.jackson.annotation. JsonProperty ; import net.sf.json.JSONObject ; @Override public String toString () { return JSONObje

Believe in Yourself By Emily Matthews

Believe in Yourself   --By Emily Matthews Believe in yourself in the power you have to control your own life, day by day, Believe in the strength that you have deep inside, and your faith will help show you the way. Believe in tomorrow and what it will bring let a hopeful heart carry you through, For the things will work out if you trust and believe there's no limit to what you can do.

Dropzone

https://www.dropzonejs.com/ Issues: https://github.com/enyo/dropzone/issues/873 http://jsfiddle.net/krmgk883/ https://stackoverflow.com/questions/20533191/dropzone-js-client-side-image-resizing Import css and dropzone.js <div class="row"> <div class="col-sm-20 well"> <form action="@Url.Action("_UploadImages", "Notebooks", new { unique = Model.UniqueId })" method="post" enctype="multipart/form-data" class="dropzone" id="my-dropzone"></form> </div> </div> <script type="text/javascript"> Dropzone.options.myDropzone = { url: '@Url.Action("_UploadImages", "Notebooks", new { unique = Model.UniqueId })', autoProcessQueue: true, uploadMultiple: true, parallelUploads: 3, maxFilesize: 10, resizeWi

process.env in Node.js

process | Node.js http://nodejs.cn/api/process.html process is a global  object http://nodejs.cn/api/process.html#process_process_env demo in script: if (process.env.NODE_ENV === 'production') { module.exports = require('./prod.js') } else { module.exports = require('./dev.js') } input "node" line commend node > process.env  // show value On Windows: set test=testValue on OS X or Linux: export test=testValue In js file process.env.test= 'dev'; package.json: "scripts": { "start": "set test=dev && node app.js" } ------------------------ Windows environment variant cmd > set test-env   // exit set test-env=production set path=%path%;C:\web;C:\Tools set test-env= my computer -> property -> advance -> environment variant... ---------------------- Linux echo $test-env     //check value of test-env // set value of test-env export test-env=production # attach va

Inside Ethereum Transactions -

图片
#3 · Inside Ethereum Transactions source :  https://www.dappuniversity.com/articles/web3-js-intro This is the third video in the 8-part tutorial series. This video will show you how to create transactions on The Ethereum Blockchain with Web3.js. This lesson will go from beginner to slightly advanced. I'll show you what happens when an Etherum transaction is created, and I'll show you how to broadcast a transaction manually to the network with Web3.js. In addition to learning Web3.js, the purpose of this lesson is to help you understand the fundamentals about how transactions work on The Ethereum Blockchain. Whenever you create a transaction, you're writing data to the blockchain and updating its state. There are several ways to do this, like sending Ether from one account to another, calling a smart contract function that writes data, and deploying a smart contract to the blockchain. We can get a greater understanding of these concepts by performing these actions w