CS_2022_01

2022-1-3 08:33:52

  用OBS录完之后的视频是mkv格式的,PR不支持mkv格式的视频,于是需要转码,一开始用FFmpeg,有点不方便,但是也能用。后来一看OBS原本自带转码工具。
发现过程:
打开OBS,点击左下角的设置会出来这个窗口,就会看到有提示。
在这里插入图片描述

OBS转码方法:
打开左上角的文件,点击录像转封装
在这里插入图片描述

转换对应文件
dd

这里说明一下,mkv格式的文件应该不能说是一个正规的格式,他是一个封装格式,仅仅把视频音频打包起来

刚才pr导出的视频有横向水波条纹,原因是导出视频设置的问题,场序选择逐行

pr导出的视频有时会很大,导出的时候在导出窗口左侧勾选与序列设置匹配,也可以把格式设置成H264 也就是mp4格式。比特率调成适当大小,就会让视频尺寸变得很小

2022-1-6 10:49:03

  idea里面shift +ctrl + enter 就是自动补齐最后的分号

2022-1-6 15:38:50

  在yum更新的时候出现Error: rpmdb open failed 的错误,
直接输入下面命令

[root@localhost tmp]# rpm --rebuilddb     # 重建rpm数据库
[root@localhost tmp]# yum clean all     # 清除所有yum的缓存

建立sftp连接,就是服务器的用户名和密码和xshell的一样
在这里插入图片描述

2022-1-9 09:10:03

java迭代器对象,先实现Iterable<T>接口(注意不是Iterator<T>接口),重写iterator()方法,这个方法返回一个Iterator对象



public class SequenceList<T> implements Iterable<T>{
    /**
     * Returns an iterator over elements of type {@code T}.
     *
     * @return an Iterator.迭代器
     */
    @Override
    public Iterator<T> iterator() {
        return new SIterator();
    }


    public class SIterator implements Iterator {
        private int cur;
        public SIterator() {
            this.cur = 0;
        }

        @Override
        public boolean hasNext() {
            return cur < N;
        }

        @Override
        public T next() {
            return eles[cur++];
        }

        /**
         * Removes from the underlying collection the last element returned
         * by this iterator (optional operation).  This method can be called
         * only once per call to {@link #next}.  The behavior of an iterator
         * is unspecified if the underlying collection is modified while the
         * iteration is in progress in any way other than by calling this
         * method.
         *
         * @throws UnsupportedOperationException if the {@code remove}
         *                                       operation is not supported by this iterator
         * @throws IllegalStateException         if the {@code next} method has not
         *                                       yet been called, or the {@code remove} method has already
         *                                       been called after the last call to the {@code next}
         *                                       method
         * @implSpec The default implementation throws an instance of
         * {@link UnsupportedOperationException} and performs no other action.
         */
        @Override
        public void remove() {

        }
    }
}

2022-1-12 22:47:03

充电桩项目可以作为简历项目

2022-1-14 21:02:57

​ 想了意一想还是把这个放在本地感觉舒服一些。没有什么顾虑

泛型方法

public <E> E getProduct(ArrayList<E> arrayList) {
        return  arrayList.get(random.nextInt(list.size()));
}

bug:

在这里插入图片描述

IllegalArgumentException: Bound must be positive

fix :

出现这个错是因为代码参数的原因,比如:

int x=-1;
int num=new Random().nextInt(x);

x在nextInt方法中 必须大于0;然后就解决了

下面的 list 应该写成arrayList

在这里插入图片描述
可变泛型方法:

定义:

//泛型可变参数
    public static <E> void printAllType (E... e){
        for (E value : e) {
            System.out.println(value);
        }
    }

调用:

// 可变参数的泛型方法的调用
ProductGetter.printAllType(1,2,3,4,5);

2022-1-16 10:53:40

查找二叉树删除节点还需要思考

​ 删除节点,就不把右子树的最小节点拽下来了,直接把里面的值付给被删除节点,只删除右子树最小的节点,要不然查找被删除节点的父节点比较麻烦

教程里是删除之后返回一棵新树,我一直以为是返回被删除节点,或许返回一棵新树更好一些

2022-1-17 10:01:38

idea技巧:

修改方法名的时候不要直接修改方法名,用如下方法

光标在要修改的方法名上,点击右键

在这里插入图片描述

会出现和修改类名一样的refactor选项,选择里面的rename,它可以把调用这个方法的地方也一同修改
在这里插入图片描述

java队列用法:

import java.util.LinkedList;
import java.util.Queue;
 
public class Main {
    public static void main(String[] args) {
        //add()和remove()方法在失败的时候会抛出异常(不推荐)
        Queue<String> queue = new LinkedList<String>();
        //添加元素
        queue.offer("a");
        queue.offer("b");
        queue.offer("c");
        queue.offer("d");
        queue.offer("e");
        for(String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("poll="+queue.poll()); //返回第一个元素,并在队列中删除
        for(String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("element="+queue.element()); //返回第一个元素 
        for(String q : queue){
            System.out.println(q);
        }
        System.out.println("===");
        System.out.println("peek="+queue.peek()); //返回第一个元素 
        for(String q : queue){
            System.out.println(q);
        }
    }
}

2022-1-17 14:25:25

对于树来说BFS就是层次遍历

一个简单的二叉查找树的BFS案例:

//层次遍历
public Queue<K> BFS() {
    Queue<Node<K,V>> queue = new LinkedList<>();
    Queue<K> resultQueue = new LinkedList<>();
    queue.offer(this.root);
    while (!queue.isEmpty()) {
        Node<K, V> topNode = queue.poll();
        resultQueue.offer(topNode.key);
        if (topNode.leftChild != null) {
            queue.offer(topNode.leftChild);
        }
        if (topNode.rightChild != null) {
            queue.offer(topNode.rightChild);
        }
    }
    return resultQueue;
}

在这里插入图片描述

目前还没想出来标注分层的方法,这个仅仅是把这个树按照BFS的顺序把所有节点放入一个队列链表里面,之后可以在想输出的地方顺序输出

定义交换机和队列的配置信息一定要写在producer的xml里面,不能写错了

在这里插入图片描述
java通配符上限

在这里插入图片描述

java类型擦除,泛型信息只存在于代码编译阶段,在进入jvm之前,与泛型相关的信息会被擦除

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值