自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

程序员光剑

AI 天才研究院和光剑读书创始人兼 CEO

  • 博客(58)
  • 资源 (6)
  • 收藏
  • 关注

原创 Android : 控制图片如何resized/moved来匹对ImageView的size

scaleType说明:android:scaleType是控制图片如何resized/moved来匹对ImageView的size。ImageView.ScaleType / android:scaleType值的意义区别:CENTER /center 按图片的原来size居中显示,当图片长/宽超过View的长/宽,则截取图片的居中部分显示CE...

2017-10-31 23:45:00 8528

原创 java.lang.SecurityException: Permission denied (missing INTERNET permission?)

E/AndroidRuntime: FATAL EXCEPTION: Thread-4Process: com.easy.kotlin, PID: 5384java.lang.SecurityException: Permission denied (missing INTERNET permission?)at java.net.Inet6Addr...

2017-10-31 20:34:00 10817

原创 Caused by: android.os.NetworkOnMainThreadException

问题:Caused by: android.os.NetworkOnMainThreadExceptionat android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1448)at java.net.Inet6AddressImpl.lookupHostByNa...

2017-10-31 19:45:00 9131

原创 Kotlin Compiler Plugins : All-open , Kotlin-spring,No-arg,Kotlin-jpa

Compiler PluginsAll-open compiler pluginKotlin has classes and their members final by default, which makes it inconvenient to use frameworks and libraries such as Spring AOP tha...

2017-10-30 22:35:00 9513

原创 20+个很棒的Android开源项目

20+个很棒的Android开源项目本文摘自文章: 20+ Awesome Open-Source Android Apps To Boost Your Development Skills.考虑到原文在墙外, 故分享在此, 希望让更多开发者看到.LeafPic难度: 初级.Open Source LeafPic图片和视频的Galle...

2017-10-29 10:48:00 8529

原创 第14章 使用Kotlin 进行 Android 开发(1)

第14章 使用Kotlin 进行 Android 开发(1)Kotlin Android根据Realm Report (2017-Q4,https://realm.io/realm-report/2017-q4) ,过去的一年在Android 端的开发:Java 从 95% 降低到 Java 85%, 而 Kotlin 从 5% 涨到 1...

2017-10-29 10:42:00 8634 4

原创 $ gradle packageDebug --stacktrace error: top-left corner pixel must be either opaque white or trans...

$ gradle packageDebug --stacktraceerror: top-left corner pixel must be either opaque white or transparent.Configure project :appConfiguration 'compile' in project ':app' is de...

2017-10-29 10:07:00 8874

原创 Android Studio 3.0 最新版本运行报错: Task 'package' is ambiguous in root project 'MyRobot'. Candidates are: ...

09:52:22.876 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed w...

2017-10-29 09:56:00 12605

原创 Error:top-left corner pixel must be either opaque white or transparent.

Error:top-left corner pixel must be either opaque white or transparent.Information:Gradle tasks [:app:assembleDebug]Error:top-left corner pixel must be either opaque white or tr...

2017-10-29 09:37:00 10364 1

原创 HTML DOM clearInterval() 方法

HTML DOM clearInterval() 方法HTML DOM Window 对象定义和用法clearInterval() 方法可取消由 setInterval() 设置的 timeout。clearInterval() 方法的参数必须是由 setInterval() 返回的 ID 值。语法clearInterval(id_of_set...

2017-10-27 18:04:00 8573

原创 干货来袭,推荐几款开源的Kotlin的Android项目

Google IO大会,谷歌宣布,将Kotlin语言作为安卓开发的一级编程语言。刷新Android的各大论坛,朋友圈,微信群。是时候总结一波Kotlin的Android项目了!废话不多说,直接上项目,别忘了star一波!1阅读精选Kotlin版https://github.com/LeeeYou/RsKotlin/阅读精选Kotlin版是一个由K...

2017-10-27 10:55:00 8605

原创 MySQL 查询一个表的大小

SELECT@mb := round((sum(DATA_LENGTH) + sum(INDEX_LENGTH)) / (1024 * 1024), 2),concat(@mb, 'MB')FROM information_schema.tablesWHERE table_schema = 'sotu';

2017-10-27 02:30:00 8628

原创 MySQL 直接存储图片并在 html 页面中展示,点击下载

数据库实体类:package com.easy.kotlin.picturecrawler.entityimport java.util.*import javax.persistence.*@Entity@Table(indexes = arrayOf( Index(name = "idx_url", unique = tr...

2017-10-27 02:10:00 10949

原创 第13章 Kotlin 集成 SpringBoot 服务端开发(2)

13.2.10 搜索关键字管理本节我们开发爬虫爬取的关键字管理的功能。数据库实体类首先,新建实体类SearchKeyWord 如下package com.easy.kotlin.picturecrawler.entityimport java.util.*import javax.persistence.*@Entity@Table(...

2017-10-26 23:03:00 8476

原创 JPA 原生CRUD 语句

jpa 原生insert的sql语句:@Modifying@Query(value = "insert into t_sys_org_user(org_id,user_id) values(?1,?2)",nativeQuery = true)int addUserToOrg(Long orgId,Long userId);jpa 原生delet...

2017-10-25 23:38:00 8518

原创 JPA 执行update/delete query 需要加上事务

Caused by: org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Execut...

2017-10-25 23:09:00 9485

原创 MySQL constraint unique Key 最大长度是 1000 bytes

mysql> alter table search_key_word add constraint idx_key_word unique (key_word);ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes

2017-10-25 20:58:00 10150

原创 JPA 注解学习

最近学习hibernate注解形式配置POJO类,将注解的解析记下来,以备以后使用。例1.@Entity@Table(name="user") public class Flight implements Serializable { Long id; @Id @GeneratedValue(generator="g...

2017-10-25 14:47:00 8515

原创 Cron表达式范例:每隔5秒执行一次:*/5 * * * * ?

Cron表达式范例: 每隔5秒执行一次:*/5 * * * * ? 每隔1分钟执行一次:0 */1 * * * ? 每天23点执行一次:0 0 23 * * ? 每天凌晨1点执行一次:0 0 1 * * ? 每月1号凌晨...

2017-10-24 23:39:00 57212

原创 第13章 Kotlin 集成 SpringBoot 服务端开发(1)

第13章 Kotlin 集成 SpringBoot 服务端开发本章介绍Kotlin服务端开发的相关内容。首先,我们简单介绍一下Spring Boot服务端开发框架,快速给出一个 Restful Hello World的示例。然后,我们讲下 Kotlin 集成 Spring Boot 进行服务端开发的步骤,最后给出一个完整的 Web 应用开发实例。13....

2017-10-24 16:43:00 8761 1

原创 Linux 查看文件夹下面文件大小的命令: $ du -sh ./*

$ du -sh ./*93M ./AndroidStudioProjects1.0M ./Applications153M ./Desktop856M ./Documents1.6G ./Downloads68K ./IdeaProjects4.0K ./JEDITdu: ./Library/Sa...

2017-10-23 14:14:00 8514

原创 UML类图关系(泛化 、继承、实现、依赖、关联、聚合、组合)

聚合是关联关系的一种特例,他体现的是整体与部分、拥有的关系,即has-a的关系,此时整体与部分之间是可分离的,他们可以具有各自的生命周期,部分可以属于多个整体对象,也可以为多个整体对象共享;组合也是关联关系的一种特例,他体现的是一种contains-a的关系,这种关系比聚合更强,也称为强聚合;其他的四者关系则体现的是类与类、或者类与接口间的引用、横向关系,是比较难区分的,有很多事物间的关系要想准备定位是很难的,前面也提到,这几种关系都是语义级别的,所以从代码层面并不能完全区分各种关系;

2017-10-23 12:29:00 8517 1

原创 第12章 元编程与注解、反射

第12章 元编程与注解、反射反射(Reflection)是在运行时获取类的函数(方法)、属性、父类、接口、注解元数据、泛型信息等类的内部信息的机制。这些信息我们称之为 RTTI(Run-Time Type Information,运行时类型信息) 。注解(Annotation)是我们给代码添加的元数据。使用注解可以写出更加简洁干净的代码,同时还可以在...

2017-10-23 00:03:00 8879

原创 第11章 运算符重载与约定

第11章 运算符重载与约定我们在《第2章 Kotlin 语法基础》中已经学习过关于运算符的相关内容,本章将继续深入探讨Kotlin中的运算符的重载与约定。通常一门编程语言中都会内置预定义的运算符(例如: + , - , * , / , == , != 等),这些运算符的操作对象只能是基本数据类型。而在实际的编程场景中有很多自定义类型,其实也有类似的...

2017-10-21 01:32:00 8589

原创 $('.tab-list-1-2-10').find('.tab').eq(count).trigger('click')

$(function () {var count = 0;setInterval(function(){count++;if(count==4){count = 0}$('.tab-list-1-2-10').find('.tab').eq(count).trigger('click');},10000)}) ...

2017-10-21 00:33:00 8849

原创 On the Rise of Kotlin

On the Rise of KotlinJUNE 20, 2017On the Rise of Kotlinhttps://blog.heroku.com/rise-of-kotlinJUNE 20, 2017Joe KutnerPOSTED BY JOE KUTNERIt’s rare when a highly structur...

2017-10-20 23:16:00 8494

原创 使用IDEA 自带的 MySQL UI 工具插件

比使用 WorkBench, Navicat更加方便!螢幕快照 2017-10-20 21.55.12.png

2017-10-20 21:58:00 10757

原创 java.lang.OutOfMemoryError: PermGen space

java.lang.OutOfMemoryError: PermGen spaceException: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler-Xms800m -Xmx1024m -XX:PermSize=512M -XX:MaxNewSize=256m...

2017-10-20 21:57:00 8573

原创 SQL中的DML、DDL以及DCL是什么?

SQL中的DML、DDL以及DCL是什么?DML(data manipulation language)是数据操纵语言:它们是SELECT、UPDATE、INSERT、DELETE,就象它的名字一样,这4条命令是用来对数据库里的数据进行操作的语言。DDL(data definition language)是数据定义语言:DDL比DML要多,主要的命令有...

2017-10-20 16:14:00 8495

原创 update issue a join TABLE b on on a.id=b.isid set a.group_date= b.groupDate

update issue a join TABLE b on on a.id=b.isid set a.group_date= b.groupDate<update id="batchUpdateIssueGroupDate"> <![CDATA[ ]]></update>u...

2017-10-20 14:05:00 8463

原创 mysql 中 You can't specify target table for update in FROM clause错误

mysql 中 You can't specify target table for update in FROM clause错误mysql中You can't specify target table <tbl> for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(...

2017-10-20 13:11:00 8435

原创 reverse 函数 与 substring_index 函数

select reverse(substring_index(reverse(substring_index((select dept_name from department where dept_no=20862), '-', 2)), '-', 1));select @a:=substring_index('信息平台事业部-企业运营平台部', '-...

2017-10-19 23:38:00 8927

原创 on duplicate key update

INSERT INTO issue_change(project_id, add_date, change_amount, base_line, gmt_create , gmt_modified)SELECT p.id project_id,date(i.commit_date) add_date,@changeAmount := count()...

2017-10-19 23:38:00 8625

原创 【Mac IDEA Java Web项目Tomcat启动报错】java.net.MalformedURLException: Local host name unknown...

java.net.MalformedURLException: Local host name unknown/Users/jack/soft/taobao-tomcat-7.0.68/bin/catalina.sh run[2017-10-19 09:39:26,744] Artifact swork.info.server:war exploded...

2017-10-19 21:46:00 8462

原创 [idea]Error:java: invalid source release: 1.8

出现问题回归正题,出现这个问题的状况是我的电脑本机装的默认jdk版本是1.8.0_71,然后我平常开发用的jdk版本是免安装的1.7,只配置了环境变量,平常用eclipse开发没有出现过这方面的问题,昨天idea也没有出现这个问题,结果今天新建了一个项目,然后设置好了jdk版本,tomcat也设置为了1.7,敲好代码之后已启动,就爆了这个错,如下:Er...

2017-10-19 21:39:00 8553

原创 人的一生该怎样度过?

人的一生该怎样度过?才能在临死的时候能够不后悔虚度这一辈子呢?

2017-10-18 21:45:00 8525 1

原创 第10章 使用 Kotlin 创建 DSL

第10章 使用 Kotlin 创建 DSL使用DSL的编程风格,可以让程序更加简单干净、直观简洁。当然,我们也可以创建自己的 DSL。相对于传统的API, DSL 更加富有表现力、更符合人类语言习惯。本章就让我们一起来学习一下 Kotlin中 DSL的相关内容。我们会首先介绍什么是DSL , 然后简单介绍 Kotlin DSL 设计中的特性支持,最后给...

2017-10-18 20:29:00 8627

原创 第9章 文件IO操作、正则表达式与多线程

第9章 文件IO操作、正则表达式与多线程我们在《第6章 扩展函数与属性》中已经介绍过Kotlin中的类扩展的特性。使用Kotlin的扩展函数功能,我们可以直接为 String 类实现一个 inc() 函数,这个函数把字符串中的每一个字符值加1"abc".inc() // bcd这个扩展函数实现如下fun String.inc(): String ...

2017-10-18 00:08:00 8518

原创 第8章 泛型 《Kotlin 项目实战开发》

第8章 泛型通常情况的类和函数,我们只需要使用具体的类型即可:要么是基本类型,要么是自定义的类。但是在集合类的场景下,我们通常需要编写可以应用于多种类型的代码,我们最简单原始的做法是,针对每一种类型,写一套刻板的代码。这样做,代码复用率会很低,抽象也没有做好。我们能不能把“类型”也抽象成参数呢?是的,当然可以。Java 5 中引入泛型机制,实现了“参数化类型”(Parameterized Type)

2017-10-17 10:11:22 8932

原创 第8章 泛型

第8章 泛型通常情况的类和函数,我们只需要使用具体的类型即可:要么是基本类型,要么是自定义的类。但是在集合类的场景下,我们通常需要编写可以应用于多种类型的代码,我们最简单原始的做法是,针对每一种类型,写一套刻板的代码。这样做,代码复用率会很低,抽象也没有做好。我们能不能把“类型”也抽象成参数呢?是的,当然可以。Java 5 中引入泛型机制,实现了“参数...

2017-10-16 23:49:00 8463 4

ClickHouse 高性能、可扩展和低成本的OLAP数据库 陈光剑 20230912

ClickHouse 设计哲学 具体问题具体分析 use good algorithms in a good context; 深入细节 dig into details; 度量指标 measure everything; 贴近生产环境 be close to production; 基准测试 do benchmarks, more of them; 不断试验、实践never stop experimenting; 大规模测试 test at scale; 大胆创新 do weird stuff; have fun! It is a database: A database has both a storage engine and a query engine. ClickHouse can efficiently ingest data from various sources and its query engine provides low-latency query responses. It is an OLAP database: An On-Line Analytic

2023-09-14

Will AI Fix Work? 工作节奏超过了我们的跟上能力 人工智能有望创造一种全新的工作方式

The pace of work is outpacing our ability to keep up. AI is poised to create a whole new way of working. 工作节奏超过了我们的跟上能力。人工智能有望创造一种全新的工作方式。 微软工作趋势指数年度报告( Work Trend Index Annual Report ) Key findings: The data points to three urgent insights business leaders must know now as they look to quickly and responsibly adopt AI. 1. Digital debt is costing us innovation: 64% of people have struggled with finding time and energy to get their work done, and those workers are 3.5x more likely to say they

2023-05-17

THE AI INDEX REPORT 人工智能指数报告 Measuring trends in Artificial Inte

THE AI INDEX REPORT 人工智能指数报告 Measuring trends in Artificial Intelligence 衡量人工智能的趋势 TOP TAKEAWAYS 最重要的要点 Industry races ahead of academia. 工业界领先于学术界。 Until 2014, most significant machine learning models were released by academia. Since then, industry has taken over. In 2022, there were 32 significant industry-produced machine learning models compared to just three produced by academia. Building state-of-the-art AI systems increasingly requires large amounts of data, compute, and money, resources

2023-04-06

四大常用限流算法原理详解:计数器固定窗口、计数器滑动窗口、漏桶、令牌桶算法.pdf

四大常用限流算法原理详解:计数器固定窗口、计数器滑动窗口、漏桶、令牌桶算法.pdf

2021-05-28

Kotlin Coroutines by Tutorials (1st Edition)

Kotlin Coroutines by Tutorials (1st Edition)

2021-04-28

Principles of programming languages by Gilles Dowek (auth.) (z-lib.org).pdf

Principles of programming languages by Gilles Dowek (auth.) (z-lib.org).pdf

2021-04-28

A Brief History of Artificial Intelligence

A Brief History of Artificial Intelligence What It Is, Where We Are, and Where We Are Going by Michael Wooldridge (z-lib.org).pdf

2021-04-28

An introduction to functional programming through lambda calculus.PDF.zip

Author: Michaelson, Greg Functional programming is rooted in lambda calculus, which constitutes the world's smallest programming language. This well-respected text offers an accessible introduction to functional programming concepts and techniques for students of mathematics and computer science. The treatment is as nontechnical as possible, and it assumes no prior knowledge of mathematics or functional programming. Cogent examples illuminate the central ideas, and numerous exercises appear throughout the text, offering reinforcement of key concepts. All problems feature complete solutions.

2019-09-22

《Kotlin项目实战开发》第3章+类型系统与可空类型

《Kotlin项目实战开发》 第3章 类型系统与可空类型 跟Java、C和C ++ 一样, Kotlin也是“静态类型编程语言”。 通常,编程语言中的类型系统中定义了  如何将数值和表达式归为不同的类型  如何操作这些类型  这些类型之间如何互相作用 我们在编程语言中使用类型的目的是为了让编译器能够确定类型所关联的对象需要分配多少空间。 在每一个编程语言中,都有一个特定的类型系统。静态类型在编译时期时,就能可靠地发现类型错误。因此通常能增进最终程序的可靠性。 类型系统在各种语言之间有非常大的不同,主要的差异存在于编译时期的语法,以及运行时期的操作实现方式。 本章我们简单介绍一下Kotlin的类型系统。

2017-09-30

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除