publisher

day62作业

爷,独闯天下 提交于 2020-01-13 05:36:48
import osos.environ.setdefault("DJANGO_SETTINGS_MODULE", "about_ORM.settings")import djangodjango.setup()from app01 import models# 1 .查找所有书名里包含金老板的书# ret1 = models.Book.objects.filter(title__contains="金老板")# print(ret1)"""select * from app01_book where title regexp "金老板";"""# 2.查找出版日期是2018年的书# ret2 = models.Book.objects.filter(publish_date__year=2018)# print(ret2)"""select * from app01_book where year(publish_date)=2018;"""# 3.查找出版日期是2017年的书名# ret3 = models.Book.objects.filter(publish_date__year=2017)# for i in ret3:# print(i.title)"""select title from app01_book where year(publish_date)=2017;

Get rid of “Publisher Unverified” warnings in Windows for executables

自作多情 提交于 2020-01-10 20:10:40
问题 I have made an application for Windows & everytime I run the application by opening the executable file I get the "Publisher Unverified" warning in Windows. It is fine if I was the only audience for this app but thats not the case. Is there any way to program my app such that this message does not show up for the users. 回答1: The only way to do this is to obtain and use a code signing certificate from a trusted source. Microsoft calls this Authenticode . Unfortunately for the little guy, these

豆瓣书籍数据爬取与分析

二次信任 提交于 2020-01-05 03:33:10
前言 17年底,买了清华大学出版社出版的《Hadoop权威指南》(第四版)学习,没想到这本书质量之差,超越我的想象,然后上网一看,也是骂声一片。从那个时候其就对出版社综合实力很感兴趣,想通过具体数据分析各个出版社的出版质量,另外借此也可以熟悉大数据生态和相关操作。 豆瓣上的书籍数据刚好可以满足需求,所以有了思路: 1. 用python编写爬虫,爬取豆瓣上的书籍信息,并持久化到mysql数据库; 2. 使用sqoop将mysql里的数据导入hive; 3. 通过hive进行离线分析。 一、爬虫部分 这部分的代码已经传到个人的github: https://github.com/harrymore/DoubanBookSpider 1. 爬虫思路及架构 通过观察豆瓣网书籍的具体页面,我们可以发现,具体书籍网址的组成形式为: https://book.douban.com/subject/bookid/ , 其中 bookid 为具体的数字。第一种思路是设定一个比较大的数字,然后从1到这个数字的范围之内去遍历所有数字对应的网址,但是我们可以发现,这些书的id往往非常大,基本都是百万级别的数字,一个个去撞库非常不现实。 其实每本书都有很多标签,每个标签都汇集了同一类的所有书,要是可以获取到所有标签,然后根据这些标签一个个去遍历就可以获得豆瓣上所有的书了,当然不同标签之间肯定有重复的书

Serializers 序列化组件

蓝咒 提交于 2019-12-27 14:50:12
Serializers 序列化组件 为什么要用序列化组件 当我们做前后端分离的项目~~我们前后端交互一般都选择JSON数据格式,JSON是一个轻量级的数据交互格式。 那么我们给前端数据的时候都要转成json格式,那就需要对我们从数据库拿到的数据进行序列化。 接下来我们看下django序列化和rest_framework序列化的对比~~ Django的序列化方法 class BooksView(View): def get(self, request): book_list = Book.objects.values("id", "title", "chapter", "pub_time", "publisher") book_list = list(book_list) # 如果我们需要取外键关联的字段信息 需要循环获取外键 再去数据库查然后拼接成我们想要的 ret = [] for book in book_list: pub_dict = {} pub_obj = Publish.objects.filter(pk=book["publisher"]).first() pub_dict["id"] = pub_obj.pk pub_dict["title"] = pub_obj.title book["publisher"] = pub_dict ret.append(book

Filtering in JMS based on body content

岁酱吖の 提交于 2019-12-25 13:39:29
问题 I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body. For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body. p.s. I dont want to use message selectors. How can I implement this. Thanks and Regards. 回答1: Take a look at apache camel. It provides a means of routing and

Filtering in JMS based on body content

那年仲夏 提交于 2019-12-25 13:37:06
问题 I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body. For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body. p.s. I dont want to use message selectors. How can I implement this. Thanks and Regards. 回答1: Take a look at apache camel. It provides a means of routing and

RTI DDS two applications publishing data on same domain. When one application closes and reopens it looses the data. How to solve?

大兔子大兔子 提交于 2019-12-24 03:13:06
问题 I have two publisher and subscriber application. App1 -> publish -> Student (1,ABC), Student(2,EFG). After it I run second application. both application subscribe and publish on same domain App2 able subscribe Student (1,ABC), Student(2,EFG) which is published by App1 then I Published data. App2-> publish -> Teacher(1,AAA),Teacher(2,BBB) Now I got Student (1,ABC), Student(2,EFG),Teacher(1,AAA),Teacher(2,BBB) from App2 when I close app2 and reopen again I am unable to subscribe this data How

RTI DDS two applications publishing data on same domain. When one application closes and reopens it looses the data. How to solve?

牧云@^-^@ 提交于 2019-12-24 03:12:35
问题 I have two publisher and subscriber application. App1 -> publish -> Student (1,ABC), Student(2,EFG). After it I run second application. both application subscribe and publish on same domain App2 able subscribe Student (1,ABC), Student(2,EFG) which is published by App1 then I Published data. App2-> publish -> Teacher(1,AAA),Teacher(2,BBB) Now I got Student (1,ABC), Student(2,EFG),Teacher(1,AAA),Teacher(2,BBB) from App2 when I close app2 and reopen again I am unable to subscribe this data How

ROS操作系统基本命令汇总

五迷三道 提交于 2019-12-15 01:05:19
【1】在使用ROS发布或者订阅消息之前,必须要使用命令 roscore 将这个ROS内核启动才行; 【2】当编写好相关文件之后,一定要返回到ROS工程目录下,进行编译,具体操作是: $ cd ~ / catkin_ws $ catkin_make $ source ~ / catkin_ws / devel / setup . bash 【3】当使用roscd 语句提示:无法找到相应的ros包的时候,采用 echo "export ROS_PACKAGE_PATH"=~/ <文件名> /:"$ROS_PACKAGE_PATH " >> ~/.bashrc 问题就可以得到解决 【4】一般而言,一个ROS工作空间包括: -(1)src 文件夹: 一般包括ROS包(launch文件+msg文件+src文件+srv文件+头文件)+CMakeLists.txt文件+package.xml文件 -(2)build 文件夹:用来存放编译过程的文件 -(3)devel 文件夹:用来存放目标文件(如setup.bash) ROS文件空间的基本组成 ROS包的基本组成 【5】node是ROS操作系统中的最小单位,当我们需要打开多个node节点的时候会,我们必须采用master来进行管理。 roscore //表示启动ros的master节点 【6】rosrun语句的基本命令格式为: $ rosrun

Error adding policy file to GAC

这一生的挚爱 提交于 2019-12-13 03:49:44
问题 I'm trying to add a publisher policy file to the gac as per this thread but I'm having problems when I try and add the file on my test server. I get "A module specified in the manifest of assembly 'policy.3.0.assemblyname.dll' could not be found" My policy file looks like this: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="*assemblyname*" publicKeyToken="7a19eec6f55e2f84" culture="neutral" /> <bindingRedirect