首页 软件开发 代码片段 ( Page 616 )

代码片段 8064

#C/C++
汉落塔算法实现代码

用 4 根柱子移动盘子n 是盘子个数,编号从1 到 nFirst 是源柱子号Second Third 是两根过渡柱Fourth 是目标柱 汉落塔算法 #include <st…

2015-01-04 128

#PHP
全角字符转换为半角字符PHP函数

/** * 全角字符转换为半角字符 */ function make_semiangle ( $str ) { $arr = array ( '0' => '0', '1' …

php
2015-01-04 642

#PHP
php日期加减

对于每天的统计数据,我们日期 date("Ymd") 转换成整型来作为数据库的主键,所以在寻找一段时间统计数据的时候需要用到时间的加减; 例如,30天内的数据 …

php
2015-01-04 252

#C/C++
Dijkstra算法

#include <iostream> #include <vector> using namespace std; struct Line { int V…

2015-01-04 941

#Python
快速激活码生成V2

# coding=utf-8 # config 为配置词典 # y 是长度 最终生产出来的验证码是 长度 = Y - title的长度 # x 是循环次数 生成数量 # title…

2015-01-04 562

#PHP
PHP从网络下载文件

set_time_limit(0); // Supports all file types // URL Here: $url = 'http://somsite.com/some…

php
2015-01-04 126

#PHP
应用curl扩展抓取网页

<?php namespace Think; header("Content-Type: text/html;charset=utf-8"); class…

php
2015-01-04 796

#Python
Python的时间转换

要进行时间转换,在python里面是非常简单的,这里会使用到 time 模块里的 strptime() 和 strftime()。 下面我们用实例来演示一下: strptime()…

2015-01-04 771

#PHP
PHP随机颜色生成器

function randomColor() { $str = '#'; for($i = 0 ; $i < 6 ; $i++) { $randNum = rand(0 , …

php
2015-01-04 971

#Ruby
Ruby 之 TkButton 示例

require 'tk' root = TkRoot.new button = TkButton.new(root) { text "Hello, World!" command …

2015-01-04 711

#SQL
SQL Server设置数据库为自动收缩

USE [master] GO ALTER DATABASE [Test] SET AUTO_SHRINK ON WITH NO_WAIT GO

sql
2015-01-04 147

#Objective-C
iOS8使用UIVisualEffectView实现模糊效果

- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the vi…

2015-01-04 669