1、使用Lambda表达式实现多线程 public static void main(String[] args) { //使用匿名内部类的方式,实现多线程 new Thread(new Runnable() { @Override public void run() { System.out.pr ...
分类:
编程语言 时间:
2020-06-30 17:34:32
阅读次数:
55
一、朴素贝叶斯分类器的构建 import numpy as np class BernoulliNavieBayes: def __init__(self, alpha=1.): # 平滑系数, 默认为1(拉普拉斯平滑). self.alpha = alpha def _class_prior_pr ...
分类:
其他好文 时间:
2020-06-30 12:34:35
阅读次数:
61
请求相关的方法(request--HttpRequest对象) print(request.GET) # 包含所有的HTTP GET 参数的类字典对象 print(request.META) # 请求头信息 return render(request, 'project_home.html') pr ...
分类:
其他好文 时间:
2020-06-27 09:36:43
阅读次数:
50
package chapter01 object test05 { def main(args:Array[String]):Unit={ //标识符 //scala中可以使用特殊符号作为标识符,其实是将特殊符号在编译时进行了转换 //操作符不能在标识符的中间和最后 var ++ ="123" pr ...
分类:
其他好文 时间:
2020-06-26 21:55:34
阅读次数:
66
public int maxProfit(int[] prices) { int n = prices.length; if(n<2){ return 0; } int[] f = new int[n]; int[] g = new int[n]; for(int i = 1,valley = pr ...
分类:
其他好文 时间:
2020-06-25 19:56:31
阅读次数:
69
我们在Springboot中经常使用@Value注解来获取配置文件中的值,像下面这样 @Component class A { @Value("${user.value}") private String configValue; public void test() { System.out.pr ...
分类:
编程语言 时间:
2020-06-25 19:52:23
阅读次数:
114
Descpition There are n people and 40 types of hats labeled from 1 to 40. Given a list of list of integers hats, where hats[i] is a list of all hats pr ...
分类:
其他好文 时间:
2020-06-25 13:58:26
阅读次数:
56
typedef void(__stdcall*NTPROC)(); HINSTANCE hinst = LoadLibrary(L"C:\\dll\\ext-ms-win-session-wininit-l1-1-0.dll"); DWORD dwMajor = 20; if(hinst) { pr ...
分类:
其他好文 时间:
2020-06-25 09:59:17
阅读次数:
49
JavaAgent 是JDK 1.5 以后引入的,也可以叫做Java代理。 JavaAgent 是运行在 main方法之前的拦截器,它内定的方法名叫 premain ,也就是说先执行 premain 方法然后再执行 main 方法。 那么如何实现一个 JavaAgent 呢?很简单,只需要增加 pr ...
分类:
编程语言 时间:
2020-06-24 14:24:35
阅读次数:
90
在connection.url中做如下设置,databaseName是你自己的数据库名 <property name="connection.url">jdbc:mysql:///databaseName?useUnicode=true&characterEncoding=UTF-8</pr ...
分类:
Web程序 时间:
2020-06-22 01:33:23
阅读次数:
70