码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
最长字串问题,python实现
这篇博客的目的是为了提醒自己,以后笔试一定得及时交啊?!!!! 阿里笔试的最后一个题,我顺手就写python实现,代码如下,不知道对不对,反正当时好几个数据都过了。 不过,反正没交上去,那个题填代码的地方是空的,对错都没用了。先记下,改天细究: def largest_common(query, text, is_first_same): if (len(query) == 0 or...
分类:编程语言   时间:2014-08-29 21:26:08    阅读次数:297
Remove Nth Node From End of List
# Definition for singly-linked list.class ListNode: def __init__(self, x): self.val = x self.next = Noneclass Solution: # @return ...
分类:其他好文   时间:2014-08-29 19:40:58    阅读次数:164
有趣的程序
1.to_proc class Array def to_proc proc { |receiver| receiver.send *self } end end [ 'Hello', 'Goodbye' ].map &[ :+, ' BeiJing!' ] #=> ["Hello BeiJing!", "Goodbye BeiJing!"] recei...
分类:其他好文   时间:2014-08-29 18:18:48    阅读次数:165
Path Sum
# Definition for a binary tree nodeclass TreeNode: def __init__(self, x): self.val = x self.left = None self.right = Noneclas...
分类:其他好文   时间:2014-08-29 17:36:18    阅读次数:135
Set Matrix Zeroes
class Solution: # @param matrix, a list of lists of integers # RETURN NOTHING, MODIFY matrix IN PLACE. def setZeroes(self, matrix): di...
分类:其他好文   时间:2014-08-29 16:00:48    阅读次数:203
python2.7批量创建虚拟机
#?-*-?coding:?cp936?-*- #jk409?于2014-8-27用python2.7编写的批量复制文件和修改虚拟机配置文件的脚本 import?os,os.path,shutil import?re,time class?main: ????def?__init__(self,name,drive,...
分类:编程语言   时间:2014-08-29 11:18:48    阅读次数:251
Python开源库的bug
scipy在misc的pilutil.py中def fromimage(im, flatten=0)函数中,# workaround for crash in PIL, see #1613.im.convert('L')上面是之前的代码,当图片模式是二值模式时,此处会出错,因为im.convert(...
分类:编程语言   时间:2014-08-29 10:33:57    阅读次数:204
Search a 2D Matrix【python】
class Solution: # @param matrix, a list of lists of integers # @param target, an integer # @return a boolean def searchMatrix(self, matrix...
分类:编程语言   时间:2014-08-28 11:24:19    阅读次数:216
普元EOS开发积累第二篇(常见错误解决方法) 持续更新
第一步:出现如下图所示的应用名称默认为空.或者下拉框中无default应用可选(下拉框出现的workspace是流程管理应用,非项目应用).第二部:到安装目录下看看\apache-tomcat-5.5.20\webapps下是否存在default文件夹.如果不存在,就到其他电脑上复制相同版本的def...
分类:其他好文   时间:2014-08-28 09:36:19    阅读次数:734
Python Tkinter 基础控件学习
# -*- coding: utf-8 -*- from Tkinter import * def btn_click(): b2['text'] = 'clicked' evalue = e.get() print 'btn Click and Entry value is %s' % evalue def btn_click_bind(event): pr...
分类:编程语言   时间:2014-08-28 00:59:58    阅读次数:269
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!