首页 文章 精选 留言 我的

精选列表

搜索[代码生成],共10000篇文章
优秀的个人博客,低调大师

有哪些Java源代码看了后让你收获很多?

曾经读过Erudika/para的源码,此源码托管在github,大致是2014年前后开源的云计算通用后端框架,基于spring boot体系,原生集成持久化(默认H2 DB,通过配置方式实现MongoDB、mysql等常用关系数据库的支持)、缓存(默认Caffeine、支持配置参数的Hazelcast、redis等)和搜索(默认Lucene,支持配置参数的Elasticsearch)三大功能,快速开发resful风格的API接口,其强大的分层思想和通用性设计能力,让我的架构思维有了很大的进步,其开源版本对于中小团队实践spring boot+spring cloud打通云计算服务具有借鉴意义,目前最新的版本为1.29.1。 下面,我就简单的分享Erudika/para源码官网的介绍,解释不到位的地方希望大家批评指正,同时,这款较为优秀的开源项目也推荐给大家去学习和使用。 特性: 多租户技术【多重租赁技术】支持——每个应用程序都有自己的表、索引和缓存; 用Amazon的签名算法进行安全的JSON; 数据库动态性,专为可伸缩和分布式数据存储而设计 全文搜索(Elasticsearch); 分布式对象缓存(hazelcast,高可扩展内存数据网格); 物联网支持与AWS(业务流程管理开发平台)和(基于云计算的操作系统,Windows Azure的主要目标是为开发者提供一个平台,帮助开发可运行在云服务器、数据中心、Web和PC上的应用程序)的集成; 灵活的安全LDAP(LDAP是轻量目录访问协议),社交登录,CSRF(跨站请求伪造)保护; 无状态的客户端认证与JSON的Web令牌(JWT,网络应用环境间传递声明而执行的一种基于JSON的开放标准,JWT是由三段信息构成的,将这三段信息文本用); 用于客户端访问控制的简单但有效的资源权限; 鲁棒约束验证基于JSR-303和Hibernate Validator; 持久性、索引和缓存操作的每个对象控制; 模块化设计的谷歌Guice(依赖注入框架(IOC))和支持插件; 网络控制台-管理用户界面。 欢迎大家加入Java高级架构/互联网:468947140 点击链接加入群聊:https://jq.qq.com/?_wv=1027&k=56hvqnu 本群提供免费的学习指导 架构资料 以及免费的解答 不懂得问题都可以在本群提出来 之后还会有职业生涯规划以及面试指导 进群修改群备注:开发年限-地区-经验 方便架构师解答问题

优秀的个人博客,低调大师

一些JS事件小片段代码整理收集(持续)

一、js实现 1 <html xmlns=" http://www.w3.org/1999/xhtml"> 2 <head> 3 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 4 <script language="javascript"> 5 function AcceptData(num){ 6 document.getElementById("accepDate").value+=num; 7 } 8 </script> 9 </head> 10 11 <body> 12 <input id="accepDate" type="text" name="accepDate" /> 13 <input type="submit" name="Submit" onclick="AcceptData('1')" value="1" /> 14 <input type="submit" name="Submit" onclick="AcceptData('2')" value="2" /> 15 </body> 16 </html> 二、input输入框的value传值显示 input输入框中用户输入的值,点击按钮显示在另一个容器之中。 function show(){ 2 var callNum = document.getElementById('exampleInputName2');//声明input 3 var callBtn = document.getElementById('callBtn');//声明按钮 4 var callingNum = document.getElementById('callingNum');//声明容器 5 callingNum.innerHtml = callNum.value;//input的value值传给容器显示 6 7 8 } 三、清空功能按钮 设置一个能清空input输入框中值的按钮,添加事件 $('#btn-clear').click(function(){ $('.ipt-cont').val(' ').focus();//清空后获得焦点以便重新输入 });

优秀的个人博客,低调大师

从基础到实现:集成学习综合教程(附Python代码

介绍 当你想购买一辆新车时,你会走到第一家汽车商店就根据经销商的建议购买一辆车吗?这是不太可能的。 你可能会浏览一些人们发布评论并比较不同车型的门户网站,检查其功能和价格。你也可能会问你的朋友和同事们的意见。总之,你不会直接得出结论,还会参考其他人的意见做出决定。 机器学习中的集成模型也是类似的思路。它们结合了多个模型的决策来提高整体性能。这可以通过各种方式实现,本文将会带你一起探索。 本文的目的是介绍集成学习的概念并理解使用这种技术的算法。为了巩固你对这个多元化主题的理解,我们将用真实问题的动手案例,配合Python来解释其中的高级算法。 注意:本文假定你对机器学习算法有基本的了解。我建议阅读这篇文章以熟悉这些概念。 目录 集成学习介绍基础集成技术最大投票(Max Voting)法平均(Averaging)法加权平均(Weighted Ave

优秀的个人博客,低调大师

(附代码

以下是5个新的机器学习或与机器学习有关的项目,你可能还没有听说过,但是你不能错过! 本文将给大家介绍五个十分可怕但还鲜为人知的机器学习项目,囊括了一些潜在的机器学习的新想法。它们基本都是Python项目。我并不是故意这么选的,但毫无疑问有我自己偏好的影响在里面。以前我也介绍过许多各种各样的项目(R、Go、C++、Scala、Java等)。 我承诺很快会出一个R版的,并在评估这些项目时使用一些外部帮助(我得承认我不是很适应R生态)。 1. Live Loss Plot 不要闭着眼睛训练深度学习模型!要有耐心地去观察你的每一期训练! 这是一个由Piotr migdaet al提供的开源Python库,可以在Jupyter Notebook中为Keras、PyTorch和其他框架提供训练损失图像。当使用Keras时,Live Loss Plot是

优秀的个人博客,低调大师

最强观战指南 | Python分析热门夺冠球队(附源代码

018年,火热的世界杯即将拉开序幕。在比赛开始之前,我们不妨用 Python 来对参赛队伍的实力情况进行分析,并大胆的预测下本届世界杯的夺冠热门球队。 通过数据分析,可以发现很多有趣的结果,比如: 找出哪些队伍是首次进入世界杯的黑马队伍 找出2018年32强中之前已经进入过世界杯,但在世界杯上没有赢得过一场比赛的队伍 当然,我们本次的主要任务是要通过数据分析来预测2018年世界杯的夺冠热门队伍。 本次分析的数据来源于 Kaggle, 包含从 1872 年到今年的数据,包括世界杯比赛、世界杯预选赛、亚洲杯、欧洲杯、国家之间的友谊赛等比赛,一共大约 40000 场比赛的情况。 本次的环境为 window 7 系统 python 3.6 Jupyter Notebook pandas version 0.22.0 先来看看数据的情况: import panda

优秀的个人博客,低调大师

代码+教程】重现“世界模型”实验,无监督方式快速训练

“世界模型”(World Models)是谷歌大脑研究科学家 David Ha 和 Swiss AI Lab 负责人 Jürgen Schmidhuber 共同提出的一个为强化学习环境构建的神经网络模型。世界模型可以通过无监督的方式快速训练,让人工智能在 “梦境” 中对外部环境的未来状态进行预测,大幅提高了完成任务的效率。这篇论文一经发布就引发了热烈讨论。 近日,论文作者之一的 David Ha 公布了重现世界模型实验的一种方法,本文带来分步解读。GitHub 上的参考 TensorFlow 模型:https://github.com/hardmaru/WorldModelsExperiments 已有其他人独立实现了世界模型。Keras 有一个实现再现了 CarRacing-v0 实验的一部分。PyTorch 也有一个项目,试图在

优秀的个人博客,低调大师

从Zero到Hero,一文掌握Python关键代码

# 01基础篇 # 变量 1 #int 2 one=1 3 some_number=100 4 5 print("one=",one) #print type1 6 print("some_number=",some_number) #python3 print need add () 7 8 """output 9 one= 1 10 some_number= 100 11 """ 1 #booleans 2 true_boolean=True 3 false_boolean=False 4 5 print("true_boolean:",true_boolean) 6 print("False_boolean;",false_boolean) 7 8 """output 9 true_boolean: True 10 False_boolean; False 11 """ 1 #string 2 my_name="leizeling" 3 4 print("my_name:{}".format(my_name)) #print type2 5 6 """output 7 true_boolean: True 8 False_boolean; False 9 """ #float book_price=15.80 print("book_price:{}".format(book_price)) """output book_price:15.8 """ # 控制流:条件语句 1 #if 2 if True: 3 print("Hollo Python if") 4 if 2>1: 5 print("2 is greater than 1") 6 7 """output 8 Hollo Python if 9 2 is greater than 1 10 """ 1 #if……else 2 if 1>2: 3 print("1 is greater than 2") 4 else: 5 print("1 is not greater than 2") 6 7 """output 8 true_boolean: True 9 False_boolean; False 10 """ #if……elif……else if 1>2: print("1 is greater than 2") elif 1<2: print("1 is not greater than 2") else: print("1 is equal to 2") """output 1 is not greater than 2 """ # 循环/迭代器 #while num=1 while num<=10: print(num) num+=1 """output 1 2 3 4 5 6 7 8 9 10 """ 1 #for 2 for i in range(1,11):#range(start,end,step),not including end 3 print(i) 4 5 """output 6 1 7 2 8 3 9 4 10 5 11 6 12 7 13 8 14 9 15 10 16 """ # 02列表:数组数据结构 #create integers list my_integers=[1,2,3,4,5] print(my_integers[0]) print(my_integers[1]) print(my_integers[4]) """output 1 2 5 """ #create str list relatives_name=["Toshiaki","Juliana","Yuji","Bruno","Kaio"] print(relatives_name) """output ['Toshiaki', 'Juliana', 'Yuji', 'Bruno', 'Kaio'] """ 1 #add item to list 2 bookshelf=[] 3 bookshelf.append("The Effective Engineer") 4 bookshelf.append("The 4 Hour Work Week") 5 print(bookshelf[0]) 6 print(bookshelf[1]) 7 8 """output 9 The Effective Engineer 10 The 4 Hour Work Week 11 """ # 03字典:键-值数据结构 #dictionary struct dictionary_example={"key1":"value1","key2":"value2","key3":"value3"} dictionary_example """output {'key1': 'value1', 'key2': 'value2', 'key3': 'value3'} """ #create dictionary dictionary_tk={"name":"Leandro","nickname":"Tk","nationality":"Brazilian"} print("My name is %s"%(dictionary_tk["name"])) print("But you can call me %s"%(dictionary_tk["nickname"])) print("And by the waay I am {}".format(dictionary_tk["nationality"])) """output My name is Leandro But you can call me Tk And by the waay I am Brazilian """ 1 #dictionary add item 2 dictionary_tk["age"]=24 3 print(dictionary_tk) 4 5 """output 6 {'nationality': 'Brazilian', 'nickname': 'Tk', 'name': 'Leandro', 'age': 24} 7 """ #dictionayr del item dictionary_tk.pop("age") print(dictionary_tk) """output {'nationality': 'Brazilian', 'nickname': 'Tk', 'name': 'Leandro'} """ # 04迭代:数据结构中的循环 #iteration of list bookshelf=["The Effective Engineer","The 4 hours work week","Zero to One","Lean Startup","Hooked"] for book in bookshelf: print(book) """output The Effective Engineer The 4 hours work week Zero to One Lean Startup Hooked """ 1 #哈希数据结构(iteration of dictionary) 2 dictionary_tk={"name":"Leandro","nickname":"Tk","nationality":"Brazilian"} 3 for key in dictionary_tk: #the attribute can use any name,not only use "key" 4 print("%s:%s"%(key,dictionary_tk[key])) 5 print("===================") 6 for key,val in dictionary_tk.items(): #attention:this is use dictionary_tk.items().not direct use dictionary_tk 7 print("{}:{}".format(key,val)) 8 9 """output 10 nationality:Brazilian 11 nickname:Tk 12 name:Leandro 13 =================== 14 nationality:Brazilian 15 nickname:Tk 16 name:Leandro 17 """ # 05 类和对象 #define class class Vechicle: pass #create instance car=Vechicle() print(car) ""output <__main__.Vechicle object at 0x000000E3014EED30> """ #define class class Vechicle(object):#object is a base class def __init__(self,number_of_wheels,type_of_tank,seating_capacity,maximum_velocity): self.number_of_wheels=number_of_wheels self.type_of_tank=type_of_tank self.seating_capacity=seating_capacity self.maximum_velocity=maximum_velocity def get_number_of_wheels(self): return self.number_of_wheels def set_number_of_wheels(self,number): self.number_of_wheels=number #create instance(object) tesla_models_s=Vechicle(4,"electric",5,250) tesla_models_s.set_number_of_wheels(8)#方法的调用显得复杂 tesla_models_s.get_number_of_wheels() """output 8 """ #use @property让方法像属性一样使用 #define class class Vechicle_1(object):#object is a base class def __init__(self,number_of_wheels,type_of_tank,seating_capacity,maximum_velocity):#first attr must is self,do not input the attr self._number_of_wheels=number_of_wheels ###属性名和方法名不要重复 self.type_of_tank=type_of_tank self.seating_capacity=seating_capacity self.maximum_velocity=maximum_velocity @property #读属性 def number_of_wheels(self): return self._number_of_wheels @number_of_wheels.setter #写属性 def number_of_wheels(self,number): self._number_of_wheels=number def make_noise(self): print("VRUUUUUUUM") tesla_models_s_1=Vechicle_1(4,"electric",5,250) print(tesla_models_s_1.number_of_wheels) tesla_models_s_1.number_of_wheels=2 print(tesla_models_s_1.number_of_wheels) print(tesla_models_s_1.make_noise()) """output 4 2 VRUUUUUUUM None """ # 06封装:隐藏信息 1 #公开实例变量 2 class Person: 3 def __init__(self,first_name): 4 self.first_name=first_name 5 tk=Person("TK") 6 print(tk.first_name) 7 tk.first_name="Kaio" 8 print(tk.first_name) 9 10 """output 11 TK 12 Kaio 13 """ #私有实例变量 class Person: def __init__(self,first_name,email): self.first_name=first_name self._email=email def get_email(self): return self._email def update_email(self,email): self._email=email tk=Person("TK","tk@mail.com") tk.update_email("new_tk@mail.com") print(tk.get_email()) """output new_tk@mail.com """ #公有方法 class Person: def __init__(self,first_name,age): self.first_name=first_name self._age=age def show_age(self): return self._age tk=Person("TK",24) print(tk.show_age()) """output 24 """ 1 #私有方法 2 class Person: 3 def __init__(self,first_name,age): 4 self.first_name=first_name 5 self._age=age 6 def _show_age(self): 7 return self._age 8 def show_age(self): 9 return self._show_age() #此处的self不要少了 10 tk=Person("TK",24) 11 print(tk.show_age()) 12 13 """output 14 24 15 """ 1 #继承 2 class Car:#父类 3 def __init__(self,number_of_wheels,seating_capacity,maximum_velocity): 4 self.number_of_wheels=number_of_wheels 5 self.seating_capacity=seating_capacity 6 self.maximum_velocity=maximum_velocity 7 class ElectricCar(Car):#派生类 8 def __init(self,number_of_wheels_1,seating_capacity_1,maximum_velocity_1): 9 Car.__init__(self,number_of_wheels_1,seating_capacity_1,maximum_velocity_1) #利用父类进行初始化 10 11 my_electric_car=ElectricCar(4,5,250) 12 print(my_electric_car.number_of_wheels) 13 print(my_electric_car.seating_capacity) 14 print(my_electric_car.maximum_velocity) 15 16 """output 17 4 18 5 19 250 20 """ 注:从机器之心转载

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册