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

代码片段 8064

#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

#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

#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 在 Windows 下获取当前鼠标光标的位置

result = "0"*8 # Eight bytes (enough for two longs) getCursorXY = Win32API.new("user32","G…

2015-01-04 316

#SQL
判断一个日期是否为月末

DECLARE @Dt DATETIME SET @Dt = '2011-06-30' IF MONTH(@Dt) != MONTH(DATEADD(DAY,1,@Dt)) PRI…

sql
2015-01-04 466

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

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

2015-01-04 669

#Python
python 时间处理

在实际中遇到一个时间处理问题,需要将 Sep 06, 2014 19:30 (UTC 时间) 和 当前时间比较早晚,知道 此 2014-09-06 19:30 格式时间的运算。因此…

2015-01-04 644

#PHP
PHP下载文件

$filename = $_GET['file']; //Get the fileid from the URL // Query the file ID $query = spr…

php
2015-01-04 947

#Ruby
ruby连接mysql代码

require 'mysql'    m = Mysql.new("localhost","name","password&quo…

2015-01-04 499