language
stringclasses 15
values | src_encoding
stringclasses 34
values | length_bytes
int64 6
7.85M
| score
float64 1.5
5.69
| int_score
int64 2
5
| detected_licenses
listlengths 0
160
| license_type
stringclasses 2
values | text
stringlengths 9
7.85M
|
---|---|---|---|---|---|---|---|
JavaScript
|
UTF-8
| 1,329 | 2.53125 | 3 |
[] |
no_license
|
import * as types from '../constants/ActionTypes.js'
import undoable, { distinctState } from 'redux-undo'
const chartInfo = {
top:0,
left:0,
legend:false
};
const ChartReducer = (state = chartInfo, action) => {
switch (action.type) {
case types.SET_LEGEND_VISIBILITY:
return Object.assign({}, state, {
legend: action.payload
})
case types.MOVE_TOP:
let top1 = state.top;
let y1 = top1-10;
if(y1>=-200){
return Object.assign({}, state, {
top: y1
})
}
return state
case types.MOVE_BOTTOM:
let top2 = state.top;
let y2 = top2+10;
if(y2<=200){
return Object.assign({}, state, {
top: y2
})
}
return state;
case types.MOVE_LEFT:
let left1 = state.left;
let y3 = left1-10;
if(y3>=-200){
return Object.assign({}, state, {
left:y3
})
}
return state;
case types.MOVE_RIGHT:
let left2 = state.left;
let y4 = left2+10;
if(y4<=200){
return Object.assign({}, state, {
left:y4
})
}
return state;
default:
return state
}
}
const undoableChartReducer = undoable(ChartReducer, {
filter: distinctState()
})
export default undoableChartReducer
|
Markdown
|
UTF-8
| 9,748 | 3.40625 | 3 |
[] |
no_license
|
# 实例方法 - 交互
## addTo
- `addTo(container, delay)`
- 参数:
- `{String|HTMLElement} container` HTMLElement对象的ID值、HTMLElement对象
- `{ Number } delay` 延迟时间,单位为毫秒 `ms`
- 返回值: `{ Object }` popo实例
将实例添加到指定容器
```js
P.init(options).addTo('container');
```
## update
- `update(options)`
- 参数:
- `{Array | Object} options` 面板更新选项
- 返回值: `{Object}` 容器实例
刷新布局或根据选项更新指定的面板,`option`缺省则为刷新布局,`options`可以为对象或对象的数组集合,对象的结构如下:
- `{ String|Number|HTMLElement|Array } panels` 面板HTMLElement 、面板ID或别名值,支持单个和数组集合
- `{ Number } width` 面板的宽度,单位为`px`
- `{ Number } height` 面板的高度,单位为`px`
- `{ Number } zIndex` 面板层级
- `{ Number } left` 面板 距离容器最左侧的距离,单位为`px`
- `{ Number } top` 面板 距离容器最顶部的距离,单位为`px`
```js
const popo = P.init(popoOptions).addTo('container');
// 刷新布局
popo.update();
// 刷新指定的面板(对象)
popo.update({
panels: [1,2],
width: 500,
height: 200,
zIndex: 100,
left: 100,
top: 50
})
// 批量刷新指定的面板(数组)
popo.update([{
panels: [1,2],
width: 500,
height: 200,
zIndex: 100,
left: 100,
top: 50
},{
panels: [3,4],
width: 300,
height: 100,
zIndex: 98,
left: 50,
top: 50
}])
```
## remove
- `remove(target, clearTpl)`
- 参数:
- `{ String|Number|HTMLElement|Array } target` 面板HTMLElement 、面板ID或别名值,支持单个和数组集合
- `{ Boolean } clearTpl ` 是否移除面板中加载的模板内容
- 返回值: `{ Object }` popo实例
删除指定的面板或移除整个PoPo实例,删除面板或移除实例后将无法再实用删除的对象
!> 如果面板中包括模板创建的内容,默认会恢复到模板位置中且不可见,不会删除模板内容
```js
var popo = P.init(popoOptions);
// 移除整个PoPo实例
popo.remove();
// 删除指定面板,但不会删除模板内容
popo.remove([1,2,3])
// 删除指定的面板,会删除模板内容
popo.remove([1,2,3], true);
```
## restore
- `restore(options)`
- 参数:
- `{Object|Array<Object>} options` 恢复选项
- 返回值: `{ Object }` popo实例
恢复布局或根据选项恢复指定面板的布局,`option`缺省则为刷新布局,`options`可以为对象或对象的数组集合,对象的结构如下:
panels, size = false, position = false, zIndex = false
- `{ String|Number|HTMLElement|Array } panels` 面板HTMLElement 、面板ID或别名值,支持单个和数组集合
- `{ Boolean } size` 是否恢复面板的宽度和高度,默认为`true`
- `{ Boolean } position` 是否恢复面板的位置,默认为`true`
- `{ Boolean } zIndex` 是否恢复面板的层级,默认为`true`
```js
const popo = P.init(popoOptions).addTo('container');
// 恢复布局
popo.restore();
// 恢复指定的面板布局(对象)
popo.restore({
panels: [1,2],
size: false,
position: true,
zIndex: false,
})
// 批量恢复指定的面板布局(数组)
popo.restore([{
panels: [1,2],
size: false,
position: true,
zIndex: false,
},{
panels: [3,4],
size: true,
position: true,
zIndex: true,
}]);
```
## setStyle
- `setStyle(style)`
- 参数:
- `{ Object } style` 样式选项,结构同配置[`style`](/zh-cn/?id=options-style)
- 返回值: `{ Object }` popo实例
重置主题样式
```js
const popo = P.init(popoOptions).addTo('container');
popo.setStyle({
classname: 'popo-theme',
custom: [
{
panels: [1,2,3],
panel: {
classanme: 'popo-panel-new',
style: {
borderColor: '1px solid red',
}
}
}
],
});
```
## updateStyle
- `updateStyle(style)`
- 参数:
- `{ Object } style` 样式选项,结构同配置[`style`](/zh-cn/?id=options-style)
- 返回值: `{ Object }` popo实例
刷新样式,用于合并样式
## removeStyle
- `removeStyle()`
- 参数: 无
- 返回值: `{ Object }` popo实例
移除所有样式并清空`style`对象
## zoom
- `zoom(scale)`
- 参数: `{ Number } scale` 缩放级别
- 返回值: `{ Object }` popo实例
缩放实例容器,只有开启选项[zoom](/zh-cn/?id=options-zoom)才有效
## show
- `show(target)`
- 参数: `{ Number | String | HTMLElement | Array<Number|String|HTMLElement> } target` 单个或多个面板,缺省为实例容器
- 返回值: `{ Object }` popo实例
显示单个或多个面板,缺省参数则显示整个实例容器
```js
const popo = P.init(popoOptions).addTo('container');
// 显示实例容器
popo.show();
// 显示ID为[1,2,3]的面板
popo.show([1,2,3]);
```
## hide
- `hide(ids)`
- 参数: `{ Number | String | HTMLElement | Array<Number|String|HTMLElement> } target` 单个或多个面板,缺省为实例容器
- 返回值: `{ Object }` popo实例
隐藏单个或多个面板,缺省参数则隐藏整个实例容器
```js
const popo = P.init(popoOptions).addTo('container');
// 隐藏实例容器
popo.hide();
// 隐藏ID为[1,2,3]的面板
popo.hide([1,2,3]);
```
## each
- `each(fn, targets, context)`
- 参数:
- `{ Function } fn` 遍历函数,回调参数为 `elements`,包括`{id, alias, isExtend, panel, wrap, center, head, foot, left, right, position, size}`
- `{Array<String|Number|HTMLElement>} targets` 面板对象集合,缺省为遍历所有面板
- `{ Object } context` 遍历函数绑定的上下文
- 返回值: `{ Object }` popo实例
遍历指定或所有的面板
```js
const popo = P.init(popoOptions).addTo('container');
// 遍历所有面板
popo.each(function(elements) {
console.log(elements);
});
// {id, alias, isExtend, panel, wrap, center, head, foot, left, right, position, size}...
// 遍历指定的面板
popo.each(function(elements) {
console.log(elements);
}, [1,2,3]);
```
## full
- `full(target, zIndex)`
- 参数:
- `{ String|Number|HTMLElement } target` 面板HTMLElement 、面板ID或别名值
- `{ Number } zInex` 全屏面板的层级
- 返回值: `{ Object }` popo实例
全屏指定的面板
## unFull
- `unFull()`
- 参数: 无
- 返回值: `{ Object }` popo实例
恢复已全屏的面板
## addPanel
- `addPanel(options)`
- 参数:
- `{Object} options` 面板选项
- 返回值: `{Object}` 创建的面板信息
向容器中添加面板,参数结构如下:
!> `layout`为`null`时不会创建面板布局
```js
{
size: {
width: 0, // {Number} 面板宽度, 单位为px
height: 0, // {Number} 面板高度, 单位为px
responsive: true, // {Boolean} 是否是响应式
},
position: {
left: 0, // {Number} 面板距容器左侧的距离,单位为px
top: 0, // {Number} 面板距容器顶部的距离,单位为px
responsive: true, // {Boolean}是否是响应式
},
id: '', // {String} HTMLElement ID
zIndex: 0, // {Number} 面板层级
layout: { // 面板布局,为 null 时不会创建面板布
headHeight: 0, //{Number|String} 头部高度,支持百分比与数值,数值单位为px
footHeight: 0, //{Number|String} 底部区域高度,支持百分比与数值,数值单位为px
leftWidth: 0, //{Number|String} 左侧宽度,支持百分比与数值,数值单位为px
rightWidth: 0, //{Number|String} 右侧宽度,支持百分比与数值,数值单位为px
gutter: 0, //{Number} 间隔大小,单位为`px`
},
}
```
## setPanelLayout
- `setPanelLayout(options)`
- 参数:
- `{Object | Array<Object>} options` 面板选项,支持对象与对象数组
- 返回值: `{ Object }` popo实例
设置面板布局,选项缺省默认值如下:
```js
{
//{String|Number|HTMLElement|Array}面板HTMLElement、面板ID或别名值,支持单个和数组集合
panels: null,
headHeight: 0, //{Number|String} 头部高度,支持百分比与数值,数值单位为px
footHeight: 0, //{Number|String} 底部区域高度,支持百分比与数值,数值单位为px
leftWidth: 0, //{Number|String} 左侧宽度,支持百分比与数值,数值单位为px
rightWidth: 0, //{Number|String} 右侧宽度,支持百分比与数值,数值单位为px
gutter: 0, //{Number} 间隔大小,单位为`px`
}
```
## clearPanel
- `clearPanel(target, clearTpl)`
- 参数:
- `{ String|Number|HTMLElement|Array } target` 面板HTMLElement 、面板ID或别名值,支持单个和数组集合
- `{ Boolean } clearTpl ` 是否清除面板中加载的模板内容
- 返回值: `{ Object }` popo实例
清空面板
!> 如果面板中包括模板创建的内容,默认会恢复到模板位置中且不可见,不会清除模板内容
## clearAllPanel
- `clearAllPanel(clearTpl)`
- 参数:
- `{ Boolean } clearTpl ` 是否清除面板中加载的模板内容
- 返回值: `{ Object }` popo实例
清空所有面板
## setBodyScroll
- `setBodyScroll()`
- 参数: 无
- 返回值: `{ Object }` popo实例
将实例容器的滚动条样式移动到`document.body`上,此方法主要用于浏览器屏幕截图
!> 由于popo实例创建了内部容器,超过可视屏幕区域的内容所产生的滚动条并不在`document.body`上,浏览器全屏截图的功能并不能识别非`document.body`的滚动条,如果需要全尺寸的屏幕截图,请在截图前调用此方法。
## resetBodyScroll
- `resetBodyScroll()`
- 参数: 无
- 返回值: `{ Object }` popo实例
恢复实例容器的滚动条样式。
|
Python
|
UTF-8
| 696 | 4.46875 | 4 |
[] |
no_license
|
#06-(07)
#키보드로 정수 수치를 입력받아 짝수인지 홀수 인지 판별하는 코드를 작성하세요
#입력받은 수치가 숫자인지도 판별하여 숫자가 아닌경우 "숫자가 아닙니다."라고 출력합니다.
num=int(input("수를 입력하세요"))
while num.isdigit():
if num % 2 == 0:
print("짝수")
elif num % 2 == 1:
print("홀수")
else:
print('숫자가 아닙니다.')
# try:
# num = input("수를 입력하세요:")
# int(num)
# if int(num) % 2 == 0:
# print("짝수")
# elif int(num) % 2 == 1:
# print("홀수")
# except ValueError as e:
# print('숫자가 아닙니다.')
|
Python
|
UTF-8
| 910 | 4.78125 | 5 |
[] |
no_license
|
"""
Python provides a number of ways to perform printing. Research
how to print using the printf operator, the `format` string
method, and by using f-strings.
"""
x = 10
y = 2.24552
z = "I like turtles!"
# Using the printf operator (%), print the following feeding in the values of x,
# y, and z:
# x is 10, y is 2.25, z is "I like turtles!"
# f - is for 'fixed number" -- .2(fix the number to two places after the decimal)
print("x is %i, y is %.2f, z is %s" % (x, y, z))
# Use the 'format' string method to print the same thing
# index position must be used when using other arguments, in this case for the second (1) position
###I am fixing to two decimal places
str = "x is {0}, y is {1:.2f}, z is {2}"
print(str.format(x,y,z))
# Finally, print the same thing using an f-string
### for fixed decimal, use the key value instead of the index value as per above
print(f"x is {x}, y is {y:.2f}, z is {z}")
|
SQL
|
UTF-8
| 12,351 | 3.25 | 3 |
[] |
no_license
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 17, 2021 at 07:23 PM
-- Server version: 8.0.17
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `real_estate_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `buyer`
--
CREATE TABLE `buyer` (
`Email` varchar(50) NOT NULL,
`First_Name` varchar(50) NOT NULL,
`Last_Name` varchar(50) NOT NULL,
`Password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `buyer`
--
INSERT INTO `buyer` (`Email`, `First_Name`, `Last_Name`, `Password`) VALUES
('testb', 'testf', 'testl', 'buyer');
-- --------------------------------------------------------
--
-- Table structure for table `buyer_bookmarks_property`
--
CREATE TABLE `buyer_bookmarks_property` (
`Email` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`Property_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
--
-- Dumping data for table `buyer_bookmarks_property`
--
INSERT INTO `buyer_bookmarks_property` (`Email`, `Property_ID`) VALUES
('testb', 1),
('testb', 4);
-- --------------------------------------------------------
--
-- Table structure for table `commercial_property`
--
CREATE TABLE `commercial_property` (
`Property_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `commercial_property`
--
INSERT INTO `commercial_property` (`Property_ID`) VALUES
(3);
-- --------------------------------------------------------
--
-- Table structure for table `online_meeting`
--
CREATE TABLE `online_meeting` (
`Meeting_ID` int(11) NOT NULL,
`Agent_ID` int(11) NOT NULL,
`Date` date NOT NULL,
`Time` time NOT NULL,
`B_Email` varchar(50) NOT NULL,
`Message` varchar(250) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `online_meeting`
--
INSERT INTO `online_meeting` (`Meeting_ID`, `Agent_ID`, `Date`, `Time`, `B_Email`, `Message`) VALUES
(1, 2, '2021-04-17', '16:00:00', 'testb', 'i would like to book a meeting!'),
(2, 2, '2021-04-17', '13:00:00', 'testb', 'if possible, i would love a tour of property 4!'),
(3, 1, '2021-04-19', '16:00:00', 'testb', ''),
(4, 2, '2021-04-22', '16:00:00', 'testb', ''),
(5, 2, '2021-04-29', '14:00:00', 'testb', '');
-- --------------------------------------------------------
--
-- Table structure for table `online_meeting_has_tour`
--
CREATE TABLE `online_meeting_has_tour` (
`Tour_ID` int(11) NOT NULL,
`Meeting_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `online_meeting_has_tour`
--
INSERT INTO `online_meeting_has_tour` (`Tour_ID`, `Meeting_ID`) VALUES
(1, 1),
(2, 2),
(3, 5);
-- --------------------------------------------------------
--
-- Table structure for table `property`
--
CREATE TABLE `property` (
`Property_ID` int(11) NOT NULL,
`Address` varchar(50) NOT NULL,
`Neighbourhood` varchar(50) NOT NULL,
`City` varchar(50) NOT NULL,
`Zip_Code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`Estimated_Value` int(11) NOT NULL,
`Square_Footage` int(11) NOT NULL,
`Num_Beds` int(11) NOT NULL,
`Num_Baths` int(11) NOT NULL,
`S_Email` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `property`
--
INSERT INTO `property` (`Property_ID`, `Address`, `Neighbourhood`, `City`, `Zip_Code`, `Estimated_Value`, `Square_Footage`, `Num_Beds`, `Num_Baths`, `S_Email`) VALUES
(1, '220 Hawkwood Boulevard NW', 'Hawkwood', 'Calgary', 'T3G3E8', 445000, 7250, 3, 3, 'tests'),
(2, '23 Applecrest Court SE', 'Applewood Park', 'Calgary', 'T2A7N8', 349900, 4050, 2, 1, 'tests'),
(3, '5, 1922 9 Avenue SE', 'Inglewood', 'Calgary', 'T2G0V2', 715000, 0, 0, 2, 'tests'),
(4, '101 Woodglen Place', 'Woodglen', 'Okotoks', 'T1S1L2', 410000, 7250, 3, 3, 'tests');
-- --------------------------------------------------------
--
-- Table structure for table `property_image`
--
CREATE TABLE `property_image` (
`Image_ID` int(11) NOT NULL,
`Property_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `property_image`
--
INSERT INTO `property_image` (`Image_ID`, `Property_ID`) VALUES
(1, 1),
(2, 1);
-- --------------------------------------------------------
--
-- Table structure for table `real_estate_agent`
--
CREATE TABLE `real_estate_agent` (
`Agent_ID` int(11) NOT NULL,
`First_Name` varchar(50) NOT NULL,
`Last_Name` varchar(50) NOT NULL,
`Contact_No` varchar(50) NOT NULL,
`Email` varchar(50) NOT NULL,
`Password` varchar(50) NOT NULL,
`Association` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `real_estate_agent`
--
INSERT INTO `real_estate_agent` (`Agent_ID`, `First_Name`, `Last_Name`, `Contact_No`, `Email`, `Password`, `Association`) VALUES
(1, 'AgentF', 'AgentL', '1111111111', 'agent@agent.com', 'agent', 'Agent Association'),
(2, 'testf', 'testl', '8888888888', 'testa', 'agent', 'test');
-- --------------------------------------------------------
--
-- Table structure for table `residential_property`
--
CREATE TABLE `residential_property` (
`Property_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `residential_property`
--
INSERT INTO `residential_property` (`Property_ID`) VALUES
(1),
(2),
(4);
-- --------------------------------------------------------
--
-- Table structure for table `seller`
--
CREATE TABLE `seller` (
`Email` varchar(50) NOT NULL,
`First_Name` varchar(50) NOT NULL,
`Last_Name` varchar(50) NOT NULL,
`Password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `seller`
--
INSERT INTO `seller` (`Email`, `First_Name`, `Last_Name`, `Password`) VALUES
('tests', 'testf', 'testl', 'seller');
-- --------------------------------------------------------
--
-- Table structure for table `tour`
--
CREATE TABLE `tour` (
`Tour_ID` int(11) NOT NULL,
`Property_ID` int(11) NOT NULL,
`Agent_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tour`
--
INSERT INTO `tour` (`Tour_ID`, `Property_ID`, `Agent_ID`) VALUES
(1, 1, 2),
(2, 4, 2),
(3, 3, 2);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `buyer`
--
ALTER TABLE `buyer`
ADD PRIMARY KEY (`Email`),
ADD UNIQUE KEY `Email` (`Email`);
--
-- Indexes for table `buyer_bookmarks_property`
--
ALTER TABLE `buyer_bookmarks_property`
ADD PRIMARY KEY (`Email`,`Property_ID`),
ADD UNIQUE KEY `Email` (`Email`,`Property_ID`),
ADD KEY `Buyer_Bookmark_Property_ID_FK` (`Property_ID`);
--
-- Indexes for table `commercial_property`
--
ALTER TABLE `commercial_property`
ADD PRIMARY KEY (`Property_ID`),
ADD UNIQUE KEY `Property_ID` (`Property_ID`);
--
-- Indexes for table `online_meeting`
--
ALTER TABLE `online_meeting`
ADD PRIMARY KEY (`Meeting_ID`),
ADD UNIQUE KEY `Meeting_ID` (`Meeting_ID`),
ADD KEY `Online_Meeting_B_Email_FK` (`B_Email`),
ADD KEY `Online_Meeting_Agent_ID_FK` (`Agent_ID`);
--
-- Indexes for table `online_meeting_has_tour`
--
ALTER TABLE `online_meeting_has_tour`
ADD PRIMARY KEY (`Tour_ID`),
ADD UNIQUE KEY `Tour_ID` (`Tour_ID`),
ADD KEY `Online_Meeting_Has_Tour_Meeting_ID_FK` (`Meeting_ID`);
--
-- Indexes for table `property`
--
ALTER TABLE `property`
ADD PRIMARY KEY (`Property_ID`),
ADD UNIQUE KEY `Property_ID` (`Property_ID`),
ADD KEY `Property_S_Email_FK` (`S_Email`);
--
-- Indexes for table `property_image`
--
ALTER TABLE `property_image`
ADD PRIMARY KEY (`Image_ID`,`Property_ID`),
ADD UNIQUE KEY `Image_ID` (`Image_ID`,`Property_ID`),
ADD KEY `Property_Image_Property_ID_FK` (`Property_ID`);
--
-- Indexes for table `real_estate_agent`
--
ALTER TABLE `real_estate_agent`
ADD PRIMARY KEY (`Agent_ID`),
ADD UNIQUE KEY `Agent_ID` (`Agent_ID`),
ADD UNIQUE KEY `Email` (`Email`);
--
-- Indexes for table `residential_property`
--
ALTER TABLE `residential_property`
ADD PRIMARY KEY (`Property_ID`),
ADD UNIQUE KEY `Property_ID` (`Property_ID`);
--
-- Indexes for table `seller`
--
ALTER TABLE `seller`
ADD PRIMARY KEY (`Email`),
ADD UNIQUE KEY `Email` (`Email`);
--
-- Indexes for table `tour`
--
ALTER TABLE `tour`
ADD PRIMARY KEY (`Tour_ID`),
ADD UNIQUE KEY `Tour_ID` (`Tour_ID`),
ADD KEY `Tour_Agent_ID_FK` (`Agent_ID`),
ADD KEY `Tour_Property_ID_FK` (`Property_ID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `online_meeting`
--
ALTER TABLE `online_meeting`
MODIFY `Meeting_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `property`
--
ALTER TABLE `property`
MODIFY `Property_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `property_image`
--
ALTER TABLE `property_image`
MODIFY `Image_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `real_estate_agent`
--
ALTER TABLE `real_estate_agent`
MODIFY `Agent_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tour`
--
ALTER TABLE `tour`
MODIFY `Tour_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `buyer_bookmarks_property`
--
ALTER TABLE `buyer_bookmarks_property`
ADD CONSTRAINT `Buyer_Bookmark_Email_FK` FOREIGN KEY (`Email`) REFERENCES `buyer` (`Email`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `Buyer_Bookmark_Property_ID_FK` FOREIGN KEY (`Property_ID`) REFERENCES `property` (`Property_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `commercial_property`
--
ALTER TABLE `commercial_property`
ADD CONSTRAINT `Commerc_Property_Property_ID_FK` FOREIGN KEY (`Property_ID`) REFERENCES `property` (`Property_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `online_meeting`
--
ALTER TABLE `online_meeting`
ADD CONSTRAINT `Online_Meeting_Agent_ID_FK` FOREIGN KEY (`Agent_ID`) REFERENCES `real_estate_agent` (`Agent_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `Online_Meeting_B_Email_FK` FOREIGN KEY (`B_Email`) REFERENCES `buyer` (`Email`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `online_meeting_has_tour`
--
ALTER TABLE `online_meeting_has_tour`
ADD CONSTRAINT `Online_Meeting_Has_Tour_Meeting_ID_FK` FOREIGN KEY (`Meeting_ID`) REFERENCES `online_meeting` (`Meeting_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `Online_Meeting_Has_Tour_Tour_ID_FK` FOREIGN KEY (`Tour_ID`) REFERENCES `tour` (`Tour_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `property`
--
ALTER TABLE `property`
ADD CONSTRAINT `Property_S_Email_FK` FOREIGN KEY (`S_Email`) REFERENCES `seller` (`Email`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `property_image`
--
ALTER TABLE `property_image`
ADD CONSTRAINT `Property_Image_Property_ID_FK` FOREIGN KEY (`Property_ID`) REFERENCES `property` (`Property_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `residential_property`
--
ALTER TABLE `residential_property`
ADD CONSTRAINT `Residential_Property_Property_ID_FK` FOREIGN KEY (`Property_ID`) REFERENCES `property` (`Property_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
--
-- Constraints for table `tour`
--
ALTER TABLE `tour`
ADD CONSTRAINT `Tour_Agent_ID_FK` FOREIGN KEY (`Agent_ID`) REFERENCES `real_estate_agent` (`Agent_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT,
ADD CONSTRAINT `Tour_Property_ID_FK` FOREIGN KEY (`Property_ID`) REFERENCES `property` (`Property_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
C#
|
UTF-8
| 2,273 | 2.703125 | 3 |
[] |
no_license
|
using System;
using System.Collections.Generic;
namespace LPS.ToolScript.Parser
{
public class EvaluatedAttributeList : Dictionary<string, EvaluatedAttribute>, IExpression, ICloneable
{
public EvaluatedAttributeList()
{
}
public void Run (IExecutionContext context)
{
Eval(context);
}
public object Eval(IExecutionContext context)
{
foreach(KeyValuePair<string, EvaluatedAttribute> kv in this)
kv.Value.Eval(context);
return this;
}
public bool EvalAsBool (IExecutionContext context)
{
throw new InvalidOperationException();
}
public T Get<T>(string name)
{
EvaluatedAttribute result;
if(TryGetValue(name, out result))
{
if(result.Value != null)
{
Type t = result.Value.GetType();
if(t != typeof(T) && !t.IsSubclassOf(typeof(T)))
return (T)Convert.ChangeType(result.Value, typeof(T));
}
return (T) result.Value;
}
throw new KeyNotFoundException();
}
public T Get<T>(string name, T default_val)
{
EvaluatedAttribute result;
if(TryGetValue(name, out result))
{
if(result.Value != null)
{
Type t = result.Value.GetType();
if(t != typeof(T) || t.IsSubclassOf(typeof(T)))
return (T)Convert.ChangeType(result.Value, typeof(T));
}
return (T) result.Value;
}
return default_val;
}
public bool TryGet<T>(string name, out T value)
{
object result;
if(TryGet(typeof(T), name, out result))
{
value = (T)result;
return true;
}
value = default(T);
return false;
}
public bool TryGet(Type type, string name, out object value)
{
EvaluatedAttribute result;
if(TryGetValue(name, out result))
{
if(result.Value != null)
{
Type t = result.Value.GetType();
if(!type.IsAssignableFrom(t))
{
value = Convert.ChangeType(result.Value, type);
return true;
}
}
value = result.Value;
return true;
}
value = null;
return false;
}
public virtual EvaluatedAttributeList Clone()
{
EvaluatedAttributeList clone = new EvaluatedAttributeList();
foreach(KeyValuePair<string, EvaluatedAttribute> kv in this)
clone.Add(kv.Key, kv.Value.Clone());
return clone;
}
object ICloneable.Clone()
{
return this.Clone();
}
}
}
|
C#
|
UTF-8
| 2,168 | 3.265625 | 3 |
[] |
no_license
|
using System;
using System.Security.Cryptography.X509Certificates;
namespace Lab6
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите путь каталога: ");
string path = Console.ReadLine();
DOCType doc = new DOCType(path);
Start(doc);
void Start(AbstractHandler Type)
{
Console.WriteLine("Выберете действие: 1)Create File 2)Open File 3)File editing");
int num = int.Parse(Console.ReadLine());
Console.WriteLine("Введите имя файла: ");
string fileName = Console.ReadLine();
switch (num)
{
case 1:
{
Console.WriteLine("Введите текст:");
string text = Console.ReadLine();
if (text != String.Empty)
Type.CreateFile(fileName, text);
else
{
Type.CreateFile(fileName);
}
break;
}
case 2:
{
Type.OpenFile(fileName);
break;
}
case 3:
{
Console.WriteLine("1)Delete 2)Move File");
int choice = int.Parse(Console.ReadLine());
if (choice == 1)
{
Type.FileEdit(fileName);
}
else if (choice == 2)
{
Console.WriteLine("path:");
string mpath = Console.ReadLine();
Type.FileEdit(fileName, mpath);
}
break;
}
}
}
}
}
}
|
Java
|
UTF-8
| 281 | 1.851563 | 2 |
[] |
no_license
|
package com.caring.wxrs.rest.request;
/**
*
* @author james
*/
public class AudioUploadRequest {
private String mediaId;
public String getMediaId() {
return mediaId;
}
public void setMediaId(String mediaId) {
this.mediaId = mediaId;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.