#tc

tornado tcp 框架 demo

 server#!/usr/bin/envpythonimportloggingfromtornado.ioloopimportIOLoopfromtornadoimportgenfromtornado.iostreamimportStreamClosedErrorfromtornado.tcpserveri...
代码星球 ·2020-08-09

leetcode 16-> 3Sum Closest

 Givenanarray nums of n integersandaninteger target,findthreeintegersin nums suchthatthesumisclosestto target.Retur...
代码星球 ·2020-08-09

leetcode 15-> 3Sum

 classSolution(object):defthreeSum(self,nums):res=[]nums.sort()foriinxrange(len(nums)-2):ifi>0andnums[i]==nums[i-1]:continuel,r=i+1,len(nums)-1whilel<...
代码星球 ·2020-08-09

leetcode 14-> Longest Common Prefix

 note:Allgiveninputsareinlowercaseletters a-z.classSolution(object):deflongestCommonPrefix(self,strs):""":typestrs:List[str]:rtype:str"""iflen(strs)==...

leetcode 13 -> Roman to Integer

 classSolution(object):defromanToInt(self,s):""":types:str:rtype:int"""lista={'I':1,'V':5,'X':10,'L':50,'C':100,'D':500,'M':1000}Value_sum=0last_Value=0for...
代码星球 ·2020-08-09

Python+ITchart实现微信中男女比例,城市分布统计并可视化显示

直接上代码: importitchatimportosimportcsvimportpandasaspdfrompyechartsimportBar,Pie,Geoimportshutilassh#根据index打印朋友的信息defprint_Info(friends):UserName=friends['UserNa...

Python+ITchart实现微信机器人对指定的朋友和群自动回复

  这里我主要用了3个机器人,可以切换。  1.图灵机器人 (傻的不行,一直在问别人问题,没有限制)    http://www.tuling123.com  2.showApi上的图灵机器人  (感觉最聪明,可以识别微信表情,英文,中文等,但是因为我是普通会员,每天1000次调用)    https://w...

/etc/postfix下 main.cf 配置文件详解

转自:https://www.cnblogs.com/qianyuliang/p/6501531.htmlpostconf-n#别名数据库(postalias/newaliases命令生成) alias_database=hash:/etc/postfix/aliases#别名表,列出localmda所使用的...

VS错误:#error 指令: Please use the /MD switch for _AFXDLL builds

我在做MFC时遇到过这个问题,解决方法如下:修改设置:工程(Project)->属性(Properties)->配置属性(ConfigurationProperties)->c/c++->代码生成(CodeGeneration)->运行库(Userun-timelibrary)->多...

leetcode 12 -> Integer to Roman

 classSolution(object):defintToRoman(self,num):""":typenum:int:rtype:str"""ifnum==0:return""ifnum>=1000:return"M"+self.intToRoman(num-1000)elifnum>=9...
代码星球 ·2020-08-09

leetcode 9 -> Palindrome Number

 classSolution(object):defisPalindrome(self,x):""":typex:int:rtype:bool"""s=str(x)if(s==s[::-1]):returnTrueelse:returnFalse ...
代码星球 ·2020-08-09

leetcode 5-> Longest Palindromic Substring

 classSolution(object):defget_f_l(self,s_length,s,list_all,last_d):max_l=0first_d=0last_d=0foriinrange(len(list_all)):if((i+1)==len(list_all)):breakforjinr...

leetcode 7-> Reverse Integer(32-bit signed integer)

 classSolution(object):defreverse(self,x):""":typex:int:rtype:int"""p=abs(x)rev=int(str(p)[::-1])if(x<0):if((-rev)<pow(-2,31)):return0else:return-(re...

leetcode 4-> Median of Two Sorted Arrays

 classSolution(object):defhb(self,list1,list2):result=[]whilelist1andlist2:iflist1[0]<list2[0]:result.append(list1[0])dellist1[0]else:result.append(list...

leetcode 2-> Add Two Numbers

 classSolution(object):defaddTwoNumbers(self,l1,l2):l3=ListNode(0)current=l3carry=0whilel1orl2:#1,1|None,1|1,None#Pad0ifNoneifl1isNone:l1v=0else:l1v=l1.val...
代码星球 ·2020-08-09
首页上一页...96979899100...下一页尾页