源码

2.3 MapReduce源码分析01

夙愿已清 提交于 2020-01-27 08:13:16
Map源码-Split 以下代码为了思路通顺进行过拆分整理 ---- 重在理解 //提交任务,等待任务完成并返回任务状态 job . waitForCompletion ( true ) ; //判断当前的状态 if ( state == JobState . DEFINE ) { //提交任务 submit ( ) ; } //监控任务的运行状态 if ( verbose ) { monitorAndPrintJob ( ) ; } //返回任务状态 return isSuccessful ( ) ; //-----------------------------submit(); //确认当前任务的状态 ensureState ( JobState . DEFINE ) ; //mapreduce1.x和2.x,但是2的时候将1的好多方法进行了优化 setUseNewAPI ( ) ; //获取当前任务所运行的集群 connect ( ) ; //Provides a way to access information about the map/reduce cluster. cluster = new Cluster ( getConfiguration ( ) ) ; //创建Job的提交器 final JobSubmitter submitter =

AS导入osmdroid源码6.1.5版本运行报错

偶尔善良 提交于 2020-01-27 07:57:32
AS导入osmdroid源码运行报错 ERROR: Connection reset Open File 一直提示这一行的问题 apply from: “https://raw.githubusercontent.com/gradle-fury/gradle-fury/v1.1.4/gradle/maven-support.gradle”,但没有具体提示信息。 ***解决方法 把项目的build.gradle 里的buildscript 和allprojects加上下面一句话 maven { url “http://maven.aliyun.com/nexus/content/repositories/jcenter”} 点击Sync Nowc重新编译就好了 来源: CSDN 作者: moon清泉 链接: https://blog.csdn.net/MoonAndroid/article/details/103629703

Win平台阅读Kafka源码时候使用bat脚本时候报错以及解决方案

末鹿安然 提交于 2020-01-27 05:57:14
问题1: 使用bat脚本报错: 解决方案: 在配置好kafka的server.properties文件后,cmd进入命令窗口输入命令:.\bin\windows\kafka-server-start.bat config\server.properties提示错误:错误: 找不到或无法加载主类 Files\Java\jdk1.8.0_111\lib;C:\Program 解决方式如下:在kafka安装目录中找到bin\windows目录中的kafka-run-class.bat找到142行为%CLASSPATH%加上双引号 修改前:set COMMAND=%Java% %KAFKA_HEAP_OPTS% %KAFKA_JVM_PERFORMANCE_OPTS% %KAFKA_JMX_OPTS% %KAFKA_LOG4J_OPTS% -cp %CLASSPATH% %KAFKA_OPTS% %* 修改后:set COMMAND=%JAVA% %KAFKA_HEAP_OPTS% %KAFKA_JVM_PERFORMANCE_OPTS% %KAFKA_JMX_OPTS% %KAFKA_LOG4J_OPTS% -cp "%CLASSPATH%" %KAFKA_OPTS% %* 问题2 当我们使用idea调试启动kafka之后,想要使用kafka-topics.bat创建脚本时候发现报错:

【darknet源码解析-28】图像RGB2YUV与YUV2RGB格式互转

天大地大妈咪最大 提交于 2020-01-27 04:38:59
本系列为darknet源码解析,由于在image.c中涉及到图像的RGB,YUV,HSV格式,在本文我们将image.c中涉及到的rgb_to_yuv()函数以及yuv_to_rgb()函数进行解析. RGB格式转为YUV格式 对应函数如下: void rgb_to_yuv(image im) { assert(im.c == 3); int i, j; float r, g, b; float y, u, v; for(j = 0; j < im.h; ++j){ for(i = 0; i < im.w; ++i){ r = get_pixel(im, i , j, 0); g = get_pixel(im, i , j, 1); b = get_pixel(im, i , j, 2); y = .299*r + .587*g + .114*b; u = -.14713*r + -.28886*g + .436*b; v = .615*r + -.51499*g + -.10001*b; set_pixel(im, i, j, 0, y); set_pixel(im, i, j, 1, u); set_pixel(im, i, j, 2, v); } } } YUV格式转化RGB格式 void yuv_to_rgb(image im) { assert(im.c == 3);

Spring5.0源码导入教程

假如想象 提交于 2020-01-27 04:01:16
1- 安装Gradle和下载Spring源码 前些天跟着老师学习spring源码,看着老师导入spring5.0源码一键成功,我在本机器上怎么导入怎么失败的。真的想砸电脑,估计我今天运气好被我导入成功了 。 Gradle 安装配置和JDK安装配置我这边就不写了,如果需要帮助的可以留言 。 spring下载地址:https://github.com/spring-projects/spring-framework 我在我本机器上导入报了这个错误,错误明细如下: **Spring源码编译报错:Can't find resource for bundle java.util.PropertyResourceBundle,key kotlin.gradle.testing.enabled。** 这个错应该是idea自身的问题,没有找到kotlin.gradle.testing.enabled这个配置。 1-1 IDEA util.jar 修改 找到IDEA 安装目录下的 util.jar 包,util.jar 包的目录 - > idea\IntelliJ IDEA 2018.2.3\lib 。这个目录下有一个util.jar 包拷贝到一个临时目录 1-2 解压util.jar 接下来我们用jar 命令来解压这个 util.jar 包 ,命令很简单 jar xvf ./util.jar 1

【Spring源码分析】AOP源码解析(上篇)

人走茶凉 提交于 2020-01-27 03:58:28
前言 前面写了六篇文章详细地分析了Spring Bean加载流程,这部分完了之后就要进入一个比较困难的部分了,就是AOP的实现原理分析。为了探究AOP实现原理,首先定义几个类,一个Dao接口: 1 public interface Dao { 2 3 public void select(); 4 5 public void insert(); 6 7 } Dao接口的实现类DaoImpl: 1 public class DaoImpl implements Dao { 2 3 @Override 4 public void select() { 5 System.out.println("Enter DaoImpl.select()"); 6 } 7 8 @Override 9 public void insert() { 10 System.out.println("Enter DaoImpl.insert()"); 11 } 12 13 } 定义一个TimeHandler,用于方法调用前后打印时间,在AOP中,这扮演的是横切关注点的角色: 1 public class TimeHandler { 2 3 public void printTime() { 4 System.out.println("CurrentTime:" + System

ros源码录包r程序编译时rosbag API报 undefined reference to `rosbag::Bag::close()'...

北城以北 提交于 2020-01-27 03:36:05
http://wiki.ros.org/rosbag/Code%20API http://docs.ros.org/melodic/api/rosbag_storage/html/c++/ https://github.com/sofiathefirst/imagesCpp/tree/master/bagdemo_ros_img writebag.cpp #include "ros/ros.h" #include "geometry_msgs/Point.h" #include <rosbag/bag.h> #include <std_msgs/Int32.h> #include <std_msgs/String.h> /** * This tutorial demonstrates simple sending of messages over the ROS system. */ int main(int argc, char **argv) { ros::init(argc, argv, "eyeInScreen"); /** * NodeHandle is the main access point to communications with the ROS system. * The first NodeHandle constructed will fully

SpringMVC框架源码解析之一:核心组件和执行流程

百般思念 提交于 2020-01-27 02:36:40
SpringMVC框架源码解析之一:核心组件和执行流程 SpringMVC框架这几年可以说是java语言中最热门的MVC框架了。在前后端分离的时代,就算不使用它来处理前端页面,但也是用它来提供Restful API。 Servlet的生命周期 在开始了解SpringMVC框架之前,先来了解下servlet生命周期: public interface Servlet { //应用容器(如tomcat)调用init方法,传入ServletConfig,来初始化servlet public void init(ServletConfig config) throws ServletException; ... //应用容器获取到http请求后,调用service方法对请求进行处理 public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException; ... //应用容器调用destroy方法,来销毁servlet public void destroy(); } 可以看到,servlet是在应用容器(如tomcat)中生存的,其生命周期由应用容器来管理。 servlet的init() 方法被设计成只调用一次。它在第一次创建 Servlet 时被调用

Properties-load()源码

微笑、不失礼 提交于 2020-01-26 21:34:13
public class Properties /** * Reads a property list (key and element pairs) from the input * byte stream. The input stream is in a simple line-oriented * format as specified in * {@link #load(java.io.Reader) load(Reader)} and is assumed to use * the ISO 8859-1 character encoding; that is each byte is one Latin1 * character. Characters not in Latin1, and certain special characters, * are represented in keys and elements using Unicode escapes as defined in * section 3.3 of * <cite>The Java™ Language Specification</cite>. * <p> * The specified stream remains open after this method returns. * *