自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(22)
  • 资源 (7)
  • 收藏
  • 关注

原创 python下实现jsonp

在高德地图加载热力图时,数据支持jsonp,通过python实现:1、后台python:# 通过jsonp格式返回热力图的数据def heatjsonp(request): funcname = request.GET.get('callback') # print(funcname) content = '%s(%s)' % (funcname, heatdata())...

2018-04-27 11:21:39 3670

翻译 python官网对于dict字典操作的例子

Here is a small example using a dictionary:>>> tel = {'jack': 4098, 'sape': 4139}>>> tel['guido'] = 4127>>> tel{'sape': 4139, 'guido': 4127, 'jack': 4098}>>> te...

2018-04-26 15:10:43 257

原创 通过django的values_list和annotate实现group by功能

lnglat_set = LngLat.objects.all()heatmapdict = {}lnglat = lnglat_set.first()lnglat<LngLat: 126.03407000000,42.028320000000>celldatausage_set = CellDataUsage.objects.filter(cell__lnglat=lng...

2018-04-26 15:07:23 1669

翻译 values()和annotate()组合成group by 时,必须values再前,annotate在后,顺序不同则不起效果

values()¶Ordinarily, annotations are generated on a per-object basis - an annotatedQuerySet will return one result for each object in the originalQuerySet. However, when a values() clause is used to c...

2018-04-26 11:41:07 703

翻译 annotate与aggregate的区别

For example, to find the price range of books offered in each store,you could use the annotation:以下语句查的是每一个商店中书的最高价和最低价,注意是每一个商店,结果是按商店分的数组相当于给每条数据做注释。>>> from django.db.models import ...

2018-04-26 10:45:54 711 1

翻译 django group by (annotate), .values().annotate(), values( , ).distinct().annotate(Count())

An aggregate within a values() clause is applied before other argumentswithin the same values() clause. If you need to group by another value,add it to an earlier values() clause instead. For example:...

2018-04-26 10:18:37 2914

翻译 ManyToManyField增加的额外关系列,如何查询query

https://docs.djangoproject.com/en/2.0/topics/db/models/#extra-fields-on-many-to-many-relationshipsUnlike normal many-to-many fields, you can’t use add(), create(),or set() to create relationships:>...

2018-04-23 16:06:48 685

原创 ValueError: Cannot assign QuerySet :must be a instance

ValueError: Cannot assign "<QuerySet [<Poi: 1>]>": "ComplaintRelatedAmapPois.poi" must be a "Poi" instance.初学django数据库模型models,总是分不清楚QuerySet和instance实例,错过第二次,赶紧记住。注意:本意是想要一个instance实例,但是第...

2018-04-23 14:03:22 5847

原创 python写一个过滤日期时间的函数

使用re正则表达式过滤文字中日期时间的部分,groups()函数得到所有分组()年月日时分秒的结果,生成datetime日期。因为是从人工填写的文字中搜索日期,所以需要考虑的问题很多,比如:1、年份是2018年还是18年,whichyear函数专门解决这个问题,通过对比最长公共子序列,还可以解决年份位数有误的问题,比如20188或218.2、年份或月份不全的问题,如有年份没有月份,或有月份没有年份...

2018-04-22 12:08:29 2665

原创 python try except 出现异常时,except 中如何返回异常的信息字符串

https://docs.python.org/3/tutorial/errors.html#handling-exceptionshttps://docs.python.org/3/library/exceptions.html#ValueErrortry: int("x")except Exception as e: '''异常的父类,可以捕获所有的异常''' pri...

2018-04-20 17:29:33 8001

原创 python求下一个月的今天

https://docs.python.org/3/library/calendar.html?highlight=calendar#calendar.monthrangecalendar.monthrange(year, month)Returns weekday of first day of the month and number of days in month, for thespe...

2018-04-19 16:54:19 3721

原创 Model的一列数据,default=None与null=True,如果没有null=True,则不允许该数据为None,相当于default=None不起作用

# emos工单,投诉的内容class Record(models.Model): jobid = models.CharField(max_length=50, default=None) customerserviceid = models.BigIntegerField() city = models.ForeignKey(City, on_delete=models.C...

2018-04-17 17:33:00 4055

原创 如何使用try catch

以下时报错信息,最后一行有错误类型ValueError:Traceback (most recent call last):  File "<input>", line 76, in <module>  File "C:\Users\Administrator\PycharmProjects\first_django\first_app\db_opr.py", line 4...

2018-04-17 17:24:25 437

原创 python django中的时区问题 DateTimeField received a naive datetime while time zone support is active

遇到多条警告:C:\Users\Administrator\PycharmProjects\first_django\venv\lib\site-packages\django\db\models\fields\__init__.py:1423: RuntimeWarning: DateTimeField Record.whenoccur received a naive datetime (20...

2018-04-17 15:39:46 5447

原创 JavaScript splice胶接 的用法之一:删除数组中的指定元素

// 因为海量点是最后加入的图层,想要清除海量点,需要清除海量点的图层,// 方法:先将地图的所有图层取出到数组,将海量点图层弹出数组,再重设地图图层为去除海量点图层MassMarks的数组。var layers = map.getLayers();for (var i=0; i<layers.length; i++) { if ("AMap.MassMarks" === la...

2018-04-10 16:51:21 256

转载 python自动给数字前面补0的方法

python中有一个zfill方法用来给字符串前面补0,非常有用 view sourceprint?n = "123"s = n.zfill(5)asse...

2018-04-10 08:55:23 2002

原创 计算两个字符串的最长公共子串,找两个字符串的公共部分,如何在两个字符串中找出相同的字符串

代码:# 计算两个字符串的最长公共子串def getNumofCommonSubstr(str1, str2): lstr1 = len(str1) lstr2 = len(str2) record = [[0 for i in range(lstr2 + 1)] for j in range(lstr1 + 1)] # 多一位,为了在计算第一个字时,有个左上角的初始值...

2018-04-04 15:13:45 2105

转载 Python在方括号中使用for循环,类似[0 for i in range(10)],叫 列表解析List Comprehensions

https://www.cnblogs.com/liu-shuai/p/6098227.htmlPython 列表解析作者博文地址:https://www.cnblogs.com/liu-shuai/列表解析  根据已有列表,高效创建新列表的方式。  列表解析是Python迭代机制的一种应用,它常用于实现创建新的列表,因此用在[]中。语法:  [expression for iter_val in...

2018-04-04 14:22:58 161900 3

翻译 filter()的参数内容,查找语句。其中in可以在一个结果集中查找是否包含另一个结果集的数据。

Field lookups¶Field lookups are how you specify the meat of an SQL WHERE clause. They’re specified as keyword arguments to the QuerySet methods filter(), exclude() and get().For an introduction, see m...

2018-04-03 10:52:23 4091

翻译 count专门输出查询结果集的数量,比len()快,count不需要将数据从数据库提取到内存。

count()¶count()¶Returns an integer representing the number of objects in the database matchingthe QuerySet. The count() method never raises exceptions.Example:# Returns the total number of entries in ...

2018-04-03 10:47:22 1080

翻译 exists的作用是反馈查询结果集是否为空,速度快。

exists()¶exists()¶Returns True if the QuerySet contains any results, and Falseif not. This tries to perform the query in the simplest and fastest waypossible, but it does execute nearly the same query...

2018-04-03 10:43:15 741

翻译 django以字典或元组形式输出数据库结果集,可以选择输出特定列的结果

values()¶values(*fields, **expressions)¶Returns a QuerySet that returns dictionaries, rather than model instances, when used as an iterable.Each of those dictionaries represents an object, with the ke...

2018-04-03 10:32:57 2862

springboot 配置 spring data redis

springboot 配置 spring data redis

2024-07-18

linux.x64-11gR2-database-2of2.7z.002

linux.x64-11gR2-database-2of2.7z.002

2023-12-08

linux.x64-11gR2-database-2of2.7z.001

linux.x64-11gR2-database-2of2.7z.001

2023-12-08

linux.x64-11gR2-database-1of2.7z.002

linux.x64-11gR2-database-1of2.7z.002

2023-12-08

linux.x64-11gR2-database-1of2.7z.001

linux.x64-11gR2-database-1of2.7z.001

2023-12-08

添加单位简介及上传营业执照脚本.rar

uipath脚本,用于自动上传单位信息,注册到网站中 uipath脚本,用于自动上传单位信息,注册到网站中

2020-04-29

CitrixReceiver组件ICAWebWrapper.msi

Citrix Receiver登入的时候报找不到ICAWebWrapper插件 C:\ProgramData\Citrix\Citrix Receiver http://blog.51cto.com/10237709/1741185

2018-11-27

OMC北向接口参数说明

本文档描述移动通信网络的OMC北向接口的基于CORBA技术故障管理接口设计,供OMC北向接口开发人员、网络系统数据采集程序开发人员参考使用;本标准可适用于TD-LTE等网络的OMC北向接口。

2018-09-28

3GPP CORBA Alarm IRP 协议原文

适用于datang omc北向接口CORBA协议,其中附录有AlarmIRPConstDefs.idl、AlarmIRPSystem.idl、AlarmIRPNotifications.idl代码

2018-09-28

datang CORBA .idl文件

datang CORBA .idl文件,版本 Alarm IRP V3.0.0 BasicCM IRP V3.0.0 Notification IRP V3.0.0 FileTransfer IRP V3.0.0等

2018-09-28

"com.zznode.tnms.ra.c11n.nj.resource.ftp.UnixFTPEntryParser"

ftpclient listFile方法无法返回正确的数据,一般返回时null ,使用listNames 返回的也是只有文件名,这个是ftpclient 工具包的一个bug,这个有专门的大神分析了源码,并给出了多种的解决办法,比如我使用了下面这种(分析太多,,有机会仔细看下) ftpClient.configure(new FTPClientConfig("com.zznode.tnms.ra.c11n.nj.resource.ftp.UnixFTPEntryParser"));

2018-06-25

jfreechart-1.0.19-demo-src

jfreechart-1.0.19压缩包中有一个jfreechart-1.0.19-demo.jar,里面演示了各种图表的制作案例,包括BarChart、LineChart、PieChart、TimeSeriesChart、XYSeries等等,共309个例子,现开放源码,请各位下载,欢迎交流。

2017-11-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除