连云港做网站公司建设网站的网站空间

news/2025/9/29 16:03:32/文章来源:
连云港做网站公司,建设网站的网站空间,如何简单制作生理盐水,wordpress手机端编辑JAVA#xff1a;线程总结 目录 目录 JAVA#xff1a;线程总结 JAVA#xff1a;线程总结 01_多线程(多线程的引入)(了解) 02_多线程(多线程并行和并发的区别)(了解) 03_多线程(Java程序运行原理和JVM的启动是多线程的吗)(了解) 04_多线程(多线程程序实现的方式1)(掌握…JAVA线程总结 目录 目录 JAVA线程总结 JAVA线程总结 01_多线程(多线程的引入)(了解) 02_多线程(多线程并行和并发的区别)(了解) 03_多线程(Java程序运行原理和JVM的启动是多线程的吗)(了解) 04_多线程(多线程程序实现的方式1)(掌握) 05_多线程(多线程程序实现的方式2)(掌握) 06_多线程(实现Runnable的原理)(了解) 07_多线程(两种方式的区别)(掌握) 08_多线程(匿名内部类实现线程的两种方式)(掌握) 09_多线程(获取名字和设置名字)(掌握) 10_多线程(获取当前线程的对象)(掌握)  11_多线程(休眠线程)(掌握) 12_多线程(守护线程)(掌握) 13_多线程(加入线程)(掌握) 14_多线程(礼让线程)(了解) 15_多线程(设置线程的优先级)(了解) 16_多线程(同步代码块)(掌握) 17_多线程(同步方法)(掌握) 18_多线程(线程安全问题)(掌握) 19_多线程(火车站卖票的例子用实现Runnable接口)(掌握) 20_多线程(死锁)(了解) 21_多线程(以前的线程安全的类回顾)(掌握) 22_多线程(Timer)(掌握) 23_多线程(两个线程间的通信)(掌握) 24_多线程(三个或三个以上间的线程通信) 25_多线程(JDK1.5的新特性互斥锁)(掌握) 26_多线程(线程组的概述和使用)(了解) 27_多线程(线程的五种状态)(掌握) 28_多线程(线程池的概述和使用)(了解) 29_多线程(多线程程序实现的方式3)(了解) 01_多线程(多线程的引入)(了解) * * 1.什么是线程 * * 线程是程序执行的一条路径, 一个进程中可以包含多条线程 * * 多线程并发执行可以提高程序的效率, 可以同时完成多项工作 * * 2.多线程的应用场景 * * 红蜘蛛同时共享屏幕给多个电脑 * * 迅雷开启多条线程一起下载 * * QQ同时和多个人一起视频 * * 服务器同时处理多个客户端请求 * 2_多线程(多线程并行和并发的区别)(了解) * * 并行就是两个任务同时运行就是甲任务进行的同时乙任务也在进行。(需要多核CPU) * * 并发是指两个任务都请求运行而处理器只能按受一个任务就把这两个任务安排轮流进行由于时间间隔较短使人感觉两个任务都在运行。 * * 比如我跟两个网友聊天左手操作一个电脑跟甲聊同时右手用另一台电脑跟乙聊天这就叫并行。 * * 如果用一台电脑我先给甲发个消息然后立刻再给乙发消息然后再跟甲聊再跟乙聊。这就叫并发。03_多线程(Java程序运行原理和JVM的启动是多线程的吗)(了解) * * A:Java程序运行原理 * * Java命令会启动java虚拟机启动JVM等于启动了一个应用程序也就是启动了一个进程。 * 该进程会自动启动一个 “主线程” 然后主线程去调用某个类的 main 方法。 * * * B:JVM的启动是多线程的吗 * * JVM启动至少启动了垃圾回收线程和主线程所以是多线程的。 public class testThread1 {public static void main(String []args){for (int i 0; i 3000000 ; i) {new Demo();}for (int i 0; i 3000000 ; i) {System.out.println(主线程);}} } class Demo{Overrideprotected void finalize() {System.out.println(垃圾回收成功);} }04_多线程(多线程程序实现的方式1)(掌握) 多线程两种实现方式 (1)继承Thread* 定义类继承Thread* 重写run方法* 把新线程要做的事写在run方法中* 创建线程对象* 开启新线程, 内部会自动执行run方法 public class testThread2 {public static void main(String []args){Test tnew Test();//t.run(); //run()方法是普通方法要调用start()方法才会开始线程t.start();for (int i 0; i 3000000 ; i) {System.out.println(b);}} } class Test extends Thread{Overridepublic void run() {for (int i 0; i 3000000; i) {System.out.println(a);}} } 05_多线程(多线程程序实现的方式2)(掌握) (2)实现Runnable* 定义类实现Runnable接口* 实现run方法* 把新线程要做的事写在run方法中* 创建自定义的Runnable的子类对象* 创建Thread对象, 传入Runnable* 调用start()开启新线程, 内部会自动调用Runnable的run()方法 public class testThread3 {public static void main(String []args){Test1 tnew Test1();Thread tdnew Thread(t);td.start();for (int i 0; i 3000000 ; i) {System.out.println(b);}} } class Test1 implements Runnable{Overridepublic void run() {for (int i 0; i 300000 ; i) {System.out.println(a);}} } 06_多线程(实现Runnable的原理)(了解) 实现原理:     继承Thread    :    由于子类重写了Thread类的run(), 当调用start()时, 直接找子类的run()方法     实现Runnable:    构造函数中传入了Runnable的引用, 成员变量记住了它, start()调用run()方法时内部判断成员变量Runnable的引用是否为空, 不为空编译时看的是Runnable的run(),运行时执行的是子类的run()方法 07_多线程(两种方式的区别)(掌握) 优缺点:     继承Thread    :         好处:    可以直接使用Thread类中的方法,代码简单         弊端:    如果已经有了父类,就不能用这种方法     实现Runnable:         好处:    即使自己定义的线程类有了父类也没关系,因为有了父类也可以实现接口,而且接口是可以多实现的         弊端:    不能直接使用Thread中的方法需要先获取到线程对象后,才能得到Thread的方法,代码复杂 08_多线程(匿名内部类实现线程的两种方式)(掌握) public class testThread4 {public static void main(String []args){new Thread(){Overridepublic void run() {for (int i 0; i 300000 ; i) {System.out.println(a);}}}.start();new Thread(new Runnable() {Overridepublic void run() {for (int i 0; i 3000000 ; i) {System.out.println(b);}}}){}.start();} }09_多线程(获取名字和设置名字)(掌握) * * 1.获取名字 * * 通过getName()方法获取线程对象的名字 * * 2.设置名字 * * 通过构造函数可以传入String类型的名字 public class testThread5 {public static void main(String []args){//demo1();//通过setName()修改namenew Thread(){Overridepublic void run() {this.setName(杨大大);System.out.println(this.getName()a); //获取线程名字}}.start();}private static void demo1() {//通过构造方法给name赋值new Thread(杨大大){Overridepublic void run() {System.out.println(this.getName()a); //获取线程名字}}.start();new Thread(恒大大){Overridepublic void run() {System.out.println(this.getName()b);}}.start();} }10_多线程(获取当前线程的对象)(掌握) * * Thread.currentThread(), 主线程也可以获取 public class testThread6{public static void main(String []args){new Thread(杨大大){Overridepublic void run() {System.out.println(this.getName()a); //获取线程名字}}.start();new Thread(new Runnable(){Overridepublic void run() {System.out.println(Thread.currentThread().getName()b);}}){}.start();System.out.println(Thread.currentThread().getName());} }11_多线程(休眠线程)(掌握) * * Thread.sleep(毫秒,纳秒), 控制当前线程休眠若干毫秒1秒 1000毫秒 1秒 1000 * 1000 * 1000纳秒 1000000000 public class testThread7 {public static void main(String []args) throws InterruptedException {//demo1();new Thread(){Overridepublic void run() {for (int i 0; i 10; i) {try {Thread.sleep(1000);} catch (InterruptedException e) {e.printStackTrace();}System.out.println(a);}}}.start();new Thread(){Overridepublic void run() {for (int i 0; i 10 ; i) {try {Thread.sleep(1000);} catch (InterruptedException e) {e.printStackTrace();}System.out.println(b);}}}.start();}private static void demo1() throws InterruptedException {for (int i 20; i 0 ; i--) {Thread.sleep(1000);System.out.println(倒计时第i秒);}} }12_多线程(守护线程)(掌握) * * setDaemon(), 设置一个线程为守护线程, 该线程不会单独执行, 当其他非守护线程都执行结束后, 自动退出 * * public class testThread8 {public static void main(String []args){Thread t1new Thread(){Overridepublic void run() {for (int i 0; i 2 ; i) {System.out.println(this.getName()a);}}};Thread t2new Thread(){Overridepublic void run() {for (int i 0; i 20 ; i) {System.out.println(this.getName()b);}}};t2.setDaemon(true);t1.start();t2.start();} }13_多线程(加入线程)(掌握) * * join(), 当前线程暂停, 等待指定的线程执行结束后, 当前线程再继续 * * join(int), 可以等待指定的毫秒之后继续 public class testThread9 {public static void main(String []args){Thread t1new Thread(){Overridepublic void run() {for (int i 0; i 10 ; i) {System.out.println(this.getName()a);}}};Thread t2new Thread(){Overridepublic void run() {for (int i 0; i 10 ; i) {if (i2){try {t1.join();} catch (InterruptedException e) {e.printStackTrace();}}System.out.println(this.getName()b);}}};t1.start();t2.start();} }14_多线程(礼让线程)(了解) * * yield让出cpu public class testThread10 {public static void main(String []args){new Test2().start();new Test2().start();} } class Test2 extends Thread{Overridepublic void run() {for (int i 0; i 1000 ; i) {if (i%100){Thread.yield(); //让出cpu}System.out.println(this.getName()aaai);}} } 15_多线程(设置线程的优先级)(了解) * * setPriority()设置线程的优先级 public class testThread11 {public static void main(String []args){Thread t1new Thread(){Overridepublic void run() {for (int i 0; i 100; i) {System.out.println(this.getName()a);}}};Thread t2new Thread(){Overridepublic void run() {for (int i 0; i 100 ; i) {System.out.println(this.getName()b);}}}; // t1.setPriority(10); //设置最大优先级 // t2.setPriority(1);t1.setPriority(Thread.MIN_PRIORITY);t2.setPriority(Thread.MAX_PRIORITY);t1.start();t2.start();} }16_多线程(同步代码块)(掌握) * * 1.什么情况下需要同步 * * 当多线程并发, 有多段代码同时执行时, 我们希望某一段代码执行的过程中CPU不要切换到其他线程工作. 这时就需要同步. * * 如果两段代码是同步的, 那么同一时间只能执行一段, 在一段代码没执行结束之前, 不会执行另外一段代码. * * 2.同步代码块 * * 使用synchronized关键字加上一个锁对象来定义一段代码, 这就叫同步代码块 * * 多个同步代码块如果使用相同的锁对象, 那么他们就是同步的 public class testThread12 {public static void main(String []args){final Print pnew Print();new Thread(){Overridepublic void run() {while (true){p.print1();}}}.start();new Thread(){Overridepublic void run() {while (true){p.print2();}}}.start();} } class Print{test3 tnew test3();public void print1(){//synchronized (new test3())synchronized (t){ //同步代码块锁机制锁对象可以是任意的不是匿名对象因为匿名对象地址不一样System.out.print(传);System.out.print(智);System.out.print(播);System.out.print(客);System.out.print(\r\n);}}public void print2(){synchronized (t){System.out.print(用);System.out.print(心);System.out.print(创);System.out.print(造);System.out.print(\r\n);}} } class test3{}17_多线程(同步方法)(掌握) * * 使用synchronized关键字修饰一个方法, 该方法中所有的代码都是同步的 //非静态的同步方法的锁对象是什么? //锁对象是this //静态的同步方法的锁对象是什么? //锁对象是该类的字节码对象 //同步方法只需要在方法上加synchronized关键字即可 //同步代码块锁机制锁对象可以是任意的不是匿名对象因为匿名对象地址不一样 public class testThread13 {public static void main(String []args){final Print pnew Print();new Thread(){Overridepublic void run() {while (true){p.print1();}}}.start();new Thread(){Overridepublic void run() {while (true){p.print2();}}}.start();} } class Print1{test3 tnew test3();public synchronized void print1(){ //同步方法只需要在方法上加synchronized关键字即可synchronized (t){ //同步代码块锁机制锁对象可以是任意的不是匿名对象因为匿名对象地址不一样System.out.print(传);System.out.print(智);System.out.print(播);System.out.print(客);System.out.print(\r\n);}}public void print2(){synchronized (t){System.out.print(用);System.out.print(心);System.out.print(创);System.out.print(造);System.out.print(\r\n);}} } class test4{ }18_多线程(线程安全问题)(掌握) * * 多线程并发操作同一数据时, 就有可能出现线程安全问题 * * 使用同步技术可以解决这种问题, 把操作数据的代码进行同步, 不要多个线程一起操作 *需求:铁路售票,一共100张,通过四个窗口卖完. public class test1 {public static void main(String []args){new Ticket().start();new Ticket().start();new Ticket().start();new Ticket().start();} } class Ticket extends Thread{private int ticket100;Overridepublic void run() {while (true){synchronized (Ticket.class){if (ticket0){break;}try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();}System.out.println(this.getName()这是第ticket--票);}}} }19_多线程(火车站卖票的例子用实现Runnable接口)(掌握) public class test2 {public static void main(String []args){MyTicket tnew MyTicket();new Thread(t).start();new Thread(t).start();new Thread(t).start();new Thread(t).start();/*Thread t1new Thread(t);t1.start();t1.start();t1.start();t1.start();*/ //多次启动一个线程是非法的} } class MyTicket implements Runnable{private int ticket100;Overridepublic void run() {while (true){synchronized (Ticket.class){if (ticket0){break;}try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();}System.out.println(Thread.currentThread().getName()这是第ticket--票);}}} } 20_多线程(死锁)(了解) * * 多线程同步的时候, 如果同步代码嵌套, 使用相同锁, 就有可能出现死锁 * * 尽量不要嵌套使用 public class testThread14 {private static String s1筷子左;private static String s2筷子右;public static void main(String []args){new Thread(){Overridepublic void run() {while (true){synchronized (s1) {System.out.println(this.getName()获取 s1等待s2);synchronized (s2){System.out.println(this.getName()拿到s2开吃);}}}}}.start();new Thread(){Overridepublic void run() {while (true){synchronized (s2) {System.out.println(this.getName()获取 s2等待s1);synchronized (s1){System.out.println(this.getName()拿到s1开吃);}}}}}.start();} }21_多线程(以前的线程安全的类回顾)(掌握) // * A:回顾以前说过的线程安全问题 // * 看源码Vector,StringBuffer,Hashtable,Collections.synchroinzed(xxx) // * Vector是线程安全的,ArrayList是线程不安全的 // * StringBuffer是线程安全的,StringBuilder是线程不安全的 // * Hashtable是线程安全的,HashMap是线程不安全的22_多线程(Runtime类) public class testRunTime1 {public static void main(String []args) throws IOException {Runtime rRuntime.getRuntime();r.exec(shutdown -s -t 300);r.exec(shutdown -a);} }23_多线程(Timer)(掌握) public class testTimer1 {public static void main(String []args) throws InterruptedException {Timer tnew Timer();t.schedule(new MyTimerTask(),new Date(188,1,14,14,46,1),1);while (true){Thread.sleep(1000);System.out.println(new Date());}} } class MyTimerTask extends TimerTask{Overridepublic void run() {System.out.println(起床);} }24_多线程(两个线程间的通信)(掌握) * 1.什么时候需要通信* 多个线程并发执行时, 在默认情况下CPU是随机切换线程的* 如果我们希望他们有规律的执行, 就可以使用通信, 例如每个线程执行一次打印 * 2.怎么通信* 如果希望线程等待, 就调用wait()* 如果希望唤醒等待的线程, 就调用notify();* 这两个方法必须在同步代码中执行, 并且使用同步锁对象来调用public class testNotify1 {public static void main(String []args){final Print pnew Print();new Thread(){Overridepublic void run() {while (true){try {p.print1();} catch (InterruptedException e) {e.printStackTrace();}}}}.start();new Thread(){Overridepublic void run() {while (true){try {p.print2();} catch (InterruptedException e) {e.printStackTrace();}}}}.start();} }class Print {private int flag1;public void print1() throws InterruptedException {synchronized (this){if (flag!1){this.wait();}System.out.print(传);System.out.print(智);System.out.print(播);System.out.print(客);System.out.println(\r\n);flag2;this.notify(); //随机唤醒单个等待线程}}public void print2() throws InterruptedException {synchronized (this){if (flag!2){this.wait();}System.out.print(黑);System.out.print(马);System.out.print(程);System.out.print(序);System.out.println(\r\n);flag1;this.notify();}} } 25_多线程(三个或三个以上间的线程通信) * 多个线程通信的问题* notify()方法是随机唤醒一个线程* notifyAll()方法是唤醒所有线程* JDK5之前无法唤醒指定的一个线程* 如果多个线程之间通信, 需要使用notifyAll()通知所有线程, 用while来反复判断条件 1.在同步代码块中用哪个对象所锁就用哪个对象调用weit方法 *2.为什么wait和notify方法定义在Object? * 因为锁对象可以是任意的 * 3.sleep方法和wait方法的区别? * sleep方法必须传入参数参数是时间时间到了会自动醒来 * wait方法可以传入参数也可以不传入参数传入参数就是在参数的时间结束后等待v不传入参数就是直接等待 *sleep方法在同步函数或同步代码块中不释放锁 * wait方法在同步函数或同步代码块中释放锁 public class testNotify2 {public static void main(String []args){final Print2 pnew Print2();new Thread(){Overridepublic void run() {while (true){try {p.print1();} catch (InterruptedException e) {e.printStackTrace();}}}};new Thread(){Overridepublic void run() {while (true){try {p.print2();} catch (InterruptedException e) {e.printStackTrace();}}}};new Thread(){Overridepublic void run() {while (true){try {p.print3();} catch (InterruptedException e) {e.printStackTrace();}}}};} } class Print2 {private int flag1;public void print1() throws InterruptedException {synchronized (this){while (flag!1){this.wait();}System.out.print(传);System.out.print(智);System.out.print(播);System.out.print(客);System.out.println(\r\n);flag2;//this.notify(); //随机唤醒单个等待线程this.notifyAll();}}public void print2() throws InterruptedException {synchronized (this){while (flag!2){this.wait();}System.out.print(黑);System.out.print(马);System.out.print(程);System.out.print(序);System.out.println(\r\n);flag3;//this.notify();this.notifyAll();}}public void print3() throws InterruptedException {synchronized (this) {while (flag ! 3) { //线程3在此等待if在哪里等待就在哪里起来this.wait();} //while循环是循环判断每次都会判断System.out.print(i);System.out.print(t);System.out.print(hei);System.out.print(ma);System.out.println(\r\n);flag 1;//this.notify();this.notifyAll();}} }26_多线程(JDK1.5的新特性互斥锁)(掌握) * 1.同步* 使用ReentrantLock类的lock()和unlock()方法进行同步 * 2.通信* 使用ReentrantLock类的newCondition()方法可以获取Condition对象* 需要等待的时候使用Condition的await()方法, 唤醒的时候用signal()方法* 不同的线程使用不同的Condition, 这样就能区分唤醒的时候找哪个线程了public class testLock1 {public static void main(String []args){Print3 pnew Print3();new Thread(){Overridepublic void run() {try {p.print1();} catch (InterruptedException e) {e.printStackTrace();}}}.start();new Thread(){Overridepublic void run() {try {p.print2();} catch (InterruptedException e) {e.printStackTrace();}}}.start();new Thread(){Overridepublic void run() {try {p.print3();} catch (InterruptedException e) {e.printStackTrace();}}}.start();} } class Print3 {private ReentrantLock rnew ReentrantLock();private Condition c1r.newCondition();private Condition c2r.newCondition();private Condition c3r.newCondition();private int flag1;public void print1() throws InterruptedException{r.lock();if (flag!1){c1.await();}System.out.print(传);System.out.print(智);System.out.print(播);System.out.print(客);System.out.println(\r\n);flag2;//this.notify(); //随机唤醒单个等待线程c2.signal();r.unlock();}public void print2() throws InterruptedException {r.lock();if (flag!2){c2.await();}System.out.print(黑);System.out.print(马);System.out.print(程);System.out.print(序);System.out.println(\r\n);flag3;//this.notify();c3.signal();r.unlock();}public void print3() throws InterruptedException {r.lock();if (flag ! 3) { //线程3在此等待if在哪里等待就在哪里起来c3.await();} //while循环是循环判断每次都会判断System.out.print(i);System.out.print(t);System.out.print(hei);System.out.print(ma);System.out.println(\r\n);flag 1;//this.notify();c1.signal();r.unlock();} }27_多线程(线程组的概述和使用)(了解) * A:线程组概述* Java中使用ThreadGroup来表示线程组它可以对一批线程进行分类管理Java允许程序直接对线程组进行控制。* 默认情况下所有的线程都属于主线程组。* public final ThreadGroup getThreadGroup()//通过线程对象获取他所属于的组* public final String getName()//通过线程组对象获取他组的名字* 我们也可以给线程设置分组* 1,ThreadGroup(String name) 创建线程组对象并给其赋值名字* 2,创建线程对象* 3,Thread(ThreadGroup?group, Runnable?target, String?name) * 4,设置整组的优先级或者守护线程* B:案例演示* 线程组的使用,默认是主线程组public class testThreadGroup1 {public static void main(String []args){//demo1();ThreadGroup tgnew ThreadGroup(我是一个新的线程组); //创建新的线程组MyRunnable mrnew MyRunnable();Thread t1new Thread(tg,mr,张三);Thread t2new Thread(tg,mr,李四);System.out.println(t1.getThreadGroup().getName());System.out.println(t2.getThreadGroup().getName());}private static void demo1() {MyRunnable mrnew MyRunnable();Thread t1new Thread(mr,张三);Thread t2new Thread(mr,李四);ThreadGroup tg1t1.getThreadGroup();ThreadGroup tg2t2.getThreadGroup();System.out.println(tg1.getName());System.out.println(tg2.getName());} } class MyRunnable implements Runnable{Overridepublic void run() {for (int i 0; i 1000 ; i) {System.out.println(Thread.currentThread().getName()ai);}} } 28_多线程(线程的五种状态)(掌握) 29_多线程(线程池的概述和使用)(了解) * A:线程池概述* 程序启动一个新线程成本是比较高的因为它涉及到要与操作系统进行交互。而使用线程池可以很好的提高性能尤其是当程序中要创建大量生存期很短的线程时更应该考虑使用线程池。线程池里的每一个线程代码结束后并不会死亡而是再次回到线程池中成为空闲状态等待下一个对象来使用。在JDK5之前我们必须手动实现自己的线程池从JDK5开始Java内置支持线程池 * B:内置线程池的使用概述* JDK5新增了一个Executors工厂类来产生线程池有如下几个方法* public static ExecutorService newFixedThreadPool(int nThreads)* public static ExecutorService newSingleThreadExecutor()* 这些方法的返回值是ExecutorService对象该对象表示一个线程池可以执行Runnable对象或者Callable对象代表的线程。它提供了如下方法* Future? submit(Runnable task)* T FutureT submit(CallableT task)* 使用步骤* 创建线程池对象* 创建Runnable实例* 提交Runnable实例* 关闭线程池* C:案例演示public class testCallable1 {public static void main(String []args) throws ExecutionException, InterruptedException {ExecutorService pool Executors.newFixedThreadPool(2);FutureInteger f1pool.submit(new MyCallable(100)); //将线程放进线程池并执行FutureInteger f2pool.submit(new MyCallable(50));System.out.println(f1.get());System.out.println(f2.get());pool.shutdown();} } class MyCallable implements CallableInteger{private int num;public MyCallable(int num) {this.num num;}Overridepublic Integer call() throws Exception {int sum0;for (int i 1; i num ; i) {sum1;}return sum;} } 提交的是Callable * * 多线程程序实现的方式3的好处和弊端 * * 好处 * * 可以有返回值 * * 可以抛出异常 * * * 弊端 * * 代码比较复杂所以一般不用

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/921965.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

做网站开发 甲方提供资料网站建设特定开发

如果能用python代替Javascript编写基于浏览器的应用,该有多好啊。但是,Javascript是唯一一种能在浏览器里执行的语言(Flash或Silverlight除外)。换个思路,先用Python编写代码,然后在通过编译器转为为Javascript脚本,这…

黄金分割比

不会初中数学…… 定义:将线段分为两部分,满足较大部分(a)与整体(a+b)的比值等于较小部分(b)与较大部分的比值,即 \(\frac{a}{a+b} = \frac{b}{a}(a > b)\)。 \(a^2 = ab + b^2 \Rightarrow \frac{b^2}{a^…

how create rhel8 local repository server

Repository Server ConfigurationMount DVD.iso. Create DVD repo. [BaseOS] name=DVD_BaseOS enabled=1 gpgcheck=0 baseurl=file:///mnt/BaseOS [AppStream] name=DVD_AppStream enabled=1 gpgcheck=0 baseurl=file:…

对称加密和非对称加密原理对比

I will use the web search tool to find detailed explanations about the differences between asymmetric and symmetric encryption, including principles and specific cases. It seems the initial search didn…

借助Aspose.Email,使用 Python 读取 Outlook MSG 文件

Aspose.Email是一款企业级解决方案,可自动处理和转换电子邮件文件。无需Microsoft Outlook,以编程方式创建、读取和转换电子邮件文件格式。本指南将向您展示如何借助Aspose.Email使用Python读取 Outlook MSG文件。As…

痞子衡嵌入式:恩智浦i.MX RT1xxx系列MCU启动那些事(11.B)- FlexSPI NOR连接方式大全(RT1180)

大家好,我是痞子衡,是正经搞技术的痞子。今天痞子衡给大家介绍的是恩智浦i.MXRT1180的FlexSPI NOR启动的连接方式。这个 i.MXRT FlexSPI NOR 启动连接方式系列文章,痞子衡已经写过很多篇,把已面世的所有 i.MXRT 型…

文件同步工具深度测评(2025版):同步盘夺冠

为解决微信文件传输助手传输慢、无断点续传及数据安全风险等痛点,本文提供了坚果云同步盘解决方案。它凭借增量同步、全链路加密与断点续传技术,实现大文件安全、高效的多端同步与团队协作,是替代传统传输方式、升级…

20250929周一日记

20250929周一日记今日: 1.早上来截demo跑出来的3d模型图,刘送了个大企鹅,村里发金条了换了27寸显示器,帮师哥取了个大件。写了项目四文字整合好了汇报。 2.下午才去吃饭,吃的经典空投炸串锅塌里脊盖饭,去鹏翔充电…

Oracle故障处理:数据库启动时遇到ORA-01578错误

我们的文章会在微信公众号IT民工的龙马人生和博客网站( www.htz.pw )同步更新 ,欢迎关注收藏,也欢迎大家转载,但是请在文章开始地方标注文章出处,谢谢! 由于博客中有大量代码,通过页面浏览效果更佳。Oracle故障处…

建设网站过程视频dede查看网站

项目场景: 项目首页使用RadioGroupRadioButtonFragment实现页面切换,出现了一个问题fragment会出现重叠问题,就是一个fragment显示了两层, 并不是必现问题。 经过排查发现是项目主页面Activity被销毁重建了,但是之前…

【ACM出版|连续三届EI检索】第四届人工智能与智能信息处理国际学术会议(AIIIP 2025)

第四届人工智能与智能信息处理国际学术会议(AIIIP 2025)将于2025年10月24日-26日在中国-青岛举行。新一代人工智能理论的快速发展为信息处理技术的提供了新方法,促进了智能信息处理的发展与应用。智能信息处理是信号…

实用指南:梦回童年,将JSNES 游戏模拟器移植到 HarmonyOS 移植指南

实用指南:梦回童年,将JSNES 游戏模拟器移植到 HarmonyOS 移植指南pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: &quo…

单键触控感应芯片 电容是触控IC VKD233HS -永嘉微VINKA 原厂

VKD233HS是单通道触摸检测芯片,功耗低、工作电压范围 宽以及稳定的触摸检测效果可以广泛的满足不同应用的需求, 此触摸检测芯片是专为取代传统按键而设计,内建稳压电路, 提供稳定电压给触摸检测电路使用,触摸检测PAD…

文明网站建设方案深圳空间设计有限公司

JS字符串方法大全 JS-2490. 回环句 const list str.split( ); JS-2506. 统计相似字符串对的数目 words words.map(item > [...new Set(item)].sort().join())

CSS中多种边框的实现小窍门 - 教程

CSS中多种边框的实现小窍门 - 教程pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco&…

微算法科技(NASDAQ: MLGO)研发基于 DPoS 框架的 DL-DPoS(深度链接委托权益证明)机制,增强区块链的共识算法

随着区块链技术的广泛应用,传统共识算法在性能、激励机制等方面的局限性逐渐显现。DPoS机制虽有一定优势,但仍需进一步优化以适应复杂的应用场景和提高网络安全性。微算法科技(NASDAQ: MLGO)为提升区块链网络的整体…

treap树模板

#include<bits/stdc++.h> using namespace std; #define maxn 100010 #define INF 1e9 int ch[maxn][2],dat[maxn],size[maxn],val[maxn],cnt[maxn]; int tot,root;int newno(int v){val[++tot]=v;cnt[tot]=1;da…

优秀交互设计网站四川seo推广

背景 AndroidStudio默认连接的是dl.google的gadle仓库。 每次重新build时: 下载速度慢;等待了半天总时build faild;build到一半connection timeout;即使使用了魔法也难以一次build好;这严重影响了我们的学习、开发效率。 当前网络上的使用国内镜像的教程不全 网上的教程…

Spring Boot版本1.5.7.RELEASE升级到2.5.14

Spring Boot版本1.5.7.RELEASE升级到2.5.14内置tomcat升级,从8.5.x升级到9.0.x flyway升级,从4.2.0升级到5.2.3,配置:flyway.enabled=true flyway.baselineOnMigrate=true flyway.locations=db.migration修改为: …

健康网站模版wordpress 导航调用

前言 我之前写过一篇文章&#xff0c;探究了zeroTier的最基础的玩法&#xff0c;那篇文章结尾我提到了使用zeroTier虽然实现组网了&#xff0c;但是我只能访问局域网中制定的设备&#xff0c;局域网中其他设备无法访问&#xff0c;这篇文章我又研究了一套方案openwrtzeroTier旁…