装饰器是一个很著名的设计模式,经常被用于有切面需求的场景,较为经典的有插入日志、性能测试、事务处理等。 装饰器是解决这类问题的绝佳设计,有了装饰器,我们就可以抽离出大量函数中与函数功能本身无关的雷同代码并继续重用。 概括的讲,装饰器的作用就是为已经存在的对象添加额外的功能。 Python的 装饰器( ...
分类:
其他好文 时间:
2017-06-15 17:19:28
阅读次数:
106
x_button = x_space + line * (x_space + buttonWidth); y_button = y_space + row * (y_margin + buttonHeight); NSString *title = dicArray[i][@"title"]; NS ...
分类:
移动开发 时间:
2017-06-15 17:14:56
阅读次数:
150
题目链接: http://poj.org/problem?id=1696 题目描述: Space Ant Description The most exciting space discovery occurred at the end of the 20th century. In 1999, s ...
分类:
其他好文 时间:
2017-06-15 14:57:31
阅读次数:
137
python局域网alive ip侦听 作者:vpoet 日期:夏季 注:写着玩,欢迎copy # -*- coding: cp936 -*- # coding = utf-8 import os import re import thread import time import socket i ...
分类:
编程语言 时间:
2017-06-15 14:19:30
阅读次数:
199
题目链接:http://acm.timus.ru/problem.aspx?space=1&num=1823 1823. Ideal Gas Time limit: 0.5 second Memory limit: 64 MB Many of you know the universal metho ...
分类:
其他好文 时间:
2017-06-15 14:09:24
阅读次数:
218
Problem statement Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? Solution This i ...
分类:
其他好文 时间:
2017-06-15 12:52:42
阅读次数:
150
Problem statement Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Solution This is a cl ...
分类:
其他好文 时间:
2017-06-15 12:38:22
阅读次数:
148
Sort a linked list in O(n log n) time using constant space complexity. 时间复杂度为O(nlogn),可以想到归并排序、快排、桶排序。 思路:使用归并排序,整体可以分为两体,一、构造两个已排序的子链表;二、将子链表合并。针对第一部 ...
分类:
编程语言 时间:
2017-06-15 10:41:29
阅读次数:
202
1.File文件操作 java.io.File用于表示文件(目录),也就是说程序员可以通过File类在程序中操作硬盘上的文件和目录。File类只用于表示文件(目录)的信息(名称、大小等),不能对文件的内容进行访问。 1)构造方法 构造方法一:File(String pathname) 通过将给定路径 ...
分类:
编程语言 时间:
2017-06-15 00:39:42
阅读次数:
283
注:环境是Unity3D 5.0.2f1自带的MonoDevelop Ctrl+X 剪切功能。另外,光标放在一行的任意位置(不选中任何内容),使用快捷键,将把这一行剪切并删除此行,这个特性非常好用 Ctrl+Space 显示下拉提示,类似VS2012的Ctrl+J、Eclipse的Alt+/。不过这 ...
分类:
其他好文 时间:
2017-06-14 22:19:56
阅读次数:
221