Shannon
為甚麼有人要做工具類的東西?
[collections]
[caching]
[primitives support]
[concurrency libraries]
[common annotations]
[string processing]
POM.xml
裡面寫'''
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
'''
//use java
List<String> list = new ArrayList<String>();
list.add("aa");
list.add("bb");
list.add("cc");
String str = "";
for(int i=0; i<list.size(); i++){
str = str + "-" +list.get(i);
}
//str 为-aa-bb-cc
//use guava
List<String> list = new ArrayList<String>();
list.add("aa");
list.add("bb");
list.add("cc");
String result = Joiner.on("-").join(list);
//result为 aa-bb-cc
//use java
List<String> list = new ArrayList<String>();
String a = "1-2-3-4-5-6";
String[] strs = a.split("-");
for(int i=0; i<strs.length; i++){
list.add(strs[i]);
}
//use guava
String str = "1-2-3-4-5-6";
List<String> list = Splitter.on("-").splitToList(str);
//list为 [1, 2, 3, 4, 5, 6]
其他用法可以參考這裡:
Google guava工具类的介绍和使用
01 Introduction Welcome! Motivation 1 Security is an essential aspect of a web application. There could be a variety of security breaches that can happen if the web application has not addressed these during the design and development phase. The diagram below describes some common security vulnerabilities: Some Commom security vulnerabilities To mitigate a few of the above-described security vulnerabilities, we need to incorporate a secure authentication and authorization mechanism in our web application. We will learn about a few authentication and authorization mechanisms, along with the implementation of JSON web token-based (JWT) authentication. Motivation 2
Jul 15, 202201 CI/CD Introduction What is DevOps? DevOps is the combination of industry best practices, and set of tools that improves an organization’s ability to: Increase the speed of software delivery Increases the speed of software evolution Have better reliability of the software Have scalability using automation, Improved collaboration among teams. In other words, these tools enable a company to showcase industry best practices in software development.
Mar 1, 2022Introduction {%youtube i2pSr-MlCPU%} UI {%youtube 8IkNVrCqtvo%} Here's the commit with the changes made in this video. What We're Going to Build Now that we have an index.html file and all of the JavaScript code has been transferred over to script tags, let's start adding in a User Interface. Since our project has two pieces of state, we'll need two areas:
Aug 31, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up