码迷,mamicode.com
首页 > 编程语言
python with原理
在python2.5+中可以用with来保证关闭打开的文件with open('hello.txt') as f: do some file operations为什么要引入with呢?在之前如果要保证关闭文件需要这样:f = open('hello.txt')try: do some fi...
分类:编程语言   时间:2014-07-28 11:36:00    阅读次数:305
Merge Interval leetcode java
题目:Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].题解:这道题主要....
分类:编程语言   时间:2014-07-28 11:35:20    阅读次数:239
Insert Interval leetcode java
题目:Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were ini....
分类:编程语言   时间:2014-07-28 11:35:10    阅读次数:293
Length of Last Word leetocde java
题目:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last w....
分类:编程语言   时间:2014-07-28 11:35:00    阅读次数:250
Jump Game II leetcode java
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ma....
分类:编程语言   时间:2014-07-28 11:34:40    阅读次数:210
Longest Substring Without Repeating Characters leetcode java
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter....
分类:编程语言   时间:2014-07-28 11:34:30    阅读次数:265
Sort Colors leetcode java
题目:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order r....
分类:编程语言   时间:2014-07-28 11:34:20    阅读次数:297
Jump Game leetcode java
题目:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your ma....
分类:编程语言   时间:2014-07-28 11:33:50    阅读次数:278
Longest Common Prefix leetcode java
题目:Write a function to find the longest common prefix string amongst an array of strings.题解:解题思路是,先对整个String数组预处理一下,求一个最小长度(最长前缀肯定不能大于最小长度)。然后以第0个字符串....
分类:编程语言   时间:2014-07-28 11:33:30    阅读次数:241
Python -- machine learning, neural network -- PyBrain 机器学习 神经网络
I am using pybrain on my Linuxmint 13 x86_64 PC.As what it is described: PyBrain is a modular Machine Learning Library for Python. Its goal is to offe...
分类:编程语言   时间:2014-07-28 11:33:00    阅读次数:292
python 初学03 Eric+PyQt+python IDE与界面程序
近期一直在学习python和批处理,来将工作中的手工操作的低效环节用脚本自动实现。已经实现了几个脚本。但是命令行窗口,总是不太友好,对执行结果的反馈也不清楚,就想实现可视化。在网上找到Python可视化的编程的一个方法,周末专心实现了一下,效果还行,算是有头绪了。http://blog.sina.c...
分类:编程语言   时间:2014-07-28 11:32:30    阅读次数:407
[XPath/Python] XPath 与 lxml (五)XPath 实例
本文继续沿用第三章的 XML 示例文档。选取价格高于30的 price 节点# 从父节点进行筛选>>> root.xpath('//book[price>30]/price')[]# 直接对 price 进行筛选>>> root.xpath('//price[text()>30]')[]选取 pri...
分类:编程语言   时间:2014-07-28 11:30:00    阅读次数:336
javaSE_base01_基础
一、基础知识:1、JVM、JRE和JDK的区别: JVM(Java Virtual Machine):java虚拟机,用于保证java的跨平台的特性。 java语言是跨平台,jvm不是跨平台的。 JRE(Java Runtime Environment):java的运行环境,包括jvm+java的....
分类:编程语言   时间:2014-07-28 11:28:00    阅读次数:244
javaSE_base04_集合框架
四、集合框架1:String类:字符串(重点) (1)多个字符组成的一个序列,叫字符串。 生活中很多数据的描述都采用的是字符串的。而且我们还会对其进行操作。 所以,java就提供了这样的一个类供我们使用。 (2)创建字符串对象 A:String():无参构造 **举例: String s = ...
分类:编程语言   时间:2014-07-28 11:27:50    阅读次数:324
使用 JavaScript 编写优化算法 (1)
之前一直用Python来写优化算法,为了增强 JS 的熟练程度,开始将原有的代码改写成 JS。采用的工具包括 node.js + Grunt + nodeunit + github + npm + travis-ci。
分类:编程语言   时间:2014-07-28 11:27:40    阅读次数:247
python学习第一天
1.for x in 集合:print(x) #输出集合内的元素2.列表:[] #1.切片操作: [:] #全部遍历 [1] #输出第二个元素 [1:3] #遍历第二个到第三个元素 [1:] #遍历第二个到最后一个元素 [:3] #遍历前三...
分类:编程语言   时间:2014-07-28 11:26:30    阅读次数:244
javaSE_base02_面向对象
二、面向对象1、面向对象思想: (1)概述:面向对象是相对于面向过程而言的,面向过程强调的是功能,面向对象强调的是将功能封装进对象, 强调具备功能的对象; (2)思想特点: A:是符合人们思考习惯的一种思想; B:将复杂的事情简单化了; C:将程序员从执行者变成了指挥者; 比如我要达到某种结果,我就...
分类:编程语言   时间:2014-07-28 11:25:30    阅读次数:387
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!