Here

Cocoapods 1.9.0 更新日志

谁说我不能喝 提交于 2020-03-09 18:57:07
CocoaPods 1.9 现在支持 “XCFrameworks”, “podspec支持基于配置的依赖”, “指定 schemes 的代码覆盖率”, “use_frameworks link自定义” XCFramework Support 推荐指数:*** 随着Xcode11,苹果引入的新的Bundle格.XCFramework. 这种支持多个不同的架构和平台类型的.framework捆绑到一个结构里面。 二进制依赖项也需要XCFrameworks来支持macOS Catalina中引入的新的Catalyst平台。 用法 Pod::Spec.new do |s| s.name = 'ToastLib' s.version = '1.0.0' # ...rest of attributes here s.vendored_frameworks = 'ButterLib.xcframework' end 如何创建xcframework参考视频 Configuration-based dependencies for Podspecs 推荐指数:** Podspecs也指出基于配置的依赖了 用法 Podfile修改 target 'BananaApp' do pod 'Toast', :configurations => ['Debug'] end Podspec修改 Pod:

javaWeb--(1)初识javaWeb

感情迁移 提交于 2020-03-07 19:37:28
第一个普通的javaWeb工程 步骤如下 1.在sts中新建一个Dynamic Web Project 2.在src下新建package与class 3.在WebContent下新建jsp文件 工程目录结构如下 test.jsp文件如下 <%@page import="com.test.javaweb.Car"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <% Car car = new Car(); System.out.println(car.getCarInfo()); %> </body> </html> 4.运行工程,在浏览器输入 http://localhost:8080

【SpringIOC容器初始化(一)】

心不动则不痛 提交于 2020-03-05 14:07:41
【SpringIOC容器初始化(一)】 1、 IOC容器是指的spring bean 工厂里面MAP存储结构,包含beanFactory、applicationContext工厂; 2、 beanFactory采取的延迟加载,第一次getBean时才会初始化Bean; applicationContext是加载完applicationContext.xml 就创建了具体的bean实例(只对BeanDefition中描述是单例的bean,才进行恶汉模式创建) 3、applicationContext接口常用实现类 classpathXmlApplicationContext : 它是从类的跟路劲下加载配置文件,推荐使用这种 FileSystemXmlApplicationContext: 它是从磁盘上加载配置文件,配置文件可以在磁盘的任意位置 AnnotationConfigApplicationContext : 当我们使用注解配置容器对象时,需要使用此类来创建 spring 容器。它用来读取注解。 4、步骤 4.1 new ClassPathXmlApplicationContext(),初始化ClassPathXmlApplicationContext public ClassPathXmlApplicationContext(String[] configLocations,

【原创】shell 操作之 read、cat 和 here document

◇◆丶佛笑我妖孽 提交于 2020-02-29 06:27:27
本文主要学习总结一下三方面问题: 通过 read 进行行读 here document here document 的应用 【read】 在 linux 下执行 man read 能看到如下内容 read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...] One line is read from the standard input, or from the file descriptor fd supplied as an argument to the -u option, and the first word is assigned to the first name, the second word to the second name, and so on, with leftover words and their intervening separators assigned to the last name. If there are fewer words read from the input stream than names, the remaining names are assigned

How to Round a Number to N Decimal Places in Java

。_饼干妹妹 提交于 2020-02-28 11:10:51
1. Overview In this short article, we're going to look at how to round a number to n decimal places in Java. 2. Decimal Numbers in Java Java provides two primitive types that can be used for storing decimal numbers: float and double . Double is the type used by default: 1 double PI = 3.1415 ; However, both types should never be used for precise values , such as currencies. For that, and also for rounding, we can use the BigDecimal class. 3. Formatting a Decimal Number If we just want to print a decimal number with n digits after decimal point, we can simply format the output String: 1 2 System

Spring Boot Tutorial – Bootstrap a Simple Application

折月煮酒 提交于 2020-02-28 11:06:57
1. Overview Spring Boot is an opinionated, convention-over-configuration focused addition to the Spring platform – highly useful to get started with minimum effort and create stand-alone, production-grade applications. This tutorial is a starting point for Boot – a way to get started in a simple manner, with a basic web application. We'll go over some core configuration, a front-end, quick data manipulation, and exception handling. 2. Setup First, let's use Spring Initializr to generate the base for our project. The generated project relies on the Boot parent: 1 2 3 4 5 6 < parent > < groupId

笔试编程

不打扰是莪最后的温柔 提交于 2020-02-28 10:58:24
二维数组中的查找 Q: 在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 A1: 遍历整个二维数组, O(n^2) A2: 从右上或者左下开始查找。从右上开始查找:如果数组中的数比这个整数大,向左移动一位,如果数组中的数比这个数小,向下移动一位, O(n) 。 # -*- coding:utf-8 -*- class Solution: # array 二维列表 def Find(self, target, array): # write code here num_row = len(array) num_col = len(array[0]) if not array: return False i, j = 0, num_col-1 while i < num_row and j >= 0: if array[i][j] < target: i += 1 elif array[i][j] > target: j -= 1 else: return True return False if __name__ == "__main__": array = [ [1,2,3,4], [2,3,4,5], [3,4,5,6] ] target

使用 try with resource 时遇到 IDE 报错的问题分析及解决办法

*爱你&永不变心* 提交于 2020-02-28 06:29:49
问题描述:为了方便后续对某些 IO 流的操作,我写了某个工具类,里面封装了一个关闭 IO 流的方法。JDK 1.7 之前只能纯手写去封装一块关闭 IO 流的功能代码块,略微麻烦: public static void copy(InputStream is, OutputStream os) { try { byte[] flush = new byte[1024 * 2]; int readLen; while ((readLen = is.read(flush)) != -1) { os.write(flush, 0, readLen); } os.flush(); } catch (IOException e) { e.printStackTrace(); } finally { close(is, os); } } public static void close(Closeable... ios) { for (int i = 0; i < ios.length; i++) { if (ios[i] != null) { try { ios[i].close(); } catch (IOException e) { e.printStackTrace(); } } } } JDK 1.7 及其之后的版本提供了 try with resource 这块语法糖, 编译器

Inheritance and Composition (Is-a vs Has-a relationship) in Java

三世轮回 提交于 2020-02-27 23:05:18
1. Overview Inheritance and composition — along with abstraction, encapsulation, and polymorphism — are cornerstones of object-oriented programming (OOP). In this tutorial, we'll cover the basics of inheritance and composition, and we'll focus strongly on spotting the differences between the two types of relationships. 2. Inheritance's Basics Inheritance is a powerful yet overused and misused mechanism. Simply put, with inheritance, a base class (a.k.a. base type) defines the state and behavior common for a given type and lets the subclasses (a.k.a. subtypes) provide specialized versions of

Chrome sendrequest错误:TypeError:将圆形结构转换为JSON

旧巷老猫 提交于 2020-02-27 08:07:10
我有以下... chrome.extension.sendRequest({ req: "getDocument", docu: pagedoc, name: 'name' }, function(response){ var efjs = response.reply; }); 该调用以下。 case "getBrowserForDocumentAttribute": alert("ZOMG HERE"); sendResponse({ reply: getBrowserForDocumentAttribute(request.docu,request.name) }); break; 但是,我的代码永远不会到达“ ZOMG HERE”,而是在运行 chrome.extension.sendRequest 抛出以下错误 Uncaught TypeError: Converting circular structure to JSON chromeHidden.JSON.stringify chrome.Port.postMessage chrome.initExtension.chrome.extension.sendRequest suggestQuery 有谁知道是什么原因造成的? #1楼 一种方法是从主要对象中剥离对象和功能。 并简化表格 function