- 博客(37)
- 资源 (4)
- 问答 (3)
- 收藏
- 关注
原创 JAVA并发编程2
该锁用以希望所有子线程结束后,才开始继续往下走结果CyclicBarrier每个子线程都等待在同一个地方,直到barrier内的线程执行完成,子线程才继续执行结果Semaphoresemaphore允许多个线程同时几个线程同时访问临界资源结果readwritelock不加锁的情况一个的写入不会等待另一个写入完成结果枷锁的情况加锁后,写之间不会被插入,读锁进入时,写锁不能进入,但是读锁的线程可以继续进入结果BlockingQueue队列是一个先进先出的数据结构,bl
2022-07-12 00:12:59
167
原创 JAVA并发编程2
JAVA并发编程CyclicBarrier每个子线程都等待在同一个地方,直到barrier内的线程执行完成,子线程才继续执行结果Semaphoresemaphore允许多个线程同时几个线程同时访问临界资源结果readwritelock不加锁的情况一个的写入不会等待另一个写入完成结果枷锁的情况加锁后,写之间不会被插入,读锁进入时,写锁不能进入,但是读锁的线程可以继续进入...
2022-06-30 00:22:03
142
原创 JAVA并发编程
Runnable没有返回值Callable有返回值进程和线程进程: 资源分配的最小单位,具有一定独立功能的程序关于某个数据集合的一次运行活动。它是操作系统动态执行的基本单元,在传统的操作系统中,进程既是基本的分配单元,也是基本的执行单元。线程:操作系统进行运算调度的最小单位,被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程并行执行不同的任务。同一进程中的多条线程将共享该进程中的全部系统资源,如虚拟地址空间,文件描述符和信号
2022-06-20 00:42:32
137
原创 spring-web
spring-webweb配置在servlet 3.1以后,可以通过代码的方式来配置DispatcherServlet,而不用配置在web.xml中。在Servlet 3.0环境中,容器会在类路径中查找实现javax.servlet.ServletContainerInitializer接口的类,如果发现就会用他来配置Servlet容器。Spring提供了这个接口的实现SpringServletContainerInitializer,这个类又会查找实现了webAppInitializerClasses
2021-05-24 00:29:16
242
原创 AOP实践
AOP自动装配方式开启自动装配package cooper.config;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.annotation.EnableAspectJAutoProxy;@Configuration@Enabl
2021-04-23 00:49:15
210
1
原创 spring装配
装配自动装配xml文件来开启扫描<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context
2021-04-05 23:43:43
467
原创 setting 文件 阿里云
<?xml version="1.0" encoding="UTF-8"?><!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownershi
2021-03-07 18:08:06
788
原创 编译Spark 3.0.1
编译Sprak 3.0.1前置要求mvn版本为3.6.3java版本 8mvn内存设置 export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g"命令参数设置通过-D传入依赖的版本-Dhadoop.version=3.2.1 指定hadoop的版本号通过-P激活对应的Profile-Pyarn 支持yarn-Phadoop-3.2 支持hadoop 3.2-Phive -Phive-thriftserver
2020-10-14 22:46:34
596
原创 Ubuntu 安装typora
1. 添加一个可信任的公钥,不添加的话不能顺利添加typora所在仓库sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA300B7755AFCFAE2. 添加typora所在仓库sudo add-apt-repository 'deb http://typora.io linux/'3. 更新下仓库所有链接sudo apt-get update4. 安装typorasudo apt-get install ty
2020-10-10 23:58:16
778
原创 创建一个maven工程
使用阿里云的setting文件注意修改本地仓库为自己有权限的仓库<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o.
2020-10-10 23:33:45
165
原创 Ubuntu 时钟与win同步
1. 下载ntpdate 与互联网时钟先进行一次同步sudo apt install ntpdate2. 与国内时钟源进行一次时间同步sudo ntpdate cn.pool.ntp.org3. 关闭与UTC时间的同步timedatectl set-local-rtc 1注:Ubuntu 16.04以上的关闭方法,本帖子较新相信都满足4. 将同步到的时间固化到硬件上sudo hwclock --localtime --systohc...
2020-10-07 00:03:41
308
原创 001markdown所有语法
hello二级标题三级标题四级标题五级标题六级标题一级标题二级标题markdown的段落没有特殊的格式,直接编辑就好,段落的换行是使用两个以上的空格加上回车字体可以用以下几种斜体文本放在星号之间,两边各有一个星号这是放在连个星号之间的内容,这样就有了斜体斜体文本也可以放在连个下划线之间这是放在两个下划线之间的内容,这样就有了斜体粗体文本放在星号之间,两边各有两个星号...
2020-03-01 14:56:02
744
原创 AddBigDigital
package com.szl.gettime;import java.util.Scanner;import java.util.Stack;public class AddBigDigital { public static void main(String[] args) { String strNum1; S
2016-08-26 11:45:34
409
原创 LeetCode 226. Invert Binary Tree
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1懒人就是交换递归/** * Definition for a binary tree node. * stru
2016-02-24 00:25:52
445
原创 LeetCode 104. Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.这个就是递归,不想太多/** * Definitio
2016-02-24 00:02:32
471
原创 LeetCode 258. Add Digits
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only
2016-02-23 23:43:31
459
原创 LeetCode 136. Single Number
Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using e
2016-02-23 22:54:14
369
原创 LeetCode 292. Nim Game
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the
2016-02-21 15:55:53
402
原创 ubuntu不给启动选项
裸机安装的的Linux系统编译内核后并不会给选项而是直接进入默认的第一个内核,这是因为自从某个版本的系统后,默认grub编译选项发生了变化,应该进入/etc/default目录,打开grub文件,将里边有关hidden的选项注释掉,把关于时间的选项更改为合适选择时间,最后更新grub就可以了# If you change this file, run 'update-grub' afterwa
2015-12-01 16:52:34
764
原创 X86_64写PGD_SHIFT,PUD_SHIFT,PMD_SHIFT,PTE_SHIFT,PAGE_SHIFT的值分别是
看内核代码时PGD_SHIFT,PUD_SHIFT,PMD_SHIFT,PTE_SHIFT,PAGE_SHIFT的值在很多地方都定义的有,而且还不太一样,真有点傻傻分不清,于是打印出来看看,方便以后使用这时在qemuX86_64下打印的,看来PTE_SHIFT这个值是个挺怪的值以后就不要用了
2015-07-17 09:57:25
1721
转载 WINDOWS下VIM配置
Windows下gvim配置原作地:http://hi.baidu.com/leemoncc/blog/item/a6be15cf40d7ab31b600c806.html0.准备软件及插件。(a)gvim72.exe地址ftp://ftp.vim.org/pub/vim/pc/gvim72.exe。(b)vimcdoc-1.7.0-setup.exe地http://prd
2014-09-25 22:55:50
931
原创 文件系统 文件锁 多进程
进程是一个具有一定独立功能的程序关于某个数据集的一次运行活动。每个进程都有自己独立的进程地址空间,包括正文段、初始化数据段、非初始化数据段、栈、堆。文本区域存储将要被执行的代码,数据区域存储变量,栈存储自动变量以及每次函数调用时所需保存的信息,堆用于动态分配内存。进程是操作系统执行的基本单元,对操作系统的各种资源进行访问,而进程对文件的访问尤为频繁。文件是具有符号的,在逻辑上具有完整意义的一组
2014-04-19 21:17:59
1944
转载 linux 更改启动项,及时间
在装好fedora后,便由grub来引导,不作选择则默认进入fedora。每次都在开机时选择一次,显然正常人都会不爽。 以下是一点小心得,仅献给和我一样的Linux新手。 用KEdit打开/boot/grub/grub.conf。我的如下:(#号为首的行为注释行) # grub.conf generated by anaconda # # Note that you d
2014-01-03 16:12:51
1215
原创 fedora 挂载ntfs格式文件系统失败
$ sudo yum install ntfsprogs$ sudo ntfsfix /dev/sdb4其中/sdb4应和提示的盘符一致
2013-12-21 20:19:09
1354
原创 qemu
QEMU常见使用使用vnc# qemu-kvm -m 512 -hda xp.img -net nic,macaddr=00:00:11:33:02:02 \ -net tap,ifname=tap2,script=/etc/init.d/qemu-ifup \ -localtime -vnc 172.16.70.30:2 --daemonize上面让kvm虚拟机在后台运行,并
2013-12-21 18:59:53
1718
原创 linux 压缩vmalloc区的虚拟空间
--- pgtable_64_types.h 2013-12-05 17:57:26.075566596 +0800+++ /buildroot/output/build/linux-3.11.8/arch/x86/include/asm/pgtable_64_types.h 2013-11-13 11:08:24.000000000 +0800@@ -56,14 +56,11 @@ /*
2013-12-09 16:22:29
1463
原创 linux 增加一个zone
--- old/include/linux/gfp.h 2013-11-12 22:08:24.000000000 -0500+++ new/include/linux/gfp.h 2013-12-03 14:07:59.067137000 -0500@@ -35,6 +35,7 @@ #define ___GFP_NO_KSWAPD 0x400000u #define ___GFP_OT
2013-12-09 15:06:20
2088
原创 我的Makefile
## Makefile for the linux pram-filesystem routines.#ccflags-y += -O0obj-y += nvmmfs.onvmmfs-y := super.o inode.o balloc.o dir.o namei.o symlink.o file.o pgtable.o ioctl.o nvmalloc.o
2013-12-09 14:58:03
788
原创 mkdir 系统调用
mkdir 传入的参数为:以使用命令: mkdir test01 为例,用户为rootp *dir= { i_mode = 17407, i_opflags = 7, i_uid = 0, i_gid = 0, i_flags = 0, i_op = 0xffffffff81415b00 , i_sb = 0xffff8800db014
2013-12-07 10:46:52
1060
原创 mkdir 系统调用
mkdir 系统调用起始于 fs/namei.cSYSCALL_DEFINE2(mkdir, const char __user *, pathname, umode_t, mode){ return sys_mkdirat(AT_FDCWD, pathname, mode);}该函数调用系统调用SYSCALL_DEFINE3(mkdirat, int, dfd, c
2013-12-06 22:37:49
2468
原创 NVM_INODE_ATTR_GET_SET
__le16 i_mode; /* File mode */ __le16 i_sum; /* checksum of this inode */ __le16 i_nlink; /* Links count */ __le16 i_bytes; /*the bytes in the last block */
2013-11-06 17:38:04
704
原创 Hadoop入门-单机伪分布式配置
为了配置的的方便建议先提升你的登录用户权限,本配置中凡是要在终端中输入的命令都用红色字体,需注意对应的目录用了色字体标出。 启用超级用户 sudo passwd root(然后输入你的超级用户密码)以后在终端中输入su,再输入该密码就可以 用超级用户登录了 提升用户权限命令,在终端中输入sudo gedit /etc/passwd 在文件末尾找到你的登录用户:我的是szllong:x:
2012-09-01 10:42:29
506
Hadoop入门-单机伪分布式配置
Hadoop入门-单机伪分布式配置为了配置的的方便建议先提升你的登录用户权限,本配置中凡是要在终端中输入的命令都用红色字体,需注意对应的目录用了色字体标出。启用超级用户 sudo passwd root(然后输入你的超级用户密码)以后在终端中输入su,再输入该密码就可以 用超级用户登录了提升用户权限命令,在终端中输入sudo gedit /etc/passwd在文件末尾找到你的登录...
2012-08-25 14:07:10
189
Namenode启动时,每个端口都去认证一次,且认证失败
2019-01-11
WIFI物理层是怎么识别信号的?
2017-05-06
TA创建的收藏夹 TA关注的收藏夹
TA关注的人