2015-04-19 22:58:16 YangRunkangBla 阅读数 1781
--创建数据库
use master --权限
if exists (select * from sysdatabases where name='House')
drop database House
go
create database House 
on primary
(
name='House_data',
filename='E:\House_data.mdf',
size=15MB,
maxsize=20MB,
filegrowth=15%
)
log on
(
name='House_log',
filename='E:\House_log.ldf',
size=15MB,
maxsize=20MB,
filegrowth=15%
)
go

use House --在数据库House创建表及操作数据

--创建表sys_user
if exists (select * from sysobjects where name='sys_user')
drop table sys_user
go
create table sys_user
(
UID int identity(1,1),
UName varchar(20) not null,
UPASSWORD varchar(20)
)
go
--添加表sys_user约束
alter table sys_user
add constraint pk_UID primary key(UID),
constraint ck_UPASSWORD check(len(UPASSWORD)>=6)
go
--创建表hos_district
if exists (select * from sysobjects where name='hos_district')
drop table hos_district
go
create table hos_district
(
DID int identity(1,1),
DName varchar(20) not null
)
go
--添加表hos_district约束
alter table hos_district
add constraint pk_DID primary key(DID)
go

--创建表hos_street
if exists (select * from sysobjects where name='hos_street')
drop table hos_street
go
create table hos_street
(
SID int identity(1,1),
SName varchar(20) not null,
SDID int not null
)
go
--添加表hos_street约束
alter table hos_street
add constraint pk_SID primary key(SID),
constraint fk_SDID foreign key(SDID) references hos_district(DID)
go

--创建表hos_type
if exists (select * from sysobjects where name='hos_type')
drop table hos_type
go
create table hos_type
(
HTID int identity(1,1),
HTName varchar(20) not null
)
go

--创建表hos_house
if exists (select * from sysobjects where name='hos_house')
drop table hos_house
go
create table hos_house
(
HMID int  identity(1,1),
UID int not null,
SID int not null,
HTID int not null,
PRICE decimal not null,
TOPIC varchar(20) not null,
CONTENTS varchar(20) not null,
HTIME datetime not null,
COPY varchar(100)
)
go
--添加表hos_house约束
alter table hos_house
add constraint pk_HMID primary key(HMID),
constraint fk_UID foreign key(UID) references sys_user(UID),
constraint fk_SID foreign key(SID) references hos_street(SID),
constraint df_price default(0) for PRICE, --价格默认值0
constraint ck_price check(price>=0), --价格要求大于等于0
constraint df_HTIME default(getdate()) for HTIME, --日起默认为当前日期
constraint ck_HTIME check(HTIME<=getdate()) --日期要小于等于当前日期
go

--向表中添加数据
--sys_user
insert into sys_user values ('杨洋','1234567')
insert into sys_user values ('张三','1234567')
insert into sys_user values ('李四','1234567')
insert into sys_user values ('王娜','1234567')
insert into sys_user values ('王鸥','1234567')
insert into sys_user values ('吴鹏','1234567')
insert into sys_user values ('方尺','1234567')
go
--hos_district
insert into hos_district values('海淀区')
insert into hos_district values('东城区')
go
--hos_street
insert into hos_street values('中关村',1)
insert into hos_street values('万庄泉',1)
insert into hos_street values('东单',2)
insert into hos_street values('苏州街',1)
insert into hos_street values('西四',2)
go
--hos_type
insert into hos_type values ('两室一厅')
insert into hos_type values ('两室二厅')
insert into hos_type values ('一室一厅')
insert into hos_type values ('三室一厅')
insert into hos_type values ('两室两厅')
go
--hos_house
insert into hos_house values (1,1,1,50,'中关村','中关村电脑城','2014-4-7','中关村copy')
insert into hos_house values (2,1,2,50,'万庄泉','万庄泉电脑城','2014-1-7','万庄泉copy')
insert into hos_house values (3,2,3,60,'中关村','中关村电脑城','2014-6-7','中关村copy')
insert into hos_house values (4,4,4,100,'万庄泉','万庄泉电脑城','2014-8-7','万庄泉copy')
insert into hos_house values (6,3,2,200,'苏州街','苏州街电脑城','2014-5-7','苏州街copy')
insert into hos_house values (7,2,1,500,'东单','东单电脑城','2014-4-4','东单copy')
go


--查询第2-3条出租房屋信息
select TOP 2 * from hos_house
--查找指定客户发布的出租房屋信息
select 
hos_district.DName as 区县,
hos_street.SName as 街道,
hos_type.HTName as 户型,
PRICE as 价格,
TOPIC as 标题,
CONTENTS as 描述,
HTIME as 时间,
COPY as 备注
 from hos_house
inner join hos_street  on hos_street.SID=hos_house.SID
inner join hos_type on hos_type.HTID=hos_house.HTID
inner join hos_district on hos_street.SDID=hos_house.SID
 where UID in (select UID from sys_user where UName='张三')
 


2019-06-11 19:59:51 weixin_38148834 阅读数 369

参考:
目前开源数据集整理
数字图像处理常用数据集资源(预览+下载)

博主目前在做图像恢复的相关实验,记录一下适用的数据集。
这个数据集可以用来做最后的图像恢复效果检测。
数字图像处理常用数据集CSet8,8张彩色图(含lena,house,pepper,monarch,airplane,baboon,barbara,ship),大小都为256*256.还有一张未裁剪的monarch.
CSet8
图像用深度学习跑的时候,用coco2014数据集即可,主要满足下述条件:
1、数据量够大,8.5万左右。
2、内容不单一
3、彩色居多
但是,用作图像恢复感觉还是不行,因为我看到了这句话:
微软发布的 COCO 数据库是一个大型图像数据集, 专为对象检测、分割、人体关键点检测、语义分割和字幕生成而设计。其对于图像的标注信息不仅有类别、位置信息,还有对图像的语义文本描述,COCO数据集的开源使得近两三年来图像分割语义理解取得了巨大的进展,也几乎成为了图像语义理解算法性能评价的“标准”数据集。

为了保证图像内容的丰富性,我开始下载imagenet2012数据集,测试集6.75G,训练集137G。等我下载好哈~网速也是醉了,迅雷会员一点屁用没有,开了会员还是那么慢,哎。。。。。。。

-----------------------------------------------这里是分割线----------------------------------------------------------------

我这个下载的问题解决了,137G的数据集下载好了。迅雷开了会员,要下2000多个小时,大概就是83天吧,微笑脸。然后呢,网速好点的时候,2M/s,也得一天,可是它一会儿就变成了2Kb/s了。。。。于是我换了一个百度云的链接,整了一个百度云的vip,只需要5个小时!!!!!!!!!!所以,,,,朋友们!!!!!!买百度云的vip比迅雷好用多了。
好了,不吐槽了,贴链接(imagenet train数据集,137G)
我设置的是永久有效,大家加油!

链接: https://pan.baidu.com/s/1beRnOx75gX40WfSmWfzLrw 提取码: mzsx

2015-03-31 20:07:07 u010786672 阅读数 1263

House Robber

 Total Accepted: 212 Total Submissions: 780My Submissions

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night.

Given a list of non-negative integers representing the amount of money of each house, determine the maximum amount of money you can rob tonight without alerting the police.

Credits:
Special thanks to @ifanchu for adding this problem and creating all test cases. Also thanks to @ts for adding additional test cases.

题目的意思是:从数组中任选N个数相加,要求取得的和最大,前提是,任意两个数不能相邻。

记S[I]表示前i个元素所能够取得的最大和,则S[I+1]=max(S[i],S[i-1]+num[i+1]),

则代码如下:

public class Solution {
    public int rob(int[] num) {
        if(num.length==0) return 0;
        int[] s=new int[num.length];
        s[0]=num[0];
        for(int i=1;i<num.length;i++){
            if(i>1){
                s[i]=Math.max(s[i-1],s[i-2]+num[i]);
            }else{
                s[i]=Math.max(s[i-1],num[i]);
            }
            
        }
        return s[num.length-1];
    }
}












Design house

阅读数 47

Paint House

阅读数 294

没有更多推荐了,返回首页