code stringlengths 3 1.01M | repo_name stringlengths 5 116 | path stringlengths 3 311 | language stringclasses 30 values | license stringclasses 15 values | size int64 3 1.01M |
|---|---|---|---|---|---|
INSERT INTO `car_brand` (`id`, `name`, `acronym`, `name_pinyin`, `create_time`, `update_time`, `status`) VALUES
(1, '腾势', 'T', 'tengshi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(2, '三菱', 'S', 'sanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(3, '江铃集团轻汽', 'J', 'jianglingjituanqingqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(4, '五菱', 'W', 'wuling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(5, '汇众', 'H', 'huizhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(6, '依维柯', 'Y', 'yiweike', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(7, '雪佛兰', 'X', 'xuefolan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(8, '永源', 'Y', 'yongyuan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(9, '纳智捷', 'N', 'nazhijie', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(10, '北汽威旺', 'B', 'beiqiweiwang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(11, '海马', 'H', 'haima', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(12, 'MG', 'M', 'mg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(13, '广汽传祺', 'G', 'guangqichuanqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(14, '观致', 'G', 'guanzhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(15, 'DS', 'D', 'ds', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(16, '众泰', 'Z', 'zhongtai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(17, '摩根', 'M', 'mogen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(18, '英菲尼迪', 'Y', 'yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(19, 'KTM', 'K', 'ktm', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(20, '瑞麒', 'R', 'ruiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(21, '黄海', 'H', 'huanghai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(22, '长城汽车', 'Z', 'zhangchengqiche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(23, '光冈', 'G', 'guanggang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(24, '双龙', 'S', 'shuanglong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(25, '力帆', 'L', 'lifan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(26, '东南', 'D', 'dongnan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(27, '布加迪', 'B', 'bujiadi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(28, '路虎', 'L', 'luhu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(29, '菲亚特', 'F', 'feiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(30, '法拉利', 'F', 'falali', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(31, '比亚迪', 'B', 'biyadi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(32, '红旗', 'H', 'hongqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(33, '荣威', 'R', 'rongwei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(34, '雷诺', 'L', 'leinuo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(35, '思铭', 'S', 'siming', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(36, '东风风行', 'D', 'dongfengfengxing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(37, '长安汽车', 'Z', 'zhanganqiche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(38, '威麟', 'W', 'weilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(39, '奔驰', 'B', 'benchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(40, '安凯客车', 'A', 'ankaikeche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(41, '上汽大通', 'S', 'shangqidatong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(42, '启辰', 'Q', 'qichen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(43, '开瑞', 'K', 'kairui', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(44, '理念', 'L', 'linian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(45, '陆风', 'L', 'lufeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(46, '英致', 'Y', 'yingzhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(47, 'GMC', 'G', 'gmc', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(48, '双环', 'S', 'shuanghuan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(49, '东风', 'D', 'dongfeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(50, '现代', 'X', 'xiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(51, 'Tesla', 'T', 'tesla', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(52, '兰博基尼', 'L', 'lanbojini', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(53, '金杯', 'J', 'jinbei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(54, '中兴', 'Z', 'zhongxing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(55, '中华', 'Z', 'zhonghua', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(56, '奥迪', 'A', 'aodi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(57, '沃尔沃', 'W', 'woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(58, '宝骏', 'B', 'baojun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(59, '欧宝', 'O', 'oubao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(60, '福汽启腾', 'F', 'fuqiqiteng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(61, '凯冀', 'K', 'kaiji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(62, '捷豹', 'J', 'jiebao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(63, '江淮', 'J', 'jianghuai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(64, '阿斯顿•马丁', 'A', 'asidunmading', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(65, '华普', 'H', 'huapu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(66, '九龙', 'J', 'jiulong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(67, '北京汽车', 'B', 'beijingqiche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(68, '猎豹', 'L', 'liebao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(69, '标致', 'B', 'biaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(70, '铃木', 'L', 'lingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(71, '斯巴鲁', 'S', 'sibalu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(72, '林肯', 'L', 'linken', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(73, '莲花', 'L', 'lianhua', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(74, '悍马', 'H', 'hanma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(75, '成功汽车', 'C', 'chenggongqiche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(76, '本田', 'B', 'bentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(77, '阿尔法罗密欧', 'A', 'aerfaluomiou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(78, '奔腾', 'B', 'benteng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(79, '哈弗', 'H', 'hafu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(80, '飞驰', 'F', 'feichi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(81, '丰田', 'F', 'fengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(82, '宝马', 'B', 'baoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(83, '斯柯达', 'S', 'sikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(84, '长安商用车', 'Z', 'zhanganshangyongche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(85, '劳斯莱斯', 'L', 'laosilaisi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(86, '卡威', 'K', 'kawei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(87, '西亚特', 'X', 'xiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(88, '威兹曼', 'W', 'weiziman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(89, '北汽制造', 'B', 'beiqizhizao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(90, '玛莎拉蒂', 'M', 'mashaladi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(91, '宾利', 'B', 'binli', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(92, '北汽幻速', 'B', 'beiqihuansu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(93, '绅宝', 'S', 'shenbao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(94, '卡尔森', 'K', 'kaersen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(95, '一汽', 'Y', 'yiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(96, 'Jeep', 'J', 'jeep', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(97, '科尼塞克', 'K', 'kenisaike', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(98, '日产', 'R', 'richan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(99, '海格', 'H', 'haige', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(100, '东风风度', 'D', 'dongfengfengdu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(101, '迈凯伦', 'M', 'maikailun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(102, '江铃', 'J', 'jiangling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(103, '雷克萨斯', 'L', 'leikesasi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(104, '劳伦士', 'L', 'laolunshi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(105, '欧朗', 'O', 'oulang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(106, '保时捷', 'B', 'baoshijie', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(107, '道奇', 'D', 'daoqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(108, '北汽新能源', 'B', 'beiqixinnengyuan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(109, 'MINI', 'M', 'mini', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(110, '野马', 'Y', 'yema', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(111, '萨博', 'S', 'sabo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(112, '福特', 'F', 'fute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(113, '讴歌', 'O', 'ouge', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(114, '福迪', 'F', 'fudi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(115, '金旅', 'J', 'jinlu:', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(116, '路特斯', 'L', 'lutesi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(117, '克莱斯勒', 'K', 'kelaisile', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(118, '哈飞', 'H', 'hafei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(119, '马自达', 'M', 'mazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(120, '广汽吉奥', 'G', 'guangqijiao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(121, '巴博斯', 'B', 'babosi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(122, '中欧', 'Z', 'zhongou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(123, 'Smart', 'S', 'smart', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(124, '起亚', 'Q', 'qiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(125, '吉利', 'J', 'jili', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(126, '华颂', 'H', 'huasong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(127, '东风小康', 'D', 'dongfengxiaokang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(128, '世爵', 'S', 'shijue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(129, '凯迪拉克', 'K', 'kaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(130, '恒天', 'H', 'hengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(131, '雪铁龙', 'X', 'xuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(132, '别克', 'B', 'bieke', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(133, '奇瑞', 'Q', 'qirui', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(134, '华泰', 'H', 'huatai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(135, '大众', 'D', 'dazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(136, '昌河', 'C', 'changhe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(137, '东风风神', 'D', 'dongfengfengshen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(138, '福田', 'F', 'futian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1);
INSERT INTO `car_model` (`id`, `brand_id`, `name`, `acronym`, `name_pinyin`, `create_time`, `update_time`, `status`) VALUES
(1, 1, '比亚迪戴姆勒', 'B', 'biyadidaimule', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(2, 1, '腾势电动车', 'T', 'tengshidiandongche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(3, 2, '戈蓝-东南三菱', 'G', 'gelan-dongnansanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(4, 2, '君阁-东南三菱', 'J', 'junge-dongnansanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(5, 2, '蓝瑟-东南三菱', 'L', 'lanse-dongnansanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(6, 2, '翼神-东南三菱', 'Y', 'yishen-dongnansanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(7, 2, '帕杰罗劲畅-广汽三菱', 'P', 'pajieluojingchang-guangqisanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(8, 2, '新劲炫 ASX-广汽三菱', 'X', 'xinjingxuan asx-guangqisanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(9, 2, '格蓝迪-进口三菱', 'G', 'gelandi-jinkousanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(10, 2, 'LANCER-进口三菱', 'L', 'lancer-jinkousanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(11, 2, '欧蓝德-进口三菱', 'O', 'oulande-jinkousanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(12, 2, '帕杰罗-进口三菱', 'P', 'pajieluo-jinkousanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(13, 2, '帕杰罗劲畅-进口三菱', 'P', 'pajieluojingchang-jinkousanling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(14, 3, '骐铃T5', 'Q', 'qilingt5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(15, 4, '上汽通用五菱', 'S', 'shangqitongyongwuling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(16, 4, 'PN货车', 'P', 'pnhuoche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(17, 4, '五菱宏光', 'W', 'wulinghongguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(18, 4, '五菱荣光', 'W', 'wulingrongguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(19, 4, '荣光小卡', 'R', 'rongguangxiaoka', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(20, 4, '征程', 'Z', 'zhengcheng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(21, 4, '五菱之光', 'W', 'wulingzhiguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(22, 5, '伊思坦纳', 'Y', 'yisitanna', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(23, 6, '宝迪', 'B', 'baodi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(24, 6, '得意', 'D', 'deyi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(25, 6, '威尼斯', 'W', 'weinisi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(26, 7, '爱唯欧', 'A', 'aiweiou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(27, 7, '创酷', 'C', 'chuangku', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(28, 7, '景程', 'J', 'jingcheng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(29, 7, '科鲁兹', 'K', 'keluzi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(30, 7, '科帕奇', 'K', 'kepaqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(31, 7, '迈锐宝', 'M', 'mairuibao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(32, 7, '赛欧', 'S', 'saiou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(33, 7, 'Camaro科迈罗-进口', 'C', 'camarokemailuo-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(34, 7, 'Volt沃蓝达-进口', 'V', 'voltwolanda-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(35, 8, 'A380', 'A', 'a380', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(36, 8, '猎鹰', 'L', 'lieying', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(37, 8, '五星', 'W', 'wuxing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(38, 9, '东风裕隆', 'D', 'dongfengyulong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(39, 9, '5 Sedan', '#', '5 sedan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(40, 9, '优6 SUV', 'Y', 'you6 suv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(41, 9, '大7 SUV', 'D', 'da7 suv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(42, 9, '大7 MPV', 'D', 'da7 mpv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(43, 9, 'MASTER CEO', 'M', 'master ceo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(44, 10, '205', '#', '205', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(45, 10, '306', '#', '306', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(46, 10, '307', '#', '307', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(47, 10, 'M20', 'M', 'm20', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(48, 11, '丘比特', 'Q', 'qiubite', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(49, 11, '福美来', 'F', 'fumeilai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(50, 11, '福美来M5', 'F', 'fumeilaim5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(51, 11, '海马M3', 'H', 'haimam3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(52, 11, '海马M8', 'H', 'haimam8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(53, 11, '海马S5', 'H', 'haimas5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(54, 11, '海马S7', 'H', 'haimas7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(55, 11, '骑士', 'Q', 'qishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(56, 11, '普力马', 'P', 'pulima', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(57, 11, '海马郑州', 'H', 'haimazhengzhou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(58, 11, '爱尚', 'A', 'aishang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(59, 11, '福卡', 'F', 'fuka', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(60, 11, '福仕达鸿达', 'F', 'fushidahongda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(61, 11, '福仕达荣达', 'F', 'fushidarongda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(62, 11, '福仕达新鸿达', 'F', 'fushidaxinhongda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(63, 11, '福仕达新腾达', 'F', 'fushidaxintengda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(64, 11, '王子', 'W', 'wangzi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(65, 12, 'MG3', 'M', 'mg3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(66, 12, 'MG GT', 'M', 'mg gt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(67, 12, 'MG5', 'M', 'mg5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(68, 12, 'MG6', 'M', 'mg6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(69, 12, 'MG7', 'M', 'mg7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(70, 13, '传祺GA3', 'C', 'chuanqiga3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(71, 13, '传祺GA3S视界', 'C', 'chuanqiga3sshijie', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(72, 13, '传祺GA5', 'C', 'chuanqiga5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(73, 13, '传祺GS5', 'C', 'chuanqigs5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(74, 13, '增程式电动传祺GA5', 'Z', 'zengchengshidiandongchuanqiga5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(75, 14, '观致3', 'G', 'guanzhi3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(76, 15, 'DS 5LS-长安标致雪铁龙', 'D', 'ds 5ls-zhanganbiaozhixuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(77, 15, 'DS 5-长安标致雪铁龙', 'D', 'ds 5-zhanganbiaozhixuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(78, 15, 'DS 6-长安标致雪铁龙', 'D', 'ds 6-zhanganbiaozhixuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(79, 15, 'DS 3-雪铁龙-进口)', 'D', 'ds 3-xuetielong-jinkou)', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(80, 15, 'DS 4-雪铁龙-进口)', 'D', 'ds 4-xuetielong-jinkou)', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(81, 15, 'E-雪铁龙-进口)', 'E', 'e-xuetielong-jinkou)', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(82, 16, '2008', '#', '2008', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(83, 16, '5008', '#', '5008', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(84, 16, 'M300', 'M', 'm300', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(85, 16, 'T200', 'T', 't200', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(86, 16, 'T600', 'T', 't600', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(87, 16, 'V10', 'V', 'v10', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(88, 16, 'Z100', 'Z', 'z100', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(89, 16, 'Z200', 'Z', 'z200', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(90, 16, 'Z200HB', 'Z', 'z200hb', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(91, 16, 'Z300', 'Z', 'z300', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(92, 16, 'Z500', 'Z', 'z500', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(93, 16, '江南TT', 'J', 'jiangnantt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(94, 16, '云100', 'Y', 'yun100', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(95, 16, '知豆E20', 'Z', 'zhidoue20', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(96, 17, '3 Wheeler', '#', '3 wheeler', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(97, 17, '4/4', '#', '4/4', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(98, 17, 'Aero', 'A', 'aero', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(99, 17, 'Plus 8', 'P', 'plus 8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(100, 17, 'Roadster', 'R', 'roadster', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(101, 18, 'Q50L-东风英菲尼迪', 'Q', 'q50l-dongfengyingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(102, 18, 'ESQ-英菲尼迪', 'E', 'esq-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(103, 18, 'JX-英菲尼迪', 'J', 'jx-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(104, 18, 'Q50-英菲尼迪', 'Q', 'q50-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(105, 18, 'Q60-英菲尼迪', 'Q', 'q60-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(106, 18, 'Q70-英菲尼迪', 'Q', 'q70-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(107, 18, 'QX50-英菲尼迪', 'Q', 'qx50-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(108, 18, 'QX60-英菲尼迪', 'Q', 'qx60-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(109, 18, 'QX70-英菲尼迪', 'Q', 'qx70-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(110, 18, 'QX80-英菲尼迪', 'Q', 'qx80-yingfeinidi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(111, 19, 'X-BOW', 'X', 'x-bow', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(112, 20, 'M1', 'M', 'm1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(113, 20, 'M5', 'M', 'm5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(114, 20, 'G3', 'G', 'g3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(115, 20, 'G5', 'G', 'g5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(116, 20, 'G6', 'G', 'g6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(117, 20, 'S', 'S', 's', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(118, 21, 'N1', 'N', 'n1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(119, 21, '翱龙CUV', 'A', 'aolongcuv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(120, 21, '傲骏', 'A', 'aojun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(121, 21, '大柴神', 'D', 'dachaishen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(122, 21, '旗胜F1', 'Q', 'qishengf1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(123, 21, '旗胜V3', 'Q', 'qishengv3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(124, 21, '瑞途', 'R', 'ruitu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(125, 21, '瑞途6', 'R', 'ruitu6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(126, 21, '挑战者', 'T', 'tiaozhanzhe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(127, 21, '小柴神', 'X', 'xiaochaishen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(128, 22, 'C20R', 'C', 'c20r', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(129, 22, 'C30', 'C', 'c30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(130, 22, 'C50', 'C', 'c50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(131, 22, 'M2', 'M', 'm2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(132, 22, 'M4', 'M', 'm4', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(133, 22, 'V80', 'V', 'v80', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(134, 22, '风骏3v', 'F', 'fengjun3v', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(135, 22, '风骏5', 'F', 'fengjun5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(136, 22, '风骏6', 'F', 'fengjun6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(137, 22, '金迪尔', 'J', 'jindier', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(138, 22, '炫丽Cross', 'X', 'xuanlicross', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(139, 23, '大蛇', 'D', 'dashe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(140, 23, '嘉路', 'J', 'jialu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(141, 23, '女王', 'N', 'nu:wang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(142, 24, '爱腾', 'A', 'aiteng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(143, 24, '柯兰多', 'K', 'kelanduo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(144, 24, '雷斯特', 'L', 'leisite', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(145, 24, '路帝', 'L', 'ludi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(146, 24, '享御', 'X', 'xiangyu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(147, 24, '主席', 'Z', 'zhuxi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(148, 25, '320', '#', '320', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(149, 25, '330', '#', '330', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(150, 25, '520', '#', '520', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(151, 25, '530', '#', '530', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(152, 25, '620', '#', '620', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(153, 25, '630', '#', '630', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(154, 25, '720', '#', '720', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(155, 25, 'T11', 'T', 't11', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(156, 25, 'T21', 'T', 't21', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(157, 25, 'X50', 'X', 'x50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(158, 25, 'X60', 'X', 'x60', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(159, 25, '丰顺', 'F', 'fengshun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(160, 25, '福顺', 'F', 'fushun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(161, 25, '兴顺', 'X', 'xingshun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(162, 26, 'V3菱悦', 'V', 'v3lingyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(163, 26, 'V5菱致', 'V', 'v5lingzhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(164, 26, 'V6菱仕', 'V', 'v6lingshi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(165, 26, '得利卡', 'D', 'delika', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(166, 26, '希旺', 'X', 'xiwang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(167, 27, '威航', 'W', 'weihang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(168, 28, '奇瑞捷豹路虎', 'Q', 'qiruijiebaoluhu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(169, 28, '揽胜极光', 'L', 'lanshengjiguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(170, 28, '路虎', 'L', 'luhu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(171, 28, '发现', 'F', 'faxian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(172, 28, '发现神行', 'F', 'faxianshenxing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(173, 28, '神行者2', 'S', 'shenxingzhe2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(174, 28, '揽胜', 'L', 'lansheng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(175, 28, '揽胜极光', 'L', 'lanshengjiguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(176, 28, '卫士', 'W', 'weishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(177, 29, '菲翔-广汽菲亚特', 'F', 'feixiang-guangqifeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(178, 29, '致悦-广汽菲亚特', 'Z', 'zhiyue-guangqifeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(179, 29, '500-进口菲亚特', '#', '500-jinkoufeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(180, 29, '菲跃-进口菲亚特', 'F', 'feiyue-jinkoufeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(181, 29, '博悦-进口菲亚特', 'B', 'boyue-jinkoufeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(182, 29, '朋多-进口菲亚特', 'P', 'pengduo-jinkoufeiyate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(183, 30, 'California', 'C', 'california', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(184, 30, '法拉利458', 'F', 'falali458', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(185, 30, 'F12berlinetta', 'F', 'f12berlinetta', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(186, 30, '法拉利FF', 'F', 'falaliff', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(187, 30, 'LaFerrari', 'L', 'laferrari', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(188, 31, 'e6', 'E', 'e6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(189, 31, 'F0', 'F', 'f0', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(190, 31, 'F3', 'F', 'f3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(191, 31, 'G3', 'G', 'g3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(192, 31, 'G3R', 'G', 'g3r', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(193, 31, 'G5', 'G', 'g5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(194, 31, 'G6', 'G', 'g6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(195, 31, 'L3', 'L', 'l3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(196, 31, 'M6', 'M', 'm6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(197, 31, 'S6', 'S', 's6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(198, 31, 'S7', 'S', 's7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(199, 31, '速锐', 'S', 'surui', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(200, 31, '思锐', 'S', 'sirui', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(201, 31, '秦', 'Q', 'qin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(202, 32, 'H7', 'H', 'h7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(203, 32, 'L5', 'L', 'l5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(204, 33, 'E50', 'E', 'e50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(205, 33, '350', '#', '350', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(206, 33, '550', '#', '550', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(207, 33, '750', '#', '750', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(208, 33, '950', '#', '950', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(209, 33, 'W5', 'W', 'w5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(210, 34, '风景', 'F', 'fengjing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(211, 34, '风朗', 'F', 'fenglang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(212, 34, '科雷傲', 'K', 'keleiao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(213, 34, '拉古那', 'L', 'lagunei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(214, 34, '拉古那-古贝', 'L', 'lagunei-gubei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(215, 34, '梅甘娜', 'M', 'meiganna', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(216, 34, '塔利斯曼', 'T', 'talisiman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(217, 34, '纬度', 'W', 'weidu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(218, 35, '思铭', 'S', 'siming', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(219, 36, 'CM7', 'C', 'cm7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(220, 36, '景逸', 'J', 'jingyi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(221, 36, '景逸LV', 'J', 'jingyilv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(222, 36, '景逸S50', 'J', 'jingyis50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(223, 36, '景逸X3', 'J', 'jingyix3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(224, 36, '景逸X5', 'J', 'jingyix5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(225, 36, '菱智', 'L', 'lingzhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(226, 37, 'CS35', 'C', 'cs35', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(227, 37, 'CS75', 'C', 'cs75', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(228, 37, 'CX20', 'C', 'cx20', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(229, 37, 'CX30', 'C', 'cx30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(230, 37, '奔奔', 'B', 'benben', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(231, 37, '奔奔mini', 'B', 'benbenmini', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(232, 37, '睿骋', 'R', 'ruicheng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(233, 37, '逸动', 'Y', 'yidong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(234, 37, '悦翔', 'Y', 'yuexiang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(235, 37, '悦翔V3', 'Y', 'yuexiangv3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(236, 37, '悦翔V5', 'Y', 'yuexiangv5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(237, 37, '悦翔V7', 'Y', 'yuexiangv7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(238, 37, '致尚XT', 'Z', 'zhishangxt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(239, 38, 'H3', 'H', 'h3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(240, 38, 'H5', 'H', 'h5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(241, 38, 'X5', 'X', 'x5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(242, 38, 'V5', 'V', 'v5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(243, 39, 'C级-北汽奔驰', 'C', 'cji-beiqibenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(244, 39, 'E级-北汽奔驰', 'E', 'eji-beiqibenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(245, 39, 'GLK级-北汽奔驰', 'G', 'glkji-beiqibenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(246, 39, '凌特-福建奔驰', 'L', 'lingte-fujianbenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(247, 39, '威霆-福建奔驰', 'W', 'weiting-fujianbenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(248, 39, '唯雅诺-福建奔驰', 'W', 'weiyanuo-fujianbenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(249, 39, 'A级-进口奔驰', 'A', 'aji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(250, 39, 'B级-进口奔驰', 'B', 'bji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(251, 39, 'CLA级-进口奔驰', 'C', 'claji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(252, 39, 'CLS级-进口奔驰', 'C', 'clsji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(253, 39, 'C级旅行-进口奔驰', 'C', 'cjilu:xing-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(254, 39, 'C级双门-进口奔驰', 'C', 'cjishuangmen-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(255, 39, 'E级敞篷-进口奔驰', 'E', 'ejichangpeng-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(256, 39, 'E级双门-进口奔驰', 'E', 'ejishuangmen-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(257, 39, 'GLA级-进口奔驰', 'G', 'glaji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(258, 39, 'GL级车-进口奔驰', 'G', 'gljiche-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(259, 39, 'G级-进口奔驰', 'G', 'gji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(260, 39, 'M级-进口奔驰', 'M', 'mji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(261, 39, 'R级-进口奔驰', 'R', 'rji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(262, 39, 'SLK级-进口奔驰', 'S', 'slkji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(263, 39, 'SL级-进口奔驰', 'S', 'slji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(264, 39, 'S级-进口奔驰', 'S', 'sji-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(265, 39, 'S级coupe-进口奔驰', 'S', 'sjicoupe-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(266, 39, 'S级混合动力-进口奔驰', 'S', 'sjihunhedongli-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(267, 39, '唯雅诺-进口奔驰', 'W', 'weiyanuo-jinkoubenchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(268, 39, 'A45 AMG-奔驰AMG', 'A', 'a45 amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(269, 39, 'C63 AMG-奔驰AMG', 'C', 'c63 amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(270, 39, 'CLA45 AMG-奔驰AMG', 'C', 'cla45 amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(271, 39, 'CLS级 AMG-奔驰AMG', 'C', 'clsji amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(272, 39, 'GLA45 AMG-奔驰AMG', 'G', 'gla45 amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(273, 39, 'GL级 AMG-奔驰AMG', 'G', 'glji amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(274, 39, 'G级 AM-奔驰AMG', 'G', 'gji am-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(275, 39, 'ML63 AMG-奔驰AMG', 'M', 'ml63 amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(276, 39, 'SLS级 AMG-奔驰AMG', 'S', 'slsji amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(277, 39, 'SL级 AMG-奔驰AMG', 'S', 'slji amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(278, 39, 'S级 AMG-奔驰AMG', 'S', 'sji amg-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(279, 39, 'S级 AMGCoupe-奔驰AMG', 'S', 'sji amgcoupe-benchiamg', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(280, 40, '宝斯通', 'B', 'baositong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(281, 41, 'G10', 'G', 'g10', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(282, 41, 'V80', 'V', 'v80', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(283, 41, '伊思坦纳', 'Y', 'yisitanna', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(284, 42, '东风日产', 'D', 'dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(285, 42, 'T70', 'T', 't70', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(286, 42, 'R30', 'R', 'r30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(287, 42, '晨风', 'C', 'chenfeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(288, 42, 'D50', 'D', 'd50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(289, 42, 'R50', 'R', 'r50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(290, 42, 'R50X', 'R', 'r50x', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(291, 43, '优劲', 'Y', 'youjing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(292, 43, '优雅', 'Y', 'youya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(293, 43, '优优', 'Y', 'youyou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(294, 43, '优胜2代', 'Y', 'yousheng2dai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(295, 43, '优雅2代', 'Y', 'youya2dai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(296, 43, '优优2代', 'Y', 'youyou2dai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(297, 44, 'S1', 'S', 's1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(298, 45, 'X5', 'X', 'x5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(299, 45, 'X6', 'X', 'x6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(300, 45, 'X8', 'X', 'x8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(301, 45, 'X9', 'X', 'x9', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(302, 45, '风尚', 'F', 'fengshang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(303, 46, '英致G3', 'Y', 'yingzhig3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(304, 47, 'GMC', 'G', 'gmc', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(305, 47, 'Savana', 'S', 'savana', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(306, 47, 'Sierra西拉', 'S', 'sierraxila', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(307, 47, 'Terrain', 'T', 'terrain', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(308, 48, 'SCEO', 'S', 'sceo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(309, 49, '虎视', 'H', 'hushi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(310, 49, '御风', 'Y', 'yufeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(311, 50, 'ix25-北京现代', 'I', 'ix25-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(312, 50, 'ix35-北京现代', 'I', 'ix35-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(313, 50, '朗动-北京现代', 'L', 'langdong-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(314, 50, '名图-北京现代', 'M', 'mingtu-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(315, 50, '全新胜达-北京现代', 'Q', 'quanxinshengda-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(316, 50, '瑞纳-北京现代', 'R', 'ruina-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(317, 50, '瑞奕-北京现代', 'R', 'ruiyi-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(318, 50, '索纳塔八-北京现代', 'S', 'suonataba-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(319, 50, '途胜-北京现代', 'T', 'tusheng-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(320, 50, '悦动-北京现代', 'Y', 'yuedong-beijingxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(321, 50, '康恩迪-四川现代', 'K', 'kangendi-sichuanxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(322, 50, '飞思Veloster-进口现代', 'F', 'feisiveloster-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(323, 50, '格锐-进口现代', 'G', 'gerui-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(324, 50, '辉翼-进口现代', 'H', 'huiyi-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(325, 50, '捷恩斯-进口现代', 'J', 'jieensi-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(326, 50, '劳恩斯-进口现代', 'L', 'laoensi-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(327, 50, '劳恩斯-酷派-进口现代', 'L', 'laoensi-kupai-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(328, 50, '胜达-进口现代', 'S', 'shengda-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(329, 50, '索纳塔混合动力-进口现代', 'S', 'suonatahunhedongli-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(330, 50, '雅科仕-进口现代', 'Y', 'yakeshi-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(331, 50, '雅尊-进口现代', 'Y', 'yazun-jinkouxiandai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(332, 51, 'ModelS', 'M', 'models', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(333, 52, 'Huracan', 'H', 'huracan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(334, 52, 'Aventador', 'A', 'aventador', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(335, 53, '华晨金杯', 'H', 'huachenjinbei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(336, 53, '智尚S30', 'Z', 'zhishangs30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(337, 53, 'S50', 'S', 's50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(338, 53, '海星A7', 'H', 'haixinga7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(339, 53, '海星A9', 'H', 'haixinga9', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(340, 53, '大海狮', 'D', 'dahaishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(341, 53, '大力神', 'D', 'dalishen', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(342, 53, '阁瑞斯', 'G', 'geruisi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(343, 53, '海狮', 'H', 'haishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(344, 53, '金典', 'J', 'jindian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(345, 53, '雷龙', 'L', 'leilong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(346, 53, '小海狮X30', 'X', 'xiaohaishix30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(347, 53, '新海狮', 'X', 'xinhaishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(348, 54, '昌铃', 'C', 'changling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(349, 54, '旗舰A9', 'Q', 'qijiana9', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(350, 54, '威虎G3', 'W', 'weihug3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(351, 54, '威虎TUV', 'W', 'weihutuv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(352, 54, '无限', 'W', 'wuxian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(353, 55, 'H220', 'H', 'h220', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(354, 55, 'H230', 'H', 'h230', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(355, 55, 'H320', 'H', 'h320', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(356, 55, 'H330', 'H', 'h330', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(357, 55, 'H530', 'H', 'h530', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(358, 55, '骏捷FRV', 'J', 'junjiefrv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(359, 55, '骏捷FSV', 'J', 'junjiefsv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(360, 55, '骏捷', 'J', 'junjie', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(361, 55, '尊驰', 'Z', 'zunchi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(362, 55, '骏捷Cross', 'J', 'junjiecross', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(363, 56, 'A3', 'A', 'a3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(364, 56, 'A4L', 'A', 'a4l', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(365, 56, 'A6L', 'A', 'a6l', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(366, 56, 'Q3', 'Q', 'q3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(367, 56, 'Q5', 'Q', 'q5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(368, 56, 'A1-进口', 'A', 'a1-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(369, 56, 'A3-进口', 'A', 'a3-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(370, 56, 'A4-进口', 'A', 'a4-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(371, 56, 'A5-进口', 'A', 'a5-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(372, 56, 'A6-进口', 'A', 'a6-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(373, 56, 'A7-进口', 'A', 'a7-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(374, 56, 'A8L-进口', 'A', 'a8l-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(375, 56, 'Q3-进口', 'Q', 'q3-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(376, 56, 'Q5-进口', 'Q', 'q5-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(377, 56, 'Q7-进口', 'Q', 'q7-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(378, 56, 'R8-进口', 'R', 'r8-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(379, 56, 'RS5-进口', 'R', 'rs5-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(380, 56, 'RS7-进口', 'R', 'rs7-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(381, 56, 'S3-进口', 'S', 's3-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(382, 56, 'S4-进口', 'S', 's4-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(383, 56, 'S5-进口', 'S', 's5-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(384, 56, 'S6-进口', 'S', 's6-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(385, 56, 'S7-进口', 'S', 's7-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(386, 56, 'S8-进口', 'S', 's8-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(387, 56, 'SQ5-进口', 'S', 'sq5-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(388, 56, 'TT-进口', 'T', 'tt-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(389, 56, 'TTS-进口', 'T', 'tts-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(390, 57, 'S80L-长安沃尔沃', 'S', 's80l-zhanganwoerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(391, 57, 'S60L-沃尔沃亚太', 'S', 's60l-woerwoyatai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(392, 57, 'XC Classic-沃尔沃亚太', 'X', 'xc classic-woerwoyatai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(393, 57, 'XC60-沃尔沃亚太', 'X', 'xc60-woerwoyatai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(394, 57, 'C70-沃尔沃', 'C', 'c70-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(395, 57, 'S60-沃尔沃', 'S', 's60-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(396, 57, 'V40-沃尔沃', 'V', 'v40-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(397, 57, 'V60-沃尔沃', 'V', 'v60-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(398, 57, 'XC60-沃尔沃', 'X', 'xc60-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(399, 57, 'XC90-沃尔沃', 'X', 'xc90-woerwo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(400, 58, '610', '#', '610', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(401, 58, '630', '#', '630', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(402, 58, '730', '#', '730', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(403, 58, '乐驰', 'L', 'lechi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(404, 59, '安德拉', 'A', 'andela', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(405, 59, '麦瑞纳', 'M', 'mairuina', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(406, 59, '赛飞利', 'S', 'saifeili', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(407, 59, '雅特', 'Y', 'yate', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(408, 59, '英速亚', 'Y', 'yingsuya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(409, 60, '启腾M70', 'Q', 'qitengm70', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(410, 61, 'C3', 'C', 'c3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(411, 62, 'F-TYPE', 'F', 'f-type', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(412, 62, 'XF', 'X', 'xf', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(413, 62, 'XJ', 'X', 'xj', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(414, 62, 'XK', 'X', 'xk', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(415, 63, '和悦', 'H', 'heyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(416, 63, '和悦A13', 'H', 'heyuea13', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(417, 63, '和悦A30', 'H', 'heyuea30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(418, 63, '和悦iEV', 'H', 'heyueiev', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(419, 63, '和悦RS', 'H', 'heyuers', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(420, 63, '江淮K3', 'J', 'jianghuaik3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(421, 63, '江淮K5', 'J', 'jianghuaik5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(422, 63, '瑞风', 'R', 'ruifeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(423, 63, '瑞风M5', 'R', 'ruifengm5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(424, 63, '瑞风S3', 'R', 'ruifengs3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(425, 63, '瑞风S5', 'R', 'ruifengs5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(426, 63, '瑞铃', 'R', 'ruiling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(427, 63, '同悦', 'T', 'tongyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(428, 63, '星锐', 'X', 'xingrui', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(429, 63, '悦悦', 'Y', 'yueyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(430, 64, 'Rapide', 'R', 'rapide', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(431, 64, 'V8 Vantage', 'V', 'v8 vantage', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(432, 64, 'V12 Vantage', 'V', 'v12 vantage', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(433, 64, 'DB9', 'D', 'db9', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(434, 64, 'Vanquish', 'V', 'vanquish', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(435, 65, '海锋', 'H', 'haifeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(436, 65, '海尚', 'H', 'haishang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(437, 65, '海迅', 'H', 'haixun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(438, 65, '海域', 'H', 'haiyu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(439, 65, '海景', 'H', 'haijing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(440, 66, '艾菲', 'A', 'aifei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(441, 66, 'A5', 'A', 'a5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(442, 66, 'A6', 'A', 'a6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(443, 66, '大MPV', 'D', 'dampv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(444, 67, 'E系列', 'E', 'exilie', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(445, 67, '北京40', 'B', 'beijing40', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(446, 68, '6481', '#', '6481', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(447, 68, 'CS6', 'C', 'cs6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(448, 68, 'CT5', 'C', 'ct5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(449, 68, '飞腾', 'F', 'feiteng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(450, 68, '飞腾C5', 'F', 'feitengc5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(451, 68, '飞扬', 'F', 'feiyang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(452, 68, '黑金刚', 'H', 'heijingang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(453, 68, '猎豹Q6', 'L', 'liebaoq6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(454, 69, '2008-东风标致', '#', '2008-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(455, 69, '3008-东风标致', '#', '3008-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(456, 69, '301-东风标致', '#', '301-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(457, 69, '307-东风标致', '#', '307-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(458, 69, '308-东风标致', '#', '308-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(459, 69, '408-东风标致', '#', '408-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(460, 69, '508-东风标致', '#', '508-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(461, 69, 'Cross307-东风标致', 'C', 'cross307-dongfengbiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(462, 69, '207CC-进口标致', '#', '207cc-jinkoubiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(463, 69, '308CC-进口标致', '#', '308cc-jinkoubiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(464, 69, '308SW-进口标致', '#', '308sw-jinkoubiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(465, 69, '4008-进口标致', '#', '4008-jinkoubiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(466, 69, 'RCZ-进口标致', 'R', 'rcz-jinkoubiaozhi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(467, 70, '奥拓-长安铃木', 'A', 'aotuo-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(468, 70, '锋驭-长安铃木', 'F', 'fengyu-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(469, 70, '羚羊-长安铃木', 'L', 'lingyang-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(470, 70, '天语SX4-长安铃木', 'T', 'tianyusx4-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(471, 70, '天语尚悦-长安铃木', 'T', 'tianyushangyue-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(472, 70, '雨燕-长安铃木', 'Y', 'yuyan-zhanganlingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(473, 70, '北斗星-昌河铃木', 'B', 'beidouxing-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(474, 70, '北斗星X5-昌河铃木', 'B', 'beidouxingx5-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(475, 70, '浪迪-昌河铃木', 'L', 'langdi-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(476, 70, '利亚纳A6-昌河铃木', 'L', 'liyanaa6-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(477, 70, '利亚纳-昌河铃木', 'L', 'liyana-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(478, 70, '派喜-昌河铃木', 'P', 'paixi-changhelingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(479, 70, '超级维特拉-进口铃木', 'C', 'chaojiweitela-jinkoulingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(480, 70, '吉姆尼-进口铃木', 'J', 'jimuni-jinkoulingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(481, 70, '凯泽西-进口铃木', 'K', 'kaizexi-jinkoulingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(482, 70, '速翼特-进口铃木', 'S', 'suyite-jinkoulingmu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(483, 71, 'BRZ', 'B', 'brz', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(484, 71, 'XV', 'X', 'xv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(485, 71, '傲虎', 'A', 'aohu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(486, 71, '驰鹏', 'C', 'chipeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(487, 71, '力狮', 'L', 'lishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(488, 71, '森林人', 'S', 'senlinren', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(489, 71, '翼豹', 'Y', 'yibao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(490, 72, 'MKC', 'M', 'mkc', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(491, 72, 'MKS', 'M', 'mks', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(492, 72, 'MKT', 'M', 'mkt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(493, 72, 'MKX', 'M', 'mkx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(494, 72, 'MKZ', 'M', 'mkz', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(495, 72, '领航员', 'L', 'linghangyuan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(496, 73, 'L3', 'L', 'l3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(497, 73, 'L5', 'L', 'l5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(498, 74, 'H1', 'H', 'h1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(499, 74, 'H2', 'H', 'h2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(500, 74, 'H3', 'H', 'h3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(501, 74, 'HX', 'H', 'hx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(502, 75, 'K1', 'K', 'k1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(503, 75, 'K2', 'K', 'k2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(504, 75, 'V1', 'V', 'v1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(505, 75, 'V2', 'V', 'v2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(506, 75, 'X1', 'X', 'x1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(507, 76, '艾力绅-东风本田', 'A', 'ailishen-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(508, 76, 'CR-V-东风本田', 'C', 'cr-v-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(509, 76, '杰德-东风本田', 'J', 'jiede-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(510, 76, 'XR-V-东风本田', 'X', 'xr-v-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(511, 76, '杰德-东风本田', 'J', 'jiede-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(512, 76, '思铂睿-东风本田', 'S', 'siborui-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(513, 76, '思域-东风本田', 'S', 'siyu-dongfengbentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(514, 76, '奥德赛-广汽本田', 'A', 'aodesai-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(515, 76, '缤智-广汽本田', 'B', 'binzhi-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(516, 76, '飞度-广汽本田', 'F', 'feidu-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(517, 76, '锋范-广汽本田', 'F', 'fengfan-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(518, 76, '歌诗图-广汽本田', 'G', 'geshitu-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(519, 76, '凌派-广汽本田', 'L', 'lingpai-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(520, 76, '雅阁-广汽本田', 'Y', 'yage-guangqibentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(521, 76, 'CR-Z-进口本田', 'C', 'cr-z-jinkoubentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(522, 76, 'INSIGHT-进口本田', 'I', 'insight-jinkoubentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(523, 76, '飞度Hybrid-进口本田', 'F', 'feiduhybrid-jinkoubentian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(524, 77, 'ALFA MiTo', 'A', 'alfa mito', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(525, 77, 'Giulietta', 'G', 'giulietta', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(526, 77, '4C', '#', '4c', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(527, 77, 'ALFAGT', 'A', 'alfagt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(528, 78, 'B50', 'B', 'b50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(529, 78, 'B70', 'B', 'b70', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(530, 78, 'B90', 'B', 'b90', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(531, 78, 'X80', 'X', 'x80', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(532, 79, '哈弗COUPEC', 'H', 'hafucoupec', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(533, 79, '哈弗H1', 'H', 'hafuh1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(534, 79, '哈弗H2', 'H', 'hafuh2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(535, 79, '哈弗H5', 'H', 'hafuh5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(536, 79, '哈弗H6', 'H', 'hafuh6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(537, 79, '哈弗H8', 'H', 'hafuh8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(538, 79, '哈弗H9', 'H', 'hafuh9', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(539, 80, '斯宾特', 'S', 'sibinte', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(540, 80, '威霆', 'W', 'weiting', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(541, 81, 'RAV4-一汽丰田', 'R', 'rav4-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(542, 81, '花冠EX-一汽丰田', 'H', 'huaguanex-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(543, 81, '皇冠-一汽丰田', 'H', 'huangguan-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(544, 81, '卡罗拉-一汽丰田', 'K', 'kaluola-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(545, 81, '柯斯达-一汽丰田', 'K', 'kesida-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(546, 81, '兰德酷路泽-一汽丰田', 'L', 'landekuluze-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(547, 81, '普拉多-一汽丰田', 'P', 'puladuo-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(548, 81, '普锐斯-一汽丰田', 'P', 'puruisi-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(549, 81, '锐志-一汽丰田', 'R', 'ruizhi-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(550, 81, '威驰-一汽丰田', 'W', 'weichi-yiqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(551, 81, 'YARiS L致炫-广汽丰田', 'Y', 'yaris lzhixuan-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(552, 81, '汉兰达-广汽丰田', 'H', 'hanlanda-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(553, 81, '凯美瑞-广汽丰田', 'K', 'kaimeirui-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(554, 81, '雷凌-广汽丰田', 'L', 'leiling-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(555, 81, '雅力士-广汽丰田', 'Y', 'yalishi-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(556, 81, '逸致-广汽丰田', 'Y', 'yizhi-guangqifengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(557, 81, '86-进口丰田', '#', '86-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(558, 81, 'FJ酷路泽-进口丰田', 'F', 'fjkuluze-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(559, 81, 'HIACE-进口丰田', 'H', 'hiace-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(560, 81, 'Sienna-进口丰田', 'S', 'sienna-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(561, 81, 'ZELAS杰路驰-进口丰田', 'Z', 'zelasjieluchi-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(562, 81, '埃尔法-进口丰田', 'A', 'aierfa-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(563, 81, '普拉多-进口丰田', 'P', 'puladuo-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(564, 81, '普瑞维亚-进口丰田', 'P', 'puruiweiya-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(565, 81, '坦途-进口丰田', 'T', 'tantu-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(566, 81, '威飒-进口丰田', 'W', 'weisa-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(567, 81, '红杉-进口丰田', 'H', 'hongshan-jinkoufengtian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(568, 82, '3系-华晨宝马', '#', '3xi-huachenbaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(569, 82, '5系-华晨宝马', '#', '5xi-huachenbaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(570, 82, 'X1-华晨宝马', 'X', 'x1-huachenbaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(571, 82, 'i3-进口宝马', 'I', 'i3-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(572, 82, 'i8-进口宝马', 'I', 'i8-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(573, 82, '1系-进口宝马', '#', '1xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(574, 82, '2系-进口宝马', '#', '2xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(575, 82, '3系-进口宝马', '#', '3xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(576, 82, '3系GT-进口宝马', '#', '3xigt-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(577, 82, '4系-进口宝马', '#', '4xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(578, 82, '5系-进口宝马', '#', '5xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(579, 82, '5系GT-进口宝马', '#', '5xigt-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(580, 82, '6系-进口宝马', '#', '6xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(581, 82, '7系-进口宝马', '#', '7xi-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(582, 82, 'X3-进口宝马', 'X', 'x3-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(583, 82, 'X4-进口宝马', 'X', 'x4-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(584, 82, 'X5-进口宝马', 'X', 'x5-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(585, 82, 'X6-进口宝马', 'X', 'x6-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(586, 82, 'Z4-进口宝马', 'Z', 'z4-jinkoubaoma', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(587, 82, 'M3', 'M', 'm3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(588, 82, 'M4', 'M', 'm4', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(589, 82, 'M5', 'M', 'm5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(590, 82, 'M6', 'M', 'm6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(591, 82, 'X5M', 'X', 'x5m', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(592, 82, 'X6M', 'X', 'x6m', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(593, 83, '昊锐-上海大众斯柯达', 'H', 'haorui-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(594, 83, '晶锐-上海大众斯柯达', 'J', 'jingrui-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(595, 83, '明锐-上海大众斯柯达', 'M', 'mingrui-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(596, 83, '速派-上海大众斯柯达', 'S', 'supai-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(597, 83, '昕动-上海大众斯柯达', 'X', 'xindong-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(598, 83, '昕锐-上海大众斯柯达', 'X', 'xinrui-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(599, 83, '野帝-上海大众斯柯达', 'Y', 'yedi-shanghaidazhongsikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(600, 83, 'Yeti-进口斯柯达', 'Y', 'yeti-jinkousikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(601, 83, '速尊-进口斯柯达', 'S', 'suzun-jinkousikeda', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(602, 84, 'V5', 'V', 'v5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(603, 84, '欧诺', 'O', 'ounuo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(604, 84, '睿行', 'R', 'ruixing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(605, 84, '星光4500', 'X', 'xingguang4500', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(606, 84, '长安星卡', 'Z', 'zhanganxingka', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(607, 84, '长安之星', 'Z', 'zhanganzhixing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(608, 84, '长安之星2', 'Z', 'zhanganzhixing2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(609, 84, '长安之星7', 'Z', 'zhanganzhixing7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(610, 84, '尊行', 'Z', 'zunxing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(611, 84, '欧力威', 'O', 'ouliwei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(612, 84, '神骐', 'S', 'shenqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(613, 85, '幻影', 'H', 'huanying', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(614, 85, '古思特', 'G', 'gusite', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(615, 85, '魅影', 'M', 'meiying', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(616, 86, '卡威K1', 'K', 'kaweik1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(617, 86, '卡威W1', 'K', 'kaweiw1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(618, 87, 'Leon', 'L', 'leon', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(619, 87, '欧悦博', 'O', 'ouyuebo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(620, 87, '伊比飒', 'Y', 'yibisa', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(621, 88, 'GT', 'G', 'gt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(622, 88, 'Roadster', 'R', 'roadster', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(623, 89, 'BJ212', 'B', 'bj212', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(624, 89, '陆霸', 'L', 'luba', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(625, 89, '陆铃', 'L', 'luling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(626, 89, '骑士S12', 'Q', 'qishis12', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(627, 89, '锐铃', 'R', 'ruiling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(628, 89, '勇士', 'Y', 'yongshi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(629, 89, '域胜007', 'Y', 'yusheng007', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(630, 89, '越铃', 'Y', 'yueling', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(631, 89, '战旗', 'Z', 'zhanqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(632, 90, 'Ghibli', 'G', 'ghibli', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(633, 90, 'GranCabrio', 'G', 'grancabrio', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(634, 90, 'GT', 'G', 'gt', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(635, 90, '总裁', 'Z', 'zongcai', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(636, 91, '慕尚', 'M', 'mushang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(637, 91, '飞驰', 'F', 'feichi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(638, 91, '欧陆', 'O', 'oulu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(639, 92, 'S2', 'S', 's2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(640, 92, 'S3', 'S', 's3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(641, 93, 'D20', 'D', 'd20', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(642, 93, 'D50', 'D', 'd50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(643, 93, 'D60', 'D', 'd60', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(644, 93, 'D70', 'D', 'd70', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(645, 94, 'GL级', 'G', 'glji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(646, 94, 'S级', 'S', 'sji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(647, 95, '威志-天津一汽', 'W', 'weizhi-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(648, 95, '威志V2-天津一汽', 'W', 'weizhiv2-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(649, 95, '威志V5-天津一汽', 'W', 'weizhiv5-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(650, 95, '威姿-天津一汽', 'W', 'weizi-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(651, 95, '夏利-天津一汽', 'X', 'xiali-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(652, 95, '夏利N3-天津一汽', 'X', 'xialin3-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(653, 95, '夏利N5-天津一汽', 'X', 'xialin5-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(654, 95, '夏利N7-天津一汽', 'X', 'xialin7-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(655, 95, '骏派D60-天津一汽', 'J', 'junpaid60-tianjinyiqi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(656, 95, '森雅S80-一汽吉林', 'S', 'senyas80-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(657, 95, '森雅M80-一汽吉林', 'S', 'senyam80-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(658, 95, '佳宝V52-一汽吉林', 'J', 'jiabaov52-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(659, 95, '佳宝V70II代-一汽吉林', 'J', 'jiabaov70iidai-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(660, 95, '佳宝V80-一汽吉林', 'J', 'jiabaov80-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(661, 95, '佳宝T50-一汽吉林', 'J', 'jiabaot50-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(662, 95, '佳宝T51-一汽吉林', 'J', 'jiabaot51-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(663, 95, '佳宝T57-一汽吉林', 'J', 'jiabaot57-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(664, 95, '佳宝V70-一汽吉林', 'J', 'jiabaov70-yiqijilin', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(665, 95, '坤程-一汽通用', 'K', 'kuncheng-yiqitongyong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(666, 96, '大切诺基', 'D', 'daqienuoji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(667, 96, '牧马人', 'M', 'mumaren', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(668, 96, '指南者', 'Z', 'zhinanzhe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(669, 96, '自由光', 'Z', 'ziyouguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(670, 96, '自由客', 'Z', 'ziyouke', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(671, 97, 'Agera', 'A', 'agera', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(672, 98, '骊威-东风日产', 'L', 'liwei-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(673, 98, '楼兰-东风日产', 'L', 'loulan-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(674, 98, '玛驰-东风日产', 'M', 'machi-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(675, 98, '奇骏-东风日产', 'Q', 'qijun-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(676, 98, '骐达-东风日产', 'Q', 'qida-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(677, 98, '天籁-东风日产', 'T', 'tianlai-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(678, 98, '逍客-东风日产', 'X', 'xiaoke-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(679, 98, '轩逸-东风日产', 'X', 'xuanyi-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(680, 98, '阳光-东风日产', 'Y', 'yangguang-dongfengrichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(681, 98, 'D22-郑州日产', 'D', 'd22-zhengzhourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(682, 98, 'NV200-郑州日产', 'N', 'nv200-zhengzhourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(683, 98, '帕拉丁-郑州日产', 'P', 'palading-zhengzhourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(684, 98, '370Z-进口日产', '#', '370z-jinkourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(685, 98, 'GT-R-进口日产', 'G', 'gt-r-jinkourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(686, 98, '碧莲-进口日产', 'B', 'bilian-jinkourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(687, 98, '贵士-进口日产', 'G', 'guishi-jinkourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(688, 98, '途乐-进口日产', 'T', 'tule-jinkourichan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(689, 99, '苏州金龙', 'S', 'suzhoujinlong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(690, 99, '海格H5C', 'H', 'haigeh5c', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(691, 99, '海格H5V', 'H', 'haigeh5v', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(692, 99, '海格H6C', 'H', 'haigeh6c', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(693, 99, '海格H7V', 'H', 'haigeh7v', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(694, 99, '龙威', 'L', 'longwei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(695, 99, '御骏', 'Y', 'yujun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(696, 100, '奥丁', 'A', 'aoding', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(697, 100, '俊风', 'J', 'junfeng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(698, 100, '锐骐多功能商用车', 'R', 'ruiqiduogongnengshangyongche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(699, 100, '锐骐皮卡', 'R', 'ruiqipika', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(700, 100, '帅客', 'S', 'shuaike', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(701, 100, '御轩', 'Y', 'yuxuan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(702, 101, 'P1', 'P', 'p1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(703, 101, '625C', '#', '625c', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(704, 101, '650S', '#', '650s', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(705, 101, '12C', '#', '12c', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(706, 102, '驭胜', 'Y', 'yusheng', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(707, 102, '宝典', 'B', 'baodian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(708, 102, '域虎', 'Y', 'yuhu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(709, 102, '江铃福特', 'J', 'jianglingfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(710, 102, '经典全顺', 'J', 'jingdianquanshun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(711, 102, '新世代全顺', 'X', 'xinshidaiquanshun', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(712, 103, 'CT', 'C', 'ct', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(713, 103, 'ES', 'E', 'es', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(714, 103, 'GS', 'G', 'gs', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(715, 103, 'GX', 'G', 'gx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(716, 103, 'IS', 'I', 'is', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(717, 103, 'LS', 'L', 'ls', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(718, 103, 'LX', 'L', 'lx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(719, 103, 'NX', 'N', 'nx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(720, 103, 'RC', 'R', 'rc', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(721, 103, 'RX', 'R', 'rx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(722, 104, 'ML级', 'M', 'mlji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(723, 104, 'S级', 'S', 'sji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(724, 105, '一汽欧朗', 'Y', 'yiqioulang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(725, 105, '欧朗', 'O', 'oulang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(726, 106, '911', '#', '911', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(727, 106, '918 Spyder', '#', '918 spyder', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(728, 106, 'Boxster', 'B', 'boxster', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(729, 106, 'Cayenne', 'C', 'cayenne', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(730, 106, 'Cayman', 'C', 'cayman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(731, 106, 'Macan', 'M', 'macan', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(732, 106, 'Panamera', 'P', 'panamera', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(733, 107, 'Ram', 'R', 'ram', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(734, 107, '酷搏', 'K', 'kubo', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(735, 107, '酷威', 'K', 'kuwei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(736, 108, 'E150EV', 'E', 'e150ev', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(737, 109, 'MINI', 'M', 'mini', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(738, 109, 'CABRIO', 'C', 'cabrio', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(739, 109, 'CLUBMAN', 'C', 'clubman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(740, 109, 'COUNTRYMAN', 'C', 'countryman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(741, 109, 'COUPE', 'C', 'coupe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(742, 109, 'PACEMAN', 'P', 'paceman', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(743, 109, 'ROADSTER', 'R', 'roadster', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(744, 109, 'MINI JCW', 'M', 'mini jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(745, 109, 'CLUBMAN JCW', 'C', 'clubman jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(746, 109, 'COUNTRYMAN JCW', 'C', 'countryman jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(747, 109, 'COUPE JCW', 'C', 'coupe jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(748, 109, 'MINI JCW', 'M', 'mini jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(749, 109, 'PACEMAN JCW', 'P', 'paceman jcw', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(750, 110, 'F10', 'F', 'f10', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(751, 110, 'F12', 'F', 'f12', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(752, 110, 'F16', 'F', 'f16', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(753, 111, 'Saab 9-3', 'S', 'saab 9-3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(754, 112, '福克斯-长安福特', 'F', 'fukesi-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(755, 112, '嘉年华-长安福特', 'J', 'jianianhua-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(756, 112, '麦柯斯S-MAX-长安福特', 'M', 'maikesis-max-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(757, 112, '蒙迪欧-长安福特', 'M', 'mengdiou-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(758, 112, '翼搏-长安福特', 'Y', 'yibo-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(759, 112, '翼虎-长安福特', 'Y', 'yihu-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(760, 112, '致胜-长安福特', 'Z', 'zhisheng-zhanganfute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(761, 112, '嘉年华ST-进口福特', 'J', 'jianianhuast-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(762, 112, '福克斯ST-进口福特', 'F', 'fukesist-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(763, 112, '锐界-进口福特', 'R', 'ruijie-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(764, 112, '探险者-进口福特', 'T', 'tanxianzhe-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(765, 112, '征服者-进口福特', 'Z', 'zhengfuzhe-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(766, 112, '福特E350-进口福特', 'F', 'futee350-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(767, 112, '野马-进口福特', 'Y', 'yema-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(768, 112, '福特F-150-进口福特', 'F', 'futef-150-jinkoufute', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(769, 113, 'ILX', 'I', 'ilx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(770, 113, 'TL', 'T', 'tl', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(771, 113, 'TLX', 'T', 'tlx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(772, 113, 'MDX', 'M', 'mdx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(773, 113, 'RDX', 'R', 'rdx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(774, 113, 'RL', 'R', 'rl', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(775, 113, 'RLX', 'R', 'rlx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(776, 113, 'ZDX', 'Z', 'zdx', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(777, 114, '揽福', 'L', 'lanfu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(778, 114, '探索者', 'T', 'tansuozhe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(779, 114, '小超人', 'X', 'xiaochaoren', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(780, 114, '雄狮', 'X', 'xiongshi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(781, 115, '海狮', 'H', 'haishi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(782, 116, 'Evora', 'E', 'evora', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(783, 116, 'Exige', 'E', 'exige', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(784, 116, '爱丽丝', 'A', 'ailisi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(785, 117, '300', '#', '300', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(786, 117, '大捷龙', 'D', 'dajielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(787, 118, '路宝', 'L', 'lubao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(788, 118, '哈飞小霸王', 'H', 'hafeixiaobawang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(789, 118, '骏意', 'J', 'junyi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(790, 118, '民意', 'M', 'minyi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(791, 118, '中意V5', 'Z', 'zhongyiv5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(792, 119, 'CX-7-一汽马自达', 'C', 'cx-7-yiqimazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(793, 119, 'Mazda6-一汽马自达', 'M', 'mazda6-yiqimazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(794, 119, '睿翼-一汽马自达', 'R', 'ruiyi-yiqimazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(795, 119, '阿特兹-一汽马自达', 'A', 'atezi-yiqimazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(796, 119, 'Mazda8-一汽马自达', 'M', 'mazda8-yiqimazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(797, 119, '2-长安马自达', '#', '2-zhanganmazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(798, 119, '3经典-长安马自达', '#', '3jingdian-zhanganmazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(799, 119, '3星骋-长安马自达', '#', '3xingcheng-zhanganmazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(800, 119, '昂克赛拉-长安马自达', 'A', 'angkesaila-zhanganmazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(801, 119, 'CX-5-进口马自达', 'C', 'cx-5-jinkoumazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(802, 119, 'CX-7-进口马自达', 'C', 'cx-7-jinkoumazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(803, 119, 'CX-9-进口马自达', 'C', 'cx-9-jinkoumazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(804, 119, 'Mazda5-进口马自达', 'M', 'mazda5-jinkoumazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(805, 119, 'MX-5-进口马自达', 'M', 'mx-5-jinkoumazida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(806, 120, 'E美', 'E', 'emei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(807, 120, '奥轩G5', 'A', 'aoxuang5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(808, 120, '奥轩GX5', 'A', 'aoxuangx5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(809, 120, '财运100', 'C', 'caiyun100', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(810, 120, '财运300', 'C', 'caiyun300', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(811, 120, '财运500', 'C', 'caiyun500', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(812, 120, '吉奥GP150', 'J', 'jiaogp150', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(813, 120, '吉奥GX6', 'J', 'jiaogx6', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(814, 120, '星朗', 'X', 'xinglang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(815, 120, '星旺', 'X', 'xingwang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(816, 120, '星旺CL', 'X', 'xingwangcl', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(817, 121, '巴博斯 CLS级', 'B', 'babosi clsji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(818, 121, '巴博斯 S级', 'B', 'babosi sji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(819, 121, '巴博斯 M级', 'B', 'babosi mji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(820, 121, '巴博斯 SLK级', 'B', 'babosi slkji', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(821, 122, '中欧奔驰房车', 'Z', 'zhongoubenchifangche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(822, 123, 'Smart', 'S', 'smart', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(823, 124, 'K2-东风悦达起亚', 'K', 'k2-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(824, 124, 'K3-东风悦达起亚', 'K', 'k3-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(825, 124, 'K3S-东风悦达起亚', 'K', 'k3s-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(826, 124, 'K4-东风悦达起亚', 'K', 'k4-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(827, 124, 'K5-东风悦达起亚', 'K', 'k5-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(828, 124, 'RIO-东风悦达起亚', 'R', 'rio-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(829, 124, '福瑞迪-东风悦达起亚', 'F', 'furuidi-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(830, 124, '赛拉图-东风悦达起亚', 'S', 'sailatu-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(831, 124, '狮跑-东风悦达起亚', 'S', 'shipao-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(832, 124, '秀尔-东风悦达起亚', 'X', 'xiuer-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(833, 124, '智跑-东风悦达起亚', 'Z', 'zhipao-dongfengyuedaqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(834, 124, 'K5混合动力-进口起亚', 'K', 'k5hunhedongli-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(835, 124, 'VQ威客-进口起亚', 'V', 'vqweike-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(836, 124, '霸锐-进口起亚', 'B', 'barui-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(837, 124, '凯尊-进口起亚', 'K', 'kaizun-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(838, 124, '速迈-进口起亚', 'S', 'sumai-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(839, 124, '索兰托-进口起亚', 'S', 'suolantuo-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(840, 124, '新佳乐-进口起亚', 'X', 'xinjiale-jinkouqiya', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(841, 125, '帝豪', 'D', 'dihao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(842, 125, '帝豪EC8', 'D', 'dihaoec8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(843, 125, 'GC7', 'G', 'gc7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(844, 125, 'GX7', 'G', 'gx7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(845, 125, 'SC3', 'S', 'sc3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(846, 125, 'SX7', 'S', 'sx7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(847, 125, '海景', 'H', 'haijing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(848, 125, '豪情SUV', 'H', 'haoqingsuv', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(849, 125, '金刚', 'J', 'jingang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(850, 125, '熊猫', 'X', 'xiongmao', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(851, 125, '英伦TX4', 'Y', 'yingluntx4', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(852, 125, '远景', 'Y', 'yuanjing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(853, 125, '自由舰', 'Z', 'ziyoujian', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(854, 126, '华颂7', 'H', 'huasong7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(855, 127, 'C35', 'C', 'c35', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(856, 127, 'C36', 'C', 'c36', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(857, 127, 'C37', 'C', 'c37', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(858, 127, 'K17', 'K', 'k17', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(859, 127, 'V07S', 'V', 'v07s', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(860, 127, '风光', 'F', 'fengguang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(861, 127, 'K01', 'K', 'k01', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(862, 127, 'K02', 'K', 'k02', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(863, 127, 'K07', 'K', 'k07', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(864, 127, 'K07II', 'K', 'k07ii', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(865, 127, 'V21', 'V', 'v21', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(866, 127, 'V22', 'V', 'v22', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(867, 127, 'V27', 'V', 'v27', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(868, 127, 'V29', 'V', 'v29', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(869, 128, 'C8', 'C', 'c8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(870, 129, 'ATS-L-上海通用凯迪拉克', 'A', 'ats-l-shanghaitongyongkaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(871, 129, 'XTS-上海通用凯迪拉克', 'X', 'xts-shanghaitongyongkaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(872, 129, 'ATS-进口凯迪拉克', 'A', 'ats-jinkoukaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(873, 129, 'CTS-进口凯迪拉克', 'C', 'cts-jinkoukaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(874, 129, 'SRX-进口凯迪拉克', 'S', 'srx-jinkoukaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(875, 129, '凯雷德-进口凯迪拉克', 'K', 'kaileide-jinkoukaidilake', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(876, 130, '途腾T1', 'T', 'tutengt1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(877, 130, '途腾T2', 'T', 'tutengt2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(878, 130, '途腾T3', 'T', 'tutengt3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(879, 131, 'C2-东风雪铁龙', 'C', 'c2-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(880, 131, 'C3-XR-东风雪铁龙', 'C', 'c3-xr-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(881, 131, 'C4L-东风雪铁龙', 'C', 'c4l-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(882, 131, 'C5-东风雪铁龙', 'C', 'c5-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(883, 131, '爱丽舍-东风雪铁龙', 'A', 'ailishe-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(884, 131, '世嘉-东风雪铁龙', 'S', 'shijia-dongfengxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(885, 131, 'C4Aircross-进口雪铁龙', 'C', 'c4aircross-jinkouxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(886, 131, 'C4毕加索-进口雪铁龙', 'C', 'c4bijiasuo-jinkouxuetielong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(887, 132, '凯越', 'K', 'kaiyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(888, 132, '英朗', 'Y', 'yinglang', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(889, 132, '君威', 'J', 'junwei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(890, 132, '君越', 'J', 'junyue', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(891, 132, '昂科拉', 'A', 'angkela', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(892, 132, '昂科威', 'A', 'angkewei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(893, 132, '别克GL8', 'B', 'biekegl8', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(894, 132, '昂科雷-进口', 'A', 'angkelei-jinkou', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(895, 133, 'E3', 'E', 'e3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(896, 133, 'E5', 'E', 'e5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(897, 133, 'eQ电动车', 'E', 'eqdiandongche', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(898, 133, '新QQ', 'X', 'xinqq', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(899, 133, 'QQ3', 'Q', 'qq3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(900, 133, '艾瑞泽3', 'A', 'airuize3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(901, 133, '艾瑞泽7', 'A', 'airuize7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(902, 133, '东方之子', 'D', 'dongfangzhizi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(903, 133, '风云2', 'F', 'fengyun2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(904, 133, '旗云1', 'Q', 'qiyun1', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(905, 133, '旗云2', 'Q', 'qiyun2', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(906, 133, '旗云3', 'Q', 'qiyun3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(907, 133, '瑞虎3', 'R', 'ruihu3', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(908, 133, '瑞虎5', 'R', 'ruihu5', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(909, 134, '路盛E70', 'L', 'lushenge70', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(910, 134, '华泰B11', 'H', 'huataib11', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(911, 134, '宝利格', 'B', 'baolige', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(912, 134, '圣达菲', 'S', 'shengdafei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(913, 134, '新圣达菲', 'X', 'xinshengdafei', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(914, 134, '特拉卡', 'T', 'telaka', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(915, 135, 'Polo-上海大众', 'P', 'polo-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(916, 135, '朗境-上海大众', 'L', 'langjing-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(917, 135, '朗行-上海大众', 'L', 'langxing-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(918, 135, '朗逸-上海大众', 'L', 'langyi-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(919, 135, '帕萨特-上海大众', 'P', 'pasate-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(920, 135, '途安-上海大众', 'T', 'tuan-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(921, 135, '途观-上海大众', 'T', 'tuguan-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(922, 135, '新桑塔纳-上海大众', 'X', 'xinsangtana-shanghaidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(923, 135, 'CC-一汽大众', 'C', 'cc-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(924, 135, '宝来-一汽大众', 'B', 'baolai-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(925, 135, '高尔夫-一汽大众', 'G', 'gaoerfu-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(926, 135, '高尔夫GTI-一汽大众', 'G', 'gaoerfugti-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(927, 135, '捷达-一汽大众', 'J', 'jieda-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(928, 135, '迈腾-一汽大众', 'M', 'maiteng-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(929, 135, '速腾-一汽大众', 'S', 'suteng-yiqidazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(930, 135, 'Eos-进口大众', 'E', 'eos-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(931, 135, 'Tiguan-进口大众', 'T', 'tiguan-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(932, 135, '大众up-进口大众', 'D', 'dazhongup-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(933, 135, '高尔夫-进口大众', 'G', 'gaoerfu-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(934, 135, '辉腾-进口大众', 'H', 'huiteng-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(935, 135, '甲壳虫-进口大众', 'J', 'jiaqiaochong-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(936, 135, '凯路威-进口大众', 'K', 'kailuwei-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(937, 135, '迈特威-进口大众', 'M', 'maitewei-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(938, 135, '迈腾-进口大众', 'M', 'maiteng-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(939, 135, '尚酷-进口大众', 'S', 'shangku-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(940, 135, '途锐-进口大众', 'T', 'turui-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(941, 135, '夏朗-进口大众', 'X', 'xialang-jinkoudazhong', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(942, 136, '福瑞达', 'F', 'furuida', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(943, 136, '福瑞达M50', 'F', 'furuidam50', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(944, 137, 'A30', 'A', 'a30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(945, 137, 'A60', 'A', 'a60', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(946, 137, 'AX7', 'A', 'ax7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(947, 137, 'H30', 'H', 'h30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(948, 137, 'S30', 'S', 's30', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(949, 138, '风景', 'F', 'fengjing', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(950, 138, '风景G7', 'F', 'fengjingg7', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(951, 138, '蒙派克E', 'M', 'mengpaikee', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(952, 138, '蒙派克S', 'M', 'mengpaikes', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(953, 138, '迷迪', 'M', 'midi', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(954, 138, '萨普', 'S', 'sapu', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1),
(955, 138, '拓陆者', 'T', 'tuoluzhe', '2015-07-16 12:38:34', '2015-07-16 12:38:34', 1);
INSERT INTO `city` (`ID`, `CITY_ID`, `CITY_NAME`, `CITY_TYPE`, `PARENT_ID`) VALUES
(1, 110000, '北京市', 1, 0),
(2, 120000, '天津市', 1, 0),
(3, 130000, '河北省', 1, 0),
(4, 140000, '山西省', 1, 0),
(5, 150000, '内蒙古自治区', 1, 0),
(6, 210000, '辽宁省', 1, 0),
(7, 220000, '吉林省', 1, 0),
(8, 230000, '黑龙江省', 1, 0),
(9, 310000, '上海市', 1, 0),
(10, 320000, '江苏省', 1, 0),
(11, 330000, '浙江省', 1, 0),
(12, 340000, '安徽省', 1, 0),
(13, 350000, '福建省', 1, 0),
(14, 360000, '江西省', 1, 0),
(15, 370000, '山东省', 1, 0),
(16, 410000, '河南省', 1, 0),
(17, 420000, '湖北省', 1, 0),
(18, 430000, '湖南省', 1, 0),
(19, 440000, '广东省', 1, 0),
(20, 450000, '广西壮族自治区', 1, 0),
(21, 460000, '海南省', 1, 0),
(22, 500000, '重庆市', 1, 0),
(23, 510000, '四川省', 1, 0),
(24, 520000, '贵州省', 1, 0),
(25, 530000, '云南省', 1, 0),
(26, 540000, '西藏自治区', 1, 0),
(27, 610000, '陕西省', 1, 0),
(28, 620000, '甘肃省', 1, 0),
(29, 630000, '青海省', 1, 0),
(30, 640000, '宁夏回族自治区', 1, 0),
(31, 650000, '新疆维吾尔自治区', 1, 0),
(32, 710000, '台湾省', 1, 0),
(33, 810000, '香港特别行政区', 1, 0),
(34, 820000, '澳门特别行政区', 1, 0),
(35, 110100, '北京市', 2, 110000),
(36, 120100, '天津市', 2, 120000),
(37, 130100, '石家庄市', 2, 130000),
(38, 130200, '唐山市', 2, 130000),
(39, 130300, '秦皇岛市', 2, 130000),
(40, 130400, '邯郸市', 2, 130000),
(41, 130500, '邢台市', 2, 130000),
(42, 130600, '保定市', 2, 130000),
(43, 130700, '张家口市', 2, 130000),
(44, 130800, '承德市', 2, 130000),
(45, 130900, '沧州市', 2, 130000),
(46, 131000, '廊坊市', 2, 130000),
(47, 131100, '衡水市', 2, 130000),
(48, 140100, '太原市', 2, 140000),
(49, 140200, '大同市', 2, 140000),
(50, 140300, '阳泉市', 2, 140000),
(51, 140400, '长治市', 2, 140000),
(52, 140500, '晋城市', 2, 140000),
(53, 140600, '朔州市', 2, 140000),
(54, 140700, '晋中市', 2, 140000),
(55, 140800, '运城市', 2, 140000),
(56, 140900, '忻州市', 2, 140000),
(57, 141000, '临汾市', 2, 140000),
(58, 141100, '吕梁市', 2, 140000),
(59, 150100, '呼和浩特市', 2, 150000),
(60, 150200, '包头市', 2, 150000),
(61, 150300, '乌海市', 2, 150000),
(62, 150400, '赤峰市', 2, 150000),
(63, 150500, '通辽市', 2, 150000),
(64, 150600, '鄂尔多斯市', 2, 150000),
(65, 150700, '呼伦贝尔市', 2, 150000),
(66, 150800, '巴彦淖尔市', 2, 150000),
(67, 150900, '乌兰察布市', 2, 150000),
(68, 152200, '兴安盟', 2, 150000),
(69, 152500, '锡林郭勒盟', 2, 150000),
(70, 152900, '阿拉善盟', 2, 150000),
(71, 210100, '沈阳市', 2, 210000),
(72, 210200, '大连市', 2, 210000),
(73, 210300, '鞍山市', 2, 210000),
(74, 210400, '抚顺市', 2, 210000),
(75, 210500, '本溪市', 2, 210000),
(76, 210600, '丹东市', 2, 210000),
(77, 210700, '锦州市', 2, 210000),
(78, 210800, '营口市', 2, 210000),
(79, 210900, '阜新市', 2, 210000),
(80, 211000, '辽阳市', 2, 210000),
(81, 211100, '盘锦市', 2, 210000),
(82, 211200, '铁岭市', 2, 210000),
(83, 211300, '朝阳市', 2, 210000),
(84, 211400, '葫芦岛市', 2, 210000),
(85, 220100, '长春市', 2, 220000),
(86, 220200, '吉林市', 2, 220000),
(87, 220300, '四平市', 2, 220000),
(88, 220400, '辽源市', 2, 220000),
(89, 220500, '通化市', 2, 220000),
(90, 220600, '白山市', 2, 220000),
(91, 220700, '松原市', 2, 220000),
(92, 220800, '白城市', 2, 220000),
(93, 222400, '延边朝鲜族自治州', 2, 220000),
(94, 230100, '哈尔滨市', 2, 230000),
(95, 230200, '齐齐哈尔市', 2, 230000),
(96, 230300, '鸡西市', 2, 230000),
(97, 230400, '鹤岗市', 2, 230000),
(98, 230500, '双鸭山市', 2, 230000),
(99, 230600, '大庆市', 2, 230000),
(100, 230700, '伊春市', 2, 230000),
(101, 230800, '佳木斯市', 2, 230000),
(102, 230900, '七台河市', 2, 230000),
(103, 231000, '牡丹江市', 2, 230000),
(104, 231100, '黑河市', 2, 230000),
(105, 231200, '绥化市', 2, 230000),
(106, 232700, '大兴安岭地区', 2, 230000),
(107, 310100, '上海市', 2, 310000),
(108, 320100, '南京市', 2, 320000),
(109, 320200, '无锡市', 2, 320000),
(110, 320300, '徐州市', 2, 320000),
(111, 320400, '常州市', 2, 320000),
(112, 320500, '苏州市', 2, 320000),
(113, 320600, '南通市', 2, 320000),
(114, 320700, '连云港市', 2, 320000),
(115, 320800, '淮安市', 2, 320000),
(116, 320900, '盐城市', 2, 320000),
(117, 321000, '扬州市', 2, 320000),
(118, 321100, '镇江市', 2, 320000),
(119, 321200, '泰州市', 2, 320000),
(120, 321300, '宿迁市', 2, 320000),
(121, 330100, '杭州市', 2, 330000),
(122, 330200, '宁波市', 2, 330000),
(123, 330300, '温州市', 2, 330000),
(124, 330400, '嘉兴市', 2, 330000),
(125, 330500, '湖州市', 2, 330000),
(126, 330600, '绍兴市', 2, 330000),
(127, 330700, '金华市', 2, 330000),
(128, 330800, '衢州市', 2, 330000),
(129, 330900, '舟山市', 2, 330000),
(130, 331000, '台州市', 2, 330000),
(131, 331100, '丽水市', 2, 330000),
(132, 340100, '合肥市', 2, 340000),
(133, 340200, '芜湖市', 2, 340000),
(134, 340300, '蚌埠市', 2, 340000),
(135, 340400, '淮南市', 2, 340000),
(136, 340500, '马鞍山市', 2, 340000),
(137, 340600, '淮北市', 2, 340000),
(138, 340700, '铜陵市', 2, 340000),
(139, 340800, '安庆市', 2, 340000),
(140, 341000, '黄山市', 2, 340000),
(141, 341100, '滁州市', 2, 340000),
(142, 341200, '阜阳市', 2, 340000),
(143, 341300, '宿州市', 2, 340000),
(144, 341400, '巢湖市', 2, 340000),
(145, 341500, '六安市', 2, 340000),
(146, 341600, '亳州市', 2, 340000),
(147, 341700, '池州市', 2, 340000),
(148, 341800, '宣城市', 2, 340000),
(149, 350100, '福州市', 2, 350000),
(150, 350200, '厦门市', 2, 350000),
(151, 350300, '莆田市', 2, 350000),
(152, 350400, '三明市', 2, 350000),
(153, 350500, '泉州市', 2, 350000),
(154, 350600, '漳州市', 2, 350000),
(155, 350700, '南平市', 2, 350000),
(156, 350800, '龙岩市', 2, 350000),
(157, 350900, '宁德市', 2, 350000),
(158, 360100, '南昌市', 2, 360000),
(159, 360200, '景德镇市', 2, 360000),
(160, 360300, '萍乡市', 2, 360000),
(161, 360400, '九江市', 2, 360000),
(162, 360500, '新余市', 2, 360000),
(163, 360600, '鹰潭市', 2, 360000),
(164, 360700, '赣州市', 2, 360000),
(165, 360800, '吉安市', 2, 360000),
(166, 360900, '宜春市', 2, 360000),
(167, 361000, '抚州市', 2, 360000),
(168, 361100, '上饶市', 2, 360000),
(169, 370100, '济南市', 2, 370000),
(170, 370200, '青岛市', 2, 370000),
(171, 370300, '淄博市', 2, 370000),
(172, 370400, '枣庄市', 2, 370000),
(173, 370500, '东营市', 2, 370000),
(174, 370600, '烟台市', 2, 370000),
(175, 370700, '潍坊市', 2, 370000),
(176, 370800, '济宁市', 2, 370000),
(177, 370900, '泰安市', 2, 370000),
(178, 371000, '威海市', 2, 370000),
(179, 371100, '日照市', 2, 370000),
(180, 371200, '莱芜市', 2, 370000),
(181, 371300, '临沂市', 2, 370000),
(182, 371400, '德州市', 2, 370000),
(183, 371500, '聊城市', 2, 370000),
(184, 371600, '滨州市', 2, 370000),
(185, 371700, '荷泽市', 2, 370000),
(186, 410100, '郑州市', 2, 410000),
(187, 410200, '开封市', 2, 410000),
(188, 410300, '洛阳市', 2, 410000),
(189, 410400, '平顶山市', 2, 410000),
(190, 410500, '安阳市', 2, 410000),
(191, 410600, '鹤壁市', 2, 410000),
(192, 410700, '新乡市', 2, 410000),
(193, 410800, '焦作市', 2, 410000),
(194, 410900, '濮阳市', 2, 410000),
(195, 411000, '许昌市', 2, 410000),
(196, 411100, '漯河市', 2, 410000),
(197, 411200, '三门峡市', 2, 410000),
(198, 411300, '南阳市', 2, 410000),
(199, 411400, '商丘市', 2, 410000),
(200, 411500, '信阳市', 2, 410000),
(201, 411600, '周口市', 2, 410000),
(202, 411700, '驻马店市', 2, 410000),
(203, 420100, '武汉市', 2, 420000),
(204, 420200, '黄石市', 2, 420000),
(205, 420300, '十堰市', 2, 420000),
(206, 420500, '宜昌市', 2, 420000),
(207, 420600, '襄樊市', 2, 420000),
(208, 420700, '鄂州市', 2, 420000),
(209, 420800, '荆门市', 2, 420000),
(210, 420900, '孝感市', 2, 420000),
(211, 421000, '荆州市', 2, 420000),
(212, 421100, '黄冈市', 2, 420000),
(213, 421200, '咸宁市', 2, 420000),
(214, 421300, '随州市', 2, 420000),
(215, 422800, '恩施土家族苗族自治州', 2, 420000),
(216, 429000, '省直辖行政单位', 2, 420000),
(217, 430100, '长沙市', 2, 430000),
(218, 430200, '株洲市', 2, 430000),
(219, 430300, '湘潭市', 2, 430000),
(220, 430400, '衡阳市', 2, 430000),
(221, 430500, '邵阳市', 2, 430000),
(222, 430600, '岳阳市', 2, 430000),
(223, 430700, '常德市', 2, 430000),
(224, 430800, '张家界市', 2, 430000),
(225, 430900, '益阳市', 2, 430000),
(226, 431000, '郴州市', 2, 430000),
(227, 431100, '永州市', 2, 430000),
(228, 431200, '怀化市', 2, 430000),
(229, 431300, '娄底市', 2, 430000),
(230, 433100, '湘西土家族苗族自治州', 2, 430000),
(231, 440100, '广州市', 2, 440000),
(232, 440200, '韶关市', 2, 440000),
(233, 440300, '深圳市', 2, 440000),
(234, 440400, '珠海市', 2, 440000),
(235, 440500, '汕头市', 2, 440000),
(236, 440600, '佛山市', 2, 440000),
(237, 440700, '江门市', 2, 440000),
(238, 440800, '湛江市', 2, 440000),
(239, 440900, '茂名市', 2, 440000),
(240, 441200, '肇庆市', 2, 440000),
(241, 441300, '惠州市', 2, 440000),
(242, 441400, '梅州市', 2, 440000),
(243, 441500, '汕尾市', 2, 440000),
(244, 441600, '河源市', 2, 440000),
(245, 441700, '阳江市', 2, 440000),
(246, 441800, '清远市', 2, 440000),
(247, 441900, '东莞市', 2, 440000),
(248, 442000, '中山市', 2, 440000),
(249, 445100, '潮州市', 2, 440000),
(250, 445200, '揭阳市', 2, 440000),
(251, 445300, '云浮市', 2, 440000),
(252, 450100, '南宁市', 2, 450000),
(253, 450200, '柳州市', 2, 450000),
(254, 450300, '桂林市', 2, 450000),
(255, 450400, '梧州市', 2, 450000),
(256, 450500, '北海市', 2, 450000),
(257, 450600, '防城港市', 2, 450000),
(258, 450700, '钦州市', 2, 450000),
(259, 450800, '贵港市', 2, 450000),
(260, 450900, '玉林市', 2, 450000),
(261, 451000, '百色市', 2, 450000),
(262, 451100, '贺州市', 2, 450000),
(263, 451200, '河池市', 2, 450000),
(264, 451300, '来宾市', 2, 450000),
(265, 451400, '崇左市', 2, 450000),
(266, 460100, '海口市', 2, 460000),
(267, 460200, '三亚市', 2, 460000),
(268, 469000, '省直辖县级行政单位', 2, 460000),
(269, 500100, '重庆市', 2, 500000),
(270, 510100, '成都市', 2, 510000),
(271, 510300, '自贡市', 2, 510000),
(272, 510400, '攀枝花市', 2, 510000),
(273, 510500, '泸州市', 2, 510000),
(274, 510600, '德阳市', 2, 510000),
(275, 510700, '绵阳市', 2, 510000),
(276, 510800, '广元市', 2, 510000),
(277, 510900, '遂宁市', 2, 510000),
(278, 511000, '内江市', 2, 510000),
(279, 511100, '乐山市', 2, 510000),
(280, 511300, '南充市', 2, 510000),
(281, 511400, '眉山市', 2, 510000),
(282, 511500, '宜宾市', 2, 510000),
(283, 511600, '广安市', 2, 510000),
(284, 511700, '达州市', 2, 510000),
(285, 511800, '雅安市', 2, 510000),
(286, 511900, '巴中市', 2, 510000),
(287, 512000, '资阳市', 2, 510000),
(288, 513200, '阿坝藏族羌族自治州', 2, 510000),
(289, 513300, '甘孜藏族自治州', 2, 510000),
(290, 513400, '凉山彝族自治州', 2, 510000),
(291, 520100, '贵阳市', 2, 520000),
(292, 520200, '六盘水市', 2, 520000),
(293, 520300, '遵义市', 2, 520000),
(294, 520400, '安顺市', 2, 520000),
(295, 522200, '铜仁地区', 2, 520000),
(296, 522300, '黔西南布依族苗族自治州', 2, 520000),
(297, 522400, '毕节地区', 2, 520000),
(298, 522600, '黔东南苗族侗族自治州', 2, 520000),
(299, 522700, '黔南布依族苗族自治州', 2, 520000),
(300, 530100, '昆明市', 2, 530000),
(301, 530300, '曲靖市', 2, 530000),
(302, 530400, '玉溪市', 2, 530000),
(303, 530500, '保山市', 2, 530000),
(304, 530600, '昭通市', 2, 530000),
(305, 530700, '丽江市', 2, 530000),
(306, 530800, '思茅市', 2, 530000),
(307, 530900, '临沧市', 2, 530000),
(308, 532300, '楚雄彝族自治州', 2, 530000),
(309, 532500, '红河哈尼族彝族自治州', 2, 530000),
(310, 532600, '文山壮族苗族自治州', 2, 530000),
(311, 532800, '西双版纳傣族自治州', 2, 530000),
(312, 532900, '大理白族自治州', 2, 530000),
(313, 533100, '德宏傣族景颇族自治州', 2, 530000),
(314, 533300, '怒江傈僳族自治州', 2, 530000),
(315, 533400, '迪庆藏族自治州', 2, 530000),
(316, 540100, '拉萨市', 2, 540000),
(317, 542100, '昌都地区', 2, 540000),
(318, 542200, '山南地区', 2, 540000),
(319, 542300, '日喀则地区', 2, 540000),
(320, 542400, '那曲地区', 2, 540000),
(321, 542500, '阿里地区', 2, 540000),
(322, 542600, '林芝地区', 2, 540000),
(323, 610100, '西安市', 2, 610000),
(324, 610200, '铜川市', 2, 610000),
(325, 610300, '宝鸡市', 2, 610000),
(326, 610400, '咸阳市', 2, 610000),
(327, 610500, '渭南市', 2, 610000),
(328, 610600, '延安市', 2, 610000),
(329, 610700, '汉中市', 2, 610000),
(330, 610800, '榆林市', 2, 610000),
(331, 610900, '安康市', 2, 610000),
(332, 611000, '商洛市', 2, 610000),
(333, 620100, '兰州市', 2, 620000),
(334, 620200, '嘉峪关市', 2, 620000),
(335, 620300, '金昌市', 2, 620000),
(336, 620400, '白银市', 2, 620000),
(337, 620500, '天水市', 2, 620000),
(338, 620600, '武威市', 2, 620000),
(339, 620700, '张掖市', 2, 620000),
(340, 620800, '平凉市', 2, 620000),
(341, 620900, '酒泉市', 2, 620000),
(342, 621000, '庆阳市', 2, 620000),
(343, 621100, '定西市', 2, 620000),
(344, 621200, '陇南市', 2, 620000),
(345, 622900, '临夏回族自治州', 2, 620000),
(346, 623000, '甘南藏族自治州', 2, 620000),
(347, 630100, '西宁市', 2, 630000),
(348, 632100, '海东地区', 2, 630000),
(349, 632200, '海北藏族自治州', 2, 630000),
(350, 632300, '黄南藏族自治州', 2, 630000),
(351, 632500, '海南藏族自治州', 2, 630000),
(352, 632600, '果洛藏族自治州', 2, 630000),
(353, 632700, '玉树藏族自治州', 2, 630000),
(354, 632800, '海西蒙古族藏族自治州', 2, 630000),
(355, 640100, '银川市', 2, 640000),
(356, 640200, '石嘴山市', 2, 640000),
(357, 640300, '吴忠市', 2, 640000),
(358, 640400, '固原市', 2, 640000),
(359, 640500, '中卫市', 2, 640000),
(360, 650100, '乌鲁木齐市', 2, 650000),
(361, 650200, '克拉玛依市', 2, 650000),
(362, 652100, '吐鲁番地区', 2, 650000),
(363, 652200, '哈密地区', 2, 650000),
(364, 652300, '昌吉回族自治州', 2, 650000),
(365, 652700, '博尔塔拉蒙古自治州', 2, 650000),
(366, 652800, '巴音郭楞蒙古自治州', 2, 650000),
(367, 652900, '阿克苏地区', 2, 650000),
(368, 653000, '克孜勒苏柯尔克孜自治州', 2, 650000),
(369, 653100, '喀什地区', 2, 650000),
(370, 653200, '和田地区', 2, 650000),
(371, 654000, '伊犁哈萨克自治州', 2, 650000),
(372, 654200, '塔城地区', 2, 650000),
(373, 654300, '阿勒泰地区', 2, 650000),
(374, 659000, '省直辖行政单位', 2, 650000),
(375, 110101, '东城区', 3, 110100),
(376, 110102, '西城区', 3, 110100),
(377, 110103, '崇文区', 3, 110100),
(378, 110104, '宣武区', 3, 110100),
(379, 110105, '朝阳区', 3, 110100),
(380, 110106, '丰台区', 3, 110100),
(381, 110107, '石景山区', 3, 110100),
(382, 110108, '海淀区', 3, 110100),
(383, 110109, '门头沟区', 3, 110100),
(384, 110111, '房山区', 3, 110100),
(385, 110112, '通州区', 3, 110100),
(386, 110113, '顺义区', 3, 110100),
(387, 110114, '昌平区', 3, 110100),
(388, 110115, '大兴区', 3, 110100),
(389, 110116, '怀柔区', 3, 110100),
(390, 110117, '平谷区', 3, 110100),
(391, 110228, '密云县', 3, 110100),
(392, 110229, '延庆县', 3, 110100),
(393, 120101, '和平区', 3, 120100),
(394, 120102, '河东区', 3, 120100),
(395, 120103, '河西区', 3, 120100),
(396, 120104, '南开区', 3, 120100),
(397, 120105, '河北区', 3, 120100),
(398, 120106, '红桥区', 3, 120100),
(399, 120107, '塘沽区', 3, 120100),
(400, 120108, '汉沽区', 3, 120100),
(401, 120109, '大港区', 3, 120100),
(402, 120110, '东丽区', 3, 120100),
(403, 120111, '西青区', 3, 120100),
(404, 120112, '津南区', 3, 120100),
(405, 120113, '北辰区', 3, 120100),
(406, 120114, '武清区', 3, 120100),
(407, 120115, '宝坻区', 3, 120100),
(408, 120221, '宁河县', 3, 120100),
(409, 120223, '静海县', 3, 120100),
(410, 120225, '蓟 县', 3, 120100),
(411, 130102, '长安区', 3, 130100),
(412, 130103, '桥东区', 3, 130100),
(413, 130104, '桥西区', 3, 130100),
(414, 130105, '新华区', 3, 130100),
(415, 130107, '井陉矿区', 3, 130100),
(416, 130108, '裕华区', 3, 130100),
(417, 130121, '井陉县', 3, 130100),
(418, 130123, '正定县', 3, 130100),
(419, 130124, '栾城县', 3, 130100),
(420, 130125, '行唐县', 3, 130100),
(421, 130126, '灵寿县', 3, 130100),
(422, 130127, '高邑县', 3, 130100),
(423, 130128, '深泽县', 3, 130100),
(424, 130129, '赞皇县', 3, 130100),
(425, 130130, '无极县', 3, 130100),
(426, 130131, '平山县', 3, 130100),
(427, 130132, '元氏县', 3, 130100),
(428, 130133, '赵 县', 3, 130100),
(429, 130181, '辛集市', 3, 130100),
(430, 130182, '藁城市', 3, 130100),
(431, 130183, '晋州市', 3, 130100),
(432, 130184, '新乐市', 3, 130100),
(433, 130185, '鹿泉市', 3, 130100),
(434, 130202, '路南区', 3, 130200),
(435, 130203, '路北区', 3, 130200),
(436, 130204, '古冶区', 3, 130200),
(437, 130205, '开平区', 3, 130200),
(438, 130207, '丰南区', 3, 130200),
(439, 130208, '丰润区', 3, 130200),
(440, 130223, '滦 县', 3, 130200),
(441, 130224, '滦南县', 3, 130200),
(442, 130225, '乐亭县', 3, 130200),
(443, 130227, '迁西县', 3, 130200),
(444, 130229, '玉田县', 3, 130200),
(445, 130230, '唐海县', 3, 130200),
(446, 130281, '遵化市', 3, 130200),
(447, 130283, '迁安市', 3, 130200),
(448, 130302, '海港区', 3, 130300),
(449, 130303, '山海关区', 3, 130300),
(450, 130304, '北戴河区', 3, 130300),
(451, 130321, '青龙满族自治县', 3, 130300),
(452, 130322, '昌黎县', 3, 130300),
(453, 130323, '抚宁县', 3, 130300),
(454, 130324, '卢龙县', 3, 130300),
(455, 130402, '邯山区', 3, 130400),
(456, 130403, '丛台区', 3, 130400),
(457, 130404, '复兴区', 3, 130400),
(458, 130406, '峰峰矿区', 3, 130400),
(459, 130421, '邯郸县', 3, 130400),
(460, 130423, '临漳县', 3, 130400),
(461, 130424, '成安县', 3, 130400),
(462, 130425, '大名县', 3, 130400),
(463, 130426, '涉 县', 3, 130400),
(464, 130427, '磁 县', 3, 130400),
(465, 130428, '肥乡县', 3, 130400),
(466, 130429, '永年县', 3, 130400),
(467, 130430, '邱 县', 3, 130400),
(468, 130431, '鸡泽县', 3, 130400),
(469, 130432, '广平县', 3, 130400),
(470, 130433, '馆陶县', 3, 130400),
(471, 130434, '魏 县', 3, 130400),
(472, 130435, '曲周县', 3, 130400),
(473, 130481, '武安市', 3, 130400),
(474, 130502, '桥东区', 3, 130500),
(475, 130503, '桥西区', 3, 130500),
(476, 130521, '邢台县', 3, 130500),
(477, 130522, '临城县', 3, 130500),
(478, 130523, '内丘县', 3, 130500),
(479, 130524, '柏乡县', 3, 130500),
(480, 130525, '隆尧县', 3, 130500),
(481, 130526, '任 县', 3, 130500),
(482, 130527, '南和县', 3, 130500),
(483, 130528, '宁晋县', 3, 130500),
(484, 130529, '巨鹿县', 3, 130500),
(485, 130530, '新河县', 3, 130500),
(486, 130531, '广宗县', 3, 130500),
(487, 130532, '平乡县', 3, 130500),
(488, 130533, '威 县', 3, 130500),
(489, 130534, '清河县', 3, 130500),
(490, 130535, '临西县', 3, 130500),
(491, 130581, '南宫市', 3, 130500),
(492, 130582, '沙河市', 3, 130500),
(493, 130602, '新市区', 3, 130600),
(494, 130603, '北市区', 3, 130600),
(495, 130604, '南市区', 3, 130600),
(496, 130621, '满城县', 3, 130600),
(497, 130622, '清苑县', 3, 130600),
(498, 130623, '涞水县', 3, 130600),
(499, 130624, '阜平县', 3, 130600),
(500, 130625, '徐水县', 3, 130600),
(501, 130626, '定兴县', 3, 130600),
(502, 130627, '唐 县', 3, 130600),
(503, 130628, '高阳县', 3, 130600),
(504, 130629, '容城县', 3, 130600),
(505, 130630, '涞源县', 3, 130600),
(506, 130631, '望都县', 3, 130600),
(507, 130632, '安新县', 3, 130600),
(508, 130633, '易 县', 3, 130600),
(509, 130634, '曲阳县', 3, 130600),
(510, 130635, '蠡 县', 3, 130600),
(511, 130636, '顺平县', 3, 130600),
(512, 130637, '博野县', 3, 130600),
(513, 130638, '雄 县', 3, 130600),
(514, 130681, '涿州市', 3, 130600),
(515, 130682, '定州市', 3, 130600),
(516, 130683, '安国市', 3, 130600),
(517, 130684, '高碑店市', 3, 130600),
(518, 130702, '桥东区', 3, 130700),
(519, 130703, '桥西区', 3, 130700),
(520, 130705, '宣化区', 3, 130700),
(521, 130706, '下花园区', 3, 130700),
(522, 130721, '宣化县', 3, 130700),
(523, 130722, '张北县', 3, 130700),
(524, 130723, '康保县', 3, 130700),
(525, 130724, '沽源县', 3, 130700),
(526, 130725, '尚义县', 3, 130700),
(527, 130726, '蔚 县', 3, 130700),
(528, 130727, '阳原县', 3, 130700),
(529, 130728, '怀安县', 3, 130700),
(530, 130729, '万全县', 3, 130700),
(531, 130730, '怀来县', 3, 130700),
(532, 130731, '涿鹿县', 3, 130700),
(533, 130732, '赤城县', 3, 130700),
(534, 130733, '崇礼县', 3, 130700),
(535, 130802, '双桥区', 3, 130800),
(536, 130803, '双滦区', 3, 130800),
(537, 130804, '鹰手营子矿区', 3, 130800),
(538, 130821, '承德县', 3, 130800),
(539, 130822, '兴隆县', 3, 130800),
(540, 130823, '平泉县', 3, 130800),
(541, 130824, '滦平县', 3, 130800),
(542, 130825, '隆化县', 3, 130800),
(543, 130826, '丰宁满族自治县', 3, 130800),
(544, 130827, '宽城满族自治县', 3, 130800),
(545, 130828, '围场满族蒙古族自治县', 3, 130800),
(546, 130902, '新华区', 3, 130900),
(547, 130903, '运河区', 3, 130900),
(548, 130921, '沧 县', 3, 130900),
(549, 130922, '青 县', 3, 130900),
(550, 130923, '东光县', 3, 130900),
(551, 130924, '海兴县', 3, 130900),
(552, 130925, '盐山县', 3, 130900),
(553, 130926, '肃宁县', 3, 130900),
(554, 130927, '南皮县', 3, 130900),
(555, 130928, '吴桥县', 3, 130900),
(556, 130929, '献 县', 3, 130900),
(557, 130930, '孟村回族自治县', 3, 130900),
(558, 130981, '泊头市', 3, 130900),
(559, 130982, '任丘市', 3, 130900),
(560, 130983, '黄骅市', 3, 130900),
(561, 130984, '河间市', 3, 130900),
(562, 131002, '安次区', 3, 131000),
(563, 131003, '广阳区', 3, 131000),
(564, 131022, '固安县', 3, 131000),
(565, 131023, '永清县', 3, 131000),
(566, 131024, '香河县', 3, 131000),
(567, 131025, '大城县', 3, 131000),
(568, 131026, '文安县', 3, 131000),
(569, 131028, '大厂回族自治县', 3, 131000),
(570, 131081, '霸州市', 3, 131000),
(571, 131082, '三河市', 3, 131000),
(572, 131102, '桃城区', 3, 131100),
(573, 131121, '枣强县', 3, 131100),
(574, 131122, '武邑县', 3, 131100),
(575, 131123, '武强县', 3, 131100),
(576, 131124, '饶阳县', 3, 131100),
(577, 131125, '安平县', 3, 131100),
(578, 131126, '故城县', 3, 131100),
(579, 131127, '景 县', 3, 131100),
(580, 131128, '阜城县', 3, 131100),
(581, 131181, '冀州市', 3, 131100),
(582, 131182, '深州市', 3, 131100),
(583, 140105, '小店区', 3, 140100),
(584, 140106, '迎泽区', 3, 140100),
(585, 140107, '杏花岭区', 3, 140100),
(586, 140108, '尖草坪区', 3, 140100),
(587, 140109, '万柏林区', 3, 140100),
(588, 140110, '晋源区', 3, 140100),
(589, 140121, '清徐县', 3, 140100),
(590, 140122, '阳曲县', 3, 140100),
(591, 140123, '娄烦县', 3, 140100),
(592, 140181, '古交市', 3, 140100),
(593, 140202, '城 区', 3, 140200),
(594, 140203, '矿 区', 3, 140200),
(595, 140211, '南郊区', 3, 140200),
(596, 140212, '新荣区', 3, 140200),
(597, 140221, '阳高县', 3, 140200),
(598, 140222, '天镇县', 3, 140200),
(599, 140223, '广灵县', 3, 140200),
(600, 140224, '灵丘县', 3, 140200),
(601, 140225, '浑源县', 3, 140200),
(602, 140226, '左云县', 3, 140200),
(603, 140227, '大同县', 3, 140200),
(604, 140302, '城 区', 3, 140300),
(605, 140303, '矿 区', 3, 140300),
(606, 140311, '郊 区', 3, 140300),
(607, 140321, '平定县', 3, 140300),
(608, 140322, '盂 县', 3, 140300),
(609, 140402, '城 区', 3, 140400),
(610, 140411, '郊 区', 3, 140400),
(611, 140421, '长治县', 3, 140400),
(612, 140423, '襄垣县', 3, 140400),
(613, 140424, '屯留县', 3, 140400),
(614, 140425, '平顺县', 3, 140400),
(615, 140426, '黎城县', 3, 140400),
(616, 140427, '壶关县', 3, 140400),
(617, 140428, '长子县', 3, 140400),
(618, 140429, '武乡县', 3, 140400),
(619, 140430, '沁 县', 3, 140400),
(620, 140431, '沁源县', 3, 140400),
(621, 140481, '潞城市', 3, 140400),
(622, 140502, '城 区', 3, 140500),
(623, 140521, '沁水县', 3, 140500),
(624, 140522, '阳城县', 3, 140500),
(625, 140524, '陵川县', 3, 140500),
(626, 140525, '泽州县', 3, 140500),
(627, 140581, '高平市', 3, 140500),
(628, 140602, '朔城区', 3, 140600),
(629, 140603, '平鲁区', 3, 140600),
(630, 140621, '山阴县', 3, 140600),
(631, 140622, '应 县', 3, 140600),
(632, 140623, '右玉县', 3, 140600),
(633, 140624, '怀仁县', 3, 140600),
(634, 140702, '榆次区', 3, 140700),
(635, 140721, '榆社县', 3, 140700),
(636, 140722, '左权县', 3, 140700),
(637, 140723, '和顺县', 3, 140700),
(638, 140724, '昔阳县', 3, 140700),
(639, 140725, '寿阳县', 3, 140700),
(640, 140726, '太谷县', 3, 140700),
(641, 140727, '祁 县', 3, 140700),
(642, 140728, '平遥县', 3, 140700),
(643, 140729, '灵石县', 3, 140700),
(644, 140781, '介休市', 3, 140700),
(645, 140802, '盐湖区', 3, 140800),
(646, 140821, '临猗县', 3, 140800),
(647, 140822, '万荣县', 3, 140800),
(648, 140823, '闻喜县', 3, 140800),
(649, 140824, '稷山县', 3, 140800),
(650, 140825, '新绛县', 3, 140800),
(651, 140826, '绛 县', 3, 140800),
(652, 140827, '垣曲县', 3, 140800),
(653, 140828, '夏 县', 3, 140800),
(654, 140829, '平陆县', 3, 140800),
(655, 140830, '芮城县', 3, 140800),
(656, 140881, '永济市', 3, 140800),
(657, 140882, '河津市', 3, 140800),
(658, 140902, '忻府区', 3, 140900),
(659, 140921, '定襄县', 3, 140900),
(660, 140922, '五台县', 3, 140900),
(661, 140923, '代 县', 3, 140900),
(662, 140924, '繁峙县', 3, 140900),
(663, 140925, '宁武县', 3, 140900),
(664, 140926, '静乐县', 3, 140900),
(665, 140927, '神池县', 3, 140900),
(666, 140928, '五寨县', 3, 140900),
(667, 140929, '岢岚县', 3, 140900),
(668, 140930, '河曲县', 3, 140900),
(669, 140931, '保德县', 3, 140900),
(670, 140932, '偏关县', 3, 140900),
(671, 140981, '原平市', 3, 140900),
(672, 141002, '尧都区', 3, 141000),
(673, 141021, '曲沃县', 3, 141000),
(674, 141022, '翼城县', 3, 141000),
(675, 141023, '襄汾县', 3, 141000),
(676, 141024, '洪洞县', 3, 141000),
(677, 141025, '古 县', 3, 141000),
(678, 141026, '安泽县', 3, 141000),
(679, 141027, '浮山县', 3, 141000),
(680, 141028, '吉 县', 3, 141000),
(681, 141029, '乡宁县', 3, 141000),
(682, 141030, '大宁县', 3, 141000),
(683, 141031, '隰 县', 3, 141000),
(684, 141032, '永和县', 3, 141000),
(685, 141033, '蒲 县', 3, 141000),
(686, 141034, '汾西县', 3, 141000),
(687, 141081, '侯马市', 3, 141000),
(688, 141082, '霍州市', 3, 141000),
(689, 141102, '离石区', 3, 141100),
(690, 141121, '文水县', 3, 141100),
(691, 141122, '交城县', 3, 141100),
(692, 141123, '兴 县', 3, 141100),
(693, 141124, '临 县', 3, 141100),
(694, 141125, '柳林县', 3, 141100),
(695, 141126, '石楼县', 3, 141100),
(696, 141127, '岚 县', 3, 141100),
(697, 141128, '方山县', 3, 141100),
(698, 141129, '中阳县', 3, 141100),
(699, 141130, '交口县', 3, 141100),
(700, 141181, '孝义市', 3, 141100),
(701, 141182, '汾阳市', 3, 141100),
(702, 150102, '新城区', 3, 150100),
(703, 150103, '回民区', 3, 150100),
(704, 150104, '玉泉区', 3, 150100),
(705, 150105, '赛罕区', 3, 150100),
(706, 150121, '土默特左旗', 3, 150100),
(707, 150122, '托克托县', 3, 150100),
(708, 150123, '和林格尔县', 3, 150100),
(709, 150124, '清水河县', 3, 150100),
(710, 150125, '武川县', 3, 150100),
(711, 150202, '东河区', 3, 150200),
(712, 150203, '昆都仑区', 3, 150200),
(713, 150204, '青山区', 3, 150200),
(714, 150205, '石拐区', 3, 150200),
(715, 150206, '白云矿区', 3, 150200),
(716, 150207, '九原区', 3, 150200),
(717, 150221, '土默特右旗', 3, 150200),
(718, 150222, '固阳县', 3, 150200),
(719, 150223, '达尔罕茂明安联合旗', 3, 150200),
(720, 150302, '海勃湾区', 3, 150300),
(721, 150303, '海南区', 3, 150300),
(722, 150304, '乌达区', 3, 150300),
(723, 150402, '红山区', 3, 150400),
(724, 150403, '元宝山区', 3, 150400),
(725, 150404, '松山区', 3, 150400),
(726, 150421, '阿鲁科尔沁旗', 3, 150400),
(727, 150422, '巴林左旗', 3, 150400),
(728, 150423, '巴林右旗', 3, 150400),
(729, 150424, '林西县', 3, 150400),
(730, 150425, '克什克腾旗', 3, 150400),
(731, 150426, '翁牛特旗', 3, 150400),
(732, 150428, '喀喇沁旗', 3, 150400),
(733, 150429, '宁城县', 3, 150400),
(734, 150430, '敖汉旗', 3, 150400),
(735, 150502, '科尔沁区', 3, 150500),
(736, 150521, '科尔沁左翼中旗', 3, 150500),
(737, 150522, '科尔沁左翼后旗', 3, 150500),
(738, 150523, '开鲁县', 3, 150500),
(739, 150524, '库伦旗', 3, 150500),
(740, 150525, '奈曼旗', 3, 150500),
(741, 150526, '扎鲁特旗', 3, 150500),
(742, 150581, '霍林郭勒市', 3, 150500),
(743, 150602, '东胜区', 3, 150600),
(744, 150621, '达拉特旗', 3, 150600),
(745, 150622, '准格尔旗', 3, 150600),
(746, 150623, '鄂托克前旗', 3, 150600),
(747, 150624, '鄂托克旗', 3, 150600),
(748, 150625, '杭锦旗', 3, 150600),
(749, 150626, '乌审旗', 3, 150600),
(750, 150627, '伊金霍洛旗', 3, 150600),
(751, 150702, '海拉尔区', 3, 150700),
(752, 150721, '阿荣旗', 3, 150700),
(753, 150722, '莫力达瓦达斡尔族自治旗', 3, 15070),
(754, 150723, '鄂伦春自治旗', 3, 150700),
(755, 150724, '鄂温克族自治旗', 3, 150700),
(756, 150725, '陈巴尔虎旗', 3, 150700),
(757, 150726, '新巴尔虎左旗', 3, 150700),
(758, 150727, '新巴尔虎右旗', 3, 150700),
(759, 150781, '满洲里市', 3, 150700),
(760, 150782, '牙克石市', 3, 150700),
(761, 150783, '扎兰屯市', 3, 150700),
(762, 150784, '额尔古纳市', 3, 150700),
(763, 150785, '根河市', 3, 150700),
(764, 150802, '临河区', 3, 150800),
(765, 150821, '五原县', 3, 150800),
(766, 150822, '磴口县', 3, 150800),
(767, 150823, '乌拉特前旗', 3, 150800),
(768, 150824, '乌拉特中旗', 3, 150800),
(769, 150825, '乌拉特后旗', 3, 150800),
(770, 150826, '杭锦后旗', 3, 150800),
(771, 150902, '集宁区', 3, 150900),
(772, 150921, '卓资县', 3, 150900),
(773, 150922, '化德县', 3, 150900),
(774, 150923, '商都县', 3, 150900),
(775, 150924, '兴和县', 3, 150900),
(776, 150925, '凉城县', 3, 150900),
(777, 150926, '察哈尔右翼前旗', 3, 150900),
(778, 150927, '察哈尔右翼中旗', 3, 150900),
(779, 150928, '察哈尔右翼后旗', 3, 150900),
(780, 150929, '四子王旗', 3, 150900),
(781, 150981, '丰镇市', 3, 150900),
(782, 152201, '乌兰浩特市', 3, 152200),
(783, 152202, '阿尔山市', 3, 152200),
(784, 152221, '科尔沁右翼前旗', 3, 152200),
(785, 152222, '科尔沁右翼中旗', 3, 152200),
(786, 152223, '扎赉特旗', 3, 152200),
(787, 152224, '突泉县', 3, 152200),
(788, 152501, '二连浩特市', 3, 152500),
(789, 152502, '锡林浩特市', 3, 152500),
(790, 152522, '阿巴嘎旗', 3, 152500),
(791, 152523, '苏尼特左旗', 3, 152500),
(792, 152524, '苏尼特右旗', 3, 152500),
(793, 152525, '东乌珠穆沁旗', 3, 152500),
(794, 152526, '西乌珠穆沁旗', 3, 152500),
(795, 152527, '太仆寺旗', 3, 152500),
(796, 152528, '镶黄旗', 3, 152500),
(797, 152529, '正镶白旗', 3, 152500),
(798, 152530, '正蓝旗', 3, 152500),
(799, 152531, '多伦县', 3, 152500),
(800, 152921, '阿拉善左旗', 3, 152900),
(801, 152922, '阿拉善右旗', 3, 152900),
(802, 152923, '额济纳旗', 3, 152900),
(803, 210102, '和平区', 3, 210100),
(804, 210103, '沈河区', 3, 210100),
(805, 210104, '大东区', 3, 210100),
(806, 210105, '皇姑区', 3, 210100),
(807, 210106, '铁西区', 3, 210100),
(808, 210111, '苏家屯区', 3, 210100),
(809, 210112, '东陵区', 3, 210100),
(810, 210113, '新城子区', 3, 210100),
(811, 210114, '于洪区', 3, 210100),
(812, 210122, '辽中县', 3, 210100),
(813, 210123, '康平县', 3, 210100),
(814, 210124, '法库县', 3, 210100),
(815, 210181, '新民市', 3, 210100),
(816, 210202, '中山区', 3, 210200),
(817, 210203, '西岗区', 3, 210200),
(818, 210204, '沙河口区', 3, 210200),
(819, 210211, '甘井子区', 3, 210200),
(820, 210212, '旅顺口区', 3, 210200),
(821, 210213, '金州区', 3, 210200),
(822, 210224, '长海县', 3, 210200),
(823, 210281, '瓦房店市', 3, 210200),
(824, 210282, '普兰店市', 3, 210200),
(825, 210283, '庄河市', 3, 210200),
(826, 210302, '铁东区', 3, 210300),
(827, 210303, '铁西区', 3, 210300),
(828, 210304, '立山区', 3, 210300),
(829, 210311, '千山区', 3, 210300),
(830, 210321, '台安县', 3, 210300),
(831, 210323, '岫岩满族自治县', 3, 210300),
(832, 210381, '海城市', 3, 210300),
(833, 210402, '新抚区', 3, 210400),
(834, 210403, '东洲区', 3, 210400),
(835, 210404, '望花区', 3, 210400),
(836, 210411, '顺城区', 3, 210400),
(837, 210421, '抚顺县', 3, 210400),
(838, 210422, '新宾满族自治县', 3, 210400),
(839, 210423, '清原满族自治县', 3, 210400),
(840, 210502, '平山区', 3, 210500),
(841, 210503, '溪湖区', 3, 210500),
(842, 210504, '明山区', 3, 210500),
(843, 210505, '南芬区', 3, 210500),
(844, 210521, '本溪满族自治县', 3, 210500),
(845, 210522, '桓仁满族自治县', 3, 210500),
(846, 210602, '元宝区', 3, 210600),
(847, 210603, '振兴区', 3, 210600),
(848, 210604, '振安区', 3, 210600),
(849, 210624, '宽甸满族自治县', 3, 210600),
(850, 210681, '东港市', 3, 210600),
(851, 210682, '凤城市', 3, 210600),
(852, 210702, '古塔区', 3, 210700),
(853, 210703, '凌河区', 3, 210700),
(854, 210711, '太和区', 3, 210700),
(855, 210726, '黑山县', 3, 210700),
(856, 210727, '义 县', 3, 210700),
(857, 210781, '凌海市', 3, 210700),
(858, 210782, '北宁市', 3, 210700),
(859, 210802, '站前区', 3, 210800),
(860, 210803, '西市区', 3, 210800),
(861, 210804, '鲅鱼圈区', 3, 210800),
(862, 210811, '老边区', 3, 210800),
(863, 210881, '盖州市', 3, 210800),
(864, 210882, '大石桥市', 3, 210800),
(865, 210902, '海州区', 3, 210900),
(866, 210903, '新邱区', 3, 210900),
(867, 210904, '太平区', 3, 210900),
(868, 210905, '清河门区', 3, 210900),
(869, 210911, '细河区', 3, 210900),
(870, 210921, '阜新蒙古族自治县', 3, 210900),
(871, 210922, '彰武县', 3, 210900),
(872, 211002, '白塔区', 3, 211000),
(873, 211003, '文圣区', 3, 211000),
(874, 211004, '宏伟区', 3, 211000),
(875, 211005, '弓长岭区', 3, 211000),
(876, 211011, '太子河区', 3, 211000),
(877, 211021, '辽阳县', 3, 211000),
(878, 211081, '灯塔市', 3, 211000),
(879, 211102, '双台子区', 3, 211100),
(880, 211103, '兴隆台区', 3, 211100),
(881, 211121, '大洼县', 3, 211100),
(882, 211122, '盘山县', 3, 211100),
(883, 211202, '银州区', 3, 211200),
(884, 211204, '清河区', 3, 211200),
(885, 211221, '铁岭县', 3, 211200),
(886, 211223, '西丰县', 3, 211200),
(887, 211224, '昌图县', 3, 211200),
(888, 211281, '调兵山市', 3, 211200),
(889, 211282, '开原市', 3, 211200),
(890, 211302, '双塔区', 3, 211300),
(891, 211303, '龙城区', 3, 211300),
(892, 211321, '朝阳县', 3, 211300),
(893, 211322, '建平县', 3, 211300),
(894, 211324, '喀喇沁左翼蒙古族自治县', 3, 211300),
(895, 211381, '北票市', 3, 211300),
(896, 211382, '凌源市', 3, 211300),
(897, 211402, '连山区', 3, 211400),
(898, 211403, '龙港区', 3, 211400),
(899, 211404, '南票区', 3, 211400),
(900, 211421, '绥中县', 3, 211400),
(901, 211422, '建昌县', 3, 211400),
(902, 211481, '兴城市', 3, 211400),
(903, 220102, '南关区', 3, 220100),
(904, 220103, '宽城区', 3, 220100),
(905, 220104, '朝阳区', 3, 220100),
(906, 220105, '二道区', 3, 220100),
(907, 220106, '绿园区', 3, 220100),
(908, 220112, '双阳区', 3, 220100),
(909, 220122, '农安县', 3, 220100),
(910, 220181, '九台市', 3, 220100),
(911, 220182, '榆树市', 3, 220100),
(912, 220183, '德惠市', 3, 220100),
(913, 220202, '昌邑区', 3, 220200),
(914, 220203, '龙潭区', 3, 220200),
(915, 220204, '船营区', 3, 220200),
(916, 220211, '丰满区', 3, 220200),
(917, 220221, '永吉县', 3, 220200),
(918, 220281, '蛟河市', 3, 220200),
(919, 220282, '桦甸市', 3, 220200),
(920, 220283, '舒兰市', 3, 220200),
(921, 220284, '磐石市', 3, 220200),
(922, 220302, '铁西区', 3, 220300),
(923, 220303, '铁东区', 3, 220300),
(924, 220322, '梨树县', 3, 220300),
(925, 220323, '伊通满族自治县', 3, 220300),
(926, 220381, '公主岭市', 3, 220300),
(927, 220382, '双辽市', 3, 220300),
(928, 220402, '龙山区', 3, 220400),
(929, 220403, '西安区', 3, 220400),
(930, 220421, '东丰县', 3, 220400),
(931, 220422, '东辽县', 3, 220400),
(932, 220502, '东昌区', 3, 220500),
(933, 220503, '二道江区', 3, 220500),
(934, 220521, '通化县', 3, 220500),
(935, 220523, '辉南县', 3, 220500),
(936, 220524, '柳河县', 3, 220500),
(937, 220581, '梅河口市', 3, 220500),
(938, 220582, '集安市', 3, 220500),
(939, 220602, '八道江区', 3, 220600),
(940, 220621, '抚松县', 3, 220600),
(941, 220622, '靖宇县', 3, 220600),
(942, 220623, '长白朝鲜族自治县', 3, 220600),
(943, 220625, '江源县', 3, 220600),
(944, 220681, '临江市', 3, 220600),
(945, 220702, '宁江区', 3, 220700),
(946, 220721, '前郭尔罗斯蒙古族自治县', 3, 220700),
(947, 220722, '长岭县', 3, 220700),
(948, 220723, '乾安县', 3, 220700),
(949, 220724, '扶余县', 3, 220700),
(950, 220802, '洮北区', 3, 220800),
(951, 220821, '镇赉县', 3, 220800),
(952, 220822, '通榆县', 3, 220800),
(953, 220881, '洮南市', 3, 220800),
(954, 220882, '大安市', 3, 220800),
(955, 222401, '延吉市', 3, 222400),
(956, 222402, '图们市', 3, 222400),
(957, 222403, '敦化市', 3, 222400),
(958, 222404, '珲春市', 3, 222400),
(959, 222405, '龙井市', 3, 222400),
(960, 222406, '和龙市', 3, 222400),
(961, 222424, '汪清县', 3, 222400),
(962, 222426, '安图县', 3, 222400),
(963, 230102, '道里区', 3, 230100),
(964, 230103, '南岗区', 3, 230100),
(965, 230104, '道外区', 3, 230100),
(966, 230106, '香坊区', 3, 230100),
(967, 230107, '动力区', 3, 230100),
(968, 230108, '平房区', 3, 230100),
(969, 230109, '松北区', 3, 230100),
(970, 230111, '呼兰区', 3, 230100),
(971, 230123, '依兰县', 3, 230100),
(972, 230124, '方正县', 3, 230100),
(973, 230125, '宾 县', 3, 230100),
(974, 230126, '巴彦县', 3, 230100),
(975, 230127, '木兰县', 3, 230100),
(976, 230128, '通河县', 3, 230100),
(977, 230129, '延寿县', 3, 230100),
(978, 230181, '阿城市', 3, 230100),
(979, 230182, '双城市', 3, 230100),
(980, 230183, '尚志市', 3, 230100),
(981, 230184, '五常市', 3, 230100),
(982, 230202, '龙沙区', 3, 230200),
(983, 230203, '建华区', 3, 230200),
(984, 230204, '铁锋区', 3, 230200),
(985, 230205, '昂昂溪区', 3, 230200),
(986, 230206, '富拉尔基区', 3, 230200),
(987, 230207, '碾子山区', 3, 230200),
(988, 230208, '梅里斯达斡尔族区', 3, 230200),
(989, 230221, '龙江县', 3, 230200),
(990, 230223, '依安县', 3, 230200),
(991, 230224, '泰来县', 3, 230200),
(992, 230225, '甘南县', 3, 230200),
(993, 230227, '富裕县', 3, 230200),
(994, 230229, '克山县', 3, 230200),
(995, 230230, '克东县', 3, 230200),
(996, 230231, '拜泉县', 3, 230200),
(997, 230281, '讷河市', 3, 230200),
(998, 230302, '鸡冠区', 3, 230300),
(999, 230303, '恒山区', 3, 230300),
(1000, 230304, '滴道区', 3, 230300),
(1001, 230305, '梨树区', 3, 230300),
(1002, 230306, '城子河区', 3, 230300),
(1003, 230307, '麻山区', 3, 230300),
(1004, 230321, '鸡东县', 3, 230300),
(1005, 230381, '虎林市', 3, 230300),
(1006, 230382, '密山市', 3, 230300),
(1007, 230402, '向阳区', 3, 230400),
(1008, 230403, '工农区', 3, 230400),
(1009, 230404, '南山区', 3, 230400),
(1010, 230405, '兴安区', 3, 230400),
(1011, 230406, '东山区', 3, 230400),
(1012, 230407, '兴山区', 3, 230400),
(1013, 230421, '萝北县', 3, 230400),
(1014, 230422, '绥滨县', 3, 230400),
(1015, 230502, '尖山区', 3, 230500),
(1016, 230503, '岭东区', 3, 230500),
(1017, 230505, '四方台区', 3, 230500),
(1018, 230506, '宝山区', 3, 230500),
(1019, 230521, '集贤县', 3, 230500),
(1020, 230522, '友谊县', 3, 230500),
(1021, 230523, '宝清县', 3, 230500),
(1022, 230524, '饶河县', 3, 230500),
(1023, 230602, '萨尔图区', 3, 230600),
(1024, 230603, '龙凤区', 3, 230600),
(1025, 230604, '让胡路区', 3, 230600),
(1026, 230605, '红岗区', 3, 230600),
(1027, 230606, '大同区', 3, 230600),
(1028, 230621, '肇州县', 3, 230600),
(1029, 230622, '肇源县', 3, 230600),
(1030, 230623, '林甸县', 3, 230600),
(1031, 230624, '杜尔伯特蒙古族自治县', 3, 230600),
(1032, 230702, '伊春区', 3, 230700),
(1033, 230703, '南岔区', 3, 230700),
(1034, 230704, '友好区', 3, 230700),
(1035, 230705, '西林区', 3, 230700),
(1036, 230706, '翠峦区', 3, 230700),
(1037, 230707, '新青区', 3, 230700),
(1038, 230708, '美溪区', 3, 230700),
(1039, 230709, '金山屯区', 3, 230700),
(1040, 230710, '五营区', 3, 230700),
(1041, 230711, '乌马河区', 3, 230700),
(1042, 230712, '汤旺河区', 3, 230700),
(1043, 230713, '带岭区', 3, 230700),
(1044, 230714, '乌伊岭区', 3, 230700),
(1045, 230715, '红星区', 3, 230700),
(1046, 230716, '上甘岭区', 3, 230700),
(1047, 230722, '嘉荫县', 3, 230700),
(1048, 230781, '铁力市', 3, 230700),
(1049, 230802, '永红区', 3, 230800),
(1050, 230803, '向阳区', 3, 230800),
(1051, 230804, '前进区', 3, 230800),
(1052, 230805, '东风区', 3, 230800),
(1053, 230811, '郊 区', 3, 230800),
(1054, 230822, '桦南县', 3, 230800),
(1055, 230826, '桦川县', 3, 230800),
(1056, 230828, '汤原县', 3, 230800),
(1057, 230833, '抚远县', 3, 230800),
(1058, 230881, '同江市', 3, 230800),
(1059, 230882, '富锦市', 3, 230800),
(1060, 230902, '新兴区', 3, 230900),
(1061, 230903, '桃山区', 3, 230900),
(1062, 230904, '茄子河区', 3, 230900),
(1063, 230921, '勃利县', 3, 230900),
(1064, 231002, '东安区', 3, 231000),
(1065, 231003, '阳明区', 3, 231000),
(1066, 231004, '爱民区', 3, 231000),
(1067, 231005, '西安区', 3, 231000),
(1068, 231024, '东宁县', 3, 231000),
(1069, 231025, '林口县', 3, 231000),
(1070, 231081, '绥芬河市', 3, 231000),
(1071, 231083, '海林市', 3, 231000),
(1072, 231084, '宁安市', 3, 231000),
(1073, 231085, '穆棱市', 3, 231000),
(1074, 231102, '爱辉区', 3, 231100),
(1075, 231121, '嫩江县', 3, 231100),
(1076, 231123, '逊克县', 3, 231100),
(1077, 231124, '孙吴县', 3, 231100),
(1078, 231181, '北安市', 3, 231100),
(1079, 231182, '五大连池市', 3, 231100),
(1080, 231202, '北林区', 3, 231200),
(1081, 231221, '望奎县', 3, 231200),
(1082, 231222, '兰西县', 3, 231200),
(1083, 231223, '青冈县', 3, 231200),
(1084, 231224, '庆安县', 3, 231200),
(1085, 231225, '明水县', 3, 231200),
(1086, 231226, '绥棱县', 3, 231200),
(1087, 231281, '安达市', 3, 231200),
(1088, 231282, '肇东市', 3, 231200),
(1089, 231283, '海伦市', 3, 231200),
(1090, 232721, '呼玛县', 3, 232700),
(1091, 232722, '塔河县', 3, 232700),
(1092, 232723, '漠河县', 3, 232700),
(1093, 310101, '黄浦区', 3, 310100),
(1094, 310103, '卢湾区', 3, 310100),
(1095, 310104, '徐汇区', 3, 310100),
(1096, 310105, '长宁区', 3, 310100),
(1097, 310106, '静安区', 3, 310100),
(1098, 310107, '普陀区', 3, 310100),
(1099, 310108, '闸北区', 3, 310100),
(1100, 310109, '虹口区', 3, 310100),
(1101, 310110, '杨浦区', 3, 310100),
(1102, 310112, '闵行区', 3, 310100),
(1103, 310113, '宝山区', 3, 310100),
(1104, 310114, '嘉定区', 3, 310100),
(1105, 310115, '浦东新区', 3, 310100),
(1106, 310116, '金山区', 3, 310100),
(1107, 310117, '松江区', 3, 310100),
(1108, 310118, '青浦区', 3, 310100),
(1109, 310119, '南汇区', 3, 310100),
(1110, 310120, '奉贤区', 3, 310100),
(1111, 310230, '崇明县', 3, 310100),
(1112, 320102, '玄武区', 3, 320100),
(1113, 320103, '白下区', 3, 320100),
(1114, 320104, '秦淮区', 3, 320100),
(1115, 320105, '建邺区', 3, 320100),
(1116, 320106, '鼓楼区', 3, 320100),
(1117, 320107, '下关区', 3, 320100),
(1118, 320111, '浦口区', 3, 320100),
(1119, 320113, '栖霞区', 3, 320100),
(1120, 320114, '雨花台区', 3, 320100),
(1121, 320115, '江宁区', 3, 320100),
(1122, 320116, '六合区', 3, 320100),
(1123, 320124, '溧水县', 3, 320100),
(1124, 320125, '高淳县', 3, 320100),
(1125, 320202, '崇安区', 3, 320200),
(1126, 320203, '南长区', 3, 320200),
(1127, 320204, '北塘区', 3, 320200),
(1128, 320205, '锡山区', 3, 320200),
(1129, 320206, '惠山区', 3, 320200),
(1130, 320211, '滨湖区', 3, 320200),
(1131, 320281, '江阴市', 3, 320200),
(1132, 320282, '宜兴市', 3, 320200),
(1133, 320302, '鼓楼区', 3, 320300),
(1134, 320303, '云龙区', 3, 320300),
(1135, 320304, '九里区', 3, 320300),
(1136, 320305, '贾汪区', 3, 320300),
(1137, 320311, '泉山区', 3, 320300),
(1138, 320321, '丰 县', 3, 320300),
(1139, 320322, '沛 县', 3, 320300),
(1140, 320323, '铜山县', 3, 320300),
(1141, 320324, '睢宁县', 3, 320300),
(1142, 320381, '新沂市', 3, 320300),
(1143, 320382, '邳州市', 3, 320300),
(1144, 320402, '天宁区', 3, 320400),
(1145, 320404, '钟楼区', 3, 320400),
(1146, 320405, '戚墅堰区', 3, 320400),
(1147, 320411, '新北区', 3, 320400),
(1148, 320412, '武进区', 3, 320400),
(1149, 320481, '溧阳市', 3, 320400),
(1150, 320482, '金坛市', 3, 320400),
(1151, 320502, '沧浪区', 3, 320500),
(1152, 320503, '平江区', 3, 320500),
(1153, 320504, '金阊区', 3, 320500),
(1154, 320505, '虎丘区', 3, 320500),
(1155, 320506, '吴中区', 3, 320500),
(1156, 320507, '相城区', 3, 320500),
(1157, 320581, '常熟市', 3, 320500),
(1158, 320582, '张家港市', 3, 320500),
(1159, 320583, '昆山市', 3, 320500),
(1160, 320584, '吴江市', 3, 320500),
(1161, 320585, '太仓市', 3, 320500),
(1162, 320602, '崇川区', 3, 320600),
(1163, 320611, '港闸区', 3, 320600),
(1164, 320621, '海安县', 3, 320600),
(1165, 320623, '如东县', 3, 320600),
(1166, 320681, '启东市', 3, 320600),
(1167, 320682, '如皋市', 3, 320600),
(1168, 320683, '通州市', 3, 320600),
(1169, 320684, '海门市', 3, 320600),
(1170, 320703, '连云区', 3, 320700),
(1171, 320705, '新浦区', 3, 320700),
(1172, 320706, '海州区', 3, 320700),
(1173, 320721, '赣榆县', 3, 320700),
(1174, 320722, '东海县', 3, 320700),
(1175, 320723, '灌云县', 3, 320700),
(1176, 320724, '灌南县', 3, 320700),
(1177, 320802, '清河区', 3, 320800),
(1178, 320803, '楚州区', 3, 320800),
(1179, 320804, '淮阴区', 3, 320800),
(1180, 320811, '清浦区', 3, 320800),
(1181, 320826, '涟水县', 3, 320800),
(1182, 320829, '洪泽县', 3, 320800),
(1183, 320830, '盱眙县', 3, 320800),
(1184, 320831, '金湖县', 3, 320800),
(1185, 320902, '亭湖区', 3, 320900),
(1186, 320903, '盐都区', 3, 320900),
(1187, 320921, '响水县', 3, 320900),
(1188, 320922, '滨海县', 3, 320900),
(1189, 320923, '阜宁县', 3, 320900),
(1190, 320924, '射阳县', 3, 320900),
(1191, 320925, '建湖县', 3, 320900),
(1192, 320981, '东台市', 3, 320900),
(1193, 320982, '大丰市', 3, 320900),
(1194, 321002, '广陵区', 3, 321000),
(1195, 321003, '邗江区', 3, 321000),
(1196, 321011, '郊 区', 3, 321000),
(1197, 321023, '宝应县', 3, 321000),
(1198, 321081, '仪征市', 3, 321000),
(1199, 321084, '高邮市', 3, 321000),
(1200, 321088, '江都市', 3, 321000),
(1201, 321102, '京口区', 3, 321100),
(1202, 321111, '润州区', 3, 321100),
(1203, 321112, '丹徒区', 3, 321100),
(1204, 321181, '丹阳市', 3, 321100),
(1205, 321182, '扬中市', 3, 321100),
(1206, 321183, '句容市', 3, 321100),
(1207, 321202, '海陵区', 3, 321200),
(1208, 321203, '高港区', 3, 321200),
(1209, 321281, '兴化市', 3, 321200),
(1210, 321282, '靖江市', 3, 321200),
(1211, 321283, '泰兴市', 3, 321200),
(1212, 321284, '姜堰市', 3, 321200),
(1213, 321302, '宿城区', 3, 321300),
(1214, 321311, '宿豫区', 3, 321300),
(1215, 321322, '沭阳县', 3, 321300),
(1216, 321323, '泗阳县', 3, 321300),
(1217, 321324, '泗洪县', 3, 321300),
(1218, 330102, '上城区', 3, 330100),
(1219, 330103, '下城区', 3, 330100),
(1220, 330104, '江干区', 3, 330100),
(1221, 330105, '拱墅区', 3, 330100),
(1222, 330106, '西湖区', 3, 330100),
(1223, 330108, '滨江区', 3, 330100),
(1224, 330109, '萧山区', 3, 330100),
(1225, 330110, '余杭区', 3, 330100),
(1226, 330122, '桐庐县', 3, 330100),
(1227, 330127, '淳安县', 3, 330100),
(1228, 330182, '建德市', 3, 330100),
(1229, 330183, '富阳市', 3, 330100),
(1230, 330185, '临安市', 3, 330100),
(1231, 330203, '海曙区', 3, 330200),
(1232, 330204, '江东区', 3, 330200),
(1233, 330205, '江北区', 3, 330200),
(1234, 330206, '北仑区', 3, 330200),
(1235, 330211, '镇海区', 3, 330200),
(1236, 330212, '鄞州区', 3, 330200),
(1237, 330225, '象山县', 3, 330200),
(1238, 330226, '宁海县', 3, 330200),
(1239, 330281, '余姚市', 3, 330200),
(1240, 330282, '慈溪市', 3, 330200),
(1241, 330283, '奉化市', 3, 330200),
(1242, 330302, '鹿城区', 3, 330300),
(1243, 330303, '龙湾区', 3, 330300),
(1244, 330304, '瓯海区', 3, 330300),
(1245, 330322, '洞头县', 3, 330300),
(1246, 330324, '永嘉县', 3, 330300),
(1247, 330326, '平阳县', 3, 330300),
(1248, 330327, '苍南县', 3, 330300),
(1249, 330328, '文成县', 3, 330300),
(1250, 330329, '泰顺县', 3, 330300),
(1251, 330381, '瑞安市', 3, 330300),
(1252, 330382, '乐清市', 3, 330300),
(1253, 330402, '秀城区', 3, 330400),
(1254, 330411, '秀洲区', 3, 330400),
(1255, 330421, '嘉善县', 3, 330400),
(1256, 330424, '海盐县', 3, 330400),
(1257, 330481, '海宁市', 3, 330400),
(1258, 330482, '平湖市', 3, 330400),
(1259, 330483, '桐乡市', 3, 330400),
(1260, 330502, '吴兴区', 3, 330500),
(1261, 330503, '南浔区', 3, 330500),
(1262, 330521, '德清县', 3, 330500),
(1263, 330522, '长兴县', 3, 330500),
(1264, 330523, '安吉县', 3, 330500),
(1265, 330602, '越城区', 3, 330600),
(1266, 330621, '绍兴县', 3, 330600),
(1267, 330624, '新昌县', 3, 330600),
(1268, 330681, '诸暨市', 3, 330600),
(1269, 330682, '上虞市', 3, 330600),
(1270, 330683, '嵊州市', 3, 330600),
(1271, 330702, '婺城区', 3, 330700),
(1272, 330703, '金东区', 3, 330700),
(1273, 330723, '武义县', 3, 330700),
(1274, 330726, '浦江县', 3, 330700),
(1275, 330727, '磐安县', 3, 330700),
(1276, 330781, '兰溪市', 3, 330700),
(1277, 330782, '义乌市', 3, 330700),
(1278, 330783, '东阳市', 3, 330700),
(1279, 330784, '永康市', 3, 330700),
(1280, 330802, '柯城区', 3, 330800),
(1281, 330803, '衢江区', 3, 330800),
(1282, 330822, '常山县', 3, 330800),
(1283, 330824, '开化县', 3, 330800),
(1284, 330825, '龙游县', 3, 330800),
(1285, 330881, '江山市', 3, 330800),
(1286, 330902, '定海区', 3, 330900),
(1287, 330903, '普陀区', 3, 330900),
(1288, 330921, '岱山县', 3, 330900),
(1289, 330922, '嵊泗县', 3, 330900),
(1290, 331002, '椒江区', 3, 331000),
(1291, 331003, '黄岩区', 3, 331000),
(1292, 331004, '路桥区', 3, 331000),
(1293, 331021, '玉环县', 3, 331000),
(1294, 331022, '三门县', 3, 331000),
(1295, 331023, '天台县', 3, 331000),
(1296, 331024, '仙居县', 3, 331000),
(1297, 331081, '温岭市', 3, 331000),
(1298, 331082, '临海市', 3, 331000),
(1299, 331102, '莲都区', 3, 331100),
(1300, 331121, '青田县', 3, 331100),
(1301, 331122, '缙云县', 3, 331100),
(1302, 331123, '遂昌县', 3, 331100),
(1303, 331124, '松阳县', 3, 331100),
(1304, 331125, '云和县', 3, 331100),
(1305, 331126, '庆元县', 3, 331100),
(1306, 331127, '景宁畲族自治县', 3, 331100),
(1307, 331181, '龙泉市', 3, 331100),
(1308, 340102, '瑶海区', 3, 340100),
(1309, 340103, '庐阳区', 3, 340100),
(1310, 340104, '蜀山区', 3, 340100),
(1311, 340111, '包河区', 3, 340100),
(1312, 340121, '长丰县', 3, 340100),
(1313, 340122, '肥东县', 3, 340100),
(1314, 340123, '肥西县', 3, 340100),
(1315, 340202, '镜湖区', 3, 340200),
(1316, 340203, '马塘区', 3, 340200),
(1317, 340204, '新芜区', 3, 340200),
(1318, 340207, '鸠江区', 3, 340200),
(1319, 340221, '芜湖县', 3, 340200),
(1320, 340222, '繁昌县', 3, 340200),
(1321, 340223, '南陵县', 3, 340200),
(1322, 340302, '龙子湖区', 3, 340300),
(1323, 340303, '蚌山区', 3, 340300),
(1324, 340304, '禹会区', 3, 340300),
(1325, 340311, '淮上区', 3, 340300),
(1326, 340321, '怀远县', 3, 340300),
(1327, 340322, '五河县', 3, 340300),
(1328, 340323, '固镇县', 3, 340300),
(1329, 340402, '大通区', 3, 340400),
(1330, 340403, '田家庵区', 3, 340400),
(1331, 340404, '谢家集区', 3, 340400),
(1332, 340405, '八公山区', 3, 340400),
(1333, 340406, '潘集区', 3, 340400),
(1334, 340421, '凤台县', 3, 340400),
(1335, 340502, '金家庄区', 3, 340500),
(1336, 340503, '花山区', 3, 340500),
(1337, 340504, '雨山区', 3, 340500),
(1338, 340521, '当涂县', 3, 340500),
(1339, 340602, '杜集区', 3, 340600),
(1340, 340603, '相山区', 3, 340600),
(1341, 340604, '烈山区', 3, 340600),
(1342, 340621, '濉溪县', 3, 340600),
(1343, 340702, '铜官山区', 3, 340700),
(1344, 340703, '狮子山区', 3, 340700),
(1345, 340711, '郊 区', 3, 340700),
(1346, 340721, '铜陵县', 3, 340700),
(1347, 340802, '迎江区', 3, 340800),
(1348, 340803, '大观区', 3, 340800),
(1349, 340811, '郊 区', 3, 340800),
(1350, 340822, '怀宁县', 3, 340800),
(1351, 340823, '枞阳县', 3, 340800),
(1352, 340824, '潜山县', 3, 340800),
(1353, 340825, '太湖县', 3, 340800),
(1354, 340826, '宿松县', 3, 340800),
(1355, 340827, '望江县', 3, 340800),
(1356, 340828, '岳西县', 3, 340800),
(1357, 340881, '桐城市', 3, 340800),
(1358, 341002, '屯溪区', 3, 341000),
(1359, 341003, '黄山区', 3, 341000),
(1360, 341004, '徽州区', 3, 341000),
(1361, 341021, '歙 县', 3, 341000),
(1362, 341022, '休宁县', 3, 341000),
(1363, 341023, '黟 县', 3, 341000),
(1364, 341024, '祁门县', 3, 341000),
(1365, 341102, '琅琊区', 3, 341100),
(1366, 341103, '南谯区', 3, 341100),
(1367, 341122, '来安县', 3, 341100),
(1368, 341124, '全椒县', 3, 341100),
(1369, 341125, '定远县', 3, 341100),
(1370, 341126, '凤阳县', 3, 341100),
(1371, 341181, '天长市', 3, 341100),
(1372, 341182, '明光市', 3, 341100),
(1373, 341202, '颍州区', 3, 341200),
(1374, 341203, '颍东区', 3, 341200),
(1375, 341204, '颍泉区', 3, 341200),
(1376, 341221, '临泉县', 3, 341200),
(1377, 341222, '太和县', 3, 341200),
(1378, 341225, '阜南县', 3, 341200),
(1379, 341226, '颍上县', 3, 341200),
(1380, 341282, '界首市', 3, 341200),
(1381, 341302, '墉桥区', 3, 341300),
(1382, 341321, '砀山县', 3, 341300),
(1383, 341322, '萧 县', 3, 341300),
(1384, 341323, '灵璧县', 3, 341300),
(1385, 341324, '泗 县', 3, 341300),
(1386, 341402, '居巢区', 3, 341400),
(1387, 341421, '庐江县', 3, 341400),
(1388, 341422, '无为县', 3, 341400),
(1389, 341423, '含山县', 3, 341400),
(1390, 341424, '和 县', 3, 341400),
(1391, 341502, '金安区', 3, 341500),
(1392, 341503, '裕安区', 3, 341500),
(1393, 341521, '寿 县', 3, 341500),
(1394, 341522, '霍邱县', 3, 341500),
(1395, 341523, '舒城县', 3, 341500),
(1396, 341524, '金寨县', 3, 341500),
(1397, 341525, '霍山县', 3, 341500),
(1398, 341602, '谯城区', 3, 341600),
(1399, 341621, '涡阳县', 3, 341600),
(1400, 341622, '蒙城县', 3, 341600),
(1401, 341623, '利辛县', 3, 341600),
(1402, 341702, '贵池区', 3, 341700),
(1403, 341721, '东至县', 3, 341700),
(1404, 341722, '石台县', 3, 341700),
(1405, 341723, '青阳县', 3, 341700),
(1406, 341802, '宣州区', 3, 341800),
(1407, 341821, '郎溪县', 3, 341800),
(1408, 341822, '广德县', 3, 341800),
(1409, 341823, '泾 县', 3, 341800),
(1410, 341824, '绩溪县', 3, 341800),
(1411, 341825, '旌德县', 3, 341800),
(1412, 341881, '宁国市', 3, 341800),
(1413, 350102, '鼓楼区', 3, 350100),
(1414, 350103, '台江区', 3, 350100),
(1415, 350104, '仓山区', 3, 350100),
(1416, 350105, '马尾区', 3, 350100),
(1417, 350111, '晋安区', 3, 350100),
(1418, 350121, '闽侯县', 3, 350100),
(1419, 350122, '连江县', 3, 350100),
(1420, 350123, '罗源县', 3, 350100),
(1421, 350124, '闽清县', 3, 350100),
(1422, 350125, '永泰县', 3, 350100),
(1423, 350128, '平潭县', 3, 350100),
(1424, 350181, '福清市', 3, 350100),
(1425, 350182, '长乐市', 3, 350100),
(1426, 350203, '思明区', 3, 350200),
(1427, 350205, '海沧区', 3, 350200),
(1428, 350206, '湖里区', 3, 350200),
(1429, 350211, '集美区', 3, 350200),
(1430, 350212, '同安区', 3, 350200),
(1431, 350213, '翔安区', 3, 350200),
(1432, 350302, '城厢区', 3, 350300),
(1433, 350303, '涵江区', 3, 350300),
(1434, 350304, '荔城区', 3, 350300),
(1435, 350305, '秀屿区', 3, 350300),
(1436, 350322, '仙游县', 3, 350300),
(1437, 350402, '梅列区', 3, 350400),
(1438, 350403, '三元区', 3, 350400),
(1439, 350421, '明溪县', 3, 350400),
(1440, 350423, '清流县', 3, 350400),
(1441, 350424, '宁化县', 3, 350400),
(1442, 350425, '大田县', 3, 350400),
(1443, 350426, '尤溪县', 3, 350400),
(1444, 350427, '沙 县', 3, 350400),
(1445, 350428, '将乐县', 3, 350400),
(1446, 350429, '泰宁县', 3, 350400),
(1447, 350430, '建宁县', 3, 350400),
(1448, 350481, '永安市', 3, 350400),
(1449, 350502, '鲤城区', 3, 350500),
(1450, 350503, '丰泽区', 3, 350500),
(1451, 350504, '洛江区', 3, 350500),
(1452, 350505, '泉港区', 3, 350500),
(1453, 350521, '惠安县', 3, 350500),
(1454, 350524, '安溪县', 3, 350500),
(1455, 350525, '永春县', 3, 350500),
(1456, 350526, '德化县', 3, 350500),
(1457, 350527, '金门县', 3, 350500),
(1458, 350581, '石狮市', 3, 350500),
(1459, 350582, '晋江市', 3, 350500),
(1460, 350583, '南安市', 3, 350500),
(1461, 350602, '芗城区', 3, 350600),
(1462, 350603, '龙文区', 3, 350600),
(1463, 350622, '云霄县', 3, 350600),
(1464, 350623, '漳浦县', 3, 350600),
(1465, 350624, '诏安县', 3, 350600),
(1466, 350625, '长泰县', 3, 350600),
(1467, 350626, '东山县', 3, 350600),
(1468, 350627, '南靖县', 3, 350600),
(1469, 350628, '平和县', 3, 350600),
(1470, 350629, '华安县', 3, 350600),
(1471, 350681, '龙海市', 3, 350600),
(1472, 350702, '延平区', 3, 350700),
(1473, 350721, '顺昌县', 3, 350700),
(1474, 350722, '浦城县', 3, 350700),
(1475, 350723, '光泽县', 3, 350700),
(1476, 350724, '松溪县', 3, 350700),
(1477, 350725, '政和县', 3, 350700),
(1478, 350781, '邵武市', 3, 350700),
(1479, 350782, '武夷山市', 3, 350700),
(1480, 350783, '建瓯市', 3, 350700),
(1481, 350784, '建阳市', 3, 350700),
(1482, 350802, '新罗区', 3, 350800),
(1483, 350821, '长汀县', 3, 350800),
(1484, 350822, '永定县', 3, 350800),
(1485, 350823, '上杭县', 3, 350800),
(1486, 350824, '武平县', 3, 350800),
(1487, 350825, '连城县', 3, 350800),
(1488, 350881, '漳平市', 3, 350800),
(1489, 350902, '蕉城区', 3, 350900),
(1490, 350921, '霞浦县', 3, 350900),
(1491, 350922, '古田县', 3, 350900),
(1492, 350923, '屏南县', 3, 350900),
(1493, 350924, '寿宁县', 3, 350900),
(1494, 350925, '周宁县', 3, 350900),
(1495, 350926, '柘荣县', 3, 350900),
(1496, 350981, '福安市', 3, 350900),
(1497, 350982, '福鼎市', 3, 350900),
(1498, 360102, '东湖区', 3, 360100),
(1499, 360103, '西湖区', 3, 360100),
(1500, 360104, '青云谱区', 3, 360100),
(1501, 360105, '湾里区', 3, 360100),
(1502, 360111, '青山湖区', 3, 360100),
(1503, 360121, '南昌县', 3, 360100),
(1504, 360122, '新建县', 3, 360100),
(1505, 360123, '安义县', 3, 360100),
(1506, 360124, '进贤县', 3, 360100),
(1507, 360202, '昌江区', 3, 360200),
(1508, 360203, '珠山区', 3, 360200),
(1509, 360222, '浮梁县', 3, 360200),
(1510, 360281, '乐平市', 3, 360200),
(1511, 360302, '安源区', 3, 360300),
(1512, 360313, '湘东区', 3, 360300),
(1513, 360321, '莲花县', 3, 360300),
(1514, 360322, '上栗县', 3, 360300),
(1515, 360323, '芦溪县', 3, 360300),
(1516, 360402, '庐山区', 3, 360400),
(1517, 360403, '浔阳区', 3, 360400),
(1518, 360421, '九江县', 3, 360400),
(1519, 360423, '武宁县', 3, 360400),
(1520, 360424, '修水县', 3, 360400),
(1521, 360425, '永修县', 3, 360400),
(1522, 360426, '德安县', 3, 360400),
(1523, 360427, '星子县', 3, 360400),
(1524, 360428, '都昌县', 3, 360400),
(1525, 360429, '湖口县', 3, 360400),
(1526, 360430, '彭泽县', 3, 360400),
(1527, 360481, '瑞昌市', 3, 360400),
(1528, 360502, '渝水区', 3, 360500),
(1529, 360521, '分宜县', 3, 360500),
(1530, 360602, '月湖区', 3, 360600),
(1531, 360622, '余江县', 3, 360600),
(1532, 360681, '贵溪市', 3, 360600),
(1533, 360702, '章贡区', 3, 360700),
(1534, 360721, '赣 县', 3, 360700),
(1535, 360722, '信丰县', 3, 360700),
(1536, 360723, '大余县', 3, 360700),
(1537, 360724, '上犹县', 3, 360700),
(1538, 360725, '崇义县', 3, 360700),
(1539, 360726, '安远县', 3, 360700),
(1540, 360727, '龙南县', 3, 360700),
(1541, 360728, '定南县', 3, 360700),
(1542, 360729, '全南县', 3, 360700),
(1543, 360730, '宁都县', 3, 360700),
(1544, 360731, '于都县', 3, 360700),
(1545, 360732, '兴国县', 3, 360700),
(1546, 360733, '会昌县', 3, 360700),
(1547, 360734, '寻乌县', 3, 360700),
(1548, 360735, '石城县', 3, 360700),
(1549, 360781, '瑞金市', 3, 360700),
(1550, 360782, '南康市', 3, 360700),
(1551, 360802, '吉州区', 3, 360800),
(1552, 360803, '青原区', 3, 360800),
(1553, 360821, '吉安县', 3, 360800),
(1554, 360822, '吉水县', 3, 360800),
(1555, 360823, '峡江县', 3, 360800),
(1556, 360824, '新干县', 3, 360800),
(1557, 360825, '永丰县', 3, 360800),
(1558, 360826, '泰和县', 3, 360800),
(1559, 360827, '遂川县', 3, 360800),
(1560, 360828, '万安县', 3, 360800),
(1561, 360829, '安福县', 3, 360800),
(1562, 360830, '永新县', 3, 360800),
(1563, 360881, '井冈山市', 3, 360800),
(1564, 360902, '袁州区', 3, 360900),
(1565, 360921, '奉新县', 3, 360900),
(1566, 360922, '万载县', 3, 360900),
(1567, 360923, '上高县', 3, 360900),
(1568, 360924, '宜丰县', 3, 360900),
(1569, 360925, '靖安县', 3, 360900),
(1570, 360926, '铜鼓县', 3, 360900),
(1571, 360981, '丰城市', 3, 360900),
(1572, 360982, '樟树市', 3, 360900),
(1573, 360983, '高安市', 3, 360900),
(1574, 361002, '临川区', 3, 361000),
(1575, 361021, '南城县', 3, 361000),
(1576, 361022, '黎川县', 3, 361000),
(1577, 361023, '南丰县', 3, 361000),
(1578, 361024, '崇仁县', 3, 361000),
(1579, 361025, '乐安县', 3, 361000),
(1580, 361026, '宜黄县', 3, 361000),
(1581, 361027, '金溪县', 3, 361000),
(1582, 361028, '资溪县', 3, 361000),
(1583, 361029, '东乡县', 3, 361000),
(1584, 361030, '广昌县', 3, 361000),
(1585, 361102, '信州区', 3, 361100),
(1586, 361121, '上饶县', 3, 361100),
(1587, 361122, '广丰县', 3, 361100),
(1588, 361123, '玉山县', 3, 361100),
(1589, 361124, '铅山县', 3, 361100),
(1590, 361125, '横峰县', 3, 361100),
(1591, 361126, '弋阳县', 3, 361100),
(1592, 361127, '余干县', 3, 361100),
(1593, 361128, '鄱阳县', 3, 361100),
(1594, 361129, '万年县', 3, 361100),
(1595, 361130, '婺源县', 3, 361100),
(1596, 361181, '德兴市', 3, 361100),
(1597, 370102, '历下区', 3, 370100),
(1598, 370103, '市中区', 3, 370100),
(1599, 370104, '槐荫区', 3, 370100),
(1600, 370105, '天桥区', 3, 370100),
(1601, 370112, '历城区', 3, 370100),
(1602, 370113, '长清区', 3, 370100),
(1603, 370124, '平阴县', 3, 370100),
(1604, 370125, '济阳县', 3, 370100),
(1605, 370126, '商河县', 3, 370100),
(1606, 370181, '章丘市', 3, 370100),
(1607, 370202, '市南区', 3, 370200),
(1608, 370203, '市北区', 3, 370200),
(1609, 370205, '四方区', 3, 370200),
(1610, 370211, '黄岛区', 3, 370200),
(1611, 370212, '崂山区', 3, 370200),
(1612, 370213, '李沧区', 3, 370200),
(1613, 370214, '城阳区', 3, 370200),
(1614, 370281, '胶州市', 3, 370200),
(1615, 370282, '即墨市', 3, 370200),
(1616, 370283, '平度市', 3, 370200),
(1617, 370284, '胶南市', 3, 370200),
(1618, 370285, '莱西市', 3, 370200),
(1619, 370302, '淄川区', 3, 370300),
(1620, 370303, '张店区', 3, 370300),
(1621, 370304, '博山区', 3, 370300),
(1622, 370305, '临淄区', 3, 370300),
(1623, 370306, '周村区', 3, 370300),
(1624, 370321, '桓台县', 3, 370300),
(1625, 370322, '高青县', 3, 370300),
(1626, 370323, '沂源县', 3, 370300),
(1627, 370402, '市中区', 3, 370400),
(1628, 370403, '薛城区', 3, 370400),
(1629, 370404, '峄城区', 3, 370400),
(1630, 370405, '台儿庄区', 3, 370400),
(1631, 370406, '山亭区', 3, 370400),
(1632, 370481, '滕州市', 3, 370400),
(1633, 370502, '东营区', 3, 370500),
(1634, 370503, '河口区', 3, 370500),
(1635, 370521, '垦利县', 3, 370500),
(1636, 370522, '利津县', 3, 370500),
(1637, 370523, '广饶县', 3, 370500),
(1638, 370602, '芝罘区', 3, 370600),
(1639, 370611, '福山区', 3, 370600),
(1640, 370612, '牟平区', 3, 370600),
(1641, 370613, '莱山区', 3, 370600),
(1642, 370634, '长岛县', 3, 370600),
(1643, 370681, '龙口市', 3, 370600),
(1644, 370682, '莱阳市', 3, 370600),
(1645, 370683, '莱州市', 3, 370600),
(1646, 370684, '蓬莱市', 3, 370600),
(1647, 370685, '招远市', 3, 370600),
(1648, 370686, '栖霞市', 3, 370600),
(1649, 370687, '海阳市', 3, 370600),
(1650, 370702, '潍城区', 3, 370700),
(1651, 370703, '寒亭区', 3, 370700),
(1652, 370704, '坊子区', 3, 370700),
(1653, 370705, '奎文区', 3, 370700),
(1654, 370724, '临朐县', 3, 370700),
(1655, 370725, '昌乐县', 3, 370700),
(1656, 370781, '青州市', 3, 370700),
(1657, 370782, '诸城市', 3, 370700),
(1658, 370783, '寿光市', 3, 370700),
(1659, 370784, '安丘市', 3, 370700),
(1660, 370785, '高密市', 3, 370700),
(1661, 370786, '昌邑市', 3, 370700),
(1662, 370802, '市中区', 3, 370800),
(1663, 370811, '任城区', 3, 370800),
(1664, 370826, '微山县', 3, 370800),
(1665, 370827, '鱼台县', 3, 370800),
(1666, 370828, '金乡县', 3, 370800),
(1667, 370829, '嘉祥县', 3, 370800),
(1668, 370830, '汶上县', 3, 370800),
(1669, 370831, '泗水县', 3, 370800),
(1670, 370832, '梁山县', 3, 370800),
(1671, 370881, '曲阜市', 3, 370800),
(1672, 370882, '兖州市', 3, 370800),
(1673, 370883, '邹城市', 3, 370800),
(1674, 370902, '泰山区', 3, 370900),
(1675, 370903, '岱岳区', 3, 370900),
(1676, 370921, '宁阳县', 3, 370900),
(1677, 370923, '东平县', 3, 370900),
(1678, 370982, '新泰市', 3, 370900),
(1679, 370983, '肥城市', 3, 370900),
(1680, 371002, '环翠区', 3, 371000),
(1681, 371081, '文登市', 3, 371000),
(1682, 371082, '荣成市', 3, 371000),
(1683, 371083, '乳山市', 3, 371000),
(1684, 371102, '东港区', 3, 371100),
(1685, 371103, '岚山区', 3, 371100),
(1686, 371121, '五莲县', 3, 371100),
(1687, 371122, '莒 县', 3, 371100),
(1688, 371202, '莱城区', 3, 371200),
(1689, 371203, '钢城区', 3, 371200),
(1690, 371302, '兰山区', 3, 371300),
(1691, 371311, '罗庄区', 3, 371300),
(1692, 371312, '河东区', 3, 371300),
(1693, 371321, '沂南县', 3, 371300),
(1694, 371322, '郯城县', 3, 371300),
(1695, 371323, '沂水县', 3, 371300),
(1696, 371324, '苍山县', 3, 371300),
(1697, 371325, '费 县', 3, 371300),
(1698, 371326, '平邑县', 3, 371300),
(1699, 371327, '莒南县', 3, 371300),
(1700, 371328, '蒙阴县', 3, 371300),
(1701, 371329, '临沭县', 3, 371300),
(1702, 371402, '德城区', 3, 371400),
(1703, 371421, '陵 县', 3, 371400),
(1704, 371422, '宁津县', 3, 371400),
(1705, 371423, '庆云县', 3, 371400),
(1706, 371424, '临邑县', 3, 371400),
(1707, 371425, '齐河县', 3, 371400),
(1708, 371426, '平原县', 3, 371400),
(1709, 371427, '夏津县', 3, 371400),
(1710, 371428, '武城县', 3, 371400),
(1711, 371481, '乐陵市', 3, 371400),
(1712, 371482, '禹城市', 3, 371400),
(1713, 371502, '东昌府区', 3, 371500),
(1714, 371521, '阳谷县', 3, 371500),
(1715, 371522, '莘 县', 3, 371500),
(1716, 371523, '茌平县', 3, 371500),
(1717, 371524, '东阿县', 3, 371500),
(1718, 371525, '冠 县', 3, 371500),
(1719, 371526, '高唐县', 3, 371500),
(1720, 371581, '临清市', 3, 371500),
(1721, 371602, '滨城区', 3, 371600),
(1722, 371621, '惠民县', 3, 371600),
(1723, 371622, '阳信县', 3, 371600),
(1724, 371623, '无棣县', 3, 371600),
(1725, 371624, '沾化县', 3, 371600),
(1726, 371625, '博兴县', 3, 371600),
(1727, 371626, '邹平县', 3, 371600),
(1728, 371702, '牡丹区', 3, 371700),
(1729, 371721, '曹 县', 3, 371700),
(1730, 371722, '单 县', 3, 371700),
(1731, 371723, '成武县', 3, 371700),
(1732, 371724, '巨野县', 3, 371700),
(1733, 371725, '郓城县', 3, 371700),
(1734, 371726, '鄄城县', 3, 371700),
(1735, 371727, '定陶县', 3, 371700),
(1736, 371728, '东明县', 3, 371700),
(1737, 410102, '中原区', 3, 410100),
(1738, 410103, '二七区', 3, 410100),
(1739, 410104, '管城回族区', 3, 410100),
(1740, 410105, '金水区', 3, 410100),
(1741, 410106, '上街区', 3, 410100),
(1742, 410108, '邙山区', 3, 410100),
(1743, 410122, '中牟县', 3, 410100),
(1744, 410181, '巩义市', 3, 410100),
(1745, 410182, '荥阳市', 3, 410100),
(1746, 410183, '新密市', 3, 410100),
(1747, 410184, '新郑市', 3, 410100),
(1748, 410185, '登封市', 3, 410100),
(1749, 410202, '龙亭区', 3, 410200),
(1750, 410203, '顺河回族区', 3, 410200),
(1751, 410204, '鼓楼区', 3, 410200),
(1752, 410205, '南关区', 3, 410200),
(1753, 410211, '郊 区', 3, 410200),
(1754, 410221, '杞 县', 3, 410200),
(1755, 410222, '通许县', 3, 410200),
(1756, 410223, '尉氏县', 3, 410200),
(1757, 410224, '开封县', 3, 410200),
(1758, 410225, '兰考县', 3, 410200),
(1759, 410302, '老城区', 3, 410300),
(1760, 410303, '西工区', 3, 410300),
(1761, 410304, '廛河回族区', 3, 410300),
(1762, 410305, '涧西区', 3, 410300),
(1763, 410306, '吉利区', 3, 410300),
(1764, 410307, '洛龙区', 3, 410300),
(1765, 410322, '孟津县', 3, 410300),
(1766, 410323, '新安县', 3, 410300),
(1767, 410324, '栾川县', 3, 410300),
(1768, 410325, '嵩 县', 3, 410300),
(1769, 410326, '汝阳县', 3, 410300),
(1770, 410327, '宜阳县', 3, 410300),
(1771, 410328, '洛宁县', 3, 410300),
(1772, 410329, '伊川县', 3, 410300),
(1773, 410381, '偃师市', 3, 410300),
(1774, 410402, '新华区', 3, 410400),
(1775, 410403, '卫东区', 3, 410400),
(1776, 410404, '石龙区', 3, 410400),
(1777, 410411, '湛河区', 3, 410400),
(1778, 410421, '宝丰县', 3, 410400),
(1779, 410422, '叶 县', 3, 410400),
(1780, 410423, '鲁山县', 3, 410400),
(1781, 410425, '郏 县', 3, 410400),
(1782, 410481, '舞钢市', 3, 410400),
(1783, 410482, '汝州市', 3, 410400),
(1784, 410502, '文峰区', 3, 410500),
(1785, 410503, '北关区', 3, 410500),
(1786, 410505, '殷都区', 3, 410500),
(1787, 410506, '龙安区', 3, 410500),
(1788, 410522, '安阳县', 3, 410500),
(1789, 410523, '汤阴县', 3, 410500),
(1790, 410526, '滑 县', 3, 410500),
(1791, 410527, '内黄县', 3, 410500),
(1792, 410581, '林州市', 3, 410500),
(1793, 410602, '鹤山区', 3, 410600),
(1794, 410603, '山城区', 3, 410600),
(1795, 410611, '淇滨区', 3, 410600),
(1796, 410621, '浚 县', 3, 410600),
(1797, 410622, '淇 县', 3, 410600),
(1798, 410702, '红旗区', 3, 410700),
(1799, 410703, '卫滨区', 3, 410700),
(1800, 410704, '凤泉区', 3, 410700),
(1801, 410711, '牧野区', 3, 410700),
(1802, 410721, '新乡县', 3, 410700),
(1803, 410724, '获嘉县', 3, 410700),
(1804, 410725, '原阳县', 3, 410700),
(1805, 410726, '延津县', 3, 410700),
(1806, 410727, '封丘县', 3, 410700),
(1807, 410728, '长垣县', 3, 410700),
(1808, 410781, '卫辉市', 3, 410700),
(1809, 410782, '辉县市', 3, 410700),
(1810, 410802, '解放区', 3, 410800),
(1811, 410803, '中站区', 3, 410800),
(1812, 410804, '马村区', 3, 410800),
(1813, 410811, '山阳区', 3, 410800),
(1814, 410821, '修武县', 3, 410800),
(1815, 410822, '博爱县', 3, 410800),
(1816, 410823, '武陟县', 3, 410800),
(1817, 410825, '温 县', 3, 410800),
(1818, 410881, '济源市', 3, 410800),
(1819, 410882, '沁阳市', 3, 410800),
(1820, 410883, '孟州市', 3, 410800),
(1821, 410902, '华龙区', 3, 410900),
(1822, 410922, '清丰县', 3, 410900),
(1823, 410923, '南乐县', 3, 410900),
(1824, 410926, '范 县', 3, 410900),
(1825, 410927, '台前县', 3, 410900),
(1826, 410928, '濮阳县', 3, 410900),
(1827, 411002, '魏都区', 3, 411000),
(1828, 411023, '许昌县', 3, 411000),
(1829, 411024, '鄢陵县', 3, 411000),
(1830, 411025, '襄城县', 3, 411000),
(1831, 411081, '禹州市', 3, 411000),
(1832, 411082, '长葛市', 3, 411000),
(1833, 411102, '源汇区', 3, 411100),
(1834, 411103, '郾城区', 3, 411100),
(1835, 411104, '召陵区', 3, 411100),
(1836, 411121, '舞阳县', 3, 411100),
(1837, 411122, '临颍县', 3, 411100),
(1838, 411202, '湖滨区', 3, 411200),
(1839, 411221, '渑池县', 3, 411200),
(1840, 411222, '陕 县', 3, 411200),
(1841, 411224, '卢氏县', 3, 411200),
(1842, 411281, '义马市', 3, 411200),
(1843, 411282, '灵宝市', 3, 411200),
(1844, 411302, '宛城区', 3, 411300),
(1845, 411303, '卧龙区', 3, 411300),
(1846, 411321, '南召县', 3, 411300),
(1847, 411322, '方城县', 3, 411300),
(1848, 411323, '西峡县', 3, 411300),
(1849, 411324, '镇平县', 3, 411300),
(1850, 411325, '内乡县', 3, 411300),
(1851, 411326, '淅川县', 3, 411300),
(1852, 411327, '社旗县', 3, 411300),
(1853, 411328, '唐河县', 3, 411300),
(1854, 411329, '新野县', 3, 411300),
(1855, 411330, '桐柏县', 3, 411300),
(1856, 411381, '邓州市', 3, 411300),
(1857, 411402, '梁园区', 3, 411400),
(1858, 411403, '睢阳区', 3, 411400),
(1859, 411421, '民权县', 3, 411400),
(1860, 411422, '睢 县', 3, 411400),
(1861, 411423, '宁陵县', 3, 411400),
(1862, 411424, '柘城县', 3, 411400),
(1863, 411425, '虞城县', 3, 411400),
(1864, 411426, '夏邑县', 3, 411400),
(1865, 411481, '永城市', 3, 411400),
(1866, 411502, '师河区', 3, 411500),
(1867, 411503, '平桥区', 3, 411500),
(1868, 411521, '罗山县', 3, 411500),
(1869, 411522, '光山县', 3, 411500),
(1870, 411523, '新 县', 3, 411500),
(1871, 411524, '商城县', 3, 411500),
(1872, 411525, '固始县', 3, 411500),
(1873, 411526, '潢川县', 3, 411500),
(1874, 411527, '淮滨县', 3, 411500),
(1875, 411528, '息 县', 3, 411500),
(1876, 411602, '川汇区', 3, 411600),
(1877, 411621, '扶沟县', 3, 411600),
(1878, 411622, '西华县', 3, 411600),
(1879, 411623, '商水县', 3, 411600),
(1880, 411624, '沈丘县', 3, 411600),
(1881, 411625, '郸城县', 3, 411600),
(1882, 411626, '淮阳县', 3, 411600),
(1883, 411627, '太康县', 3, 411600),
(1884, 411628, '鹿邑县', 3, 411600),
(1885, 411681, '项城市', 3, 411600),
(1886, 411702, '驿城区', 3, 411700),
(1887, 411721, '西平县', 3, 411700),
(1888, 411722, '上蔡县', 3, 411700),
(1889, 411723, '平舆县', 3, 411700),
(1890, 411724, '正阳县', 3, 411700),
(1891, 411725, '确山县', 3, 411700),
(1892, 411726, '泌阳县', 3, 411700),
(1893, 411727, '汝南县', 3, 411700),
(1894, 411728, '遂平县', 3, 411700),
(1895, 411729, '新蔡县', 3, 411700),
(1896, 420102, '江岸区', 3, 420100),
(1897, 420103, '江汉区', 3, 420100),
(1898, 420104, '乔口区', 3, 420100),
(1899, 420105, '汉阳区', 3, 420100),
(1900, 420106, '武昌区', 3, 420100),
(1901, 420107, '青山区', 3, 420100),
(1902, 420111, '洪山区', 3, 420100),
(1903, 420112, '东西湖区', 3, 420100),
(1904, 420113, '汉南区', 3, 420100),
(1905, 420114, '蔡甸区', 3, 420100),
(1906, 420115, '江夏区', 3, 420100),
(1907, 420116, '黄陂区', 3, 420100),
(1908, 420117, '新洲区', 3, 420100),
(1909, 420202, '黄石港区', 3, 420200),
(1910, 420203, '西塞山区', 3, 420200),
(1911, 420204, '下陆区', 3, 420200),
(1912, 420205, '铁山区', 3, 420200),
(1913, 420222, '阳新县', 3, 420200),
(1914, 420281, '大冶市', 3, 420200),
(1915, 420302, '茅箭区', 3, 420300),
(1916, 420303, '张湾区', 3, 420300),
(1917, 420321, '郧 县', 3, 420300),
(1918, 420322, '郧西县', 3, 420300),
(1919, 420323, '竹山县', 3, 420300),
(1920, 420324, '竹溪县', 3, 420300),
(1921, 420325, '房 县', 3, 420300),
(1922, 420381, '丹江口市', 3, 420300),
(1923, 420502, '西陵区', 3, 420500),
(1924, 420503, '伍家岗区', 3, 420500),
(1925, 420504, '点军区', 3, 420500),
(1926, 420505, '猇亭区', 3, 420500),
(1927, 420506, '夷陵区', 3, 420500),
(1928, 420525, '远安县', 3, 420500),
(1929, 420526, '兴山县', 3, 420500),
(1930, 420527, '秭归县', 3, 420500),
(1931, 420528, '长阳土家族自治县', 3, 420500),
(1932, 420529, '五峰土家族自治县', 3, 420500),
(1933, 420581, '宜都市', 3, 420500),
(1934, 420582, '当阳市', 3, 420500),
(1935, 420583, '枝江市', 3, 420500),
(1936, 420602, '襄城区', 3, 420600),
(1937, 420606, '樊城区', 3, 420600),
(1938, 420607, '襄阳区', 3, 420600),
(1939, 420624, '南漳县', 3, 420600),
(1940, 420625, '谷城县', 3, 420600),
(1941, 420626, '保康县', 3, 420600),
(1942, 420682, '老河口市', 3, 420600),
(1943, 420683, '枣阳市', 3, 420600),
(1944, 420684, '宜城市', 3, 420600),
(1945, 420702, '梁子湖区', 3, 420700),
(1946, 420703, '华容区', 3, 420700),
(1947, 420704, '鄂城区', 3, 420700),
(1948, 420802, '东宝区', 3, 420800),
(1949, 420804, '掇刀区', 3, 420800),
(1950, 420821, '京山县', 3, 420800),
(1951, 420822, '沙洋县', 3, 420800),
(1952, 420881, '钟祥市', 3, 420800),
(1953, 420902, '孝南区', 3, 420900),
(1954, 420921, '孝昌县', 3, 420900),
(1955, 420922, '大悟县', 3, 420900),
(1956, 420923, '云梦县', 3, 420900),
(1957, 420981, '应城市', 3, 420900),
(1958, 420982, '安陆市', 3, 420900),
(1959, 420984, '汉川市', 3, 420900),
(1960, 421002, '沙市区', 3, 421000),
(1961, 421003, '荆州区', 3, 421000),
(1962, 421022, '公安县', 3, 421000),
(1963, 421023, '监利县', 3, 421000),
(1964, 421024, '江陵县', 3, 421000),
(1965, 421081, '石首市', 3, 421000),
(1966, 421083, '洪湖市', 3, 421000),
(1967, 421087, '松滋市', 3, 421000),
(1968, 421102, '黄州区', 3, 421100),
(1969, 421121, '团风县', 3, 421100),
(1970, 421122, '红安县', 3, 421100),
(1971, 421123, '罗田县', 3, 421100),
(1972, 421124, '英山县', 3, 421100),
(1973, 421125, '浠水县', 3, 421100),
(1974, 421126, '蕲春县', 3, 421100),
(1975, 421127, '黄梅县', 3, 421100),
(1976, 421181, '麻城市', 3, 421100),
(1977, 421182, '武穴市', 3, 421100),
(1978, 421202, '咸安区', 3, 421200),
(1979, 421221, '嘉鱼县', 3, 421200),
(1980, 421222, '通城县', 3, 421200),
(1981, 421223, '崇阳县', 3, 421200),
(1982, 421224, '通山县', 3, 421200),
(1983, 421281, '赤壁市', 3, 421200),
(1984, 421302, '曾都区', 3, 421300),
(1985, 421381, '广水市', 3, 421300),
(1986, 422801, '恩施市', 3, 422800),
(1987, 422802, '利川市', 3, 422800),
(1988, 422822, '建始县', 3, 422800),
(1989, 422823, '巴东县', 3, 422800),
(1990, 422825, '宣恩县', 3, 422800),
(1991, 422826, '咸丰县', 3, 422800),
(1992, 422827, '来凤县', 3, 422800),
(1993, 422828, '鹤峰县', 3, 422800),
(1994, 429004, '仙桃市', 3, 429000),
(1995, 429005, '潜江市', 3, 429000),
(1996, 429006, '天门市', 3, 429000),
(1997, 429021, '神农架林区', 3, 429000),
(1998, 430102, '芙蓉区', 3, 430100),
(1999, 430103, '天心区', 3, 430100),
(2000, 430104, '岳麓区', 3, 430100),
(2001, 430105, '开福区', 3, 430100),
(2002, 430111, '雨花区', 3, 430100),
(2003, 430121, '长沙县', 3, 430100),
(2004, 430122, '望城县', 3, 430100),
(2005, 430124, '宁乡县', 3, 430100),
(2006, 430181, '浏阳市', 3, 430100),
(2007, 430202, '荷塘区', 3, 430200),
(2008, 430203, '芦淞区', 3, 430200),
(2009, 430204, '石峰区', 3, 430200),
(2010, 430211, '天元区', 3, 430200),
(2011, 430221, '株洲县', 3, 430200),
(2012, 430223, '攸 县', 3, 430200),
(2013, 430224, '茶陵县', 3, 430200),
(2014, 430225, '炎陵县', 3, 430200),
(2015, 430281, '醴陵市', 3, 430200),
(2016, 430302, '雨湖区', 3, 430300),
(2017, 430304, '岳塘区', 3, 430300),
(2018, 430321, '湘潭县', 3, 430300),
(2019, 430381, '湘乡市', 3, 430300),
(2020, 430382, '韶山市', 3, 430300),
(2021, 430405, '珠晖区', 3, 430400),
(2022, 430406, '雁峰区', 3, 430400),
(2023, 430407, '石鼓区', 3, 430400),
(2024, 430408, '蒸湘区', 3, 430400),
(2025, 430412, '南岳区', 3, 430400),
(2026, 430421, '衡阳县', 3, 430400),
(2027, 430422, '衡南县', 3, 430400),
(2028, 430423, '衡山县', 3, 430400),
(2029, 430424, '衡东县', 3, 430400),
(2030, 430426, '祁东县', 3, 430400),
(2031, 430481, '耒阳市', 3, 430400),
(2032, 430482, '常宁市', 3, 430400),
(2033, 430502, '双清区', 3, 430500),
(2034, 430503, '大祥区', 3, 430500),
(2035, 430511, '北塔区', 3, 430500),
(2036, 430521, '邵东县', 3, 430500),
(2037, 430522, '新邵县', 3, 430500),
(2038, 430523, '邵阳县', 3, 430500),
(2039, 430524, '隆回县', 3, 430500),
(2040, 430525, '洞口县', 3, 430500),
(2041, 430527, '绥宁县', 3, 430500),
(2042, 430528, '新宁县', 3, 430500),
(2043, 430529, '城步苗族自治县', 3, 430500),
(2044, 430581, '武冈市', 3, 430500),
(2045, 430602, '岳阳楼区', 3, 430600),
(2046, 430603, '云溪区', 3, 430600),
(2047, 430611, '君山区', 3, 430600),
(2048, 430621, '岳阳县', 3, 430600),
(2049, 430623, '华容县', 3, 430600),
(2050, 430624, '湘阴县', 3, 430600),
(2051, 430626, '平江县', 3, 430600),
(2052, 430681, '汨罗市', 3, 430600),
(2053, 430682, '临湘市', 3, 430600),
(2054, 430702, '武陵区', 3, 430700),
(2055, 430703, '鼎城区', 3, 430700),
(2056, 430721, '安乡县', 3, 430700),
(2057, 430722, '汉寿县', 3, 430700),
(2058, 430723, '澧 县', 3, 430700),
(2059, 430724, '临澧县', 3, 430700),
(2060, 430725, '桃源县', 3, 430700),
(2061, 430726, '石门县', 3, 430700),
(2062, 430781, '津市市', 3, 430700),
(2063, 430802, '永定区', 3, 430800),
(2064, 430811, '武陵源区', 3, 430800),
(2065, 430821, '慈利县', 3, 430800),
(2066, 430822, '桑植县', 3, 430800),
(2067, 430902, '资阳区', 3, 430900),
(2068, 430903, '赫山区', 3, 430900),
(2069, 430921, '南 县', 3, 430900),
(2070, 430922, '桃江县', 3, 430900),
(2071, 430923, '安化县', 3, 430900),
(2072, 430981, '沅江市', 3, 430900),
(2073, 431002, '北湖区', 3, 431000),
(2074, 431003, '苏仙区', 3, 431000),
(2075, 431021, '桂阳县', 3, 431000),
(2076, 431022, '宜章县', 3, 431000),
(2077, 431023, '永兴县', 3, 431000),
(2078, 431024, '嘉禾县', 3, 431000),
(2079, 431025, '临武县', 3, 431000),
(2080, 431026, '汝城县', 3, 431000),
(2081, 431027, '桂东县', 3, 431000),
(2082, 431028, '安仁县', 3, 431000),
(2083, 431081, '资兴市', 3, 431000),
(2084, 431102, '芝山区', 3, 431100),
(2085, 431103, '冷水滩区', 3, 431100),
(2086, 431121, '祁阳县', 3, 431100),
(2087, 431122, '东安县', 3, 431100),
(2088, 431123, '双牌县', 3, 431100),
(2089, 431124, '道 县', 3, 431100),
(2090, 431125, '江永县', 3, 431100),
(2091, 431126, '宁远县', 3, 431100),
(2092, 431127, '蓝山县', 3, 431100),
(2093, 431128, '新田县', 3, 431100),
(2094, 431129, '江华瑶族自治县', 3, 431100),
(2095, 431202, '鹤城区', 3, 431200),
(2096, 431221, '中方县', 3, 431200),
(2097, 431222, '沅陵县', 3, 431200),
(2098, 431223, '辰溪县', 3, 431200),
(2099, 431224, '溆浦县', 3, 431200),
(2100, 431225, '会同县', 3, 431200),
(2101, 431226, '麻阳苗族自治县', 3, 431200),
(2102, 431227, '新晃侗族自治县', 3, 431200),
(2103, 431228, '芷江侗族自治县', 3, 431200),
(2104, 431229, '靖州苗族侗族自治县', 3, 431200),
(2105, 431230, '通道侗族自治县', 3, 431200),
(2106, 431281, '洪江市', 3, 431200),
(2107, 431302, '娄星区', 3, 431300),
(2108, 431321, '双峰县', 3, 431300),
(2109, 431322, '新化县', 3, 431300),
(2110, 431381, '冷水江市', 3, 431300),
(2111, 431382, '涟源市', 3, 431300),
(2112, 433101, '吉首市', 3, 433100),
(2113, 433122, '泸溪县', 3, 433100),
(2114, 433123, '凤凰县', 3, 433100),
(2115, 433124, '花垣县', 3, 433100),
(2116, 433125, '保靖县', 3, 433100),
(2117, 433126, '古丈县', 3, 433100),
(2118, 433127, '永顺县', 3, 433100),
(2119, 433130, '龙山县', 3, 433100),
(2120, 440102, '东山区', 3, 440100),
(2121, 440103, '荔湾区', 3, 440100),
(2122, 440104, '越秀区', 3, 440100),
(2123, 440105, '海珠区', 3, 440100),
(2124, 440106, '天河区', 3, 440100),
(2125, 440107, '芳村区', 3, 440100),
(2126, 440111, '白云区', 3, 440100),
(2127, 440112, '黄埔区', 3, 440100),
(2128, 440113, '番禺区', 3, 440100),
(2129, 440114, '花都区', 3, 440100),
(2130, 440183, '增城市', 3, 440100),
(2131, 440184, '从化市', 3, 440100),
(2132, 440203, '武江区', 3, 440200),
(2133, 440204, '浈江区', 3, 440200),
(2134, 440205, '曲江区', 3, 440200),
(2135, 440222, '始兴县', 3, 440200),
(2136, 440224, '仁化县', 3, 440200),
(2137, 440229, '翁源县', 3, 440200),
(2138, 440232, '乳源瑶族自治县', 3, 440200),
(2139, 440233, '新丰县', 3, 440200),
(2140, 440281, '乐昌市', 3, 440200),
(2141, 440282, '南雄市', 3, 440200),
(2142, 440303, '罗湖区', 3, 440300),
(2143, 440304, '福田区', 3, 440300),
(2144, 440305, '南山区', 3, 440300),
(2145, 440306, '宝安区', 3, 440300),
(2146, 440307, '龙岗区', 3, 440300),
(2147, 440308, '盐田区', 3, 440300),
(2148, 440402, '香洲区', 3, 440400),
(2149, 440403, '斗门区', 3, 440400),
(2150, 440404, '金湾区', 3, 440400),
(2151, 440507, '龙湖区', 3, 440500),
(2152, 440511, '金平区', 3, 440500),
(2153, 440512, '濠江区', 3, 440500),
(2154, 440513, '潮阳区', 3, 440500),
(2155, 440514, '潮南区', 3, 440500),
(2156, 440515, '澄海区', 3, 440500),
(2157, 440523, '南澳县', 3, 440500),
(2158, 440604, '禅城区', 3, 440600),
(2159, 440605, '南海区', 3, 440600),
(2160, 440606, '顺德区', 3, 440600),
(2161, 440607, '三水区', 3, 440600),
(2162, 440608, '高明区', 3, 440600),
(2163, 440703, '蓬江区', 3, 440700),
(2164, 440704, '江海区', 3, 440700),
(2165, 440705, '新会区', 3, 440700),
(2166, 440781, '台山市', 3, 440700),
(2167, 440783, '开平市', 3, 440700),
(2168, 440784, '鹤山市', 3, 440700),
(2169, 440785, '恩平市', 3, 440700),
(2170, 440802, '赤坎区', 3, 440800),
(2171, 440803, '霞山区', 3, 440800),
(2172, 440804, '坡头区', 3, 440800),
(2173, 440811, '麻章区', 3, 440800),
(2174, 440823, '遂溪县', 3, 440800),
(2175, 440825, '徐闻县', 3, 440800),
(2176, 440881, '廉江市', 3, 440800),
(2177, 440882, '雷州市', 3, 440800),
(2178, 440883, '吴川市', 3, 440800),
(2179, 440902, '茂南区', 3, 440900),
(2180, 440903, '茂港区', 3, 440900),
(2181, 440923, '电白县', 3, 440900),
(2182, 440981, '高州市', 3, 440900),
(2183, 440982, '化州市', 3, 440900),
(2184, 440983, '信宜市', 3, 440900),
(2185, 441202, '端州区', 3, 441200),
(2186, 441203, '鼎湖区', 3, 441200),
(2187, 441223, '广宁县', 3, 441200),
(2188, 441224, '怀集县', 3, 441200),
(2189, 441225, '封开县', 3, 441200),
(2190, 441226, '德庆县', 3, 441200),
(2191, 441283, '高要市', 3, 441200),
(2192, 441284, '四会市', 3, 441200),
(2193, 441302, '惠城区', 3, 441300),
(2194, 441303, '惠阳区', 3, 441300),
(2195, 441322, '博罗县', 3, 441300),
(2196, 441323, '惠东县', 3, 441300),
(2197, 441324, '龙门县', 3, 441300),
(2198, 441402, '梅江区', 3, 441400),
(2199, 441421, '梅 县', 3, 441400),
(2200, 441422, '大埔县', 3, 441400),
(2201, 441423, '丰顺县', 3, 441400),
(2202, 441424, '五华县', 3, 441400),
(2203, 441426, '平远县', 3, 441400),
(2204, 441427, '蕉岭县', 3, 441400),
(2205, 441481, '兴宁市', 3, 441400),
(2206, 441502, '城 区', 3, 441500),
(2207, 441521, '海丰县', 3, 441500),
(2208, 441523, '陆河县', 3, 441500),
(2209, 441581, '陆丰市', 3, 441500),
(2210, 441602, '源城区', 3, 441600),
(2211, 441621, '紫金县', 3, 441600),
(2212, 441622, '龙川县', 3, 441600),
(2213, 441623, '连平县', 3, 441600),
(2214, 441624, '和平县', 3, 441600),
(2215, 441625, '东源县', 3, 441600),
(2216, 441702, '江城区', 3, 441700),
(2217, 441721, '阳西县', 3, 441700),
(2218, 441723, '阳东县', 3, 441700),
(2219, 441781, '阳春市', 3, 441700),
(2220, 441802, '清城区', 3, 441800),
(2221, 441821, '佛冈县', 3, 441800),
(2222, 441823, '阳山县', 3, 441800),
(2223, 441825, '连山壮族瑶族自治县', 3, 441800),
(2224, 441826, '连南瑶族自治县', 3, 441800),
(2225, 441827, '清新县', 3, 441800),
(2226, 441881, '英德市', 3, 441800),
(2227, 441882, '连州市', 3, 441800),
(2228, 445102, '湘桥区', 3, 445100),
(2229, 445121, '潮安县', 3, 445100),
(2230, 445122, '饶平县', 3, 445100),
(2231, 445202, '榕城区', 3, 445200),
(2232, 445221, '揭东县', 3, 445200),
(2233, 445222, '揭西县', 3, 445200),
(2234, 445224, '惠来县', 3, 445200),
(2235, 445281, '普宁市', 3, 445200),
(2236, 445302, '云城区', 3, 445300),
(2237, 445321, '新兴县', 3, 445300),
(2238, 445322, '郁南县', 3, 445300),
(2239, 445323, '云安县', 3, 445300),
(2240, 445381, '罗定市', 3, 445300),
(2241, 511113, '金口河区', 3, 511100),
(2242, 511123, '犍为县', 3, 511100),
(2243, 511124, '井研县', 3, 511100),
(2244, 511126, '夹江县', 3, 511100),
(2245, 511129, '沐川县', 3, 511100),
(2246, 511132, '峨边彝族自治县', 3, 511100),
(2247, 511133, '马边彝族自治县', 3, 511100),
(2248, 511181, '峨眉山市', 3, 511100),
(2249, 511302, '顺庆区', 3, 511300),
(2250, 511303, '高坪区', 3, 511300),
(2251, 511304, '嘉陵区', 3, 511300),
(2252, 511321, '南部县', 3, 511300),
(2253, 511322, '营山县', 3, 511300),
(2254, 511323, '蓬安县', 3, 511300),
(2255, 511324, '仪陇县', 3, 511300),
(2256, 511325, '西充县', 3, 511300),
(2257, 511381, '阆中市', 3, 511300),
(2258, 511402, '东坡区', 3, 511400),
(2259, 511421, '仁寿县', 3, 511400),
(2260, 511422, '彭山县', 3, 511400),
(2261, 511423, '洪雅县', 3, 511400),
(2262, 511424, '丹棱县', 3, 511400),
(2263, 511425, '青神县', 3, 511400),
(2264, 511502, '翠屏区', 3, 511500),
(2265, 511521, '宜宾县', 3, 511500),
(2266, 511522, '南溪县', 3, 511500),
(2267, 511523, '江安县', 3, 511500),
(2268, 511524, '长宁县', 3, 511500),
(2269, 511525, '高 县', 3, 511500),
(2270, 511526, '珙 县', 3, 511500),
(2271, 511527, '筠连县', 3, 511500),
(2272, 511528, '兴文县', 3, 511500),
(2273, 511529, '屏山县', 3, 511500),
(2274, 511602, '广安区', 3, 511600),
(2275, 511621, '岳池县', 3, 511600),
(2276, 511622, '武胜县', 3, 511600),
(2277, 511623, '邻水县', 3, 511600),
(2278, 511681, '华莹市', 3, 511600),
(2279, 511702, '通川区', 3, 511700),
(2280, 511721, '达 县', 3, 511700),
(2281, 511722, '宣汉县', 3, 511700),
(2282, 511723, '开江县', 3, 511700),
(2283, 511724, '大竹县', 3, 511700),
(2284, 511725, '渠 县', 3, 511700),
(2285, 511781, '万源市', 3, 511700),
(2286, 511802, '雨城区', 3, 511800),
(2287, 511821, '名山县', 3, 511800),
(2288, 511822, '荥经县', 3, 511800),
(2289, 511823, '汉源县', 3, 511800),
(2290, 511824, '石棉县', 3, 511800),
(2291, 511825, '天全县', 3, 511800),
(2292, 511826, '芦山县', 3, 511800),
(2293, 511827, '宝兴县', 3, 511800),
(2294, 511902, '巴州区', 3, 511900),
(2295, 511921, '通江县', 3, 511900),
(2296, 511922, '南江县', 3, 511900),
(2297, 511923, '平昌县', 3, 511900),
(2298, 512002, '雁江区', 3, 512000),
(2299, 512021, '安岳县', 3, 512000),
(2300, 512022, '乐至县', 3, 512000),
(2301, 512081, '简阳市', 3, 512000),
(2302, 513221, '汶川县', 3, 513200),
(2303, 513222, '理 县', 3, 513200),
(2304, 513223, '茂 县', 3, 513200),
(2305, 513224, '松潘县', 3, 513200),
(2306, 513225, '九寨沟县', 3, 513200),
(2307, 513226, '金川县', 3, 513200),
(2308, 513227, '小金县', 3, 513200),
(2309, 513228, '黑水县', 3, 513200),
(2310, 513229, '马尔康县', 3, 513200),
(2311, 513230, '壤塘县', 3, 513200),
(2312, 513231, '阿坝县', 3, 513200),
(2313, 513232, '若尔盖县', 3, 513200),
(2314, 513233, '红原县', 3, 513200),
(2315, 513321, '康定县', 3, 513300),
(2316, 513322, '泸定县', 3, 513300),
(2317, 513323, '丹巴县', 3, 513300),
(2318, 513324, '九龙县', 3, 513300),
(2319, 513325, '雅江县', 3, 513300),
(2320, 513326, '道孚县', 3, 513300),
(2321, 513327, '炉霍县', 3, 513300),
(2322, 513328, '甘孜县', 3, 513300),
(2323, 513329, '新龙县', 3, 513300),
(2324, 513330, '德格县', 3, 513300),
(2325, 513331, '白玉县', 3, 513300),
(2326, 513332, '石渠县', 3, 513300),
(2327, 513333, '色达县', 3, 513300),
(2328, 513334, '理塘县', 3, 513300),
(2329, 513335, '巴塘县', 3, 513300),
(2330, 513336, '乡城县', 3, 513300),
(2331, 513337, '稻城县', 3, 513300),
(2332, 513338, '得荣县', 3, 513300),
(2333, 513401, '西昌市', 3, 513400),
(2334, 513422, '木里藏族自治县', 3, 513400),
(2335, 513423, '盐源县', 3, 513400),
(2336, 513424, '德昌县', 3, 513400),
(2337, 513425, '会理县', 3, 513400),
(2338, 513426, '会东县', 3, 513400),
(2339, 513427, '宁南县', 3, 513400),
(2340, 513428, '普格县', 3, 513400),
(2341, 513429, '布拖县', 3, 513400),
(2342, 513430, '金阳县', 3, 513400),
(2343, 513431, '昭觉县', 3, 513400),
(2344, 513432, '喜德县', 3, 513400),
(2345, 513433, '冕宁县', 3, 513400),
(2346, 513434, '越西县', 3, 513400),
(2347, 513435, '甘洛县', 3, 513400),
(2348, 513436, '美姑县', 3, 513400),
(2349, 513437, '雷波县', 3, 513400),
(2350, 520102, '南明区', 3, 520100),
(2351, 520103, '云岩区', 3, 520100),
(2352, 520111, '花溪区', 3, 520100),
(2353, 520112, '乌当区', 3, 520100),
(2354, 520113, '白云区', 3, 520100),
(2355, 520114, '小河区', 3, 520100),
(2356, 520121, '开阳县', 3, 520100),
(2357, 520122, '息烽县', 3, 520100),
(2358, 520123, '修文县', 3, 520100),
(2359, 520181, '清镇市', 3, 520100),
(2360, 520201, '钟山区', 3, 520200),
(2361, 520203, '六枝特区', 3, 520200),
(2362, 520221, '水城县', 3, 520200),
(2363, 520222, '盘 县', 3, 520200),
(2364, 520302, '红花岗区', 3, 520300),
(2365, 520303, '汇川区', 3, 520300),
(2366, 520321, '遵义县', 3, 520300),
(2367, 520322, '桐梓县', 3, 520300),
(2368, 520323, '绥阳县', 3, 520300),
(2369, 520324, '正安县', 3, 520300),
(2370, 520325, '道真仡佬族苗族自治县', 3, 520300),
(2371, 520326, '务川仡佬族苗族自治县', 3, 520300),
(2372, 520327, '凤冈县', 3, 520300),
(2373, 520328, '湄潭县', 3, 520300),
(2374, 520329, '余庆县', 3, 520300),
(2375, 520330, '习水县', 3, 520300),
(2376, 520381, '赤水市', 3, 520300),
(2377, 520382, '仁怀市', 3, 520300),
(2378, 520402, '西秀区', 3, 520400),
(2379, 520421, '平坝县', 3, 520400),
(2380, 520422, '普定县', 3, 520400),
(2381, 520423, '镇宁布依族苗族自治县', 3, 520400),
(2382, 520424, '关岭布依族苗族自治县', 3, 520400),
(2383, 520425, '紫云苗族布依族自治县', 3, 520400),
(2384, 522201, '铜仁市', 3, 522200),
(2385, 522222, '江口县', 3, 522200),
(2386, 522223, '玉屏侗族自治县', 3, 522200),
(2387, 522224, '石阡县', 3, 522200),
(2388, 522225, '思南县', 3, 522200),
(2389, 522226, '印江土家族苗族自治县', 3, 522200),
(2390, 522227, '德江县', 3, 522200),
(2391, 522228, '沿河土家族自治县', 3, 522200),
(2392, 522229, '松桃苗族自治县', 3, 522200),
(2393, 522230, '万山特区', 3, 522200),
(2394, 522301, '兴义市', 3, 522300),
(2395, 522322, '兴仁县', 3, 522300),
(2396, 522323, '普安县', 3, 522300),
(2397, 522324, '晴隆县', 3, 522300),
(2398, 522325, '贞丰县', 3, 522300),
(2399, 522326, '望谟县', 3, 522300),
(2400, 522327, '册亨县', 3, 522300),
(2401, 522328, '安龙县', 3, 522300),
(2402, 522401, '毕节市', 3, 522400),
(2403, 522422, '大方县', 3, 522400),
(2404, 522423, '黔西县', 3, 522400),
(2405, 522424, '金沙县', 3, 522400),
(2406, 522425, '织金县', 3, 522400),
(2407, 522426, '纳雍县', 3, 522400),
(2408, 522427, '威宁彝族回族苗族自治县', 3, 522400),
(2409, 522428, '赫章县', 3, 522400),
(2410, 522601, '凯里市', 3, 522600),
(2411, 522622, '黄平县', 3, 522600),
(2412, 522623, '施秉县', 3, 522600),
(2413, 522624, '三穗县', 3, 522600),
(2414, 522625, '镇远县', 3, 522600),
(2415, 522626, '岑巩县', 3, 522600),
(2416, 522627, '天柱县', 3, 522600),
(2417, 522628, '锦屏县', 3, 522600),
(2418, 522629, '剑河县', 3, 522600),
(2419, 522630, '台江县', 3, 522600),
(2420, 522631, '黎平县', 3, 522600),
(2421, 522632, '榕江县', 3, 522600),
(2422, 522633, '从江县', 3, 522600),
(2423, 522634, '雷山县', 3, 522600),
(2424, 522635, '麻江县', 3, 522600),
(2425, 522636, '丹寨县', 3, 522600),
(2426, 522701, '都匀市', 3, 522700),
(2427, 522702, '福泉市', 3, 522700),
(2428, 522722, '荔波县', 3, 522700),
(2429, 522723, '贵定县', 3, 522700),
(2430, 522725, '瓮安县', 3, 522700),
(2431, 522726, '独山县', 3, 522700),
(2432, 522727, '平塘县', 3, 522700),
(2433, 522728, '罗甸县', 3, 522700),
(2434, 522729, '长顺县', 3, 522700),
(2435, 522730, '龙里县', 3, 522700),
(2436, 522731, '惠水县', 3, 522700),
(2437, 522732, '三都水族自治县', 3, 522700),
(2438, 530102, '五华区', 3, 530100),
(2439, 530103, '盘龙区', 3, 530100),
(2440, 530111, '官渡区', 3, 530100),
(2441, 530112, '西山区', 3, 530100),
(2442, 530113, '东川区', 3, 530100),
(2443, 530121, '呈贡县', 3, 530100),
(2444, 530122, '晋宁县', 3, 530100),
(2445, 530124, '富民县', 3, 530100),
(2446, 530125, '宜良县', 3, 530100),
(2447, 530126, '石林彝族自治县', 3, 530100),
(2448, 530127, '嵩明县', 3, 530100),
(2449, 530128, '禄劝彝族苗族自治县', 3, 530100),
(2450, 530129, '寻甸回族彝族自治县', 3, 530100),
(2451, 530181, '安宁市', 3, 530100),
(2452, 530302, '麒麟区', 3, 530300),
(2453, 530321, '马龙县', 3, 530300),
(2454, 530322, '陆良县', 3, 530300),
(2455, 530323, '师宗县', 3, 530300),
(2456, 530324, '罗平县', 3, 530300),
(2457, 530325, '富源县', 3, 530300),
(2458, 530326, '会泽县', 3, 530300),
(2459, 530328, '沾益县', 3, 530300),
(2460, 530381, '宣威市', 3, 530300),
(2461, 530402, '红塔区', 3, 530400),
(2462, 530421, '江川县', 3, 530400),
(2463, 530422, '澄江县', 3, 530400),
(2464, 530423, '通海县', 3, 530400),
(2465, 530424, '华宁县', 3, 530400),
(2466, 530425, '易门县', 3, 530400),
(2467, 530426, '峨山彝族自治县', 3, 530400),
(2468, 530427, '新平彝族傣族自治县', 3, 530400),
(2469, 530428, '元江哈尼族彝族傣族自治县', 3, 530400),
(2470, 530502, '隆阳区', 3, 530500),
(2471, 530521, '施甸县', 3, 530500),
(2472, 530522, '腾冲县', 3, 530500),
(2473, 530523, '龙陵县', 3, 530500),
(2474, 530524, '昌宁县', 3, 530500),
(2475, 530602, '昭阳区', 3, 530600),
(2476, 530621, '鲁甸县', 3, 530600),
(2477, 530622, '巧家县', 3, 530600),
(2478, 530623, '盐津县', 3, 530600),
(2479, 530624, '大关县', 3, 530600),
(2480, 530625, '永善县', 3, 530600),
(2481, 530626, '绥江县', 3, 530600),
(2482, 530627, '镇雄县', 3, 530600),
(2483, 530628, '彝良县', 3, 530600),
(2484, 530629, '威信县', 3, 530600),
(2485, 530630, '水富县', 3, 530600),
(2486, 530702, '古城区', 3, 530700),
(2487, 530721, '玉龙纳西族自治县', 3, 530700),
(2488, 530722, '永胜县', 3, 530700),
(2489, 530723, '华坪县', 3, 530700),
(2490, 530724, '宁蒗彝族自治县', 3, 530700),
(2491, 530802, '翠云区', 3, 530800),
(2492, 530821, '普洱哈尼族彝族自治县', 3, 530800),
(2493, 530822, '墨江哈尼族自治县', 3, 530800),
(2494, 530823, '景东彝族自治县', 3, 530800),
(2495, 530824, '景谷傣族彝族自治县', 3, 530800),
(2496, 530825, '镇沅彝族哈尼族拉祜族自治县', 3, 530800),
(2497, 530826, '江城哈尼族彝族自治县', 3, 530800),
(2498, 530827, '孟连傣族拉祜族佤族自治县', 3, 530800),
(2499, 530828, '澜沧拉祜族自治县', 3, 530800),
(2500, 530829, '西盟佤族自治县', 3, 530800),
(2501, 530902, '临翔区', 3, 530900),
(2502, 530921, '凤庆县', 3, 530900),
(2503, 530922, '云 县', 3, 530900),
(2504, 530923, '永德县', 3, 530900),
(2505, 530924, '镇康县', 3, 530900),
(2506, 530925, '双江拉祜族佤族布朗族傣族自治县', 3, 530900),
(2507, 530926, '耿马傣族佤族自治县', 3, 530900),
(2508, 530927, '沧源佤族自治县', 3, 530900),
(2509, 532301, '楚雄市', 3, 532300),
(2510, 532322, '双柏县', 3, 532300),
(2511, 532323, '牟定县', 3, 532300),
(2512, 532324, '南华县', 3, 532300),
(2513, 532325, '姚安县', 3, 532300),
(2514, 532326, '大姚县', 3, 532300),
(2515, 532327, '永仁县', 3, 532300),
(2516, 532328, '元谋县', 3, 532300),
(2517, 532329, '武定县', 3, 532300),
(2518, 532331, '禄丰县', 3, 532300),
(2519, 532501, '个旧市', 3, 532500),
(2520, 532502, '开远市', 3, 532500),
(2521, 532522, '蒙自县', 3, 532500),
(2522, 532523, '屏边苗族自治县', 3, 532500),
(2523, 532524, '建水县', 3, 532500),
(2524, 532525, '石屏县', 3, 532500),
(2525, 532526, '弥勒县', 3, 532500),
(2526, 532527, '泸西县', 3, 532500),
(2527, 532528, '元阳县', 3, 532500),
(2528, 532529, '红河县', 3, 532500),
(2529, 532530, '金平苗族瑶族傣族自治县', 3, 532500),
(2530, 532531, '绿春县', 3, 532500),
(2531, 532532, '河口瑶族自治县', 3, 532500),
(2532, 532621, '文山县', 3, 532600),
(2533, 532622, '砚山县', 3, 532600),
(2534, 532623, '西畴县', 3, 532600),
(2535, 532624, '麻栗坡县', 3, 532600),
(2536, 532625, '马关县', 3, 532600),
(2537, 532626, '丘北县', 3, 532600),
(2538, 532627, '广南县', 3, 532600),
(2539, 532628, '富宁县', 3, 532600),
(2540, 532801, '景洪市', 3, 532800),
(2541, 532822, '勐海县', 3, 532800),
(2542, 532823, '勐腊县', 3, 532800),
(2543, 532901, '大理市', 3, 532900),
(2544, 532922, '漾濞彝族自治县', 3, 532900),
(2545, 532923, '祥云县', 3, 532900),
(2546, 532924, '宾川县', 3, 532900),
(2547, 532925, '弥渡县', 3, 532900),
(2548, 532926, '南涧彝族自治县', 3, 532900),
(2549, 532927, '巍山彝族回族自治县', 3, 532900),
(2550, 532928, '永平县', 3, 532900),
(2551, 532929, '云龙县', 3, 532900),
(2552, 532930, '洱源县', 3, 532900),
(2553, 532931, '剑川县', 3, 532900),
(2554, 532932, '鹤庆县', 3, 532900),
(2555, 533102, '瑞丽市', 3, 533100),
(2556, 533103, '潞西市', 3, 533100),
(2557, 533122, '梁河县', 3, 533100),
(2558, 533123, '盈江县', 3, 533100),
(2559, 533124, '陇川县', 3, 533100),
(2560, 533321, '泸水县', 3, 533300),
(2561, 533323, '福贡县', 3, 533300),
(2562, 533324, '贡山独龙族怒族自治县', 3, 533300),
(2563, 533325, '兰坪白族普米族自治县', 3, 533300),
(2564, 533421, '香格里拉县', 3, 533400),
(2565, 533422, '德钦县', 3, 533400),
(2566, 533423, '维西傈僳族自治县', 3, 533400),
(2567, 540102, '城关区', 3, 540100),
(2568, 540121, '林周县', 3, 540100),
(2569, 540122, '当雄县', 3, 540100),
(2570, 540123, '尼木县', 3, 540100),
(2571, 540124, '曲水县', 3, 540100),
(2572, 540125, '堆龙德庆县', 3, 540100),
(2573, 540126, '达孜县', 3, 540100),
(2574, 540127, '墨竹工卡县', 3, 540100),
(2575, 542121, '昌都县', 3, 542100),
(2576, 542122, '江达县', 3, 542100),
(2577, 542123, '贡觉县', 3, 542100),
(2578, 542124, '类乌齐县', 3, 542100),
(2579, 542125, '丁青县', 3, 542100),
(2580, 542126, '察雅县', 3, 542100),
(2581, 542127, '八宿县', 3, 542100),
(2582, 542128, '左贡县', 3, 542100),
(2583, 542129, '芒康县', 3, 542100),
(2584, 542132, '洛隆县', 3, 542100),
(2585, 542133, '边坝县', 3, 542100),
(2586, 542221, '乃东县', 3, 542200),
(2587, 542222, '扎囊县', 3, 542200),
(2588, 542223, '贡嘎县', 3, 542200),
(2589, 542224, '桑日县', 3, 542200),
(2590, 542225, '琼结县', 3, 542200),
(2591, 542226, '曲松县', 3, 542200),
(2592, 542227, '措美县', 3, 542200),
(2593, 542228, '洛扎县', 3, 542200),
(2594, 542229, '加查县', 3, 542200),
(2595, 542231, '隆子县', 3, 542200),
(2596, 542232, '错那县', 3, 542200),
(2597, 542233, '浪卡子县', 3, 542200),
(2598, 542301, '日喀则市', 3, 542300),
(2599, 542322, '南木林县', 3, 542300),
(2600, 542323, '江孜县', 3, 542300),
(2601, 542324, '定日县', 3, 542300),
(2602, 542325, '萨迦县', 3, 542300),
(2603, 542326, '拉孜县', 3, 542300),
(2604, 542327, '昂仁县', 3, 542300),
(2605, 542328, '谢通门县', 3, 542300),
(2606, 542329, '白朗县', 3, 542300),
(2607, 542330, '仁布县', 3, 542300),
(2608, 542331, '康马县', 3, 542300),
(2609, 542332, '定结县', 3, 542300),
(2610, 542333, '仲巴县', 3, 542300),
(2611, 542334, '亚东县', 3, 542300),
(2612, 542335, '吉隆县', 3, 542300),
(2613, 542336, '聂拉木县', 3, 542300),
(2614, 542337, '萨嘎县', 3, 542300),
(2615, 542338, '岗巴县', 3, 542300),
(2616, 542421, '那曲县', 3, 542400),
(2617, 542422, '嘉黎县', 3, 542400),
(2618, 542423, '比如县', 3, 542400),
(2619, 542424, '聂荣县', 3, 542400),
(2620, 542425, '安多县', 3, 542400),
(2621, 542426, '申扎县', 3, 542400),
(2622, 542427, '索 县', 3, 542400),
(2623, 542428, '班戈县', 3, 542400),
(2624, 542429, '巴青县', 3, 542400),
(2625, 542430, '尼玛县', 3, 542400),
(2626, 542521, '普兰县', 3, 542500),
(2627, 542522, '札达县', 3, 542500),
(2628, 542523, '噶尔县', 3, 542500),
(2629, 542524, '日土县', 3, 542500),
(2630, 542525, '革吉县', 3, 542500),
(2631, 542526, '改则县', 3, 542500),
(2632, 542527, '措勤县', 3, 542500),
(2633, 542621, '林芝县', 3, 542600),
(2634, 542622, '工布江达县', 3, 542600),
(2635, 542623, '米林县', 3, 542600),
(2636, 542624, '墨脱县', 3, 542600),
(2637, 542625, '波密县', 3, 542600),
(2638, 542626, '察隅县', 3, 542600),
(2639, 542627, '朗 县', 3, 542600),
(2640, 610102, '新城区', 3, 610100),
(2641, 610103, '碑林区', 3, 610100),
(2642, 610104, '莲湖区', 3, 610100),
(2643, 610111, '灞桥区', 3, 610100),
(2644, 610112, '未央区', 3, 610100),
(2645, 610113, '雁塔区', 3, 610100),
(2646, 610114, '阎良区', 3, 610100),
(2647, 610115, '临潼区', 3, 610100),
(2648, 610116, '长安区', 3, 610100),
(2649, 610122, '蓝田县', 3, 610100),
(2650, 610124, '周至县', 3, 610100),
(2651, 610125, '户 县', 3, 610100),
(2652, 610126, '高陵县', 3, 610100),
(2653, 610202, '王益区', 3, 610200),
(2654, 610203, '印台区', 3, 610200),
(2655, 610204, '耀州区', 3, 610200),
(2656, 610222, '宜君县', 3, 610200),
(2657, 610302, '渭滨区', 3, 610300),
(2658, 610303, '金台区', 3, 610300),
(2659, 610304, '陈仓区', 3, 610300),
(2660, 610322, '凤翔县', 3, 610300),
(2661, 610323, '岐山县', 3, 610300),
(2662, 610324, '扶风县', 3, 610300),
(2663, 610326, '眉 县', 3, 610300),
(2664, 610327, '陇 县', 3, 610300),
(2665, 610328, '千阳县', 3, 610300),
(2666, 610329, '麟游县', 3, 610300),
(2667, 610330, '凤 县', 3, 610300),
(2668, 610331, '太白县', 3, 610300),
(2669, 610402, '秦都区', 3, 610400),
(2670, 610403, '杨凌区', 3, 610400),
(2671, 610404, '渭城区', 3, 610400),
(2672, 610422, '三原县', 3, 610400),
(2673, 610423, '泾阳县', 3, 610400),
(2674, 610424, '乾 县', 3, 610400),
(2675, 610425, '礼泉县', 3, 610400),
(2676, 610426, '永寿县', 3, 610400),
(2677, 610427, '彬 县', 3, 610400),
(2678, 610428, '长武县', 3, 610400),
(2679, 610429, '旬邑县', 3, 610400),
(2680, 610430, '淳化县', 3, 610400),
(2681, 610431, '武功县', 3, 610400),
(2682, 610481, '兴平市', 3, 610400),
(2683, 610502, '临渭区', 3, 610500),
(2684, 610521, '华 县', 3, 610500),
(2685, 610522, '潼关县', 3, 610500),
(2686, 610523, '大荔县', 3, 610500),
(2687, 610524, '合阳县', 3, 610500),
(2688, 610525, '澄城县', 3, 610500),
(2689, 610526, '蒲城县', 3, 610500),
(2690, 610527, '白水县', 3, 610500),
(2691, 610528, '富平县', 3, 610500),
(2692, 610581, '韩城市', 3, 610500),
(2693, 610582, '华阴市', 3, 610500),
(2694, 610602, '宝塔区', 3, 610600),
(2695, 610621, '延长县', 3, 610600),
(2696, 610622, '延川县', 3, 610600),
(2697, 610623, '子长县', 3, 610600),
(2698, 610624, '安塞县', 3, 610600),
(2699, 610625, '志丹县', 3, 610600),
(2700, 610626, '吴旗县', 3, 610600),
(2701, 610627, '甘泉县', 3, 610600),
(2702, 610628, '富 县', 3, 610600),
(2703, 610629, '洛川县', 3, 610600),
(2704, 610630, '宜川县', 3, 610600),
(2705, 610631, '黄龙县', 3, 610600),
(2706, 610632, '黄陵县', 3, 610600),
(2707, 610702, '汉台区', 3, 610700),
(2708, 610721, '南郑县', 3, 610700),
(2709, 610722, '城固县', 3, 610700),
(2710, 610723, '洋 县', 3, 610700),
(2711, 610724, '西乡县', 3, 610700),
(2712, 610725, '勉 县', 3, 610700),
(2713, 610726, '宁强县', 3, 610700),
(2714, 610727, '略阳县', 3, 610700),
(2715, 610728, '镇巴县', 3, 610700),
(2716, 610729, '留坝县', 3, 610700),
(2717, 610730, '佛坪县', 3, 610700),
(2718, 610802, '榆阳区', 3, 610800),
(2719, 610821, '神木县', 3, 610800),
(2720, 610822, '府谷县', 3, 610800),
(2721, 610823, '横山县', 3, 610800),
(2722, 610824, '靖边县', 3, 610800),
(2723, 610825, '定边县', 3, 610800),
(2724, 610826, '绥德县', 3, 610800),
(2725, 610827, '米脂县', 3, 610800),
(2726, 610828, '佳 县', 3, 610800),
(2727, 610829, '吴堡县', 3, 610800),
(2728, 610830, '清涧县', 3, 610800),
(2729, 610831, '子洲县', 3, 610800),
(2730, 610902, '汉滨区', 3, 610900),
(2731, 610921, '汉阴县', 3, 610900),
(2732, 610922, '石泉县', 3, 610900),
(2733, 610923, '宁陕县', 3, 610900),
(2734, 610924, '紫阳县', 3, 610900),
(2735, 610925, '岚皋县', 3, 610900),
(2736, 610926, '平利县', 3, 610900),
(2737, 610927, '镇坪县', 3, 610900),
(2738, 610928, '旬阳县', 3, 610900),
(2739, 610929, '白河县', 3, 610900),
(2740, 611002, '商州区', 3, 611000),
(2741, 611021, '洛南县', 3, 611000),
(2742, 611022, '丹凤县', 3, 611000),
(2743, 611023, '商南县', 3, 611000),
(2744, 611024, '山阳县', 3, 611000),
(2745, 611025, '镇安县', 3, 611000),
(2746, 611026, '柞水县', 3, 611000),
(2747, 620102, '城关区', 3, 620100),
(2748, 620103, '七里河区', 3, 620100),
(2749, 620104, '西固区', 3, 620100),
(2750, 620105, '安宁区', 3, 620100),
(2751, 620111, '红古区', 3, 620100),
(2752, 620121, '永登县', 3, 620100),
(2753, 620122, '皋兰县', 3, 620100),
(2754, 620123, '榆中县', 3, 620100),
(2755, 620302, '金川区', 3, 620300),
(2756, 620321, '永昌县', 3, 620300),
(2757, 620402, '白银区', 3, 620400),
(2758, 620403, '平川区', 3, 620400),
(2759, 620421, '靖远县', 3, 620400),
(2760, 620422, '会宁县', 3, 620400),
(2761, 620423, '景泰县', 3, 620400),
(2762, 620502, '秦城区', 3, 620500),
(2763, 620503, '北道区', 3, 620500),
(2764, 620521, '清水县', 3, 620500),
(2765, 620522, '秦安县', 3, 620500),
(2766, 620523, '甘谷县', 3, 620500),
(2767, 620524, '武山县', 3, 620500),
(2768, 620525, '张家川回族自治县', 3, 620500),
(2769, 620602, '凉州区', 3, 620600),
(2770, 620621, '民勤县', 3, 620600),
(2771, 620622, '古浪县', 3, 620600),
(2772, 620623, '天祝藏族自治县', 3, 620600),
(2773, 620702, '甘州区', 3, 620700),
(2774, 620721, '肃南裕固族自治县', 3, 620700),
(2775, 620722, '民乐县', 3, 620700),
(2776, 620723, '临泽县', 3, 620700),
(2777, 620724, '高台县', 3, 620700),
(2778, 620725, '山丹县', 3, 620700),
(2779, 620802, '崆峒区', 3, 620800),
(2780, 620821, '泾川县', 3, 620800),
(2781, 620822, '灵台县', 3, 620800),
(2782, 620823, '崇信县', 3, 620800),
(2783, 620824, '华亭县', 3, 620800),
(2784, 620825, '庄浪县', 3, 620800),
(2785, 620826, '静宁县', 3, 620800),
(2786, 620902, '肃州区', 3, 620900),
(2787, 620921, '金塔县', 3, 620900),
(2788, 620922, '安西县', 3, 620900),
(2789, 620923, '肃北蒙古族自治县', 3, 620900),
(2790, 620924, '阿克塞哈萨克族自治县', 3, 620900),
(2791, 620981, '玉门市', 3, 620900),
(2792, 620982, '敦煌市', 3, 620900),
(2793, 621002, '西峰区', 3, 621000),
(2794, 621021, '庆城县', 3, 621000),
(2795, 621022, '环 县', 3, 621000),
(2796, 621023, '华池县', 3, 621000),
(2797, 621024, '合水县', 3, 621000),
(2798, 621025, '正宁县', 3, 621000),
(2799, 621026, '宁 县', 3, 621000),
(2800, 621027, '镇原县', 3, 621000),
(2801, 621102, '安定区', 3, 621100),
(2802, 621121, '通渭县', 3, 621100),
(2803, 621122, '陇西县', 3, 621100),
(2804, 621123, '渭源县', 3, 621100),
(2805, 621124, '临洮县', 3, 621100),
(2806, 621125, '漳 县', 3, 621100),
(2807, 621126, '岷 县', 3, 621100),
(2808, 621202, '武都区', 3, 621200),
(2809, 621221, '成 县', 3, 621200),
(2810, 621222, '文 县', 3, 621200),
(2811, 621223, '宕昌县', 3, 621200),
(2812, 621224, '康 县', 3, 621200),
(2813, 621225, '西和县', 3, 621200),
(2814, 621226, '礼 县', 3, 621200),
(2815, 621227, '徽 县', 3, 621200),
(2816, 621228, '两当县', 3, 621200),
(2817, 622901, '临夏市', 3, 622900),
(2818, 622921, '临夏县', 3, 622900),
(2819, 622922, '康乐县', 3, 622900),
(2820, 622923, '永靖县', 3, 622900),
(2821, 622924, '广河县', 3, 622900),
(2822, 622925, '和政县', 3, 622900),
(2823, 622926, '东乡族自治县', 3, 622900),
(2824, 622927, '积石山保安族东乡族撒拉族自治县', 3, 622900),
(2825, 623001, '合作市', 3, 623000),
(2826, 623021, '临潭县', 3, 623000),
(2827, 623022, '卓尼县', 3, 623000),
(2828, 623023, '舟曲县', 3, 623000),
(2829, 623024, '迭部县', 3, 623000),
(2830, 623025, '玛曲县', 3, 623000),
(2831, 623026, '碌曲县', 3, 623000),
(2832, 623027, '夏河县', 3, 623000),
(2833, 630102, '城东区', 3, 630100),
(2834, 630103, '城中区', 3, 630100),
(2835, 630104, '城西区', 3, 630100),
(2836, 630105, '城北区', 3, 630100),
(2837, 630121, '大通回族土族自治县', 3, 630100),
(2838, 630122, '湟中县', 3, 630100),
(2839, 630123, '湟源县', 3, 630100),
(2840, 632121, '平安县', 3, 632100),
(2841, 632122, '民和回族土族自治县', 3, 632100),
(2842, 632123, '乐都县', 3, 632100),
(2843, 632126, '互助土族自治县', 3, 632100),
(2844, 632127, '化隆回族自治县', 3, 632100),
(2845, 632128, '循化撒拉族自治县', 3, 632100),
(2846, 632221, '门源回族自治县', 3, 632200),
(2847, 632222, '祁连县', 3, 632200),
(2848, 632223, '海晏县', 3, 632200),
(2849, 632224, '刚察县', 3, 632200),
(2850, 632321, '同仁县', 3, 632300),
(2851, 632322, '尖扎县', 3, 632300),
(2852, 632323, '泽库县', 3, 632300),
(2853, 632324, '河南蒙古族自治县', 3, 632300),
(2854, 632521, '共和县', 3, 632500),
(2855, 632522, '同德县', 3, 632500),
(2856, 632523, '贵德县', 3, 632500),
(2857, 632524, '兴海县', 3, 632500),
(2858, 632525, '贵南县', 3, 632500),
(2859, 632621, '玛沁县', 3, 632600),
(2860, 632622, '班玛县', 3, 632600),
(2861, 632623, '甘德县', 3, 632600),
(2862, 632624, '达日县', 3, 632600),
(2863, 632625, '久治县', 3, 632600),
(2864, 632626, '玛多县', 3, 632600),
(2865, 632721, '玉树县', 3, 632700),
(2866, 632722, '杂多县', 3, 632700),
(2867, 632723, '称多县', 3, 632700),
(2868, 632724, '治多县', 3, 632700),
(2869, 632725, '囊谦县', 3, 632700),
(2870, 632726, '曲麻莱县', 3, 632700),
(2871, 632801, '格尔木市', 3, 632800),
(2872, 632802, '德令哈市', 3, 632800),
(2873, 632821, '乌兰县', 3, 632800),
(2874, 632822, '都兰县', 3, 632800),
(2875, 632823, '天峻县', 3, 632800),
(2876, 640104, '兴庆区', 3, 640100),
(2877, 640105, '西夏区', 3, 640100),
(2878, 640106, '金凤区', 3, 640100),
(2879, 640121, '永宁县', 3, 640100),
(2880, 640122, '贺兰县', 3, 640100),
(2881, 640181, '灵武市', 3, 640100),
(2882, 640202, '大武口区', 3, 640200),
(2883, 640205, '惠农区', 3, 640200),
(2884, 640221, '平罗县', 3, 640200),
(2885, 640302, '利通区', 3, 640300),
(2886, 640323, '盐池县', 3, 640300),
(2887, 640324, '同心县', 3, 640300),
(2888, 640381, '青铜峡市', 3, 640300),
(2889, 640402, '原州区', 3, 640400),
(2890, 640422, '西吉县', 3, 640400),
(2891, 640423, '隆德县', 3, 640400),
(2892, 640424, '泾源县', 3, 640400),
(2893, 640425, '彭阳县', 3, 640400),
(2894, 640502, '沙坡头区', 3, 640500),
(2895, 640521, '中宁县', 3, 640500),
(2896, 640522, '海原县', 3, 640500),
(2897, 650102, '天山区', 3, 650100),
(2898, 650103, '沙依巴克区', 3, 650100),
(2899, 650104, '新市区', 3, 650100),
(2900, 650105, '水磨沟区', 3, 650100),
(2901, 650106, '头屯河区', 3, 650100),
(2902, 650107, '达坂城区', 3, 650100),
(2903, 650108, '东山区', 3, 650100),
(2904, 650121, '乌鲁木齐县', 3, 650100),
(2905, 650202, '独山子区', 3, 650200),
(2906, 650203, '克拉玛依区', 3, 650200),
(2907, 650204, '白碱滩区', 3, 650200),
(2908, 650205, '乌尔禾区', 3, 650200),
(2909, 652101, '吐鲁番市', 3, 652100),
(2910, 652122, '鄯善县', 3, 652100),
(2911, 652123, '托克逊县', 3, 652100),
(2912, 652201, '哈密市', 3, 652200),
(2913, 652222, '巴里坤哈萨克自治县', 3, 652200),
(2914, 652223, '伊吾县', 3, 652200),
(2915, 652301, '昌吉市', 3, 652300),
(2916, 652302, '阜康市', 3, 652300),
(2917, 652303, '米泉市', 3, 652300),
(2918, 652323, '呼图壁县', 3, 652300),
(2919, 652324, '玛纳斯县', 3, 652300),
(2920, 652325, '奇台县', 3, 652300),
(2921, 652327, '吉木萨尔县', 3, 652300),
(2922, 652328, '木垒哈萨克自治县', 3, 652300),
(2923, 652701, '博乐市', 3, 652700),
(2924, 652722, '精河县', 3, 652700),
(2925, 652723, '温泉县', 3, 652700),
(2926, 652801, '库尔勒市', 3, 652800),
(2927, 652822, '轮台县', 3, 652800),
(2928, 652823, '尉犁县', 3, 652800),
(2929, 652824, '若羌县', 3, 652800),
(2930, 652825, '且末县', 3, 652800),
(2931, 652826, '焉耆回族自治县', 3, 652800),
(2932, 652827, '和静县', 3, 652800),
(2933, 652828, '和硕县', 3, 652800),
(2934, 652829, '博湖县', 3, 652800),
(2935, 652901, '阿克苏市', 3, 652900),
(2936, 652922, '温宿县', 3, 652900),
(2937, 652923, '库车县', 3, 652900),
(2938, 652924, '沙雅县', 3, 652900),
(2939, 652925, '新和县', 3, 652900),
(2940, 652926, '拜城县', 3, 652900),
(2941, 652927, '乌什县', 3, 652900),
(2942, 652928, '阿瓦提县', 3, 652900),
(2943, 652929, '柯坪县', 3, 652900),
(2944, 653001, '阿图什市', 3, 653000),
(2945, 653022, '阿克陶县', 3, 653000),
(2946, 653023, '阿合奇县', 3, 653000),
(2947, 653024, '乌恰县', 3, 653000),
(2948, 653101, '喀什市', 3, 653100),
(2949, 653121, '疏附县', 3, 653100),
(2950, 653122, '疏勒县', 3, 653100),
(2951, 653123, '英吉沙县', 3, 653100),
(2952, 653124, '泽普县', 3, 653100),
(2953, 653125, '莎车县', 3, 653100),
(2954, 653126, '叶城县', 3, 653100),
(2955, 653127, '麦盖提县', 3, 653100),
(2956, 653128, '岳普湖县', 3, 653100),
(2957, 653129, '伽师县', 3, 653100),
(2958, 653130, '巴楚县', 3, 653100),
(2959, 653131, '塔什库尔干塔吉克自治县', 3, 653100),
(2960, 653201, '和田市', 3, 653200),
(2961, 653221, '和田县', 3, 653200),
(2962, 653222, '墨玉县', 3, 653200),
(2963, 653223, '皮山县', 3, 653200),
(2964, 653224, '洛浦县', 3, 653200),
(2965, 653225, '策勒县', 3, 653200),
(2966, 653226, '于田县', 3, 653200),
(2967, 653227, '民丰县', 3, 653200),
(2968, 654002, '伊宁市', 3, 654000),
(2969, 654003, '奎屯市', 3, 654000),
(2970, 654021, '伊宁县', 3, 654000),
(2971, 654022, '察布查尔锡伯自治县', 3, 654000),
(2972, 654023, '霍城县', 3, 654000),
(2973, 654024, '巩留县', 3, 654000),
(2974, 654025, '新源县', 3, 654000),
(2975, 654026, '昭苏县', 3, 654000),
(2976, 654027, '特克斯县', 3, 654000),
(2977, 654028, '尼勒克县', 3, 654000),
(2978, 654201, '塔城市', 3, 654200),
(2979, 654202, '乌苏市', 3, 654200),
(2980, 654221, '额敏县', 3, 654200),
(2981, 654223, '沙湾县', 3, 654200),
(2982, 654224, '托里县', 3, 654200),
(2983, 654225, '裕民县', 3, 654200),
(2984, 654226, '和布克赛尔蒙古自治县', 3, 654200),
(2985, 654301, '阿勒泰市', 3, 654300),
(2986, 654321, '布尔津县', 3, 654300),
(2987, 654322, '富蕴县', 3, 654300),
(2988, 654323, '福海县', 3, 654300),
(2989, 654324, '哈巴河县', 3, 654300),
(2990, 654325, '青河县', 3, 654300),
(2991, 654326, '吉木乃县', 3, 654300),
(2992, 659001, '石河子市', 3, 659000),
(2993, 659002, '阿拉尔市', 3, 659000),
(2994, 659003, '图木舒克市', 3, 659000),
(2995, 659004, '五家渠市', 3, 659000),
(2996, 450102, '兴宁区', 3, 450100),
(2997, 450103, '青秀区', 3, 450100),
(2998, 450105, '江南区', 3, 450100),
(2999, 450107, '西乡塘区', 3, 450100),
(3000, 450108, '良庆区', 3, 450100),
(3001, 450109, '邕宁区', 3, 450100),
(3002, 450122, '武鸣县', 3, 450100),
(3003, 450123, '隆安县', 3, 450100),
(3004, 450124, '马山县', 3, 450100),
(3005, 450125, '上林县', 3, 450100),
(3006, 450126, '宾阳县', 3, 450100),
(3007, 450127, '横 县', 3, 450100),
(3008, 450202, '城中区', 3, 450200),
(3009, 450203, '鱼峰区', 3, 450200),
(3010, 450204, '柳南区', 3, 450200),
(3011, 450205, '柳北区', 3, 450200),
(3012, 450221, '柳江县', 3, 450200),
(3013, 450222, '柳城县', 3, 450200),
(3014, 450223, '鹿寨县', 3, 450200),
(3015, 450224, '融安县', 3, 450200),
(3016, 450225, '融水苗族自治县', 3, 450200),
(3017, 450226, '三江侗族自治县', 3, 450200),
(3018, 450302, '秀峰区', 3, 450300),
(3019, 450303, '叠彩区', 3, 450300),
(3020, 450304, '象山区', 3, 450300),
(3021, 450305, '七星区', 3, 450300),
(3022, 450311, '雁山区', 3, 450300),
(3023, 450321, '阳朔县', 3, 450300),
(3024, 450322, '临桂县', 3, 450300),
(3025, 450323, '灵川县', 3, 450300),
(3026, 450324, '全州县', 3, 450300),
(3027, 450325, '兴安县', 3, 450300),
(3028, 450326, '永福县', 3, 450300),
(3029, 450327, '灌阳县', 3, 450300),
(3030, 450328, '龙胜各族自治县', 3, 450300),
(3031, 450329, '资源县', 3, 450300),
(3032, 450330, '平乐县', 3, 450300),
(3033, 450331, '荔蒲县', 3, 450300),
(3034, 450332, '恭城瑶族自治县', 3, 450300),
(3035, 450403, '万秀区', 3, 450400),
(3036, 450404, '蝶山区', 3, 450400),
(3037, 450405, '长洲区', 3, 450400),
(3038, 450421, '苍梧县', 3, 450400),
(3039, 450422, '藤 县', 3, 450400),
(3040, 450423, '蒙山县', 3, 450400),
(3041, 450481, '岑溪市', 3, 450400),
(3042, 450502, '海城区', 3, 450500),
(3043, 450503, '银海区', 3, 450500),
(3044, 450512, '铁山港区', 3, 450500),
(3045, 450521, '合浦县', 3, 450500),
(3046, 450602, '港口区', 3, 450600),
(3047, 450603, '防城区', 3, 450600),
(3048, 450621, '上思县', 3, 450600),
(3049, 450681, '东兴市', 3, 450600),
(3050, 450702, '钦南区', 3, 450700),
(3051, 450703, '钦北区', 3, 450700),
(3052, 450721, '灵山县', 3, 450700),
(3053, 450722, '浦北县', 3, 450700),
(3054, 450802, '港北区', 3, 450800),
(3055, 450803, '港南区', 3, 450800),
(3056, 450804, '覃塘区', 3, 450800),
(3057, 450821, '平南县', 3, 450800),
(3058, 450881, '桂平市', 3, 450800),
(3059, 450902, '玉州区', 3, 450900),
(3060, 450921, '容 县', 3, 450900),
(3061, 450922, '陆川县', 3, 450900),
(3062, 450923, '博白县', 3, 450900),
(3063, 450924, '兴业县', 3, 450900),
(3064, 450981, '北流市', 3, 450900),
(3065, 451002, '右江区', 3, 451000),
(3066, 451021, '田阳县', 3, 451000),
(3067, 451022, '田东县', 3, 451000),
(3068, 451023, '平果县', 3, 451000),
(3069, 451024, '德保县', 3, 451000),
(3070, 451025, '靖西县', 3, 451000),
(3071, 451026, '那坡县', 3, 451000),
(3072, 451027, '凌云县', 3, 451000),
(3073, 451028, '乐业县', 3, 451000),
(3074, 451029, '田林县', 3, 451000),
(3075, 451030, '西林县', 3, 451000),
(3076, 451031, '隆林各族自治县', 3, 451000),
(3077, 451102, '八步区', 3, 451100),
(3078, 451121, '昭平县', 3, 451100),
(3079, 451122, '钟山县', 3, 451100),
(3080, 451123, '富川瑶族自治县', 3, 451100),
(3081, 451202, '金城江区', 3, 451200),
(3082, 451221, '南丹县', 3, 451200),
(3083, 451222, '天峨县', 3, 451200),
(3084, 451223, '凤山县', 3, 451200),
(3085, 451224, '东兰县', 3, 451200),
(3086, 451225, '罗城仫佬族自治县', 3, 451200),
(3087, 451226, '环江毛南族自治县', 3, 451200),
(3088, 451227, '巴马瑶族自治县', 3, 451200),
(3089, 451228, '都安瑶族自治县', 3, 451200),
(3090, 451229, '大化瑶族自治县', 3, 451200),
(3091, 451281, '宜州市', 3, 451200),
(3092, 451302, '兴宾区', 3, 451300),
(3093, 451321, '忻城县', 3, 451300),
(3094, 451322, '象州县', 3, 451300),
(3095, 451323, '武宣县', 3, 451300),
(3096, 451324, '金秀瑶族自治县', 3, 451300),
(3097, 451381, '合山市', 3, 451300),
(3098, 451402, '江洲区', 3, 451400),
(3099, 451421, '扶绥县', 3, 451400),
(3100, 451422, '宁明县', 3, 451400),
(3101, 451423, '龙州县', 3, 451400),
(3102, 451424, '大新县', 3, 451400),
(3103, 451425, '天等县', 3, 451400),
(3104, 451481, '凭祥市', 3, 451400),
(3105, 460105, '秀英区', 3, 460100),
(3106, 460106, '龙华区', 3, 460100),
(3107, 460107, '琼山区', 3, 460100),
(3108, 460108, '美兰区', 3, 460100),
(3109, 469001, '五指山市', 3, 469000),
(3110, 469002, '琼海市', 3, 469000),
(3111, 469003, '儋州市', 3, 469000),
(3112, 469005, '文昌市', 3, 469000),
(3113, 469006, '万宁市', 3, 469000),
(3114, 469007, '东方市', 3, 469000),
(3115, 469025, '定安县', 3, 469000),
(3116, 469026, '屯昌县', 3, 469000),
(3117, 469027, '澄迈县', 3, 469000),
(3118, 469028, '临高县', 3, 469000),
(3119, 469030, '白沙黎族自治县', 3, 469000),
(3120, 469031, '昌江黎族自治县', 3, 469000),
(3121, 469033, '乐东黎族自治县', 3, 469000),
(3122, 469034, '陵水黎族自治县', 3, 469000),
(3123, 469035, '保亭黎族苗族自治县', 3, 469000),
(3124, 469036, '琼中黎族苗族自治县', 3, 469000),
(3125, 469037, '西沙群岛', 3, 469000),
(3126, 469038, '南沙群岛', 3, 469000),
(3127, 469039, '中沙群岛的岛礁及其海域', 3, 469000),
(3128, 500101, '万州区', 3, 500100),
(3129, 500102, '涪陵区', 3, 500100),
(3130, 500103, '渝中区', 3, 500100),
(3131, 500104, '大渡口区', 3, 500100),
(3132, 500105, '江北区', 3, 500100),
(3133, 500106, '沙坪坝区', 3, 500100),
(3134, 500107, '九龙坡区', 3, 500100),
(3135, 500108, '南岸区', 3, 500100),
(3136, 500109, '北碚区', 3, 500100),
(3137, 500110, '万盛区', 3, 500100),
(3138, 500111, '双桥区', 3, 500100),
(3139, 500112, '渝北区', 3, 500100),
(3140, 500113, '巴南区', 3, 500100),
(3141, 500114, '黔江区', 3, 500100),
(3142, 500115, '长寿区', 3, 500100),
(3143, 500222, '綦江县', 3, 500100),
(3144, 500223, '潼南县', 3, 500100),
(3145, 500224, '铜梁县', 3, 500100),
(3146, 500225, '大足县', 3, 500100),
(3147, 500226, '荣昌县', 3, 500100),
(3148, 500227, '璧山县', 3, 500100),
(3149, 500228, '梁平县', 3, 500100),
(3150, 500229, '城口县', 3, 500100),
(3151, 500230, '丰都县', 3, 500100),
(3152, 500231, '垫江县', 3, 500100),
(3153, 500232, '武隆县', 3, 500100),
(3154, 500233, '忠 县', 3, 500100),
(3155, 500234, '开 县', 3, 500100),
(3156, 500235, '云阳县', 3, 500100),
(3157, 500236, '奉节县', 3, 500100),
(3158, 500237, '巫山县', 3, 500100),
(3159, 500238, '巫溪县', 3, 500100),
(3160, 500240, '石柱土家族自治县', 3, 500100),
(3161, 500241, '秀山土家族苗族自治县', 3, 500100),
(3162, 500242, '酉阳土家族苗族自治县', 3, 500100),
(3163, 500243, '彭水苗族土家族自治县', 3, 500100),
(3164, 500381, '江津市', 3, 500100),
(3165, 500382, '合川市', 3, 500100),
(3166, 500383, '永川市', 3, 500100),
(3167, 500384, '南川市', 3, 500100),
(3168, 510104, '锦江区', 3, 510100),
(3169, 510105, '青羊区', 3, 510100),
(3170, 510106, '金牛区', 3, 510100),
(3171, 510107, '武侯区', 3, 510100),
(3172, 510108, '成华区', 3, 510100),
(3173, 510112, '龙泉驿区', 3, 510100),
(3174, 510113, '青白江区', 3, 510100),
(3175, 510114, '新都区', 3, 510100),
(3176, 510115, '温江区', 3, 510100),
(3177, 510121, '金堂县', 3, 510100),
(3178, 510122, '双流县', 3, 510100),
(3179, 510124, '郫 县', 3, 510100),
(3180, 510129, '大邑县', 3, 510100),
(3181, 510131, '蒲江县', 3, 510100),
(3182, 510132, '新津县', 3, 510100),
(3183, 510181, '都江堰市', 3, 510100),
(3184, 510182, '彭州市', 3, 510100),
(3185, 510183, '邛崃市', 3, 510100),
(3186, 510184, '崇州市', 3, 510100),
(3187, 510302, '自流井区', 3, 510300),
(3188, 510303, '贡井区', 3, 510300),
(3189, 510304, '大安区', 3, 510300),
(3190, 510311, '沿滩区', 3, 510300),
(3191, 510321, '荣 县', 3, 510300),
(3192, 510322, '富顺县', 3, 510300),
(3193, 510402, '东 区', 3, 510400),
(3194, 510403, '西 区', 3, 510400),
(3195, 510411, '仁和区', 3, 510400),
(3196, 510421, '米易县', 3, 510400),
(3197, 510422, '盐边县', 3, 510400),
(3198, 510502, '江阳区', 3, 510500),
(3199, 510503, '纳溪区', 3, 510500),
(3200, 510504, '龙马潭区', 3, 510500),
(3201, 510521, '泸 县', 3, 510500),
(3202, 510522, '合江县', 3, 510500),
(3203, 510524, '叙永县', 3, 510500),
(3204, 510525, '古蔺县', 3, 510500),
(3205, 510603, '旌阳区', 3, 510600),
(3206, 510623, '中江县', 3, 510600),
(3207, 510626, '罗江县', 3, 510600),
(3208, 510681, '广汉市', 3, 510600),
(3209, 510682, '什邡市', 3, 510600),
(3210, 510683, '绵竹市', 3, 510600),
(3211, 510703, '涪城区', 3, 510700),
(3212, 510704, '游仙区', 3, 510700),
(3213, 510722, '三台县', 3, 510700),
(3214, 510723, '盐亭县', 3, 510700),
(3215, 510724, '安 县', 3, 510700),
(3216, 510725, '梓潼县', 3, 510700),
(3217, 510726, '北川羌族自治县', 3, 510700),
(3218, 510727, '平武县', 3, 510700),
(3219, 510781, '江油市', 3, 510700),
(3220, 510802, '市中区', 3, 510800),
(3221, 510811, '元坝区', 3, 510800),
(3222, 510812, '朝天区', 3, 510800),
(3223, 510821, '旺苍县', 3, 510800),
(3224, 510822, '青川县', 3, 510800),
(3225, 510823, '剑阁县', 3, 510800),
(3226, 510824, '苍溪县', 3, 510800),
(3227, 510903, '船山区', 3, 510900),
(3228, 510904, '安居区', 3, 510900),
(3229, 510921, '蓬溪县', 3, 510900),
(3230, 510922, '射洪县', 3, 510900),
(3231, 510923, '大英县', 3, 510900),
(3232, 511002, '市中区', 3, 511000),
(3233, 511011, '东兴区', 3, 511000),
(3234, 511024, '威远县', 3, 511000),
(3235, 511025, '资中县', 3, 511000),
(3236, 511028, '隆昌县', 3, 511000),
(3237, 511102, '市中区', 3, 511100),
(3238, 511111, '沙湾区', 3, 511100),
(3239, 511112, '五通桥区', 3, 511100),
(3240, 440309, '龙华新区', 3, 440300),
(3241, 440310, '光明新区', 3, 440300),
(3242, 440311, '坪山新区', 3, 440312),
(3243, 440308, '大鹏新区', 3, 440300),
(3244, 710001, '台湾省', 2, 710000),
(3245, 810001, '香港特别行政区', 2, 810000),
(3246, 820001, '澳门特别行政区', 2, 820000);
| caoxudong/springboot-demo | src/test/resources/data.sql | SQL | bsd-3-clause | 243,996 |
<?php
/**
* contentinum - accessibility websites
*
* LICENSE
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category contentinum backend
* @package Controller
* @author Michael Jochum, michael.jochum@jochum-mediaservices.de
* @copyright Copyright (c) 2009-2013 jochum-mediaservices, Katja Jochum (http://www.jochum-mediaservices.de)
* @license http://www.opensource.org/licenses/bsd-license
* @since contentinum version 5.0
* @link https://github.com/Mikel1961/contentinum-components
* @version 1.0.0
*/
namespace Mcwork\Controller;
use ContentinumComponents\Controller\AbstractMcworkController;
use Zend\View\Model\ViewModel;
use ContentinumComponents\Storage\StorageManager;
/**
* form controller backend add a data record in database
*
* @author Michael Jochum, michael.jochum@jochum-mediaservices.de
*/
class FsUploadController extends AbstractMcworkController
{
public function application($pageOptions, $defaultRole = null, $acl = null)
{
$view = new ViewModel(array('error' => 'Application not found or incorrect parameter' ));
$view->setTemplate('content/response/json');
return $view;
}
public function process($pageOptions, $defaultRole, $acl)
{
if (! isset($_FILES['fileUpload'])) {
$view = new ViewModel(array('error' => 'no_file_specified' ));
$view->setTemplate('content/response/json');
return $view;
} else {
$uploadedFile = $_FILES['fileUpload'];
}
try {
$datas = $this->getRequest()->getPost();
$this->worker->setStorage(new StorageManager());
$this->worker->setMediaAttributeFields($this->getMcParameter('media_attribute_fields', 'Medias'));
$ret = $this->worker->singleUpload($uploadedFile, $datas['newname']);
$model = $this->worker->getParameter('model');
$entity = $this->worker->getParameter('entity');
if (false === $this->worker->getNotNew()){
$save = new $model($this->getServiceLocator()->get('doctrine.entitymanager.orm_default'));
$this->worker->addInsert('resource', 'memberresource');
$save->save($this->worker->preparedInsert($datas->toArray())
->emptyInserts(), new $entity());
} else {
$this->worker->emptyInserts();
}
$view = $view = new ViewModel(array('return' => $ret));
$view->setTemplate($pageOptions->template);
return $view;
} catch (\Exception $e ){
$view = new ViewModel(array('error' => 'Application error during upload' ));
$view->setTemplate('content/response/json');
return $view;
}
}
} | Mikel1961/contentinum.5.1 | module/Mcwork/src/Mcwork/Controller/FsUploadController.php | PHP | bsd-3-clause | 3,604 |
import pytest
from django.db import connection, IntegrityError
from .models import MyTree
def flush_constraints():
# the default db setup is to have constraints DEFERRED.
# So IntegrityErrors only happen when the transaction commits.
# Django's testcase thing does eventually flush the constraints but to
# actually test it *within* a testcase we have to flush it manually.
connection.cursor().execute("SET CONSTRAINTS ALL IMMEDIATE")
def test_node_creation_simple(db):
MyTree.objects.create(label='root1')
MyTree.objects.create(label='root2')
def test_node_creation_with_no_label(db):
# You need a label
with pytest.raises(ValueError):
MyTree.objects.create(label='')
with pytest.raises(ValueError):
MyTree.objects.create(label=None)
with pytest.raises(ValueError):
MyTree.objects.create()
def test_root_node_already_exists(db):
MyTree.objects.create(label='root1')
with pytest.raises(IntegrityError):
MyTree.objects.create(label='root1')
def test_same_label_but_different_parent(db):
root1 = MyTree.objects.create(label='root1')
MyTree.objects.create(label='root1', parent=root1)
def test_same_label_as_sibling(db):
root1 = MyTree.objects.create(label='root1')
MyTree.objects.create(label='child', parent=root1)
with pytest.raises(IntegrityError):
MyTree.objects.create(label='child', parent=root1)
def test_parent_is_self_errors(db):
root1 = MyTree.objects.create(label='root1')
root1.parent = root1
with pytest.raises(IntegrityError):
root1.save()
flush_constraints()
def test_parent_is_remote_ancestor_errors(db):
root1 = MyTree.objects.create(label='root1')
child2 = MyTree.objects.create(label='child2', parent=root1)
desc3 = MyTree.objects.create(label='desc3', parent=child2)
with pytest.raises(IntegrityError):
# To test this integrity error, have to update table without calling save()
# (because save() changes `ltree` to match `parent_id`)
MyTree.objects.filter(pk=desc3.pk).update(parent=root1)
flush_constraints()
def test_parent_is_descendant_errors(db):
root1 = MyTree.objects.create(label='root1')
child2 = MyTree.objects.create(label='child2', parent=root1)
desc3 = MyTree.objects.create(label='desc3', parent=child2)
child2.parent = desc3
with pytest.raises(IntegrityError):
child2.save()
flush_constraints()
| craigds/django-mpathy | tests/test_db_consistency.py | Python | bsd-3-clause | 2,474 |
package prefuse.util;
import java.util.ArrayList;
import prefuse.data.Graph;
import prefuse.data.Node;
import prefuse.data.Schema;
import prefuse.data.Tree;
/**
* Library routines for creating various Graph structures. All Graphs
* generated by methods of this class include a String-valued
* "label" field.
*
* @author <a href="http://jheer.org">jeffrey heer</a>
*/
public class GraphLib {
private GraphLib() {
// prevent instantiation
}
// ------------------------------------------------------------------------
// Graph Creation Routines
/**
* Builds a completely unconnected (edge-free) graph with the given
* number of nodes
* @param n the number of nodes
* @return a graph with n nodes and no edges
*/
public static Graph getNodes(int n) {
Graph g = new Graph();
g.getNodeTable().addColumns(LABEL_SCHEMA);
for ( int i=0; i < n; i++ ) {
Node node = g.addNode();
node.setString(LABEL, String.valueOf(i));
}
return g;
}
/**
* Builds a "star" graph with one central hub connected to the given
* number of satellite nodes.
* @param n the number of points of the star
* @return a "star" graph with n points, for a total of n+1 nodes
*/
public static Graph getStar(int n) {
Graph g = new Graph();
g.getNodeTable().addColumns(LABEL_SCHEMA);
Node r = g.addNode();
r.setString(LABEL, "0");
for ( int i=1; i <= n; ++i ) {
Node nn = g.addNode();
nn.setString(LABEL, String.valueOf(i));
g.addEdge(r, nn);
}
return g;
}
/**
* Returns a clique of given size. A clique is a graph in which every node
* is a neighbor of every other node.
* @param n the number of nodes in the graph
* @return a clique of size n
*/
public static Graph getClique(int n) {
Graph g = new Graph();
g.getNodeTable().addColumns(LABEL_SCHEMA);
Node nodes[] = new Node[n];
for ( int i = 0; i < n; ++i ) {
nodes[i] = g.addNode();
nodes[i].setString(LABEL, String.valueOf(i));
}
for ( int i = 0; i < n; ++i ) {
for ( int j = i; j < n; ++j )
if ( i != j )
g.addEdge(nodes[i], nodes[j]);
}
return g;
}
/**
* Returns a graph structured as an m-by-n grid.
* @param m the number of rows of the grid
* @param n the number of columns of the grid
* @return an m-by-n grid structured graph
*/
public static Graph getGrid(int m, int n) {
Graph g = new Graph();
g.getNodeTable().addColumns(LABEL_SCHEMA);
Node[] nodes = new Node[m*n];
for ( int i = 0; i < m*n; ++i ) {
nodes[i] = g.addNode();
nodes[i].setString(LABEL, String.valueOf(i));
if ( i >= n )
g.addEdge(nodes[i-n], nodes[i]);
if ( i % n != 0 )
g.addEdge(nodes[i-1], nodes[i]);
}
return g;
}
public static Graph getHoneycomb(int levels) {
Graph g = new Graph();
g.getNodeTable().addColumns(LABEL_SCHEMA);
ArrayList<Node> layer1 = halfcomb(g, levels);
ArrayList<Node> layer2 = halfcomb(g, levels);
for ( int i=0; i<(levels<<1); ++i ) {
Node n1 = layer1.get(i);
Node n2 = layer2.get(i);
g.addEdge(n1, n2);
}
return g;
}
private static ArrayList<Node> halfcomb(Graph g, int levels) {
ArrayList<Node> top = new ArrayList<Node>();
ArrayList<Node> layer = new ArrayList<Node>();
int label = 0;
for ( int i=0; i<levels; ++i ) {
Node n = g.addNode();
n.setString(LABEL, String.valueOf(label++));
top.add(n);
}
for ( int i=0; i<levels; ++i ) {
Node n = null;
for ( int j=0; j<top.size(); ++j ) {
Node p = top.get(j);
if ( n == null ) {
n = g.addNode();
n.setString(LABEL, String.valueOf(label++));
layer.add(n);
}
g.addEdge(p, n);
n = g.addNode();
n.setString(LABEL, String.valueOf(label++));
layer.add(n);
g.addEdge(p, n);
}
if ( i == levels-1 ) {
return layer;
}
top.clear();
for ( int j=0; j<layer.size(); ++j ) {
Node p = layer.get(j);
n = g.addNode();
n.setString(LABEL, String.valueOf(label++));
top.add(n);
g.addEdge(p, n);
}
layer.clear();
}
// should never happen
return top;
}
/**
* Returns a balanced tree of the requested breadth and depth.
* @param breadth the breadth of each level of the tree
* @param depth the depth of the tree
* @return a balanced tree
*/
public static Tree getBalancedTree(int breadth, int depth) {
Tree t = new Tree();
t.getNodeTable().addColumns(LABEL_SCHEMA);
Node r = t.addRoot();
r.setString(LABEL, "0,0");
if ( depth > 0 )
balancedHelper(t, r, breadth, depth-1);
return t;
}
private static void balancedHelper(Tree t, Node n,
int breadth, int depth)
{
for ( int i=0; i<breadth; ++i ) {
Node c = t.addChild(n);
c.setString(LABEL, i+","+c.getDepth());
if ( depth > 0 )
balancedHelper(t,c,breadth,depth-1);
}
}
/**
* Returns a left deep binary tree
* @param depth the depth of the tree
* @return the generated tree
*/
public static Tree getLeftDeepTree(int depth) {
Tree t = new Tree();
t.getNodeTable().addColumns(LABEL_SCHEMA);
Node r = t.addRoot();
r.setString(LABEL, "0,0");
deepHelper(t, r, 2, depth, true);
return t;
}
/**
* Returns a right deep binary tree
* @param depth the depth of the tree
* @return the generated Tree
*/
public static Tree getRightDeepTree(int depth) {
Tree t = new Tree();
t.getNodeTable().addColumns(LABEL_SCHEMA);
Node r = t.addRoot();
r.setString(LABEL, "0,0");
deepHelper(t, r, 2, depth, false);
return t;
}
/**
* Create a diamond tree, with a given branching factor at
* each level, and depth levels for the two main branches.
* @param b the number of children of each branch node
* @param d1 the length of the first (left) branch
* @param d2 the length of the second (right) branch
* @return the generated Tree
*/
public static Tree getDiamondTree(int b, int d1, int d2) {
Tree t = new Tree();
t.getNodeTable().addColumns(LABEL_SCHEMA);
Node r = t.addRoot();
r.setString(LABEL, "0,0");
Node left = t.addChild(r);
left.setString(LABEL, "1,0");
Node right = t.addChild(r);
right.setString(LABEL, "1,1");
deepHelper(t, left, b, d1-2, true);
deepHelper(t, right, b, d1-2, false);
while ( left.getFirstChild() != null )
left = left.getFirstChild();
while ( right.getLastChild() != null )
right = right.getLastChild();
deepHelper(t, left, b, d2-1, false);
deepHelper(t, right, b, d2-1, true);
return t;
}
private static void deepHelper(Tree t, Node n,
int breadth, int depth, boolean left)
{
Node c = t.addChild(n);
c.setString(LABEL, "0,"+c.getDepth());
if ( left && depth > 0 )
deepHelper(t, c, breadth, depth-1, left);
for ( int i=1; i<breadth; ++i ) {
c = t.addChild(n);
c.setString(LABEL, i+","+c.getDepth());
}
if ( !left && depth > 0 )
deepHelper(t, c, breadth, depth-1, left);
}
// ------------------------------------------------------------------------
/** Label data field included in generated Graphs */
public static final String LABEL = "label";
/** Node table schema used for generated Graphs */
public static final Schema LABEL_SCHEMA = new Schema();
static {
LABEL_SCHEMA.addColumn(LABEL, String.class, "");
}
} // end of class GraphLib
| dritanlatifi/AndroidPrefuse | src/prefuse/util/GraphLib.java | Java | bsd-3-clause | 8,814 |
/* ___ _ ___ _ _ *\
** / __| |/ (_) | | Your SKilL scala Binding **
** \__ \ ' <| | | |__ generated: 01.02.2019 **
** |___/_|\_\_|_|____| by: feldentm **
\* */
package de.ust.skill.sir.api.internal
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.ListBuffer
import scala.collection.mutable.HashMap
import scala.collection.mutable.HashSet
import scala.collection.mutable.WrappedArray
import java.nio.BufferUnderflowException
import java.nio.MappedByteBuffer
import java.util.Arrays
import de.ust.skill.common.jvm.streams.MappedInStream
import de.ust.skill.common.jvm.streams.MappedOutStream
import de.ust.skill.common.scala.api.PoolSizeMissmatchError
import de.ust.skill.common.scala.api.RestrictionCheckFailed
import de.ust.skill.common.scala.api.SkillObject
import de.ust.skill.common.scala.internal.AutoField
import de.ust.skill.common.scala.internal.BulkChunk
import de.ust.skill.common.scala.internal.Chunk
import de.ust.skill.common.scala.internal.DistributedField
import de.ust.skill.common.scala.internal.IgnoredField
import de.ust.skill.common.scala.internal.FieldDeclaration
import de.ust.skill.common.scala.internal.KnownField
import de.ust.skill.common.scala.internal.LazyField
import de.ust.skill.common.scala.internal.SimpleChunk
import de.ust.skill.common.scala.internal.SingletonStoragePool
import de.ust.skill.common.scala.internal.fieldTypes._
import de.ust.skill.common.scala.internal.restrictions._
/**
* comment FieldLike.comment
*/
final class F_FieldLike_comment(
_index : Int,
_owner : FieldLikePool,
_type : FieldType[_root_.de.ust.skill.sir.Comment])
extends FieldDeclaration[_root_.de.ust.skill.sir.Comment,_root_.de.ust.skill.sir.FieldLike](_type,
"comment",
_index,
_owner)
with KnownField[_root_.de.ust.skill.sir.Comment,_root_.de.ust.skill.sir.FieldLike] {
override def createKnownRestrictions : Unit = {
}
override def read(part : MappedInStream, target : Chunk) {
val d = owner.data
val in = part.view(target.begin.toInt, target.end.toInt)
val t = this.t.asInstanceOf[CommentPool]
try {
target match {
case c : SimpleChunk ⇒
var i = c.bpo.toInt
val high = i + c.count
while (i != high) {
d(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment = t.read(in).asInstanceOf[_root_.de.ust.skill.sir.Comment]
i += 1
}
case bci : BulkChunk ⇒
val blocks = owner.blocks
var blockIndex = 0
while (blockIndex < bci.blockCount) {
val b = blocks(blockIndex)
blockIndex += 1
var i = b.bpo
val end = i + b.dynamicCount
while (i != end) {
d(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment = t.read(in).asInstanceOf[_root_.de.ust.skill.sir.Comment]
i += 1
}
}
}
} catch {
case e : BufferUnderflowException ⇒
throw new PoolSizeMissmatchError(dataChunks.size - 1,
part.position() + target.begin,
part.position() + target.end,
this, in.position())
}
if(!in.eof())
throw new PoolSizeMissmatchError(dataChunks.size - 1,
part.position() + target.begin,
part.position() + target.end,
this, in.position())
}
def offset: Unit = {
val data = owner.data
var result = 0L
dataChunks.last match {
case c : SimpleChunk ⇒
var i = c.bpo.toInt
val high = i + c.count
while (i != high) {
val v = data(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment
result += (if (null == v) 1 else V64.offset(v.getSkillID))
i += 1
}
case bci : BulkChunk ⇒
val blocks = owner.blocks
var blockIndex = 0
while (blockIndex < bci.blockCount) {
val b = blocks(blockIndex)
blockIndex += 1
var i = b.bpo
val end = i + b.dynamicCount
while (i != end) {
val v = data(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment
result += (if (null == v) 1 else V64.offset(v.getSkillID))
i += 1
}
}
}
cachedOffset = result
}
def write(out: MappedOutStream): Unit = {
val data = owner.data
dataChunks.last match {
case c : SimpleChunk ⇒
var i = c.bpo.toInt
val high = i + c.count
while (i != high) {
val v = data(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment
if (null == v) out.i8(0) else out.v64(v.getSkillID)
i += 1
}
case bci : BulkChunk ⇒
val blocks = owner.blocks
var blockIndex = 0
while (blockIndex < bci.blockCount) {
val b = blocks(blockIndex)
blockIndex += 1
var i = b.bpo
val end = i + b.dynamicCount
while (i != end) {
val v = data(i).asInstanceOf[_root_.de.ust.skill.sir.FieldLike].Internal_comment
if (null == v) out.i8(0) else out.v64(v.getSkillID)
i += 1
}
}
}
}
// note: reflective field access will raise exception for ignored fields
override def getR(i : SkillObject) : _root_.de.ust.skill.sir.Comment = i.asInstanceOf[_root_.de.ust.skill.sir.FieldLike].comment
override def setR(i : SkillObject, v : _root_.de.ust.skill.sir.Comment) {
i.asInstanceOf[_root_.de.ust.skill.sir.FieldLike].comment = v.asInstanceOf[_root_.de.ust.skill.sir.Comment]
}
}
| skill-lang/skill | src/main/scala/de/ust/skill/sir/api/internal/F_FieldLike_comment.scala | Scala | bsd-3-clause | 6,085 |
<?php
use yii\helpers\Html;
use yii\web\ForbiddenHttpException;
/* @var $this yii\web\View */
/* @var $model app\models\Requirement */
if($isAdmin){
$this->title = 'Create Requirement';
$this->params['breadcrumbs'][] = ['label' => 'Requirements', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="requirement-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>
<?php } else throw new ForbiddenHttpException('You are not allowed to access this page.'); ?> | bulletsoul/it210app | views/requirement/create.php | PHP | bsd-3-clause | 583 |
Spree::Location.class_eval do
has_one :neighbors_settings, class_name: "Spree::NeighborsSettings"
accepts_nested_attributes_for :neighbors_settings, :allow_destroy => true
#Fields for the geocoder gem
reverse_geocoded_by :latitude, :longitude
#after_validation :reverse_geocode
after_save :set_default_neighbors_settings
def set_default_neighbors_settings
unless self.neighbors_settings
Spree::NeighborsSettings.create_settings_for(self)
end
end
def neighbors_ids_by_distance
settings = self.neighbors_settings
return [] if settings.nil?
return [] if settings.radius == 0
nearby_items = Spree::Location.where(locatable_type: self.locatable_type)
nearby_items = nearby_items.where.not(id: self.id)
nearby_items = nearby_items.near([self.latitude, self.longitude], settings.radius)
#nearby_items = nearby_items.limit(settings.count)
nearby_items = nearby_items.map(&:id)
nearby_items
end
def neighbors_ids_by_choice
settings = self.neighbors_settings
return [] if settings.nil?
neighbors_ids = Spree::Neighbors.where(neighbors_settings_id: settings.id)
#neighbots_ids = neighbors_ids.limit(settings.count)
neighbors_ids = neighbors_ids.pluck(:location_id)
neighbors_ids
end
def neighbors_ids_by_property
settings = self.neighbors_settings
return nil if settings.nil?
return nil if settings.neighbors_by_property.nil?
return nil if settings.neighbors_by_property.property_id == 0
pp = Spree::ProductProperty.where(property_id: settings.neighbors_by_property.property_id)
pp = pp.where(value: settings.neighbors_by_property.value) if settings.neighbors_by_property.value.present?
neighbors_ids = pp.map { |p| p.product.location.id rescue nil }.compact
neighbors_ids
end
end
| openjaf/spree_neighbors | app/models/spree/location_decorator.rb | Ruby | bsd-3-clause | 1,808 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from markitup import settings
from markitup.markup import filter_func
from markitup.sanitize import sanitize_html
def apply_filter(request):
cleaned_data = sanitize_html(request.POST.get('data', ''), strip=True)
markup = filter_func(cleaned_data)
return render_to_response( 'markitup/preview.html',
{'preview': markup},
context_instance=RequestContext(request))
| thoslin/django-markitup | markitup/views.py | Python | bsd-3-clause | 527 |
/* $NetBSD: grfabs_reg.h,v 1.11 1998/12/20 14:32:53 thomas Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
* Copyright (c) 1994 Christian E. Hopps
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christian E. Hopps.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _GRFABS_REG_H
#define _GRFABS_REG_H
struct point {
long x;
long y;
};
typedef struct point point_t;
struct dimension {
u_long width;
u_long height;
};
typedef struct dimension dimen_t;
struct box {
long x;
long y;
u_long width;
u_long height;
};
typedef struct box box_t;
struct rectangle {
long left;
long top;
long right;
long bottom;
};
typedef struct rectangle rect_t;
typedef struct bitmap bmap_t;
typedef struct colormap colormap_t;
typedef struct display_mode dmode_t;
/*
* View stuff.
*/
struct view {
bmap_t *bitmap; /* bitmap. */
box_t display; /* viewable area. */
dmode_t *mode; /* the mode for this view */
colormap_t *colormap; /* the colormap for this view */
int flags;
void *save_area; /* Save frame-buffer when not on screen */
};
typedef struct view view_t;
/* View-flags: */
#define VF_DISPLAY 1 /* view is on the air now */
/*
* Bitmap stuff.
*/
struct bitmap {
u_short bytes_per_row; /* number of bytes per display row. */
u_short rows; /* number of display rows. */
u_short depth; /* depth of bitmap. */
u_char *plane; /* plane data for bitmap/vga. */
u_char *hw_address; /* mappable linear bitplane pointer. */
u_char *vga_address; /* mappable vga bitplane pointer */
u_char *regs; /* where the registers are */
u_char *hw_regs; /* mappable registers */
u_short reg_size; /* size of the register area */
u_int phys_mappable; /* amount of mappable lin. plane mem. */
u_int vga_mappable; /* amount of mappable vga plane mem. */
u_int lin_base; /* linear framebuffer card base */
u_int vga_base; /* vga memory card base */
};
/*
* Colormap stuff.
*/
struct colormap {
u_char type; /* what type of entries these are. */
union {
u_char grey; /* CM_GREYSCALE */
struct { /* CM_COLOR */
u_char red;
u_char green;
u_char blue;
} rgb_mask;
} valid_mask;
u_short first; /* color register entry[0] refers to */
u_short size; /* number of entries */
u_long *entry; /* the table of actual color values */
};
/*
* Mask short-hands
*/
#define grey_mask valid_mask.grey
#define red_mask valid_mask.rgb_mask.red
#define green_mask valid_mask.rgb_mask.green
#define blue_mask valid_mask.rgb_mask.blue
enum colormap_type {
CM_MONO, /* only on or off allowed */
CM_GREYSCALE, /* grey values */
CM_COLOR /* RGB values */
};
#define MAX_CENTRIES 256 /* that all there is */
/*
* Create a colormap entry
*/
#define MAKE_COLOR_ENTRY(r,g,b) (((r & 0xff)<<16)|((g & 0xff)<<8)|(b & 0xff))
#define MAKE_MONO_ENTRY(x) ((x) ? 1 : 0)
#define MAKE_GREY_ENTRY(l) (l & 0xff)
struct grfabs_sw {
void (*display_view) __P((view_t*));
view_t * (*alloc_view) __P((dmode_t *, dimen_t *, u_char));
void (*free_view) __P((view_t *));
void (*remove_view) __P((view_t *));
void (*save_view) __P((view_t *));
int (*use_colormap) __P((view_t *, colormap_t *));
};
/* display mode */
struct display_mode {
LIST_ENTRY(display_mode) link;
u_char *name; /* logical name for mode. */
dimen_t size; /* screen size */
u_char depth; /* screen depth */
void *data; /* opaque driver data */
struct grfabs_sw *grfabs_funcs; /* hardware switch table */
view_t *current_view; /* view displaying me */
};
/*
* Definition of available graphic mode list.
*/
typedef LIST_HEAD(modelist, display_mode) MODES;
/*
* Misc draw related macros.
*/
#define INIT_BOX(b,xx,yy,ww,hh) \
do { \
(b)->x = xx; \
(b)->y = yy; \
(b)->width = ww; \
(b)->height = hh; \
} while(0)
/*
* Prototype for the probe function
*/
typedef void (*grf_probe_t) __P((MODES *));
/*
* Common variables
*/
extern view_t gra_con_view;
extern colormap_t gra_con_cmap;
extern long gra_con_colors[MAX_CENTRIES];
extern u_long gra_def_color16[16];
/*
* Prototypes:
*/
int grfabs_probe __P((grf_probe_t));
view_t *grf_alloc_view __P((dmode_t *d, dimen_t *dim, u_char depth));
dmode_t *grf_get_best_mode __P((dimen_t *dim, u_char depth));
void grf_display_view __P((view_t *v));
void grf_remove_view __P((view_t *v));
void grf_free_view __P((view_t *v));
int grf_get_colormap __P((view_t *, colormap_t *));
int grf_use_colormap __P((view_t *, colormap_t *));
void grf_save_view __P((view_t *v));
#endif /* _GRFABS_REG_H */
| MarginC/kame | netbsd/sys/arch/atari/dev/grfabs_reg.h | C | bsd-3-clause | 6,243 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/base/video_frame.h"
#include <algorithm>
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/aligned_memory.h"
#include "base/string_piece.h"
#include "media/base/limits.h"
#include "media/base/video_util.h"
namespace media {
// static
scoped_refptr<VideoFrame> VideoFrame::CreateFrame(
VideoFrame::Format format,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
base::TimeDelta timestamp) {
DCHECK(IsValidConfig(format, coded_size, visible_rect, natural_size));
scoped_refptr<VideoFrame> frame(new VideoFrame(
format, coded_size, visible_rect, natural_size, timestamp));
switch (format) {
case VideoFrame::RGB32:
frame->AllocateRGB(4u);
break;
case VideoFrame::YV12:
case VideoFrame::YV16:
frame->AllocateYUV();
break;
default:
LOG(FATAL) << "Unsupported frame format: " << format;
}
return frame;
}
// static
bool VideoFrame::IsValidConfig(VideoFrame::Format format,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size) {
return (format != VideoFrame::INVALID &&
!coded_size.IsEmpty() &&
coded_size.GetArea() <= limits::kMaxCanvas &&
coded_size.width() <= limits::kMaxDimension &&
coded_size.height() <= limits::kMaxDimension &&
!visible_rect.IsEmpty() &&
visible_rect.x() >= 0 && visible_rect.y() >= 0 &&
visible_rect.right() <= coded_size.width() &&
visible_rect.bottom() <= coded_size.height() &&
!natural_size.IsEmpty() &&
natural_size.GetArea() <= limits::kMaxCanvas &&
natural_size.width() <= limits::kMaxDimension &&
natural_size.height() <= limits::kMaxDimension);
}
// static
scoped_refptr<VideoFrame> VideoFrame::WrapNativeTexture(
uint32 texture_id,
uint32 texture_target,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
base::TimeDelta timestamp,
const ReadPixelsCB& read_pixels_cb,
const base::Closure& no_longer_needed_cb) {
scoped_refptr<VideoFrame> frame(new VideoFrame(
NATIVE_TEXTURE, coded_size, visible_rect, natural_size, timestamp));
frame->texture_id_ = texture_id;
frame->texture_target_ = texture_target;
frame->read_pixels_cb_ = read_pixels_cb;
frame->no_longer_needed_cb_ = no_longer_needed_cb;
return frame;
}
void VideoFrame::ReadPixelsFromNativeTexture(void* pixels) {
DCHECK_EQ(format_, NATIVE_TEXTURE);
if (!read_pixels_cb_.is_null())
read_pixels_cb_.Run(pixels);
}
// static
scoped_refptr<VideoFrame> VideoFrame::WrapExternalYuvData(
Format format,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
int32 y_stride, int32 u_stride, int32 v_stride,
uint8* y_data, uint8* u_data, uint8* v_data,
base::TimeDelta timestamp,
const base::Closure& no_longer_needed_cb) {
DCHECK(format == YV12 || format == YV16 || format == I420) << format;
scoped_refptr<VideoFrame> frame(new VideoFrame(
format, coded_size, visible_rect, natural_size, timestamp));
frame->strides_[kYPlane] = y_stride;
frame->strides_[kUPlane] = u_stride;
frame->strides_[kVPlane] = v_stride;
frame->data_[kYPlane] = y_data;
frame->data_[kUPlane] = u_data;
frame->data_[kVPlane] = v_data;
frame->no_longer_needed_cb_ = no_longer_needed_cb;
return frame;
}
// static
scoped_refptr<VideoFrame> VideoFrame::CreateEmptyFrame() {
return new VideoFrame(
VideoFrame::EMPTY, gfx::Size(), gfx::Rect(), gfx::Size(),
base::TimeDelta());
}
// static
scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame(
const gfx::Size& size,
uint8 y, uint8 u, uint8 v,
base::TimeDelta timestamp) {
DCHECK(IsValidConfig(VideoFrame::YV12, size, gfx::Rect(size), size));
scoped_refptr<VideoFrame> frame = VideoFrame::CreateFrame(
VideoFrame::YV12, size, gfx::Rect(size), size, timestamp);
FillYUV(frame, y, u, v);
return frame;
}
// static
scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) {
const uint8 kBlackY = 0x00;
const uint8 kBlackUV = 0x80;
const base::TimeDelta kZero;
return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero);
}
#if defined(GOOGLE_TV)
// This block and other blocks wrapped around #if defined(GOOGLE_TV) is not
// maintained by the general compositor team. Please contact the following
// people instead:
//
// wonsik@chromium.org
// ycheo@chromium.org
// static
scoped_refptr<VideoFrame> VideoFrame::CreateHoleFrame(
const gfx::Size& size) {
DCHECK(IsValidConfig(VideoFrame::HOLE, size, gfx::Rect(size), size));
scoped_refptr<VideoFrame> frame(new VideoFrame(
VideoFrame::HOLE, size, gfx::Rect(size), size, base::TimeDelta()));
return frame;
}
#endif
// static
size_t VideoFrame::NumPlanes(Format format) {
switch (format) {
case VideoFrame::NATIVE_TEXTURE:
#if defined(GOOGLE_TV)
case VideoFrame::HOLE:
#endif
return 0;
case VideoFrame::RGB32:
return 1;
case VideoFrame::YV12:
case VideoFrame::YV16:
return 3;
case VideoFrame::EMPTY:
case VideoFrame::I420:
case VideoFrame::INVALID:
break;
}
NOTREACHED() << "Unsupported video frame format: " << format;
return 0;
}
static inline size_t RoundUp(size_t value, size_t alignment) {
// Check that |alignment| is a power of 2.
DCHECK((alignment + (alignment - 1)) == (alignment | (alignment - 1)));
return ((value + (alignment - 1)) & ~(alignment-1));
}
// Release data allocated by AllocateRGB() or AllocateYUV().
static void ReleaseData(uint8* data) {
DCHECK(data);
base::AlignedFree(data);
}
void VideoFrame::AllocateRGB(size_t bytes_per_pixel) {
// Round up to align at least at a 16-byte boundary for each row.
// This is sufficient for MMX and SSE2 reads (movq/movdqa).
size_t bytes_per_row = RoundUp(coded_size_.width(),
kFrameSizeAlignment) * bytes_per_pixel;
size_t aligned_height = RoundUp(coded_size_.height(), kFrameSizeAlignment);
strides_[VideoFrame::kRGBPlane] = bytes_per_row;
data_[VideoFrame::kRGBPlane] = reinterpret_cast<uint8*>(
base::AlignedAlloc(bytes_per_row * aligned_height + kFrameSizePadding,
kFrameAddressAlignment));
no_longer_needed_cb_ = base::Bind(&ReleaseData, data_[VideoFrame::kRGBPlane]);
DCHECK(!(reinterpret_cast<intptr_t>(data_[VideoFrame::kRGBPlane]) & 7));
COMPILE_ASSERT(0 == VideoFrame::kRGBPlane, RGB_data_must_be_index_0);
}
void VideoFrame::AllocateYUV() {
DCHECK(format_ == VideoFrame::YV12 || format_ == VideoFrame::YV16);
// Align Y rows at least at 16 byte boundaries. The stride for both
// YV12 and YV16 is 1/2 of the stride of Y. For YV12, every row of bytes for
// U and V applies to two rows of Y (one byte of UV for 4 bytes of Y), so in
// the case of YV12 the strides are identical for the same width surface, but
// the number of bytes allocated for YV12 is 1/2 the amount for U & V as
// YV16. We also round the height of the surface allocated to be an even
// number to avoid any potential of faulting by code that attempts to access
// the Y values of the final row, but assumes that the last row of U & V
// applies to a full two rows of Y.
size_t y_stride = RoundUp(row_bytes(VideoFrame::kYPlane),
kFrameSizeAlignment);
size_t uv_stride = RoundUp(row_bytes(VideoFrame::kUPlane),
kFrameSizeAlignment);
// The *2 here is because some formats (e.g. h264) allow interlaced coding,
// and then the size needs to be a multiple of two macroblocks (vertically).
// See libavcodec/utils.c:avcodec_align_dimensions2().
size_t y_height = RoundUp(coded_size_.height(), kFrameSizeAlignment * 2);
size_t uv_height = format_ == VideoFrame::YV12 ? y_height / 2 : y_height;
size_t y_bytes = y_height * y_stride;
size_t uv_bytes = uv_height * uv_stride;
// The extra line of UV being allocated is because h264 chroma MC
// overreads by one line in some cases, see libavcodec/utils.c:
// avcodec_align_dimensions2() and libavcodec/x86/h264_chromamc.asm:
// put_h264_chroma_mc4_ssse3().
uint8* data = reinterpret_cast<uint8*>(
base::AlignedAlloc(
y_bytes + (uv_bytes * 2 + uv_stride) + kFrameSizePadding,
kFrameAddressAlignment));
no_longer_needed_cb_ = base::Bind(&ReleaseData, data);
COMPILE_ASSERT(0 == VideoFrame::kYPlane, y_plane_data_must_be_index_0);
data_[VideoFrame::kYPlane] = data;
data_[VideoFrame::kUPlane] = data + y_bytes;
data_[VideoFrame::kVPlane] = data + y_bytes + uv_bytes;
strides_[VideoFrame::kYPlane] = y_stride;
strides_[VideoFrame::kUPlane] = uv_stride;
strides_[VideoFrame::kVPlane] = uv_stride;
}
VideoFrame::VideoFrame(VideoFrame::Format format,
const gfx::Size& coded_size,
const gfx::Rect& visible_rect,
const gfx::Size& natural_size,
base::TimeDelta timestamp)
: format_(format),
coded_size_(coded_size),
visible_rect_(visible_rect),
natural_size_(natural_size),
texture_id_(0),
texture_target_(0),
timestamp_(timestamp) {
memset(&strides_, 0, sizeof(strides_));
memset(&data_, 0, sizeof(data_));
}
VideoFrame::~VideoFrame() {
if (!no_longer_needed_cb_.is_null())
base::ResetAndReturn(&no_longer_needed_cb_).Run();
}
bool VideoFrame::IsValidPlane(size_t plane) const {
return (plane < NumPlanes(format_));
}
int VideoFrame::stride(size_t plane) const {
DCHECK(IsValidPlane(plane));
return strides_[plane];
}
int VideoFrame::row_bytes(size_t plane) const {
DCHECK(IsValidPlane(plane));
int width = coded_size_.width();
switch (format_) {
// 32bpp.
case RGB32:
return width * 4;
// Planar, 8bpp.
case YV12:
case YV16:
if (plane == kYPlane)
return width;
return RoundUp(width, 2) / 2;
default:
break;
}
// Intentionally leave out non-production formats.
NOTREACHED() << "Unsupported video frame format: " << format_;
return 0;
}
int VideoFrame::rows(size_t plane) const {
DCHECK(IsValidPlane(plane));
int height = coded_size_.height();
switch (format_) {
case RGB32:
case YV16:
return height;
case YV12:
if (plane == kYPlane)
return height;
return RoundUp(height, 2) / 2;
default:
break;
}
// Intentionally leave out non-production formats.
NOTREACHED() << "Unsupported video frame format: " << format_;
return 0;
}
uint8* VideoFrame::data(size_t plane) const {
DCHECK(IsValidPlane(plane));
return data_[plane];
}
uint32 VideoFrame::texture_id() const {
DCHECK_EQ(format_, NATIVE_TEXTURE);
return texture_id_;
}
uint32 VideoFrame::texture_target() const {
DCHECK_EQ(format_, NATIVE_TEXTURE);
return texture_target_;
}
bool VideoFrame::IsEndOfStream() const {
return format_ == VideoFrame::EMPTY;
}
void VideoFrame::HashFrameForTesting(base::MD5Context* context) {
for (int plane = 0; plane < kMaxPlanes; ++plane) {
if (!IsValidPlane(plane))
break;
for (int row = 0; row < rows(plane); ++row) {
base::MD5Update(context, base::StringPiece(
reinterpret_cast<char*>(data(plane) + stride(plane) * row),
row_bytes(plane)));
}
}
}
} // namespace media
| timopulkkinen/BubbleFish | media/base/video_frame.cc | C++ | bsd-3-clause | 11,760 |
package org.broadinstitute.hellbender.tools.picard.sam;
import htsjdk.samtools.*;
import htsjdk.samtools.util.CloserUtil;
import org.broadinstitute.hellbender.CommandLineProgramTest;
import org.broadinstitute.hellbender.exceptions.GATKException;
import org.broadinstitute.hellbender.exceptions.UserException;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.io.File;
import java.util.*;
public class RevertSamIntegrationTest extends CommandLineProgramTest {
private static final File TEST_DATA_DIR = getTestDataDir();
public static final File basicSamToRevert = new File(TEST_DATA_DIR, "revert_sam_basic.sam");
public static final File negativeTestSamToRevert = new File(TEST_DATA_DIR, "revert_sam_negative.sam");
private static final String revertedQualities =
"11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
private static final String unmappedRead = "both_reads_present_only_first_aligns/2";
public String getCommandLineProgramName() {
return RevertSam.class.getSimpleName();
}
@Test(dataProvider="positiveTestData")
public void basicPositiveTests(final SAMFileHeader.SortOrder so, final boolean removeDuplicates, final boolean removeAlignmentInfo,
final boolean restoreOriginalQualities, final String sample, final String library,
final List<String> attributesToClear) throws Exception {
final File output = File.createTempFile("reverted", ".sam");
final RevertSam reverter = new RevertSam();
final List<String> args = new ArrayList<>();
args.add("--INPUT");
args.add(basicSamToRevert.getAbsolutePath());
args.add("--OUTPUT");
args.add(output.getAbsolutePath());
if (so != null) {
args.add("--SORT_ORDER");
args.add(so.name());
}
args.add("--REMOVE_DUPLICATE_INFORMATION");
args.add(Boolean.toString(removeDuplicates));
args.add("--REMOVE_ALIGNMENT_INFORMATION");
args.add(Boolean.toString(removeAlignmentInfo));
args.add("--RESTORE_ORIGINAL_QUALITIES");
args.add(Boolean.toString(restoreOriginalQualities));
if (sample != null) {
args.add("--SAMPLE_ALIAS");
args.add(sample);
}
if (library != null) {
args.add("--LIBRARY_NAME");
args.add(library);
}
for (final String attr : attributesToClear) {
args.add("--ATTRIBUTE_TO_CLEAR");
args.add(attr);
}
runCommandLine(args);
final SamReader reader = SamReaderFactory.makeDefault().open(output);
final SAMFileHeader header = reader.getFileHeader();
Assert.assertEquals(header.getSortOrder(), SAMFileHeader.SortOrder.queryname);
Assert.assertEquals(header.getProgramRecords().size(), removeAlignmentInfo ? 0 : 1);
for (final SAMReadGroupRecord rg : header.getReadGroups()) {
if (sample != null) {
Assert.assertEquals(rg.getSample(), sample);
}
else {
Assert.assertEquals(rg.getSample(), "Hi,Mom!");
}
if (library != null) {
Assert.assertEquals(rg.getLibrary(), library);
}
else {
Assert.assertEquals(rg.getLibrary(), "my-library");
}
}
for (final SAMRecord rec : reader) {
if (removeDuplicates) {
Assert.assertFalse(rec.getDuplicateReadFlag(),
"Duplicates should have been removed: " + rec.getReadName());
}
if (removeAlignmentInfo) {
Assert.assertTrue(rec.getReadUnmappedFlag(),
"Alignment info should have been removed: " + rec.getReadName());
}
if (restoreOriginalQualities && !unmappedRead.equals(
rec.getReadName() + "/" + (rec.getFirstOfPairFlag() ? "1" : "2"))) {
Assert.assertEquals(rec.getBaseQualityString(), revertedQualities);
} else {
Assert.assertNotSame(rec.getBaseQualityString(), revertedQualities);
}
for (final SAMRecord.SAMTagAndValue attr : rec.getAttributes()) {
if (removeAlignmentInfo || (!attr.tag.equals("PG") && !attr.tag.equals("NM")
&& !attr.tag.equals("MQ"))) {
Assert.assertFalse(reverter.ATTRIBUTE_TO_CLEAR.contains(attr.tag),
attr.tag + " should have been cleared.");
}
}
}
CloserUtil.close(reader);
}
@DataProvider(name="positiveTestData")
public Object[][] getPostitiveTestData() {
return new Object[][] {
{null, true, true, true, null, null, Collections.EMPTY_LIST},
{SAMFileHeader.SortOrder.queryname, true, true, true, "Hey,Dad!", null, Arrays.asList("XT")},
{null, false, true, false, "Hey,Dad!", "NewLibraryName", Arrays.asList("XT")},
{null, false, false, false, null, null, Collections.EMPTY_LIST}
};
}
@Test(dataProvider="negativeTestData", expectedExceptions = {UserException.class, GATKException.class})
public void basicNegativeTest(final String sample, final String library) throws Exception {
final File output = File.createTempFile("bad", ".sam");
final RevertSam reverter = new RevertSam();
final List<String> args = new ArrayList<>();
args.add("--INPUT");
args.add(negativeTestSamToRevert.getAbsolutePath());
args.add("--OUTPUT");
args.add(output.getAbsolutePath());
if (sample != null) {
args.add("--SAMPLE_ALIAS");
args.add(sample);
}
if (library != null) {
args.add("--LIBRARY_NAME");
args.add(library);
}
runCommandLine(args);
Assert.fail("Negative test should have thrown an exception and didn't");
}
@DataProvider(name="negativeTestData")
public Object[][] getNegativeTestData() {
return new Object[][] {
{"NewSample", null},
{null, "NewLibrary"},
{"NewSample", "NewLibrary"}
};
}
}
| tomwhite/hellbender | src/test/java/org/broadinstitute/hellbender/tools/picard/sam/RevertSamIntegrationTest.java | Java | bsd-3-clause | 6,444 |
//
// Soap.h
// SOAP-IOS
//
// Created by Elliott on 13-7-26.
// Copyright (c) 2013年 Elliott. All rights reserved.
//
#import "SoapUtility.h"
#import "SoapService.h"
#import "DDXMLElement+WSDL.h" | IphoneCoder/Steward | Steward/Steward/Vendors/SoapUtility/Soap.h | C | bsd-3-clause | 202 |
module Dice where
import Control.Monad (liftM)
import Control.Monad.Random
import Data.List (intercalate)
data DiceBotCmd =
Start
| Quit
| Roll { cmdDice :: [Die] }
| None
| Bad { cmdBad :: String }
deriving (Show, Eq)
data Die =
Const { dieConst :: Int }
| Die { dieNum :: Int, dieType :: Int }
deriving (Show, Eq)
showDice :: [Die] -> String
showDice = intercalate " + " . map showDie
where showDie (Const n) = show n
showDie (Die n t) = show n ++ "d" ++ show t
showResult :: [Int] -> String
showResult = intercalate " + " . map show
randomFace :: RandomGen g => Int -> Rand g Int
randomFace t = getRandomR (1, t)
rollDie :: RandomGen g => Die -> Rand g [Int]
rollDie (Const n) = return [n]
rollDie (Die n t) = sequence . replicate n $ randomFace t
rollDice :: [Die] -> IO [Int]
rollDice = evalRandIO . liftM concat . mapM rollDie
| haskell-ro/hs-dicebot | Dice.hs | Haskell | bsd-3-clause | 873 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file documents the GNU Assembler "as".
Copyright (C) 1991-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
-->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using as: HPPA Opcodes</title>
<meta name="description" content="Using as: HPPA Opcodes">
<meta name="keywords" content="Using as: HPPA Opcodes">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="HPPA_002dDependent.html#HPPA_002dDependent" rel="up" title="HPPA-Dependent">
<link href="ESA_002f390_002dDependent.html#ESA_002f390_002dDependent" rel="next" title="ESA/390-Dependent">
<link href="HPPA-Directives.html#HPPA-Directives" rel="prev" title="HPPA Directives">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="HPPA-Opcodes"></a>
<div class="header">
<p>
Previous: <a href="HPPA-Directives.html#HPPA-Directives" accesskey="p" rel="prev">HPPA Directives</a>, Up: <a href="HPPA_002dDependent.html#HPPA_002dDependent" accesskey="u" rel="up">HPPA-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Opcodes-8"></a>
<h4 class="subsection">9.13.6 Opcodes</h4>
<p>For detailed information on the HPPA machine instruction set, see
<cite>PA-RISC Architecture and Instruction Set Reference Manual</cite>
(HP 09740-90039).
</p>
</body>
</html>
| AlbandeCrevoisier/ldd-athens | gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/share/doc/as.html/HPPA-Opcodes.html | HTML | bsd-3-clause | 3,340 |
//-----------------------------------------------------------------------
// FILE : TypeRepresentation.scala
// SUBJECT : Holds information about a type.
// AUTHOR : (C) Copyright 2011 by Peter C. Chapin <PChapin@vtc.vsc.edu>
//
//-----------------------------------------------------------------------
package edu.uvm.sprocket
/**
* Instances of this class store Sprocket's internal representation of a type. This is needed
* when processing function parameters (and eventually in other places as well). Right now only
* simple types are supported. Representing more complex types would be nice at some point but
* since only (fairly) simple types can be used as duty parameters it is not necessary to worry
* about complicated types at this time.
*/
class TypeRepresentation(val name: String)
| pchapin/sprocket | src/edu/uvm/sprocket/TypeRepresentation.scala | Scala | bsd-3-clause | 806 |
// Copyright (c) 2016 Timo Savola. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package condition
type C int
const (
Eq = C(iota)
Ne
GeS
GtS
GeU
GtU
LeS
LtS
LeU
LtU
OrderedAndEq
OrderedAndNe
OrderedAndGe
OrderedAndGt
OrderedAndLe
OrderedAndLt
UnorderedOrEq
UnorderedOrNe
UnorderedOrGe
UnorderedOrGt
UnorderedOrLe
UnorderedOrLt
)
const (
MinOrderedAndCondition = OrderedAndEq
MinUnorderedOrCondition = UnorderedOrEq
)
var Inverted = [22]C{
Eq: Ne,
Ne: Eq,
GeS: LtS,
GtS: LeS,
GeU: LtU,
GtU: LeU,
LeS: GtS,
LtS: GeS,
LeU: GtU,
LtU: GeU,
OrderedAndEq: UnorderedOrNe,
OrderedAndNe: UnorderedOrEq,
OrderedAndGe: UnorderedOrLt,
OrderedAndGt: UnorderedOrLe,
OrderedAndLe: UnorderedOrGt,
OrderedAndLt: UnorderedOrGe,
UnorderedOrEq: OrderedAndNe,
UnorderedOrNe: OrderedAndEq,
UnorderedOrGe: OrderedAndLt,
UnorderedOrGt: OrderedAndLe,
UnorderedOrLe: OrderedAndGt,
UnorderedOrLt: OrderedAndGe,
}
var strings = []string{
Eq: "equal",
Ne: "not-equal",
GeS: "signed greater-or-equal",
GtS: "signed greater",
GeU: "unsigned greater-or-equal",
GtU: "unsigned greater",
LeS: "signed less-or-equal",
LtS: "signed less",
LeU: "unsigned less-or-equal",
LtU: "unsigned less",
OrderedAndEq: "ordered-and-equal",
OrderedAndNe: "ordered-and-not-equal",
OrderedAndGe: "ordered-and-greater-or-equal",
OrderedAndGt: "ordered-and-greater",
OrderedAndLe: "ordered-and-less-or-equal",
OrderedAndLt: "ordered-and-less",
UnorderedOrEq: "unordered-or-equal",
UnorderedOrNe: "unordered-or-not-equal",
UnorderedOrGe: "unordered-or-greater-or-equal",
UnorderedOrGt: "unordered-or-greater",
UnorderedOrLe: "unordered-or-less-or-equal",
UnorderedOrLt: "unordered-or-less",
}
func (f C) String() string {
if i := int(f); i < len(strings) {
return strings[i]
} else {
return "<invalid condition>"
}
}
| tsavola/wag | internal/gen/condition/condition.go | GO | bsd-3-clause | 2,142 |
#include <gaussian.h>
#include <args.h>
#include <stdbool.h>
int main ( int argc, char *argv[] )
{
double units;
uint32_t gaussianSize;
float gaussianSigma;
char* imgname;//the name of the image file, taken by the arguments
//read in the program's arguments
if(readArguments(argc,argv,&imgname,&gaussianSize,&gaussianSigma)==false)
return -1;
//perform CPU blurring
if(pna_blur_cpu(imgname,gaussianSize,gaussianSigma)==false)//time it
return -2;
//perform GPU blurring and then read the timer
if(pna_blur_gpu(imgname,gaussianSize,gaussianSigma)==false)
return -3;
return 0;
}
| LefterisJP/OpenCL_Gaussian_Blur | main.c | C | bsd-3-clause | 651 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "webkit/common/fileapi/file_system_util.h"
#include <algorithm>
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/net_errors.h"
#include "url/gurl.h"
#include "webkit/common/database/database_identifier.h"
namespace fileapi {
const char kPersistentDir[] = "/persistent";
const char kTemporaryDir[] = "/temporary";
const char kIsolatedDir[] = "/isolated";
const char kExternalDir[] = "/external";
const char kTestDir[] = "/test";
const base::FilePath::CharType VirtualPath::kRoot[] = FILE_PATH_LITERAL("/");
const base::FilePath::CharType VirtualPath::kSeparator = FILE_PATH_LITERAL('/');
// TODO(ericu): Consider removing support for '\', even on Windows, if possible.
// There's a lot of test code that will need reworking, and we may have trouble
// with base::FilePath elsewhere [e.g. DirName and other methods may also need
// replacement].
base::FilePath VirtualPath::BaseName(const base::FilePath& virtual_path) {
base::FilePath::StringType path = virtual_path.value();
// Keep everything after the final separator, but if the pathname is only
// one character and it's a separator, leave it alone.
while (path.size() > 1 && base::FilePath::IsSeparator(path[path.size() - 1]))
path.resize(path.size() - 1);
base::FilePath::StringType::size_type last_separator =
path.find_last_of(base::FilePath::kSeparators);
if (last_separator != base::FilePath::StringType::npos &&
last_separator < path.size() - 1)
path.erase(0, last_separator + 1);
return base::FilePath(path);
}
base::FilePath VirtualPath::DirName(const base::FilePath& virtual_path) {
typedef base::FilePath::StringType StringType;
StringType path = virtual_path.value();
// The logic below is taken from that of base::FilePath::DirName, except
// that this version never cares about '//' or drive-letters even on win32.
// Strip trailing separators.
while (path.size() > 1 && base::FilePath::IsSeparator(path[path.size() - 1]))
path.resize(path.size() - 1);
StringType::size_type last_separator =
path.find_last_of(base::FilePath::kSeparators);
if (last_separator == StringType::npos) {
// path_ is in the current directory.
return base::FilePath(base::FilePath::kCurrentDirectory);
}
if (last_separator == 0) {
// path_ is in the root directory.
return base::FilePath(path.substr(0, 1));
}
// path_ is somewhere else, trim the basename.
path.resize(last_separator);
// Strip trailing separators.
while (path.size() > 1 && base::FilePath::IsSeparator(path[path.size() - 1]))
path.resize(path.size() - 1);
if (path.empty())
return base::FilePath(base::FilePath::kCurrentDirectory);
return base::FilePath(path);
}
void VirtualPath::GetComponents(
const base::FilePath& path,
std::vector<base::FilePath::StringType>* components) {
typedef base::FilePath::StringType StringType;
DCHECK(components);
if (!components)
return;
components->clear();
if (path.value().empty())
return;
StringType::size_type begin = 0, end = 0;
while (begin < path.value().length() && end != StringType::npos) {
end = path.value().find_first_of(base::FilePath::kSeparators, begin);
StringType component = path.value().substr(
begin, end == StringType::npos ? StringType::npos : end - begin);
if (!component.empty() && component != base::FilePath::kCurrentDirectory)
components->push_back(component);
begin = end + 1;
}
}
void VirtualPath::GetComponentsUTF8Unsafe(
const base::FilePath& path,
std::vector<std::string>* components) {
DCHECK(components);
if (!components)
return;
components->clear();
std::vector<base::FilePath::StringType> stringtype_components;
VirtualPath::GetComponents(path, &stringtype_components);
std::vector<base::FilePath::StringType>::const_iterator it;
for (it = stringtype_components.begin(); it != stringtype_components.end();
++it) {
components->push_back(base::FilePath(*it).AsUTF8Unsafe());
}
}
base::FilePath::StringType VirtualPath::GetNormalizedFilePath(
const base::FilePath& path) {
base::FilePath::StringType normalized_path = path.value();
const size_t num_separators = base::FilePath::StringType(
base::FilePath::kSeparators).length();
for (size_t i = 0; i < num_separators; ++i) {
std::replace(normalized_path.begin(), normalized_path.end(),
base::FilePath::kSeparators[i], kSeparator);
}
return (IsAbsolute(normalized_path)) ?
normalized_path : base::FilePath::StringType(kRoot) + normalized_path;
}
bool VirtualPath::IsAbsolute(const base::FilePath::StringType& path) {
return path.find(kRoot) == 0;
}
bool VirtualPath::IsRootPath(const base::FilePath& path) {
std::vector<base::FilePath::StringType> components;
VirtualPath::GetComponents(path, &components);
return (path.empty() || components.empty() ||
(components.size() == 1 &&
components[0] == VirtualPath::kRoot));
}
GURL GetFileSystemRootURI(const GURL& origin_url, FileSystemType type) {
// origin_url is based on a security origin, so http://foo.com or file:///
// instead of the corresponding filesystem URL.
DCHECK(!origin_url.SchemeIsFileSystem());
std::string url = "filesystem:" + origin_url.GetWithEmptyPath().spec();
switch (type) {
case kFileSystemTypeTemporary:
url += (kTemporaryDir + 1); // We don't want the leading slash.
return GURL(url + "/");
case kFileSystemTypePersistent:
url += (kPersistentDir + 1); // We don't want the leading slash.
return GURL(url + "/");
case kFileSystemTypeExternal:
url += (kExternalDir + 1); // We don't want the leading slash.
return GURL(url + "/");
case kFileSystemTypeIsolated:
url += (kIsolatedDir + 1); // We don't want the leading slash.
return GURL(url + "/");
case kFileSystemTypeTest:
url += (kTestDir + 1); // We don't want the leading slash.
return GURL(url + "/");
// Internal types are always pointed via isolated or external URLs.
default:
NOTREACHED();
}
NOTREACHED();
return GURL();
}
std::string GetFileSystemName(const GURL& origin_url, FileSystemType type) {
std::string origin_identifier =
webkit_database::GetIdentifierFromOrigin(origin_url);
std::string type_string = GetFileSystemTypeString(type);
DCHECK(!type_string.empty());
return origin_identifier + ":" + type_string;
}
FileSystemType QuotaStorageTypeToFileSystemType(
quota::StorageType storage_type) {
switch (storage_type) {
case quota::kStorageTypeTemporary:
return kFileSystemTypeTemporary;
case quota::kStorageTypePersistent:
return kFileSystemTypePersistent;
case quota::kStorageTypeSyncable:
return kFileSystemTypeSyncable;
case quota::kStorageTypeQuotaNotManaged:
case quota::kStorageTypeUnknown:
return kFileSystemTypeUnknown;
}
return kFileSystemTypeUnknown;
}
quota::StorageType FileSystemTypeToQuotaStorageType(FileSystemType type) {
switch (type) {
case kFileSystemTypeTemporary:
return quota::kStorageTypeTemporary;
case kFileSystemTypePersistent:
return quota::kStorageTypePersistent;
case kFileSystemTypeSyncable:
case kFileSystemTypeSyncableForInternalSync:
return quota::kStorageTypeSyncable;
case kFileSystemTypePluginPrivate:
return quota::kStorageTypeQuotaNotManaged;
default:
return quota::kStorageTypeUnknown;
}
}
std::string GetFileSystemTypeString(FileSystemType type) {
switch (type) {
case kFileSystemTypeTemporary:
return "Temporary";
case kFileSystemTypePersistent:
return "Persistent";
case kFileSystemTypeIsolated:
return "Isolated";
case kFileSystemTypeExternal:
return "External";
case kFileSystemTypeTest:
return "Test";
case kFileSystemTypeNativeLocal:
return "NativeLocal";
case kFileSystemTypeRestrictedNativeLocal:
return "RestrictedNativeLocal";
case kFileSystemTypeDragged:
return "Dragged";
case kFileSystemTypeNativeMedia:
return "NativeMedia";
case kFileSystemTypeDeviceMedia:
return "DeviceMedia";
case kFileSystemTypePicasa:
return "Picasa";
case kFileSystemTypeItunes:
return "Itunes";
case kFileSystemTypeIphoto:
return "Iphoto";
case kFileSystemTypeDrive:
return "Drive";
case kFileSystemTypeSyncable:
case kFileSystemTypeSyncableForInternalSync:
return "Syncable";
case kFileSystemTypeNativeForPlatformApp:
return "NativeForPlatformApp";
case kFileSystemTypeForTransientFile:
return "TransientFile";
case kFileSystemTypePluginPrivate:
return "PluginPrivate";
case kFileSystemTypeCloudDevice:
return "CloudDevice";
case kFileSystemInternalTypeEnumStart:
case kFileSystemInternalTypeEnumEnd:
NOTREACHED();
// Fall through.
case kFileSystemTypeUnknown:
return "Unknown";
}
NOTREACHED();
return std::string();
}
std::string FilePathToString(const base::FilePath& file_path) {
#if defined(OS_WIN)
return base::UTF16ToUTF8(file_path.value());
#elif defined(OS_POSIX)
return file_path.value();
#endif
}
base::FilePath StringToFilePath(const std::string& file_path_string) {
#if defined(OS_WIN)
return base::FilePath(base::UTF8ToUTF16(file_path_string));
#elif defined(OS_POSIX)
return base::FilePath(file_path_string);
#endif
}
blink::WebFileError FileErrorToWebFileError(
base::File::Error error_code) {
switch (error_code) {
case base::File::FILE_ERROR_NOT_FOUND:
return blink::WebFileErrorNotFound;
case base::File::FILE_ERROR_INVALID_OPERATION:
case base::File::FILE_ERROR_EXISTS:
case base::File::FILE_ERROR_NOT_EMPTY:
return blink::WebFileErrorInvalidModification;
case base::File::FILE_ERROR_NOT_A_DIRECTORY:
case base::File::FILE_ERROR_NOT_A_FILE:
return blink::WebFileErrorTypeMismatch;
case base::File::FILE_ERROR_ACCESS_DENIED:
return blink::WebFileErrorNoModificationAllowed;
case base::File::FILE_ERROR_FAILED:
return blink::WebFileErrorInvalidState;
case base::File::FILE_ERROR_ABORT:
return blink::WebFileErrorAbort;
case base::File::FILE_ERROR_SECURITY:
return blink::WebFileErrorSecurity;
case base::File::FILE_ERROR_NO_SPACE:
return blink::WebFileErrorQuotaExceeded;
case base::File::FILE_ERROR_INVALID_URL:
return blink::WebFileErrorEncoding;
default:
return blink::WebFileErrorInvalidModification;
}
}
bool GetFileSystemPublicType(
const std::string type_string,
blink::WebFileSystemType* type) {
DCHECK(type);
if (type_string == "Temporary") {
*type = blink::WebFileSystemTypeTemporary;
return true;
}
if (type_string == "Persistent") {
*type = blink::WebFileSystemTypePersistent;
return true;
}
if (type_string == "Isolated") {
*type = blink::WebFileSystemTypeIsolated;
return true;
}
if (type_string == "External") {
*type = blink::WebFileSystemTypeExternal;
return true;
}
NOTREACHED();
return false;
}
std::string GetIsolatedFileSystemName(const GURL& origin_url,
const std::string& filesystem_id) {
std::string name(fileapi::GetFileSystemName(
origin_url, fileapi::kFileSystemTypeIsolated));
name.append("_");
name.append(filesystem_id);
return name;
}
bool CrackIsolatedFileSystemName(const std::string& filesystem_name,
std::string* filesystem_id) {
DCHECK(filesystem_id);
// |filesystem_name| is of the form {origin}:isolated_{filesystem_id}.
std::string start_token(":");
start_token = start_token.append(
GetFileSystemTypeString(kFileSystemTypeIsolated)).append("_");
// WebKit uses different case in its constant for isolated file system
// names, so we do a case insensitive compare by converting both strings
// to uppercase.
// TODO(benwells): Remove this when WebKit uses the same constant.
start_token = StringToUpperASCII(start_token);
std::string filesystem_name_upper = StringToUpperASCII(filesystem_name);
size_t pos = filesystem_name_upper.find(start_token);
if (pos == std::string::npos)
return false;
if (pos == 0)
return false;
*filesystem_id = filesystem_name.substr(pos + start_token.length(),
std::string::npos);
if (filesystem_id->empty())
return false;
return true;
}
bool ValidateIsolatedFileSystemId(const std::string& filesystem_id) {
const size_t kExpectedFileSystemIdSize = 32;
if (filesystem_id.size() != kExpectedFileSystemIdSize)
return false;
const std::string kExpectedChars("ABCDEF0123456789");
return ContainsOnlyChars(filesystem_id, kExpectedChars);
}
std::string GetIsolatedFileSystemRootURIString(
const GURL& origin_url,
const std::string& filesystem_id,
const std::string& optional_root_name) {
std::string root = GetFileSystemRootURI(origin_url,
kFileSystemTypeIsolated).spec();
if (base::FilePath::FromUTF8Unsafe(filesystem_id).ReferencesParent())
return std::string();
root.append(filesystem_id);
root.append("/");
if (!optional_root_name.empty()) {
if (base::FilePath::FromUTF8Unsafe(optional_root_name).ReferencesParent())
return std::string();
root.append(optional_root_name);
root.append("/");
}
return root;
}
std::string GetExternalFileSystemRootURIString(
const GURL& origin_url,
const std::string& mount_name) {
std::string root = GetFileSystemRootURI(origin_url,
kFileSystemTypeExternal).spec();
if (base::FilePath::FromUTF8Unsafe(mount_name).ReferencesParent())
return std::string();
root.append(mount_name);
root.append("/");
return root;
}
base::File::Error NetErrorToFileError(int error) {
switch (error) {
case net::OK:
return base::File::FILE_OK;
case net::ERR_ADDRESS_IN_USE:
return base::File::FILE_ERROR_IN_USE;
case net::ERR_FILE_EXISTS:
return base::File::FILE_ERROR_EXISTS;
case net::ERR_FILE_NOT_FOUND:
return base::File::FILE_ERROR_NOT_FOUND;
case net::ERR_ACCESS_DENIED:
return base::File::FILE_ERROR_ACCESS_DENIED;
case net::ERR_TOO_MANY_SOCKET_STREAMS:
return base::File::FILE_ERROR_TOO_MANY_OPENED;
case net::ERR_OUT_OF_MEMORY:
return base::File::FILE_ERROR_NO_MEMORY;
case net::ERR_FILE_NO_SPACE:
return base::File::FILE_ERROR_NO_SPACE;
case net::ERR_INVALID_ARGUMENT:
case net::ERR_INVALID_HANDLE:
return base::File::FILE_ERROR_INVALID_OPERATION;
case net::ERR_ABORTED:
case net::ERR_CONNECTION_ABORTED:
return base::File::FILE_ERROR_ABORT;
case net::ERR_ADDRESS_INVALID:
case net::ERR_INVALID_URL:
return base::File::FILE_ERROR_INVALID_URL;
default:
return base::File::FILE_ERROR_FAILED;
}
}
#if defined(OS_CHROMEOS)
FileSystemInfo GetFileSystemInfoForChromeOS(const GURL& origin_url) {
FileSystemType mount_type = fileapi::kFileSystemTypeExternal;
return FileSystemInfo(fileapi::GetFileSystemName(origin_url, mount_type),
fileapi::GetFileSystemRootURI(origin_url, mount_type),
mount_type);
}
#endif
} // namespace fileapi
| ChromiumWebApps/chromium | webkit/common/fileapi/file_system_util.cc | C++ | bsd-3-clause | 15,695 |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Internal server error</title>
<link rel="stylesheet" media="screen,projection,tv" href="/media/css/common.css" />
</head>
<body>
<div id="body">
<div id="header">
<h1>Mozilla Sheriff Duty</h1>
</div>
<div id="content">
<h2>Internal server error</h2>
<p>Sorry about this.</p>
</div>
</body>
</html>
| mozilla/sheriffs | templates/500.html | HTML | bsd-3-clause | 371 |
// *****************************************************************************
//
// Copyright (c) 2014, Southwest Research Institute® (SwRI®)
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the <organization> nor the
// names of its contributors may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// *****************************************************************************
#ifndef MAPVIZ_PLUGINS_ROBOT_IMAGE_PLUGIN_H_
#define MAPVIZ_PLUGINS_ROBOT_IMAGE_PLUGIN_H_
// C++ standard libraries
#include <string>
#include <mapviz/mapviz_plugin.h>
// QT libraries
#include <QGLWidget>
#include <QObject>
#include <QWidget>
// ROS libraries
#include <ros/ros.h>
#include <tf/transform_datatypes.h>
#include <mapviz/map_canvas.h>
// QT autogenerated files
#include "ui_robot_image_config.h"
#include "ui_topic_select.h"
namespace mapviz_plugins
{
class RobotImagePlugin : public mapviz::MapvizPlugin
{
Q_OBJECT
public:
RobotImagePlugin();
virtual ~RobotImagePlugin();
bool Initialize(QGLWidget* canvas);
void Shutdown() {}
void Draw(double x, double y, double scale);
void Transform();
void LoadConfig(const YAML::Node& node, const std::string& path);
void SaveConfig(YAML::Emitter& emitter, const std::string& path);
QWidget* GetConfigWidget(QWidget* parent);
protected:
void PrintError(const std::string& message);
void PrintInfo(const std::string& message);
void PrintWarning(const std::string& message);
protected Q_SLOTS:
void SelectFile();
void SelectFrame();
void FrameEdited();
void WidthChanged(double value);
void HeightChanged(double value);
private:
Ui::robot_image_config ui_;
QWidget* config_widget_;
double width_;
double height_;
std::string filename_;
QImage image_;
int dimension_;
int texture_id_;
bool texture_loaded_;
bool transformed_;
tf::Point top_left_;
tf::Point top_right_;
tf::Point bottom_left_;
tf::Point bottom_right_;
tf::Point top_left_transformed_;
tf::Point top_right_transformed_;
tf::Point bottom_left_transformed_;
tf::Point bottom_right_transformed_;
void UpdateShape();
void LoadImage();
};
}
#endif // MAPVIZ_PLUGINS_ROBOT_IMAGE_PLUGIN_H_
| malban/mapviz | mapviz_plugins/include/mapviz_plugins/robot_image_plugin.h | C | bsd-3-clause | 3,658 |
# -*- coding: utf-8 -*-
"""
Doctest runner for 'birdhousebuilder.recipe.adagucserver'.
"""
__docformat__ = 'restructuredtext'
import os
import sys
import unittest
import zc.buildout.tests
import zc.buildout.testing
from zope.testing import doctest, renormalizing
optionflags = (doctest.ELLIPSIS |
doctest.NORMALIZE_WHITESPACE |
doctest.REPORT_ONLY_FIRST_FAILURE)
def setUp(test):
zc.buildout.testing.buildoutSetUp(test)
# Install the recipe in develop mode
zc.buildout.testing.install_develop('birdhousebuilder.recipe.adagucserver', test)
test.globs['os'] = os
test.globs['sys'] = sys
test.globs['test_dir'] = os.path.dirname(__file__)
def test_suite():
suite = unittest.TestSuite((
doctest.DocFileSuite(
'../../../../README.rst',
setUp=setUp,
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=optionflags,
checker=renormalizing.RENormalizing([
# If want to clean up the doctest output you
# can register additional regexp normalizers
# here. The format is a two-tuple with the RE
# as the first item and the replacement as the
# second item, e.g.
# (re.compile('my-[rR]eg[eE]ps'), 'my-regexps')
zc.buildout.testing.normalize_path,
]),
),
))
return suite
if __name__ == '__main__':
unittest.main(defaultTest='test_suite')
| bird-house/birdhousebuilder.recipe.adagucserver | birdhousebuilder/recipe/adagucserver/tests/test_docs.py | Python | bsd-3-clause | 1,620 |
/*
* File: defaults.js
* Purpose: Default values, settings and initial values for the app
* Author: Adam Reed (adam@secretcode.ninja)
* Licence: BSD 3-Clause Licence
*/
var app = angular.module('BlueCube.defaults', [])
// Default settings for key parts of the app
app.constant('appDefaults', {
// Whether to attempt to auto connect to the cube ("true" | "false")
autoConnect: "false",
// Whether to send colour changes automatically in the All view ("true" | "false")
liveAllColourChanges: "true",
// Minimum and Maximum allowable history items (I recommend keeping this between 20 and 200)
minAllowedHistoryItems: 20,
maxAllowedHistoryItems: 200,
// Maximum number of items to keep in the history (it should be between minAllowedHistoryItems
// and maxAllowedHistoryItems set above)
maxHistoryItems: 100,
// Items for RSSI Signal Strength Indicator, that set the bounds for what we consider full
// signal strength and at where we consider we have no signal.
signalConsideredFullStrengthAt: -30,
signalConsideredNoStrengthAt: -100,
});
// Bluetooth LE Characteristic and search time
app.constant('bleDefaults', {
// Characteristics for the Nordic's UART Service as used by the Adafruit Bluefruit LE devices
serviceUUID: '6e400001-b5a3-f393-e0a9-e50e24dcca9e',
txCharacteristic: '6e400002-b5a3-f393-e0a9-e50e24dcca9e', // transmit is from the phone's perspective
rxCharacteristic: '6e400003-b5a3-f393-e0a9-e50e24dcca9e', // receive is from the phone's perspective
searchTime: 3 // seconds
});
// Default settings for Colours within the app
app.constant('colourDefaults', {
// The default colour used for the colour picker if the user hasn't previously selected a
// colour
defaultColour: '00d1ff',
// The default colour used for the second colour picker (if required) if the user hasn't
// previously selected a colour
otherColour: 'f80ed1',
// The default favourite colours. These match the defined colours in the Cube Library, but there
// is no reason that they can't be changed
favouriteColours: [
{
id: 1,
hex: '000000', // Black
},
{
id: 2,
hex: '0000FF', // Blue
},
{
id: 3,
hex: '00ff00', // Green
},
{
id: 4,
hex: 'ff4500', // Orange
},
{
id: 5,
hex: 'ff1444', // Pink
},
{
id: 6,
hex: 'ff00ff', // Purple
},
{
id: 7,
hex: 'ff0000', // Red
},
{
id: 8,
hex: 'ffffff', // White
},
{
id: 9,
hex: 'ffff00', // Yellow
}
],
// To ensure that each favourite colour has a unique ID, we store the next ID that should
// be used. It's 10 because we have 9 favourites above already defined.
favouriteColoursNextIndex: 10,
});
// Default settings for the Set, Copy and Move Plane Views
app.constant('axisDefaults', {
// Default axis to select ('X' | 'Y' | 'Z')
axis: 'X',
// The first or only offset to use ('0' | '1' | '2' | '3')
fromOffset: '0',
// The second offset to use ('0' | '1' | '2' | '3')
toOffset: '1',
});
// Define the defaults for the Box and Sphere views
app.constant('graphicsDefaults', {
/* boxStyle: 0 = Solid
1 = Walls Only
2 = Edges Only
3 = Walls Filled
4 = Edges Filled */
boxStyle: '0',
/* sphereStyle: 0: Walls Only
1: Solid */
sphereStyle: '0',
// sphereSize: 3 or 4
sphereSize: '3',
});
// Initially provided static favourites
app.constant('staticFavouritesDefaults', {
// A sample set of static favourites to get the user started
staticFavourites: [
{
id: 0,
name: "Rainbow",
cmds: [
{"id":1,"cmd":"set 000 180064;"},
{"id":2,"cmd":"set 011 0C0032;"},
{"id":3,"cmd":"set 022 060019;"},
{"id":4,"cmd":"set 033 03000C;"},
{"id":5,"cmd":"set 010 380044;"},
{"id":6,"cmd":"set 021 1C0022;"},
{"id":7,"cmd":"set 032 0E0011;"},
{"id":8,"cmd":"set 133 070008;"},
{"id":9,"cmd":"set 020 580024;"},
{"id":10,"cmd":"set 031 2C0012;"},
{"id":11,"cmd":"set 132 160009;"},
{"id":12,"cmd":"set 233 0B0004;"},
{"id":13,"cmd":"set 030 780004;"},
{"id":14,"cmd":"set 131 3C0002;"},
{"id":15,"cmd":"set 232 1E0001;"},
{"id":16,"cmd":"set 333 0F0000;"},
{"id":17,"cmd":"set 130 641800;"},
{"id":18,"cmd":"set 231 320C00;"},
{"id":19,"cmd":"set 332 190600;"},
{"id":20,"cmd":"set 323 0C0300;"},
{"id":21,"cmd":"set 230 443800;"},
{"id":22,"cmd":"set 331 221C00;"},
{"id":23,"cmd":"set 322 110E00;"},
{"id":24,"cmd":"set 313 080700;"},
{"id":25,"cmd":"set 330 245800;"},
{"id":26,"cmd":"set 321 122C00;"},
{"id":27,"cmd":"set 312 091600;"},
{"id":28,"cmd":"set 303 040B00;"},
{"id":29,"cmd":"set 320 047800;"},
{"id":30,"cmd":"set 311 023C00;"},
{"id":31,"cmd":"set 302 011E00;"},
{"id":32,"cmd":"set 203 000F00;"},
{"id":33,"cmd":"set 310 006418;"},
{"id":34,"cmd":"set 301 00320C;"},
{"id":35,"cmd":"set 202 001906;"},
{"id":36,"cmd":"set 103 000C03;"},
{"id":37,"cmd":"set 300 004438;"},
{"id":38,"cmd":"set 201 00221C;"},
{"id":39,"cmd":"set 102 00110E;"},
{"id":40,"cmd":"set 003 000807;"},
{"id":41,"cmd":"set 200 002458;"},
{"id":42,"cmd":"set 101 00122C;"},
{"id":43,"cmd":"set 002 000916;"},
{"id":44,"cmd":"set 013 00040B;"},
{"id":45,"cmd":"set 100 000478;"},
{"id":46,"cmd":"set 001 00023C;"},
{"id":47,"cmd":"set 012 00011E;"},
{"id":48,"cmd":"set 023 00000F;"},
{"id":49,"cmd":"set 110 180064;"},
{"id":50,"cmd":"set 121 0C0032;"},
{"id":51,"cmd":"set 222 060019;"},
{"id":52,"cmd":"set 213 03000C;"},
{"id":53,"cmd":"set 120 780004;"},
{"id":54,"cmd":"set 221 3C0002;"},
{"id":55,"cmd":"set 212 1E0001;"},
{"id":56,"cmd":"set 113 0F0000;"},
{"id":57,"cmd":"set 220 245800;"},
{"id":58,"cmd":"set 211 122C00;"},
{"id":59,"cmd":"set 112 091600;"},
{"id":60,"cmd":"set 123 040B00;"},
{"id":61,"cmd":"set 210 004438;"},
{"id":62,"cmd":"set 111 00221C;"},
{"id":63,"cmd":"set 122 00110E;"},
{"id":64,"cmd":"set 223 000807;"}
]
},
{
id: 1,
name: "All Black",
cmds: [
{"id":1,"cmd":"all 000000;"}
]
},
{
id: 2,
name: "Crossed Planes",
cmds: [
{"id":1,"cmd":"setplane X 2 0000ff;"},
{"id":2,"cmd":"setplane Y 1 3DF400;"}
]
},
{
id: 3,
name: "Filled Sphere",
cmds: [
{"id":1,"cmd":"sphere 111 ff0000 00ff00;"},
{"id":2,"cmd":"box 000 333 0000ff 2;"}
]
}
],
// To ensure that each static favourite has a unique ID, we store the next ID that should
// be used. It's 4 because we have 3 static favourites above already defined.
staticFavouritesNextIndex: 4,
});
// Initially provided user defined functions
app.constant('userDefinedFunctionsDefaults', {
// Provide a sample set of user defined functions to match those that ship with the included
// Arduino sketch
userDefinedFunctions: [
{
id: 0,
name: "Pulse Blue",
number: 1,
colourRequired: true,
colour: "0000ff",
},
{
id: 1,
name: "Pulse Green",
number: 1,
colourRequired: true,
colour: "00ff00",
},
{
id: 2,
name: "Wave",
number: 2,
colourRequired: true,
colour: "fc00ff",
},
{
id: 3,
name: "ZigZag",
number: 3,
colourRequired: true,
colour: "b7ff00",
}
],
// To ensure that each user defined function has a unique ID, we store the next ID that should
// be used. It's 4 because we have 3 user defined functions above already defined.
userDefinedFunctionsNextIndex: 4,
});
| neographophobic/BlueCube | IonicApp/www/js/defaults.js | JavaScript | bsd-3-clause | 8,411 |
{% extends "base.html" %}
{% block title %}Sign in{% endblock %}
{% from "_formhelpers.html" import render_field %}
{% block content %}
<form class="form-signin" action="" method="POST">
<fieldset>
<legend>Please sign in</legend>
{%- if error -%}
<div class="control-group error">
<span class="help-block">{{ error }}</span>
</div>
{%- endif %}
{{ render_field(form.email, class="input-block-level") }}
{{ render_field(form.password, class="input-block-level") }}
<label class="checkbox">
{{ form.remember()|safe }}{{ form.remember.label.text }}
</label>
{{ form.hidden_tag() }}
<button class="btn btn-primary" type="submit">Sign in</button>
</fieldset>
</form>
{% endblock %}
| Avamagic/mgserver-web-api | mgserver/templates/login.html | HTML | bsd-3-clause | 842 |
/*
* Table structure for table 'nas'
*/
CREATE TABLE nas (
id SERIAL PRIMARY KEY,
nasname VARCHAR(128) NOT NULL,
shortname VARCHAR(32) NOT NULL,
type VARCHAR(30) NOT NULL DEFAULT 'other',
ports int4,
secret VARCHAR(60) NOT NULL,
/*
server VARCHAR(64),
*/
community VARCHAR(50),
description VARCHAR(200)
);
create index nas_nasname on nas (nasname);
| weldpua2008/FreeBSD_PPTP_router_config | raddb/sql/postgresql/nas.sql | SQL | bsd-3-clause | 367 |
# -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
API Issues to work out:
- MatrixTransform and STTransform both have 'scale' and 'translate'
attributes, but they are used in very different ways. It would be nice
to keep this consistent, but how?
- Need a transform.map_rect function that returns the bounding rectangle of
a rect after transformation. Non-linear transforms might need to work
harder at this, but we can provide a default implementation that
works by mapping a selection of points across a grid within the original
rect.
"""
from __future__ import division
from ..shaders import Function
from ...util.event import EventEmitter
class BaseTransform(object):
"""
BaseTransform is a base class that defines a pair of complementary
coordinate mapping functions in both python and GLSL.
All BaseTransform subclasses define map() and imap() methods that map
an object through the forward or inverse transformation, respectively.
The two class variables glsl_map and glsl_imap are instances of
shaders.Function that define the forward- and inverse-mapping GLSL
function code.
Optionally, an inverse() method returns a new transform performing the
inverse mapping.
Note that although all classes should define both map() and imap(), it
is not necessarily the case that imap(map(x)) == x; there may be instances
where the inverse mapping is ambiguous or otherwise meaningless.
"""
glsl_map = None # Must be GLSL code
glsl_imap = None
# Flags used to describe the transformation. Subclasses should define each
# as True or False.
# (usually used for making optimization decisions)
# If True, then for any 3 colinear points, the
# transformed points will also be colinear.
Linear = None
# The transformation's effect on one axis is independent
# of the input position along any other axis.
Orthogonal = None
# If True, then the distance between two points is the
# same as the distance between the transformed points.
NonScaling = None
# Scale factors are applied equally to all axes.
Isometric = None
def __init__(self):
self._inverse = None
self._dynamic = False
self.changed = EventEmitter(source=self, type='transform_changed')
if self.glsl_map is not None:
self._shader_map = Function(self.glsl_map)
if self.glsl_imap is not None:
self._shader_imap = Function(self.glsl_imap)
def map(self, obj):
"""
Return *obj* mapped through the forward transformation.
Parameters
----------
obj : tuple (x,y) or (x,y,z)
array with shape (..., 2) or (..., 3)
"""
raise NotImplementedError()
def imap(self, obj):
"""
Return *obj* mapped through the inverse transformation.
Parameters
----------
obj : tuple (x,y) or (x,y,z)
array with shape (..., 2) or (..., 3)
"""
raise NotImplementedError()
@property
def inverse(self):
""" The inverse of this transform.
"""
if self._inverse is None:
self._inverse = InverseTransform(self)
return self._inverse
@property
def dynamic(self):
"""Boolean flag that indicates whether this transform is expected to
change frequently.
Transforms that are flagged as dynamic will not be collapsed in
``ChainTransform.simplified``. This allows changes to the transform
to propagate through the chain without requiring the chain to be
re-simplified.
"""
return self._dynamic
@dynamic.setter
def dynamic(self, d):
self._dynamic = d
def shader_map(self):
"""
Return a shader Function that accepts only a single vec4 argument
and defines new attributes / uniforms supplying the Function with
any static input.
"""
return self._shader_map
def shader_imap(self):
"""
see shader_map.
"""
return self._shader_imap
def _shader_object(self):
""" This method allows transforms to be assigned directly to shader
template variables.
Example::
code = 'void main() { gl_Position = $transform($position); }'
func = shaders.Function(code)
tr = STTransform()
func['transform'] = tr # use tr's forward mapping for $function
"""
return self.shader_map()
def update(self, *args):
"""
Called to inform any listeners that this transform has changed.
"""
self.changed(*args)
def __mul__(self, tr):
"""
Transform multiplication returns a new transform that is equivalent to
the two operands performed in series.
By default, multiplying two Transforms `A * B` will return
ChainTransform([A, B]). Subclasses may redefine this operation to
return more optimized results.
To ensure that both operands have a chance to simplify the operation,
all subclasses should follow the same procedure. For `A * B`:
1. A.__mul__(B) attempts to generate an optimized transform product.
2. If that fails, it must:
* return super(A).__mul__(B) OR
* return NotImplemented if the superclass would return an
invalid result.
3. When BaseTransform.__mul__(A, B) is called, it returns
NotImplemented, which causes B.__rmul__(A) to be invoked.
4. B.__rmul__(A) attempts to generate an optimized transform product.
5. If that fails, it must:
* return super(B).__rmul__(A) OR
* return ChainTransform([B, A]) if the superclass would return
an invalid result.
6. When BaseTransform.__rmul__(B, A) is called, ChainTransform([A, B])
is returned.
"""
# switch to __rmul__ attempts.
# Don't use the "return NotImplemted" trick, because that won't work if
# self and tr are of the same type.
return tr.__rmul__(self)
def __rmul__(self, tr):
return ChainTransform([tr, self])
def __repr__(self):
return "<%s at 0x%x>" % (self.__class__.__name__, id(self))
def __del__(self):
# we can remove ourselves from *all* events in this situation.
self.changed.disconnect()
class InverseTransform(BaseTransform):
def __init__(self, transform):
BaseTransform.__init__(self)
self._inverse = transform
self.map = transform.imap
self.imap = transform.map
@property
def Linear(self):
return self._inverse.Linear
@property
def Orthogonal(self):
return self._inverse.Orthogonal
@property
def NonScaling(self):
return self._inverse.NonScaling
@property
def Isometric(self):
return self._inverse.Isometric
@property
def shader_map(self):
return self._inverse.shader_imap
@property
def shader_imap(self):
return self._inverse.shader_map
def __repr__(self):
return ("<Inverse of %r>" % repr(self._inverse))
# import here to avoid import cycle; needed for BaseTransform.__mul__.
from .chain import ChainTransform # noqa
| Eric89GXL/vispy | vispy/visuals/transforms/base_transform.py | Python | bsd-3-clause | 7,578 |
<?hh // strict
namespace FH;
use Iterator;
final class Supplies {
private function __construct() { }
public static function empty_<T>(): Supply<T> {
return IO::pure(Option::none());
}
public static function fromIterator<T>(Iterator<T> $it): Supply<T> {
$rewound = (object)['value' => false];
return new IO(function() use($it, $rewound) {
if (!$rewound->value) {
$it->rewind();
$rewound->value = true;
}
if (!$it->valid()) {
return Option::none();
}
$value = $it->current();
$it->next();
return Option::some($value);
});
}
public static function each<T>(Supply<T> $s, (function(T): IO<mixed>) $f): IO<mixed> {
return new IO(function() use($s, $f) {
for (;;) {
$ok = $s->unsafePerform()->option(
false,
function($x) use($f) {
$f($x)->unsafePerform();
return true;
}
);
if (!$ok) {
break;
}
}
return null;
});
}
}
| rightfold/fh | src/main/hack/FH/Supplies.hh | C++ | bsd-3-clause | 1,251 |
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang("placeholder", "en", {title:"Placeholder Properties", toolbar:"Create Placeholder", text:"Placeholder Text", edit:"Edit Placeholder", textMissing:"The placeholder must contain text."}); | Webkadabra/WkdYiiBootstrap | assets/js/ckeditor/plugins/placeholder/lang/en.js | JavaScript | bsd-3-clause | 361 |
package utils
import (
"errors"
"github.com/mmcloughlin/geohash"
"github.com/whosonfirst/go-whosonfirst-geojson-v2"
"github.com/whosonfirst/go-whosonfirst-hash"
)
func GeohashFeature(f geojson.Feature) (string, error) {
bboxes, err := f.BoundingBoxes()
if err != nil {
return "", err
}
mbr := bboxes.MBR()
center := mbr.Center()
lat := center.Y
lon := center.X
gh := geohash.Encode(lat, lon)
return gh, nil
}
func HashFeature(f geojson.Feature) (string, error) {
return "", errors.New("This is not ready to use yet")
// what we want is for the output of (b) to be the same as (a)
// (20170801/thisisaaronland)
// hashing the file (a)
/*
h, err := hash.NewWOFHash()
if err != nil {
log.Fatal(err)
}
file_hash, err := h.HashFile(path)
*/
// hashing the feature (b)
// github.com/whosonfirst/go-whosonfirst-export
/*
e, err := export.ExportFeature(f.Bytes())
if err != nil {
return "", err
}
h, err := hash.NewWOFHash()
if err != nil {
return "", err
}
return h.HashFromJSON(e)
*/
}
// this causes an import loop so we're just going to leave it
// here as a reference for now... (20170801/thisisaaronland)
// HashGeometryForFeature(f geojson.Feature) (string, error)
// geom, err := geometry.ToString(f)
// return HashGeometry([]byte(geom))
func HashGeometry(geom []byte) (string, error) {
h, err := hash.NewWOFHash()
if err != nil {
return "", err
}
return h.HashFromJSON(geom)
}
| whosonfirst/go-whosonfirst-updated | vendor/github.com/whosonfirst/go-whosonfirst-geojson-v2/utils/hash.go | GO | bsd-3-clause | 1,483 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>TrAP JavaScript 1.3 Reference Package com.ericsson.research.trap.tests</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" />
</head>
<body>
<h3>
<a href="package-summary.html" target="classFrame">com.ericsson.research.trap.tests</a>
</h3>
<h3>Classes</h3>
<ul>
<li>
<a href="JSServerStart.html" target="classFrame">JSServerStart</a>
</li>
<li>
<a href="TestFull.html" target="classFrame">TestFull</a>
</li>
</ul>
</body>
</html> | princeofdarkness76/trap | trap-js/xref-test/com/ericsson/research/trap/tests/package-frame.html | HTML | bsd-3-clause | 866 |
#import <UIKit/UIKit.h>
#import "ATTableViewController.h"
@interface ATSettingSingleSelectViewController : ATTableViewController {
}
@end
| hmori/atndcal | atndcal/src/ATSettingSingleSelectViewController.h | C | bsd-3-clause | 145 |
package org.broadinstitute.clio.integrationtest.tests
import java.net.URI
import better.files.File
import com.sksamuel.elastic4s.IndexAndType
import io.circe.Json
import io.circe.syntax._
import org.broadinstitute.clio.client.commands.ClioCommand
import org.broadinstitute.clio.integrationtest.BaseIntegrationSpec
import org.broadinstitute.clio.server.dataaccess.elasticsearch.{
ElasticsearchIndex,
ElasticsearchUtil
}
import org.broadinstitute.clio.transfer.model.cram._
import org.broadinstitute.clio.util.model._
import org.scalatest.Assertion
import scala.concurrent.Future
import scala.util.Random
/** Tests of Clio's cram functionality. */
trait CramTests { self: BaseIntegrationSpec =>
import org.broadinstitute.clio.JsonUtils.JsonOps
def runUpsertCram(
key: CramKey,
metadata: CramMetadata,
force: Boolean = true
): Future[UpsertId] = {
val tmpMetadata = writeLocalTmpJson(metadata)
runDecode[UpsertId](
ClioCommand.addCramName,
Seq(
"--location",
key.location.entryName,
"--project",
key.project,
"--data-type",
key.dataType.entryName,
"--sample-alias",
key.sampleAlias,
"--version",
key.version.toString,
"--metadata-location",
tmpMetadata.toString,
if (force) "--force" else ""
).filter(_.nonEmpty): _*
)
}
it should "create the expected cram mapping in elasticsearch" in {
import com.sksamuel.elastic4s.http.ElasticDsl._
import ElasticsearchUtil.HttpClientOps
val expected = ElasticsearchIndex.Cram
val getRequest = getMapping(IndexAndType(expected.indexName, expected.indexType))
elasticsearchClient.executeAndUnpack(getRequest).map {
_ should be(Seq(indexToMapping(expected)))
}
}
// Generate a test for every possible Location value.
Location.values.foreach {
it should behave like testCramLocation(_)
}
/**
* Utility method for generating an assertion about behavior for a Location key.
*
* @see http://www.scalatest.org/user_guide/sharing_tests
*/
def testCramLocation(location: Location): Unit = {
it should s"handle upserts and queries for cram location $location" in {
val key = CramKey(
location = location,
project = "test project",
sampleAlias = s"someAlias $randomId",
version = 2,
dataType = DataType.WGS
)
val metadata = CramMetadata(
documentStatus = Some(DocumentStatus.Normal),
cramPath = Some(URI.create(s"gs://path/cram${CramExtensions.CramExtension}"))
)
val expected = expectedMerge(key, metadata)
for {
returnedUpsertId <- runUpsertCram(key, metadata.copy(documentStatus = None))
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--sample-alias",
key.sampleAlias
)
} yield {
outputs should contain only expected
val storedDocument = getJsonFrom(returnedUpsertId)(ElasticsearchIndex.Cram)
storedDocument.mapObject(
_.filterKeys(!ElasticsearchIndex.BookkeepingNames.contains(_))
) should be(expected)
}
}
}
it should "assign different upsertIds to different cram upserts" in {
val upsertKey = CramKey(
location = Location.GCP,
project = s"project$randomId",
sampleAlias = s"sample$randomId",
version = 1,
dataType = DataType.WGS
)
for {
upsertId1 <- runUpsertCram(
upsertKey,
CramMetadata(
cramPath = Some(
URI.create(s"gs://path/cram1${CramExtensions.CramExtension}")
)
)
)
upsertId2 <- runUpsertCram(
upsertKey,
CramMetadata(
cramPath = Some(
URI.create(s"gs://path/cram2${CramExtensions.CramExtension}")
)
)
)
} yield {
upsertId2 should be > upsertId1
val storedDocument1 = getJsonFrom(upsertId1)(ElasticsearchIndex.Cram)
storedDocument1.unsafeGet[URI]("cram_path") should be(
URI.create(s"gs://path/cram1${CramExtensions.CramExtension}")
)
val storedDocument2 = getJsonFrom(upsertId2)(ElasticsearchIndex.Cram)
storedDocument2.unsafeGet[URI]("cram_path") should be(
URI.create(s"gs://path/cram2${CramExtensions.CramExtension}")
)
storedDocument1.deepMerge {
Json.obj(
ElasticsearchIndex.UpsertIdElasticsearchName -> upsertId2.asJson,
"cram_path" -> s"gs://path/cram2${CramExtensions.CramExtension}".asJson
)
} should be(storedDocument2)
}
}
it should "assign different upsertIds to equal cram upserts" in {
val upsertKey = CramKey(
location = Location.GCP,
project = s"project$randomId",
sampleAlias = s"sample$randomId",
version = 1,
dataType = DataType.WGS
)
val upsertData = CramMetadata(
cramPath = Some(URI.create(s"gs://path/cram1${CramExtensions.CramExtension}"))
)
for {
upsertId1 <- runUpsertCram(upsertKey, upsertData)
upsertId2 <- runUpsertCram(upsertKey, upsertData)
} yield {
upsertId2 should be > upsertId1
val storedDocument1 = getJsonFrom(upsertId1)(ElasticsearchIndex.Cram)
val storedDocument2 = getJsonFrom(upsertId2)(ElasticsearchIndex.Cram)
storedDocument1.mapObject(
_.add(ElasticsearchIndex.UpsertIdElasticsearchName, upsertId2.asJson)
) should be(storedDocument2)
}
}
it should "handle querying crams by sample and project" in {
val location = Location.GCP
val project = "testProject" + randomId
val samples = {
val sameId = "testSample" + randomId
Seq(sameId, sameId, "testSample" + randomId)
}
val upserts = Future.sequence {
samples.zip(1 to 3).map {
case (sample, version) =>
val key = CramKey(location, project, DataType.WGS, sample, version)
val data = CramMetadata(
cramPath = Some(
URI.create(s"gs://path/cram${CramExtensions.CramExtension}")
),
cramSize = Some(1000L)
)
runUpsertCram(key, data)
}
}
for {
_ <- upserts
projectResults <- runCollectJson(
ClioCommand.queryCramName,
"--project",
project
)
sampleResults <- runCollectJson(
ClioCommand.queryCramName,
"--sample-alias",
samples.head
)
} yield {
projectResults should have length 3
projectResults.foldLeft(succeed) { (_, result) =>
result.unsafeGet[String]("project") should be(project)
}
sampleResults should have length 2
sampleResults.foldLeft(succeed) { (_, result) =>
result.unsafeGet[String]("sample_alias") should be(samples.head)
}
}
}
it should "query crams by regulatory designation" in {
val location = Location.GCP
val project = "testProject" + randomId
val samples = {
val sameId = "testSample" + randomId
Seq(sameId, sameId, "testSample" + randomId)
}
val upserts = Future.sequence {
samples.zip(1 to 3).map {
case (sample, version) =>
val key = CramKey(location, project, DataType.WGS, sample, version)
val data = CramMetadata(
cramPath = Some(
URI.create(s"gs://path/cram${CramExtensions.CramExtension}")
),
cramSize = Some(1000L),
regulatoryDesignation = Some(RegulatoryDesignation.ClinicalDiagnostics)
)
runUpsertCram(key, data)
}
}
for {
_ <- upserts
results <- runCollectJson(
ClioCommand.queryCramName,
"--regulatory-designation",
RegulatoryDesignation.ClinicalDiagnostics.entryName,
"--project",
project
)
} yield {
results should have length 3
results.foldLeft(succeed) { (_, result) =>
result.unsafeGet[String]("project") should be(project)
}
}
}
it should "only return exact matches for string queries" in {
val location = Location.GCP
val project = s"testProject$randomId"
val prefix = s"testSample$randomId"
val suffix = s"${randomId}testSample"
val samples = Seq(prefix, suffix, s"$prefix-$suffix")
val upserts = Future.sequence {
samples.zip(1 to 3).map {
case (sample, version) =>
val key = CramKey(location, project, DataType.WGS, sample, version)
val data = CramMetadata(
cramPath = Some(
URI.create(s"gs://path/cram${CramExtensions.CramExtension}")
),
cramSize = Some(1000L)
)
runUpsertCram(key, data)
}
}
for {
_ <- upserts
prefixResults <- runCollectJson(
ClioCommand.queryCramName,
"--sample-alias",
prefix
)
suffixResults <- runCollectJson(
ClioCommand.queryCramName,
"--sample-alias",
suffix
)
} yield {
prefixResults should have length 1
suffixResults should have length 1
}
}
it should "handle updates to cram metadata" in {
val project = s"testProject$randomId"
val key = CramKey(Location.GCP, project, DataType.WGS, s"testSample$randomId", 1)
val cramPath = URI.create(s"gs://path/cram${CramExtensions.CramExtension}")
val cramSize = 1000L
val initialNotes = "Breaking news"
val metadata = CramMetadata(
cramPath = Some(cramPath),
cramSize = Some(cramSize),
notes = Some(initialNotes)
)
def query = {
for {
results <- runCollectJson(
ClioCommand.queryCramName,
"--project",
project
)
} yield {
results should have length 1
results.head
}
}
val upsertData = CramMetadata(
cramSize = metadata.cramSize,
cramPath = metadata.cramPath
)
for {
_ <- runUpsertCram(key, upsertData)
original <- query
_ = original.unsafeGet[URI]("cram_path") should be(cramPath)
_ = original.unsafeGet[Long]("cram_size") should be(cramSize)
_ = original.unsafeGet[Option[String]]("notes") should be(None)
upsertData2 = upsertData.copy(notes = metadata.notes)
_ <- runUpsertCram(key, upsertData2)
withNotes <- query
_ = withNotes.unsafeGet[URI]("cram_path") should be(cramPath)
_ = withNotes.unsafeGet[Long]("cram_size") should be(cramSize)
_ = withNotes.unsafeGet[String]("notes") should be(initialNotes)
_ <- runUpsertCram(
key,
upsertData2.copy(cramSize = Some(2000L), notes = Some(""))
)
emptyNotes <- query
} yield {
emptyNotes.unsafeGet[URI]("cram_path") should be(cramPath)
emptyNotes.unsafeGet[Long]("cram_size") should be(2000L)
emptyNotes.unsafeGet[String]("notes") should be("")
}
}
def testQueryAll(documentStatus: DocumentStatus): Future[Assertion] = {
val queryArg = documentStatus match {
case DocumentStatus.Deleted => "--include-deleted"
case DocumentStatus.External => "--include-all"
case _ => ""
}
val project = "testProject" + randomId
val sampleAlias = "sample688." + randomId
val keysWithMetadata = (1 to 3).map { version =>
val upsertKey = CramKey(
location = Location.GCP,
project = project,
sampleAlias = sampleAlias,
version = version,
dataType = DataType.WGS
)
val upsertMetadata = CramMetadata(
cramPath = Some(URI.create(s"gs://cram/$sampleAlias.$version"))
)
(upsertKey, upsertMetadata)
}
val (notNormalKey, notNormalData) = keysWithMetadata.head
val upserts = Future.sequence {
keysWithMetadata.map {
case (v1Key, metadata) => runUpsertCram(v1Key, metadata)
}
}
def checkQuery(expectedLength: Int) = {
for {
results <- runCollectJson(
ClioCommand.queryCramName,
"--project",
project,
"--sample-alias",
sampleAlias
)
} yield {
results.length should be(expectedLength)
results.foreach { result =>
result.unsafeGet[String]("project") should be(project)
result.unsafeGet[String]("sample_alias") should be(sampleAlias)
result.unsafeGet[DocumentStatus]("document_status") should be(
DocumentStatus.Normal
)
}
results
}
}
for {
_ <- upserts
_ <- checkQuery(expectedLength = 3)
_ <- runUpsertCram(
notNormalKey,
notNormalData.copy(documentStatus = Some(documentStatus))
)
_ <- checkQuery(expectedLength = 2)
results <- runCollectJson(
ClioCommand.queryCramName,
"--project",
project,
"--sample-alias",
sampleAlias,
queryArg
)
} yield {
results.length should be(keysWithMetadata.length)
results.foldLeft(succeed) { (_, result) =>
result.unsafeGet[String]("project") should be(project)
result.unsafeGet[String]("sample_alias") should be(sampleAlias)
val resultKey = CramKey(
location = result.unsafeGet[Location]("location"),
project = result.unsafeGet[String]("project"),
sampleAlias = result.unsafeGet[String]("sample_alias"),
version = result.unsafeGet[Int]("version"),
dataType = result.unsafeGet[DataType]("data_type")
)
result.unsafeGet[DocumentStatus]("document_status") should be {
if (resultKey == notNormalKey) documentStatus else DocumentStatus.Normal
}
}
}
}
it should "show deleted cram records on queryAll, but not query" in {
testQueryAll(DocumentStatus.Deleted)
}
it should "show External cram records on queryAll, but not query" in {
testQueryAll(DocumentStatus.External)
}
def createMockFile(
rootDir: File,
baseName: String,
extension: String
): (File, String) = {
val fileContents = s"$randomId --- I am dummy '$extension' file --- $randomId"
val filePath: File = rootDir / s"$baseName$extension"
filePath.write(fileContents)
(filePath, fileContents)
}
def testMoveCram(
oldStyleCrai: Boolean = false,
changeBasename: Boolean = false
): Future[Assertion] = {
val project = s"project$randomId"
val sample = s"sample$randomId"
val flowcellBarcode = Random.alphanumeric.take(9).mkString
val lane = Random.nextInt(7) + 1
val libraryName = Random.alphanumeric.take(30).mkString
val readgroup = s"$flowcellBarcode.$lane.$libraryName"
val version = 3
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName =
s"${if (oldStyleCrai) sample else cramName}"
val rootSrc = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val (cramSrc, cramContents) =
createMockFile(rootSrc, sample, CramExtensions.CramExtension)
val (craiSrc, craiContents) =
createMockFile(rootSrc, craiName, CramExtensions.CraiExtensionAddition)
val (analysisFilesSrc, analysisFilesContents) =
createMockFile(rootSrc, sample, CramExtensions.AnalysisFilesTxtExtension)
val (alignmentSummaryMetricsSrc, alignmentSummaryMetricsContents) =
createMockFile(rootSrc, sample, CramExtensions.AlignmentSummaryMetricsExtension)
val (bamValidationReportSrc, bamValidationReportContents) =
createMockFile(rootSrc, sample, CramExtensions.BamValidationReportExtension)
val (cramValidationReportSrc, cramValidationReportContents) =
createMockFile(rootSrc, sample, CramExtensions.CramValidationReportExtension)
val (crosscheckSrc, crosscheckContents) =
createMockFile(rootSrc, sample, CramExtensions.CrossCheckExtension)
val (duplicateMetricsSrc, duplicateMetricsContents) =
createMockFile(rootSrc, sample, CramExtensions.DuplicateMetricsExtension)
val (fingerprintSrc, fingerprintContents) =
createMockFile(rootSrc, sample, CramExtensions.FingerprintVcfExtension)
val (fingerprintSummaryMetricsSrc, fingerprintingSummaryMetricsContents) =
createMockFile(
rootSrc,
sample,
CramExtensions.FingerprintingSummaryMetricsExtension
)
val (fingerprintDetailMetricsSrc, fingerprintingDetailMetricsContents) =
createMockFile(
rootSrc,
sample,
CramExtensions.FingerprintingDetailMetricsExtension
)
val (preAdapterSummaryMetricsSrc, preAdapterSummaryMetricsContents) =
createMockFile(rootSrc, sample, CramExtensions.PreAdapterSummaryMetricsExtension)
val (preAdapterDetailMetricsSrc, preAdapterDetailMetricsContents) =
createMockFile(rootSrc, sample, CramExtensions.PreAdapterDetailMetricsExtension)
val (preBqsrSelfSmSrc, preBqsrSelfSmContents) =
createMockFile(rootSrc, sample, CramExtensions.PreBqsrSelfSMExtension)
val (preBqsrDepthSmSrc, preBqsrDepthSmContents) =
createMockFile(rootSrc, sample, CramExtensions.PreBqsrDepthSMExtension)
val (hybridSelectionMetricsSrc, hybridSelectionMetricsContents) =
createMockFile(rootSrc, sample, CramExtensions.HybridSelectionMetricsExtension)
val (insertSizeMetricsSrc, insertSizeMetricsContents) =
createMockFile(rootSrc, readgroup, ".insert_size_metrics")
val (insertSizeHistogramSrc, insertSizeHistogramContents) =
createMockFile(rootSrc, readgroup, ".insert_size_histogram.pdf")
val endBasename = if (changeBasename) randomId else sample
val rootDest = rootSrc.parent / s"moved/$randomId/"
val cramDest = rootDest / s"$endBasename${CramExtensions.CramExtension}"
val craiDest = rootDest / s"$endBasename${CramExtensions.CraiExtension}"
val analysisFilesDest = rootDest / s"$endBasename${CramExtensions.AnalysisFilesTxtExtension}"
val alignmentSummaryMetricsDest = rootDest / s"$endBasename${CramExtensions.AlignmentSummaryMetricsExtension}"
val bamValidationReportDest = rootDest / s"$endBasename${CramExtensions.BamValidationReportExtension}"
val cramValidationReportDest = rootDest / s"$endBasename${CramExtensions.CramValidationReportExtension}"
val crosscheckDest = rootDest / s"$endBasename${CramExtensions.CrossCheckExtension}"
val duplicateMetricsDest = rootDest / s"$endBasename${CramExtensions.DuplicateMetricsExtension}"
val fingerprintDest = rootDest / s"$endBasename${CramExtensions.FingerprintVcfExtension}"
val fingerprintSummaryMetricsDest = rootDest / s"$endBasename${CramExtensions.FingerprintingSummaryMetricsExtension}"
val fingerprintDetailMetricsDest = rootDest / s"$endBasename${CramExtensions.FingerprintingDetailMetricsExtension}"
val hybridSelectionMetricsDest = rootDest / s"$endBasename${CramExtensions.HybridSelectionMetricsExtension}"
val preAdapterSummaryMetricsDest = rootDest / s"$endBasename${CramExtensions.PreAdapterSummaryMetricsExtension}"
val preAdapterDetailMetricsDest = rootDest / s"$endBasename${CramExtensions.PreAdapterDetailMetricsExtension}"
val preBqsrSelfSmDest = rootDest / s"$endBasename${CramExtensions.PreBqsrSelfSMExtension}"
val preBqsrDepthSmDest = rootDest / s"$endBasename${CramExtensions.PreBqsrDepthSMExtension}"
val insertSizeMetricsDest = rootDest / insertSizeMetricsSrc.name
val insertSizeHistogramDest = rootDest / insertSizeHistogramSrc.name
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSrc.uri),
craiPath = Some(craiSrc.uri),
analysisFilesTxtPath = Some(analysisFilesSrc.uri),
alignmentSummaryMetricsPath = Some(alignmentSummaryMetricsSrc.uri),
bamValidationReportPath = Some(bamValidationReportSrc.uri),
cramValidationReportPath = Some(cramValidationReportSrc.uri),
crosscheckPath = Some(crosscheckSrc.uri),
duplicateMetricsPath = Some(duplicateMetricsSrc.uri),
fingerprintPath = Some(fingerprintSrc.uri),
fingerprintingSummaryMetricsPath = Some(fingerprintSummaryMetricsSrc.uri),
fingerprintingDetailMetricsPath = Some(fingerprintDetailMetricsSrc.uri),
hybridSelectionMetricsPath = Some(hybridSelectionMetricsSrc.uri),
preAdapterSummaryMetricsPath = Some(preAdapterSummaryMetricsSrc.uri),
preAdapterDetailMetricsPath = Some(preAdapterDetailMetricsSrc.uri),
preBqsrSelfSmPath = Some(preBqsrSelfSmSrc.uri),
preBqsrDepthSmPath = Some(preBqsrDepthSmSrc.uri),
readgroupLevelMetricsFiles =
Some(List(insertSizeMetricsSrc.uri, insertSizeHistogramSrc.uri))
)
val args = Seq.concat(
Seq(
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--destination",
rootDest.uri.toString
),
if (changeBasename) {
Seq("--new-basename", endBasename)
} else {
Seq.empty
}
)
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(ClioCommand.moveCramName, args: _*)
} yield {
Seq(
cramSrc,
craiSrc,
analysisFilesSrc,
alignmentSummaryMetricsSrc,
bamValidationReportSrc,
cramValidationReportSrc,
crosscheckSrc,
duplicateMetricsSrc,
fingerprintSrc,
fingerprintSummaryMetricsSrc,
fingerprintDetailMetricsSrc,
hybridSelectionMetricsSrc,
preAdapterSummaryMetricsSrc,
preAdapterDetailMetricsSrc,
preBqsrSelfSmSrc,
preBqsrDepthSmSrc,
insertSizeMetricsSrc,
insertSizeHistogramSrc
).foreach(_ shouldNot exist)
Seq(
cramDest,
craiDest,
analysisFilesDest,
alignmentSummaryMetricsDest,
bamValidationReportDest,
cramValidationReportDest,
crosscheckDest,
duplicateMetricsDest,
fingerprintDest,
fingerprintSummaryMetricsDest,
fingerprintDetailMetricsDest,
hybridSelectionMetricsDest,
preAdapterSummaryMetricsDest,
preAdapterDetailMetricsDest,
preBqsrSelfSmDest,
preBqsrDepthSmDest,
insertSizeMetricsDest,
insertSizeHistogramDest
).foreach(_ should exist)
Seq(
(cramDest, cramContents),
(craiDest, craiContents),
(analysisFilesDest, analysisFilesContents),
(alignmentSummaryMetricsDest, alignmentSummaryMetricsContents),
(bamValidationReportDest, bamValidationReportContents),
(cramValidationReportDest, cramValidationReportContents),
(crosscheckDest, crosscheckContents),
(duplicateMetricsDest, duplicateMetricsContents),
(fingerprintDest, fingerprintContents),
(fingerprintSummaryMetricsDest, fingerprintingSummaryMetricsContents),
(fingerprintDetailMetricsDest, fingerprintingDetailMetricsContents),
(hybridSelectionMetricsDest, hybridSelectionMetricsContents),
(preAdapterSummaryMetricsDest, preAdapterSummaryMetricsContents),
(preAdapterDetailMetricsDest, preAdapterDetailMetricsContents),
(preBqsrSelfSmDest, preBqsrSelfSmContents),
(preBqsrDepthSmDest, preBqsrDepthSmContents),
(insertSizeMetricsDest, insertSizeMetricsContents),
(insertSizeHistogramDest, insertSizeHistogramContents)
).foreach {
case (dest, contents) =>
dest.contentAsString should be(contents)
}
succeed
}
result.andThen {
case _ => {
val _ = Seq(
cramSrc,
cramDest,
craiSrc,
craiDest,
analysisFilesSrc,
analysisFilesDest,
alignmentSummaryMetricsSrc,
alignmentSummaryMetricsDest,
bamValidationReportSrc,
bamValidationReportDest,
cramValidationReportSrc,
cramValidationReportDest,
crosscheckSrc,
crosscheckDest,
duplicateMetricsSrc,
duplicateMetricsDest,
fingerprintSrc,
fingerprintDest,
fingerprintSummaryMetricsSrc,
fingerprintSummaryMetricsDest,
fingerprintDetailMetricsSrc,
fingerprintDetailMetricsDest,
hybridSelectionMetricsSrc,
hybridSelectionMetricsDest,
preAdapterSummaryMetricsSrc,
preAdapterSummaryMetricsDest,
preAdapterDetailMetricsSrc,
preAdapterDetailMetricsDest,
preBqsrSelfSmSrc,
preBqsrSelfSmDest,
preBqsrDepthSmSrc,
preBqsrDepthSmDest,
insertSizeMetricsSrc,
insertSizeMetricsDest,
insertSizeHistogramSrc,
insertSizeHistogramDest
).map(_.delete(swallowIOExceptions = true))
}
}
}
it should "move the cram and crai together in GCP" in testMoveCram()
it should "fixup the crai extension on move" in testMoveCram(
oldStyleCrai = true
)
it should "support changing the cram and crai basename on move" in testMoveCram(
changeBasename = true
)
it should "not move crams without a destination" in {
recoverToExceptionIf[Exception] {
runDecode[UpsertId](
ClioCommand.moveCramName,
"--location",
Location.GCP.entryName,
"--project",
randomId,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
randomId,
"--version",
"123"
)
}.map {
_.getMessage should include("--destination")
}
}
it should "not move crams with no registered files" in {
val key = CramKey(
Location.GCP,
s"project$randomId",
DataType.WGS,
s"sample$randomId",
1
)
runUpsertCram(key, CramMetadata()).flatMap { _ =>
recoverToExceptionIf[Exception] {
runDecode[UpsertId](
ClioCommand.moveCramName,
"--location",
key.location.entryName,
"--project",
key.project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
key.sampleAlias,
"--version",
key.version.toString,
"--destination",
"gs://some-destination/"
)
}.map {
_.getMessage should include("Nothing to move")
}
}
}
def testExternalCram(
existingNote: Option[String] = None
): Future[Assertion] = {
val markExternalNote =
s"$randomId --- Marked External by the integration tests --- $randomId"
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val cramContents = s"$randomId --- I am a cram fated for other worlds --- $randomId"
val craiContents = s"$randomId --- I am an index fated for other worlds --- $randomId"
val metrics1Contents = s"$randomId --- I am a questing metrics file --- $randomId"
val metrics2Contents =
s"$randomId --- I am a second questing metrics file --- $randomId"
val storageDir = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramPath = storageDir / s"$randomId${CramExtensions.CramExtension}"
val craiPath = storageDir / s"$randomId${CramExtensions.CraiExtensionAddition}"
val metrics1Path = storageDir / s"$randomId.metrics"
val metrics2Path = storageDir / s"$randomId.metrics"
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramPath.uri),
craiPath = Some(craiPath.uri),
alignmentSummaryMetricsPath = Some(metrics1Path.uri),
fingerprintingSummaryMetricsPath = Some(metrics1Path.uri),
notes = existingNote
)
Seq(
(cramPath, cramContents),
(craiPath, craiContents),
(metrics1Path, metrics1Contents),
(metrics2Path, metrics2Contents)
).map {
case (path, contents) => path.write(contents)
}
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(
ClioCommand.markExternalCramName,
Seq(
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--note",
markExternalNote
).filter(_.nonEmpty): _*
)
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--include-deleted"
)
} yield {
outputs should have length 1
val output = outputs.head
output.unsafeGet[String]("notes") should be(
metadata.notes.fold(markExternalNote)(existing => s"$existing\n$markExternalNote")
)
output.unsafeGet[DocumentStatus]("document_status") should be(
DocumentStatus.External
)
}
result.andThen[Unit] {
case _ => {
// Without `val _ =`, the compiler complains about discarded non-Unit value.
val _ = Seq(cramPath, craiPath, metrics1Path, metrics2Path)
.map(_.delete(swallowIOExceptions = true))
}
}
}
it should "mark crams as External when marking external" in {
testExternalCram()
}
it should "require a note when marking a cram as External" in {
recoverToExceptionIf[Exception] {
runDecode[UpsertId](
ClioCommand.markExternalCramName,
"--location",
Location.GCP.entryName,
"--project",
randomId,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
randomId,
"--version",
"123"
)
}.map {
_.getMessage should include("--note")
}
}
it should "preserve existing notes when marking crams as External" in testExternalCram(
existingNote = Some(s"$randomId --- I am an existing note --- $randomId")
)
def testDeleteCram(
existingNote: Option[String] = None,
testNonExistingFile: Boolean = false,
force: Boolean = false,
workspaceName: Option[String] = None
): Future[Assertion] = {
val deleteNote = s"$randomId --- Deleted by the integration tests --- $randomId"
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val cramContents = s"$randomId --- I am a cram fated to die --- $randomId"
val craiContents = s"$randomId --- I am an index fated to die --- $randomId"
val metrics1Contents = s"$randomId --- I am an immortal metrics file --- $randomId"
val metrics2Contents =
s"$randomId --- I am a second immortal metrics file --- $randomId"
val storageDir = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramPath = storageDir / s"$randomId${CramExtensions.CramExtension}"
val craiPath = storageDir / s"$randomId${CramExtensions.CraiExtensionAddition}"
val metrics1Path = storageDir / s"$randomId.metrics"
val metrics2Path = storageDir / s"$randomId.metrics"
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramPath.uri),
craiPath = Some(craiPath.uri),
alignmentSummaryMetricsPath = Some(metrics1Path.uri),
fingerprintingSummaryMetricsPath = Some(metrics1Path.uri),
notes = existingNote,
workspaceName = workspaceName
)
val _ = if (!testNonExistingFile) {
Seq(
(cramPath, cramContents),
(craiPath, craiContents),
(metrics1Path, metrics1Contents),
(metrics2Path, metrics2Contents)
).map {
case (path, contents) => path.write(contents)
}
}
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(
ClioCommand.deleteCramName,
Seq(
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--note",
deleteNote,
if (force) "--force" else ""
).filter(_.nonEmpty): _*
)
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--include-deleted"
)
} yield {
Seq(cramPath, craiPath).foreach(_ shouldNot exist)
if (!testNonExistingFile) {
Seq((metrics1Path, metrics1Contents), (metrics2Path, metrics2Contents)).foreach {
case (path, contents) => {
path should exist
path.contentAsString should be(contents)
}
}
}
outputs should have length 1
val output = outputs.head
output.unsafeGet[String]("notes") should be(
existingNote.fold(deleteNote)(existing => s"$existing\n$deleteNote")
)
output.unsafeGet[DocumentStatus]("document_status") should be(
DocumentStatus.Deleted
)
}
result.andThen[Unit] {
case _ => {
// Without `val _ =`, the compiler complains about discarded non-Unit value.
val _ = Seq(cramPath, craiPath, metrics1Path, metrics2Path)
.map(_.delete(swallowIOExceptions = true))
}
}
}
it should "delete crams in GCP along with their crais, but not their metrics" in testDeleteCram()
it should "preserve existing notes when deleting crams" in testDeleteCram(
existingNote = Some(s"$randomId --- I am an existing note --- $randomId")
)
it should "not delete crams without a note" in {
recoverToExceptionIf[Exception] {
runDecode[UpsertId](
ClioCommand.deleteCramName,
"--location",
Location.GCP.entryName,
"--project",
randomId,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
randomId,
"--version",
"123"
)
}.map {
_.getMessage should include("--note")
}
}
it should "throw an exception deleting the associated md5 if the workspaceName is set and the md5 is missing" in {
recoverToSucceededIf[Exception] {
testDeleteCram(workspaceName = Some("testWorkspace"))
}
}
it should "throw an exception when trying to delete a cram if a file does not exist" in {
recoverToSucceededIf[Exception] {
testDeleteCram(testNonExistingFile = true)
}
}
it should "delete a cram if a file does not exist and force is true" in testDeleteCram(
testNonExistingFile = true,
force = true
)
def testDeliverMetrics(
deliverMetrics: Boolean,
regulatoryDesignation: RegulatoryDesignation,
customBillingProject: Boolean = false
): Future[Assertion] = {
val id = randomId
val project = s"project$id"
val sample = s"sample$id"
val version = 3
val cramContents = s"$id --- I am a dummy cram --- $id"
val craiContents = s"$id --- I am a dummy crai --- $id"
val md5Contents = randomId
val crosscheckContents = s"$id --- I am a dummy crosscheck --- $id"
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName = s"$cramName${CramExtensions.CraiExtensionAddition}"
val md5Name = s"$cramName${CramExtensions.Md5ExtensionAddition}"
val crosscheckName = s"$cramName.crosscheck"
val rootSource = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramSource = rootSource / cramName
val craiSource = rootSource / craiName
val crosscheckSource = rootSource / crosscheckName
val prefix = "new_basename_"
val newBasename = s"$prefix$sample"
val rootDestination = rootSource.parent / s"moved/$id/"
val cramDestination = rootDestination / s"$prefix$cramName"
val craiDestination = rootDestination / s"$prefix$craiName"
val md5Destination = rootDestination / s"$prefix$md5Name"
val crosscheckDestination = rootDestination / s"$prefix$crosscheckName"
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSource.uri),
craiPath = Some(craiSource.uri),
cramMd5 = Some(Symbol(md5Contents)),
documentStatus = Some(DocumentStatus.Normal),
crosscheckPath = Some(crosscheckSource.uri),
regulatoryDesignation = Some(regulatoryDesignation)
)
val workspaceName = s"$id-TestWorkspace-$id"
val billingProject =
if (customBillingProject) s"$id-TestBillingProject-$id"
else ClioCommand.defaultBillingProject
val _ = Seq(
(cramSource, cramContents),
(craiSource, craiContents),
(crosscheckSource, crosscheckContents)
).map {
case (source, contents) => source.write(contents)
}
val customBillingProjectArgs =
if (customBillingProject) {
Seq("--billing-project", billingProject)
} else {
Seq.empty
}
val commandArgs = Seq(
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--workspace-name",
workspaceName,
"--workspace-path",
rootDestination.uri.toString,
"--new-basename",
newBasename
) ++ (if (deliverMetrics) Some("--deliver-sample-metrics") else None) ++ customBillingProjectArgs
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(ClioCommand.deliverCramName, commandArgs: _*)
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--workspace-name",
workspaceName
)
} yield {
(Seq(cramSource, craiSource) ++ (if (deliverMetrics)
Some(crosscheckSource)
else Some(crosscheckDestination)))
.foreach(_ shouldNot exist)
(Seq(cramDestination, craiDestination, md5Destination) ++ (if (deliverMetrics)
Some(
crosscheckDestination
)
else
Some(
crosscheckSource
)))
.foreach(_ should exist)
Seq(
(cramDestination, cramContents),
(craiDestination, craiContents),
(md5Destination, md5Contents),
(
if (deliverMetrics) crosscheckDestination else crosscheckSource,
crosscheckContents
)
).foreach {
case (destination, contents) =>
destination.contentAsString should be(contents)
}
outputs should contain only expectedMerge(
key,
metadata.copy(
workspaceName = Some(workspaceName),
billingProject = Some(billingProject),
cramPath = Some(cramDestination.uri),
craiPath = Some(craiDestination.uri),
crosscheckPath = Some(
(if (deliverMetrics) crosscheckDestination else crosscheckSource).uri
)
)
)
}
result.andThen {
case _ => {
val _ = Seq(
cramSource,
cramDestination,
craiSource,
craiDestination,
md5Destination,
crosscheckSource,
crosscheckDestination
).map(_.delete(swallowIOExceptions = true))
}
}
}
RegulatoryDesignation.values.foreach(
designation ⇒
if (designation.isClinical) {
it should s"throw an exception when delivering metrics and designation is $designation" in {
recoverToSucceededIf[Exception] {
testDeliverMetrics(true, designation)
}
}
} else {
it should s"move files, generate an md5 file, " +
s"deliver metrics, and record the workspace name when delivering crams " +
s"($designation, deliverMetrics=true)" in {
testDeliverMetrics(true, designation)
}
}
)
RegulatoryDesignation.values.foreach { designation ⇒
it should s"move files, generate an md5 file, not " +
s"deliver metrics, and record the workspace name when delivering crams " +
s"($designation, deliverMetrics=false)" in {
testDeliverMetrics(false, designation)
}
}
it should "deliver with a custom billing project" in {
testDeliverMetrics(true, RegulatoryDesignation.ResearchOnly, true)
}
it should "not fail delivery if the cram is already in its target location" in {
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val cramContents = s"$randomId --- I am a dummy cram --- $randomId"
val craiContents = s"$randomId --- I am a dummy crai --- $randomId"
val md5Contents = randomId
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName = s"$cramName${CramExtensions.CraiExtensionAddition}"
val md5Name = s"$cramName${CramExtensions.Md5ExtensionAddition}"
val rootSource = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramSource = rootSource / cramName
val craiSource = rootSource / craiName
val md5Destination = rootSource / md5Name
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSource.uri),
craiPath = Some(craiSource.uri),
cramMd5 = Some(Symbol(md5Contents)),
documentStatus = Some(DocumentStatus.Normal)
)
val workspaceName = s"$randomId-TestWorkspace-$randomId"
val _ = Seq((cramSource, cramContents), (craiSource, craiContents)).map {
case (source, contents) => source.write(contents)
}
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(
ClioCommand.deliverCramName,
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--workspace-name",
workspaceName,
"--workspace-path",
rootSource.uri.toString
)
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--workspace-name",
workspaceName
)
} yield {
Seq(cramSource, craiSource, md5Destination).foreach(_ should exist)
Seq(
(cramSource, cramContents),
(craiSource, craiContents),
(md5Destination, md5Contents)
).foreach {
case (destination, contents) =>
destination.contentAsString should be(contents)
}
outputs should contain only expectedMerge(
key,
metadata.copy(
workspaceName = Some(workspaceName),
billingProject = Some(ClioCommand.defaultBillingProject)
)
)
}
result.andThen {
case _ => {
val _ = Seq(cramSource, craiSource, md5Destination)
.map(_.delete(swallowIOExceptions = true))
}
}
}
it should "respect user-set regulatory designation for crams" in {
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val md5Contents = randomId
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName = s"$cramName${CramExtensions.CraiExtensionAddition}"
val rootSource = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramSource = rootSource / cramName
val craiSource = rootSource / craiName
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSource.uri),
craiPath = Some(craiSource.uri),
cramMd5 = Some(Symbol(md5Contents)),
regulatoryDesignation = Some(RegulatoryDesignation.ClinicalDiagnostics)
)
def query = {
for {
results <- runCollectJson(
ClioCommand.queryCramName,
"--project",
project
)
} yield {
results should have length 1
results.head
}
}
for {
_ <- runUpsertCram(key, metadata)
result <- query
} yield {
result.unsafeGet[RegulatoryDesignation]("regulatory_designation") should be(
RegulatoryDesignation.ClinicalDiagnostics
)
}
}
it should "not overwrite existing regulatory designation on cram delivery" in {
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val cramContents = s"$randomId --- I am a dummy cram --- $randomId"
val craiContents = s"$randomId --- I am a dummy crai --- $randomId"
val md5Contents = randomId
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName = s"$cramName${CramExtensions.CraiExtensionAddition}"
val md5Name = s"$cramName${CramExtensions.Md5ExtensionAddition}"
val cramRegulatoryDesignation = Some(RegulatoryDesignation.ClinicalDiagnostics)
val rootSource = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramSource = rootSource / cramName
val craiSource = rootSource / craiName
val rootDestination = rootSource.parent / s"moved/$randomId/"
val cramDestination = rootDestination / cramName
val craiDestination = rootDestination / craiName
val md5Destination = rootDestination / md5Name
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSource.uri),
craiPath = Some(craiSource.uri),
cramMd5 = Some(Symbol(md5Contents)),
regulatoryDesignation = cramRegulatoryDesignation,
documentStatus = Some(DocumentStatus.Normal)
)
val workspaceName = s"$randomId-TestWorkspace-$randomId"
val _ = Seq((cramSource, cramContents), (craiSource, craiContents)).map {
case (source, contents) => source.write(contents)
}
val result = for {
_ <- runUpsertCram(key, metadata)
_ <- runIgnore(
ClioCommand.deliverCramName,
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--workspace-name",
workspaceName,
"--workspace-path",
rootDestination.uri.toString
)
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--workspace-name",
workspaceName
)
} yield {
Seq(cramSource, craiSource).foreach(_ shouldNot exist)
Seq(cramDestination, craiDestination, md5Destination).foreach(_ should exist)
Seq(
(cramDestination, cramContents),
(craiDestination, craiContents),
(md5Destination, md5Contents)
).foreach {
case (destination, contents) =>
destination.contentAsString should be(contents)
}
outputs should contain only expectedMerge(
key,
metadata.copy(
workspaceName = Some(workspaceName),
billingProject = Some(ClioCommand.defaultBillingProject),
cramPath = Some(cramDestination.uri),
craiPath = Some(craiDestination.uri)
)
)
}
result.andThen {
case _ => {
val _ = Seq(
cramSource,
cramDestination,
craiSource,
craiDestination,
md5Destination
).map(_.delete(swallowIOExceptions = true))
}
}
}
it should "fail delivery if the underlying move fails" in {
val project = s"project$randomId"
val sample = s"sample$randomId"
val version = 3
val md5Contents = randomId
val cramName = s"$sample${CramExtensions.CramExtension}"
val craiName = s"$cramName${CramExtensions.CraiExtensionAddition}"
val rootSource = rootTestStorageDir / s"cram/$project/$sample/v$version/"
val cramSource = rootSource / cramName
val craiSource = rootSource / craiName
val rootDestination = rootSource.parent / s"moved/$randomId/"
val key = CramKey(Location.GCP, project, DataType.WGS, sample, version)
val metadata = CramMetadata(
cramPath = Some(cramSource.uri),
craiPath = Some(craiSource.uri),
cramMd5 = Some(Symbol(md5Contents))
)
val workspaceName = s"$randomId-TestWorkspace-$randomId"
recoverToExceptionIf[Exception] {
for {
_ <- runUpsertCram(key, metadata)
// Should fail because the source files don't exist.
_ <- runIgnore(
ClioCommand.deliverCramName,
"--location",
Location.GCP.entryName,
"--project",
project,
"--data-type",
DataType.WGS.entryName,
"--sample-alias",
sample,
"--version",
version.toString,
"--workspace-name",
workspaceName,
"--workspace-path",
rootDestination.uri.toString
)
} yield {
()
}
}.flatMap { _ =>
for {
outputs <- runCollectJson(
ClioCommand.queryCramName,
"--workspace-name",
workspaceName
)
} yield {
// The CLP shouldn't have tried to upsert the workspace name.
outputs shouldBe empty
}
}
}
it should "upsert a new cram if force is false" in {
val upsertKey = CramKey(
location = Location.GCP,
project = s"project$randomId",
sampleAlias = s"sample$randomId",
version = 1,
dataType = DataType.WGS
)
for {
upsertId1 <- runUpsertCram(
upsertKey,
CramMetadata(notes = Some("I'm a note")),
force = false
)
} yield {
val storedDocument1 = getJsonFrom(upsertId1)(ElasticsearchIndex.Cram)
storedDocument1.unsafeGet[String]("notes") should be("I'm a note")
}
}
it should "allow an upsert that modifies values not already set or are unchanged if force is false" in {
val upsertKey = CramKey(
location = Location.GCP,
project = s"project$randomId",
sampleAlias = s"sample$randomId",
version = 1,
dataType = DataType.WGS
)
for {
upsertId1 <- runUpsertCram(
upsertKey,
CramMetadata(notes = Some("I'm a note")),
force = false
)
upsertId2 <- runUpsertCram(
upsertKey,
CramMetadata(notes = Some("I'm a note"), cramSize = Some(12345)),
force = false
)
} yield {
val storedDocument1 = getJsonFrom(upsertId1)(ElasticsearchIndex.Cram)
val storedDocument2 = getJsonFrom(upsertId2)(ElasticsearchIndex.Cram)
storedDocument1.unsafeGet[String]("notes") should be("I'm a note")
storedDocument2.unsafeGet[Long]("cram_size") should be(12345)
}
}
it should "not allow an upsert that modifies values already set if force is false" in {
val upsertKey = CramKey(
location = Location.GCP,
project = s"project$randomId",
sampleAlias = s"sample$randomId",
version = 1,
dataType = DataType.WGS
)
for {
upsertId1 <- runUpsertCram(
upsertKey,
CramMetadata(notes = Some("I'm a note")),
force = false
)
_ <- recoverToSucceededIf[Exception] {
runUpsertCram(
upsertKey,
CramMetadata(
notes = Some("I'm a different note")
),
force = false
)
}
} yield {
val storedDocument1 = getJsonFrom(upsertId1)(ElasticsearchIndex.Cram)
storedDocument1.unsafeGet[String]("notes") should be("I'm a note")
}
}
}
| broadinstitute/clio | clio-integration-test/src/it/scala/org/broadinstitute/clio/integrationtest/tests/CramTests.scala | Scala | bsd-3-clause | 52,259 |
---
id: 5900f5411000cf542c510054
challengeType: 5
title: 'Problem 468: Smooth divisors of binomial coefficients'
videoUrl: ''
localeTitle: 问题468:二项式系数的平滑除数
---
## Description
<section id="description">如果没有一个整数因子大于B,则整数称为B-smooth。 <p>设SB(n)是n的最大B-平滑除数。示例:S1(10)= 1 S4(2100)= 12 S17(2496144)= 5712 </p><p>定义F(n)=Σ1≤B≤nΣ0≤r≤nSB(C(n,r))。这里,C(n,r)表示二项式系数。示例:F(11)= 3132 F(1 111)mod 1 000 000 993 = 706036312 F(111 111)mod 1 000 000 993 = 22156169 </p><p>求F(11 111 111)mod 1 000 000 993。 </p></section>
## Instructions
<section id="instructions">
</section>
## Tests
<section id='tests'>
```yml
tests:
- text: <code>euler468()</code>应该返回852950321。
testString: assert.strictEqual(euler468(), 852950321);
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
function euler468() {
// Good luck!
return true;
}
euler468();
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>
| jonathanihm/freeCodeCamp | curriculum/challenges/chinese/08-coding-interview-prep/project-euler/problem-468-smooth-divisors-of-binomial-coefficients.chinese.md | Markdown | bsd-3-clause | 1,174 |
COMPONENT=EavesdropperC
# This assumes your State and Transceiver components are in /tos/lib relative to this
# directory:
CFLAGS += -I../../tos/lib/State -I../../tos/lib/Transceiver
#CFLAGS += -DMAX_TOS_MSGS=24
include $(TOSROOT)/apps/Makerules
| fresskarma/tinyos-1.x | contrib/rincon/apps/Eavesdropper/Makefile | Makefile | bsd-3-clause | 262 |
{% extends "account/keys/base.html" %}
{% block content %}
<blockquote><p>{{ key.description }}</p></blockquote>
{% if actions %}
<table>
<thead>
<th>Action</th>
<td></td>
</thead>
{% for action in actions %}
<td>
{%- set url = action.content_object.get_absolute_url and action.content_object.get_absolute_url() -%}
{%- if url -%}
<a href="{{ url }}">
{{- action.notes -}}
</a>
{%- else -%}
{{ action.notes }}
{%- endif -%}
</td>
<td>
{{- time_since(action.created, fuzzy=False) -}}
</td>
{% endfor %}
</table>
{% else %}
<p>{{ _('This key has not been used yet.') }}</p>
{% endif %}
<p>
{% if key.is_disabled %}
<a title="{{ _('Activate key') }}"
href="{{ url('account:keys:activate', key.slug) }}">{{ _('Activate') }}</a>
{% else %}
<a title="{{ _('Disable key') }}"
href="{{ url('account:keys:disable', key.slug) }}">{{ _('Disable') }}</a>
{% endif %}
<a href="{{ url('account:keys:delete', key.slug) }}">{{ _('Delete') }}</a>
</p>
{% endblock %} | mozilla/mozilla-badges | mozbadges/site/account/templates/account/keys/detail.html | HTML | bsd-3-clause | 1,285 |
// +build l476xx
package syscfg
// DO NOT EDIT THIS FILE. GENERATED BY xgen.
import (
"bits"
"mmio"
"unsafe"
"stm32/o/l476xx/mmap"
)
type SYSCFG_Periph struct {
MEMRMP RMEMRMP
CFGR1 RCFGR1
EXTICR [4]REXTICR
SCSR RSCSR
CFGR2 RCFGR2
SWPR RSWPR
SKR RSKR
}
func (p *SYSCFG_Periph) BaseAddr() uintptr {
return uintptr(unsafe.Pointer(p))
}
//emgo:const
var SYSCFG = (*SYSCFG_Periph)(unsafe.Pointer(uintptr(mmap.SYSCFG_BASE)))
type MEMRMP uint32
func (b MEMRMP) Field(mask MEMRMP) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask MEMRMP) J(v int) MEMRMP {
return MEMRMP(bits.MakeField32(v, uint32(mask)))
}
type RMEMRMP struct{ mmio.U32 }
func (r *RMEMRMP) Bits(mask MEMRMP) MEMRMP { return MEMRMP(r.U32.Bits(uint32(mask))) }
func (r *RMEMRMP) StoreBits(mask, b MEMRMP) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RMEMRMP) SetBits(mask MEMRMP) { r.U32.SetBits(uint32(mask)) }
func (r *RMEMRMP) ClearBits(mask MEMRMP) { r.U32.ClearBits(uint32(mask)) }
func (r *RMEMRMP) Load() MEMRMP { return MEMRMP(r.U32.Load()) }
func (r *RMEMRMP) Store(b MEMRMP) { r.U32.Store(uint32(b)) }
func (r *RMEMRMP) AtomicStoreBits(mask, b MEMRMP) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RMEMRMP) AtomicSetBits(mask MEMRMP) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RMEMRMP) AtomicClearBits(mask MEMRMP) { r.U32.AtomicClearBits(uint32(mask)) }
type RMMEMRMP struct{ mmio.UM32 }
func (rm RMMEMRMP) Load() MEMRMP { return MEMRMP(rm.UM32.Load()) }
func (rm RMMEMRMP) Store(b MEMRMP) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) MEM_MODE() RMMEMRMP {
return RMMEMRMP{mmio.UM32{&p.MEMRMP.U32, uint32(MEM_MODE)}}
}
func (p *SYSCFG_Periph) FB_MODE() RMMEMRMP {
return RMMEMRMP{mmio.UM32{&p.MEMRMP.U32, uint32(FB_MODE)}}
}
type CFGR1 uint32
func (b CFGR1) Field(mask CFGR1) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask CFGR1) J(v int) CFGR1 {
return CFGR1(bits.MakeField32(v, uint32(mask)))
}
type RCFGR1 struct{ mmio.U32 }
func (r *RCFGR1) Bits(mask CFGR1) CFGR1 { return CFGR1(r.U32.Bits(uint32(mask))) }
func (r *RCFGR1) StoreBits(mask, b CFGR1) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RCFGR1) SetBits(mask CFGR1) { r.U32.SetBits(uint32(mask)) }
func (r *RCFGR1) ClearBits(mask CFGR1) { r.U32.ClearBits(uint32(mask)) }
func (r *RCFGR1) Load() CFGR1 { return CFGR1(r.U32.Load()) }
func (r *RCFGR1) Store(b CFGR1) { r.U32.Store(uint32(b)) }
func (r *RCFGR1) AtomicStoreBits(mask, b CFGR1) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RCFGR1) AtomicSetBits(mask CFGR1) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RCFGR1) AtomicClearBits(mask CFGR1) { r.U32.AtomicClearBits(uint32(mask)) }
type RMCFGR1 struct{ mmio.UM32 }
func (rm RMCFGR1) Load() CFGR1 { return CFGR1(rm.UM32.Load()) }
func (rm RMCFGR1) Store(b CFGR1) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) FWDIS() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FWDIS)}}
}
func (p *SYSCFG_Periph) BOOSTEN() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(BOOSTEN)}}
}
func (p *SYSCFG_Periph) I2C_PB6_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C_PB6_FMP)}}
}
func (p *SYSCFG_Periph) I2C_PB7_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C_PB7_FMP)}}
}
func (p *SYSCFG_Periph) I2C_PB8_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C_PB8_FMP)}}
}
func (p *SYSCFG_Periph) I2C_PB9_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C_PB9_FMP)}}
}
func (p *SYSCFG_Periph) I2C1_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C1_FMP)}}
}
func (p *SYSCFG_Periph) I2C2_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C2_FMP)}}
}
func (p *SYSCFG_Periph) I2C3_FMP() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(I2C3_FMP)}}
}
func (p *SYSCFG_Periph) FPU_IE_0() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_0)}}
}
func (p *SYSCFG_Periph) FPU_IE_1() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_1)}}
}
func (p *SYSCFG_Periph) FPU_IE_2() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_2)}}
}
func (p *SYSCFG_Periph) FPU_IE_3() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_3)}}
}
func (p *SYSCFG_Periph) FPU_IE_4() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_4)}}
}
func (p *SYSCFG_Periph) FPU_IE_5() RMCFGR1 {
return RMCFGR1{mmio.UM32{&p.CFGR1.U32, uint32(FPU_IE_5)}}
}
type EXTICR uint32
func (b EXTICR) Field(mask EXTICR) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask EXTICR) J(v int) EXTICR {
return EXTICR(bits.MakeField32(v, uint32(mask)))
}
type REXTICR struct{ mmio.U32 }
func (r *REXTICR) Bits(mask EXTICR) EXTICR { return EXTICR(r.U32.Bits(uint32(mask))) }
func (r *REXTICR) StoreBits(mask, b EXTICR) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *REXTICR) SetBits(mask EXTICR) { r.U32.SetBits(uint32(mask)) }
func (r *REXTICR) ClearBits(mask EXTICR) { r.U32.ClearBits(uint32(mask)) }
func (r *REXTICR) Load() EXTICR { return EXTICR(r.U32.Load()) }
func (r *REXTICR) Store(b EXTICR) { r.U32.Store(uint32(b)) }
func (r *REXTICR) AtomicStoreBits(mask, b EXTICR) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *REXTICR) AtomicSetBits(mask EXTICR) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *REXTICR) AtomicClearBits(mask EXTICR) { r.U32.AtomicClearBits(uint32(mask)) }
type RMEXTICR struct{ mmio.UM32 }
func (rm RMEXTICR) Load() EXTICR { return EXTICR(rm.UM32.Load()) }
func (rm RMEXTICR) Store(b EXTICR) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) EXTI0(n int) RMEXTICR {
return RMEXTICR{mmio.UM32{&p.EXTICR[n].U32, uint32(EXTI0)}}
}
func (p *SYSCFG_Periph) EXTI1(n int) RMEXTICR {
return RMEXTICR{mmio.UM32{&p.EXTICR[n].U32, uint32(EXTI1)}}
}
func (p *SYSCFG_Periph) EXTI2(n int) RMEXTICR {
return RMEXTICR{mmio.UM32{&p.EXTICR[n].U32, uint32(EXTI2)}}
}
func (p *SYSCFG_Periph) EXTI3(n int) RMEXTICR {
return RMEXTICR{mmio.UM32{&p.EXTICR[n].U32, uint32(EXTI3)}}
}
type SCSR uint32
func (b SCSR) Field(mask SCSR) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask SCSR) J(v int) SCSR {
return SCSR(bits.MakeField32(v, uint32(mask)))
}
type RSCSR struct{ mmio.U32 }
func (r *RSCSR) Bits(mask SCSR) SCSR { return SCSR(r.U32.Bits(uint32(mask))) }
func (r *RSCSR) StoreBits(mask, b SCSR) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RSCSR) SetBits(mask SCSR) { r.U32.SetBits(uint32(mask)) }
func (r *RSCSR) ClearBits(mask SCSR) { r.U32.ClearBits(uint32(mask)) }
func (r *RSCSR) Load() SCSR { return SCSR(r.U32.Load()) }
func (r *RSCSR) Store(b SCSR) { r.U32.Store(uint32(b)) }
func (r *RSCSR) AtomicStoreBits(mask, b SCSR) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RSCSR) AtomicSetBits(mask SCSR) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RSCSR) AtomicClearBits(mask SCSR) { r.U32.AtomicClearBits(uint32(mask)) }
type RMSCSR struct{ mmio.UM32 }
func (rm RMSCSR) Load() SCSR { return SCSR(rm.UM32.Load()) }
func (rm RMSCSR) Store(b SCSR) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) SRAM2ER() RMSCSR {
return RMSCSR{mmio.UM32{&p.SCSR.U32, uint32(SRAM2ER)}}
}
func (p *SYSCFG_Periph) SRAM2BSY() RMSCSR {
return RMSCSR{mmio.UM32{&p.SCSR.U32, uint32(SRAM2BSY)}}
}
type CFGR2 uint32
func (b CFGR2) Field(mask CFGR2) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask CFGR2) J(v int) CFGR2 {
return CFGR2(bits.MakeField32(v, uint32(mask)))
}
type RCFGR2 struct{ mmio.U32 }
func (r *RCFGR2) Bits(mask CFGR2) CFGR2 { return CFGR2(r.U32.Bits(uint32(mask))) }
func (r *RCFGR2) StoreBits(mask, b CFGR2) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RCFGR2) SetBits(mask CFGR2) { r.U32.SetBits(uint32(mask)) }
func (r *RCFGR2) ClearBits(mask CFGR2) { r.U32.ClearBits(uint32(mask)) }
func (r *RCFGR2) Load() CFGR2 { return CFGR2(r.U32.Load()) }
func (r *RCFGR2) Store(b CFGR2) { r.U32.Store(uint32(b)) }
func (r *RCFGR2) AtomicStoreBits(mask, b CFGR2) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RCFGR2) AtomicSetBits(mask CFGR2) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RCFGR2) AtomicClearBits(mask CFGR2) { r.U32.AtomicClearBits(uint32(mask)) }
type RMCFGR2 struct{ mmio.UM32 }
func (rm RMCFGR2) Load() CFGR2 { return CFGR2(rm.UM32.Load()) }
func (rm RMCFGR2) Store(b CFGR2) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) CLL() RMCFGR2 {
return RMCFGR2{mmio.UM32{&p.CFGR2.U32, uint32(CLL)}}
}
func (p *SYSCFG_Periph) SPL() RMCFGR2 {
return RMCFGR2{mmio.UM32{&p.CFGR2.U32, uint32(SPL)}}
}
func (p *SYSCFG_Periph) PVDL() RMCFGR2 {
return RMCFGR2{mmio.UM32{&p.CFGR2.U32, uint32(PVDL)}}
}
func (p *SYSCFG_Periph) ECCL() RMCFGR2 {
return RMCFGR2{mmio.UM32{&p.CFGR2.U32, uint32(ECCL)}}
}
func (p *SYSCFG_Periph) SPF() RMCFGR2 {
return RMCFGR2{mmio.UM32{&p.CFGR2.U32, uint32(SPF)}}
}
type SWPR uint32
func (b SWPR) Field(mask SWPR) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask SWPR) J(v int) SWPR {
return SWPR(bits.MakeField32(v, uint32(mask)))
}
type RSWPR struct{ mmio.U32 }
func (r *RSWPR) Bits(mask SWPR) SWPR { return SWPR(r.U32.Bits(uint32(mask))) }
func (r *RSWPR) StoreBits(mask, b SWPR) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RSWPR) SetBits(mask SWPR) { r.U32.SetBits(uint32(mask)) }
func (r *RSWPR) ClearBits(mask SWPR) { r.U32.ClearBits(uint32(mask)) }
func (r *RSWPR) Load() SWPR { return SWPR(r.U32.Load()) }
func (r *RSWPR) Store(b SWPR) { r.U32.Store(uint32(b)) }
func (r *RSWPR) AtomicStoreBits(mask, b SWPR) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RSWPR) AtomicSetBits(mask SWPR) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RSWPR) AtomicClearBits(mask SWPR) { r.U32.AtomicClearBits(uint32(mask)) }
type RMSWPR struct{ mmio.UM32 }
func (rm RMSWPR) Load() SWPR { return SWPR(rm.UM32.Load()) }
func (rm RMSWPR) Store(b SWPR) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) PAGE0() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE0)}}
}
func (p *SYSCFG_Periph) PAGE1() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE1)}}
}
func (p *SYSCFG_Periph) PAGE2() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE2)}}
}
func (p *SYSCFG_Periph) PAGE3() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE3)}}
}
func (p *SYSCFG_Periph) PAGE4() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE4)}}
}
func (p *SYSCFG_Periph) PAGE5() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE5)}}
}
func (p *SYSCFG_Periph) PAGE6() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE6)}}
}
func (p *SYSCFG_Periph) PAGE7() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE7)}}
}
func (p *SYSCFG_Periph) PAGE8() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE8)}}
}
func (p *SYSCFG_Periph) PAGE9() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE9)}}
}
func (p *SYSCFG_Periph) PAGE10() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE10)}}
}
func (p *SYSCFG_Periph) PAGE11() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE11)}}
}
func (p *SYSCFG_Periph) PAGE12() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE12)}}
}
func (p *SYSCFG_Periph) PAGE13() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE13)}}
}
func (p *SYSCFG_Periph) PAGE14() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE14)}}
}
func (p *SYSCFG_Periph) PAGE15() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE15)}}
}
func (p *SYSCFG_Periph) PAGE16() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE16)}}
}
func (p *SYSCFG_Periph) PAGE17() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE17)}}
}
func (p *SYSCFG_Periph) PAGE18() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE18)}}
}
func (p *SYSCFG_Periph) PAGE19() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE19)}}
}
func (p *SYSCFG_Periph) PAGE20() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE20)}}
}
func (p *SYSCFG_Periph) PAGE21() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE21)}}
}
func (p *SYSCFG_Periph) PAGE22() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE22)}}
}
func (p *SYSCFG_Periph) PAGE23() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE23)}}
}
func (p *SYSCFG_Periph) PAGE24() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE24)}}
}
func (p *SYSCFG_Periph) PAGE25() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE25)}}
}
func (p *SYSCFG_Periph) PAGE26() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE26)}}
}
func (p *SYSCFG_Periph) PAGE27() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE27)}}
}
func (p *SYSCFG_Periph) PAGE28() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE28)}}
}
func (p *SYSCFG_Periph) PAGE29() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE29)}}
}
func (p *SYSCFG_Periph) PAGE30() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE30)}}
}
func (p *SYSCFG_Periph) PAGE31() RMSWPR {
return RMSWPR{mmio.UM32{&p.SWPR.U32, uint32(PAGE31)}}
}
type SKR uint32
func (b SKR) Field(mask SKR) int {
return bits.Field32(uint32(b), uint32(mask))
}
func (mask SKR) J(v int) SKR {
return SKR(bits.MakeField32(v, uint32(mask)))
}
type RSKR struct{ mmio.U32 }
func (r *RSKR) Bits(mask SKR) SKR { return SKR(r.U32.Bits(uint32(mask))) }
func (r *RSKR) StoreBits(mask, b SKR) { r.U32.StoreBits(uint32(mask), uint32(b)) }
func (r *RSKR) SetBits(mask SKR) { r.U32.SetBits(uint32(mask)) }
func (r *RSKR) ClearBits(mask SKR) { r.U32.ClearBits(uint32(mask)) }
func (r *RSKR) Load() SKR { return SKR(r.U32.Load()) }
func (r *RSKR) Store(b SKR) { r.U32.Store(uint32(b)) }
func (r *RSKR) AtomicStoreBits(mask, b SKR) { r.U32.AtomicStoreBits(uint32(mask), uint32(b)) }
func (r *RSKR) AtomicSetBits(mask SKR) { r.U32.AtomicSetBits(uint32(mask)) }
func (r *RSKR) AtomicClearBits(mask SKR) { r.U32.AtomicClearBits(uint32(mask)) }
type RMSKR struct{ mmio.UM32 }
func (rm RMSKR) Load() SKR { return SKR(rm.UM32.Load()) }
func (rm RMSKR) Store(b SKR) { rm.UM32.Store(uint32(b)) }
func (p *SYSCFG_Periph) KEY() RMSKR {
return RMSKR{mmio.UM32{&p.SKR.U32, uint32(KEY)}}
}
| ziutek/emgo | egpath/src/stm32/hal/raw/syscfg/l476xx--xgen_syscfg.go | GO | bsd-3-clause | 14,524 |
/*@ global glob :: posint */
let glob = 12;
module A {
function bar() {
glob = 7;
return;
}
export function zoo() {
bar();
assert(glob > 0);
}
}
| UCSD-PL/RefScript | tests/pos/simple/02-glob.ts | TypeScript | bsd-3-clause | 198 |
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<title>toString</title>
<link href="../../../images/logo-icon.svg" rel="icon" type="image/svg"><script>var pathToRoot = "../../../";</script> <script>const storage = localStorage.getItem("dokka-dark-mode")
const savedDarkMode = storage ? JSON.parse(storage) : false
if(savedDarkMode === true){
document.getElementsByTagName("html")[0].classList.add("theme-dark")
}</script>
<script type="text/javascript" src="../../../scripts/sourceset_dependencies.js" async="async"></script><link href="../../../styles/style.css" rel="Stylesheet"><link href="../../../styles/jetbrains-mono.css" rel="Stylesheet"><link href="../../../styles/main.css" rel="Stylesheet"><link href="../../../styles/prism.css" rel="Stylesheet"><link href="../../../styles/logo-styles.css" rel="Stylesheet"><script type="text/javascript" src="../../../scripts/clipboard.js" async="async"></script><script type="text/javascript" src="../../../scripts/navigation-loader.js" async="async"></script><script type="text/javascript" src="../../../scripts/platform-content-handler.js" async="async"></script><script type="text/javascript" src="../../../scripts/main.js" defer="defer"></script><script type="text/javascript" src="../../../scripts/prism.js" async="async"></script> </head>
<body>
<div class="navigation-wrapper" id="navigation-wrapper">
<div id="leftToggler"><span class="icon-toggler"></span></div>
<div class="library-name"><a href="../../../index.html">haishinkit</a></div>
<div>0.5.1</div>
<div class="pull-right d-flex"><button id="theme-toggle-button"><span id="theme-toggle"></span></button>
<div id="searchBar"></div>
</div>
</div>
<div id="container">
<div id="leftColumn">
<div id="sideMenu"></div>
</div>
<div id="main">
<div class="main-content" id="content" pageIds="haishinkit::com.haishinkit.amf.data/AsXmlDocument/toString/#/PointingToDeclaration//-473192002">
<div class="breadcrumbs"><a href="../../../index.html">haishinkit</a>/<a href="../index.html">com.haishinkit.amf.data</a>/<a href="index.html">AsXmlDocument</a>/<a href="to-string.html">toString</a></div>
<div class="cover ">
<h1 class="cover"><span>to</span><wbr></wbr><span><span>String</span></span></h1>
</div>
<div class="platform-hinted " data-platform-hinted="data-platform-hinted"><div class="content sourceset-depenent-content" data-active="" data-togglable=":haishinkit:dokkaHtml/release"><div class="symbol monospace"><span class="token keyword">open </span><span class="token keyword">override </span><span class="token keyword">fun </span><a href="to-string.html"><span class="token function">toString</span></a><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html">String</a><span class="top-right-position"><span class="copy-icon"></span><div class="copy-popup-wrapper popup-to-left"><span class="copy-popup-icon"></span><span>Content copied to clipboard</span></div></span></div></div></div>
</div>
<div class="footer"><span class="go-to-top-icon"><a href="#content" id="go-to-top-link"></a></span><span>© 2022 Copyright</span><span class="pull-right"><span>Generated by </span><a href="https://github.com/Kotlin/dokka"><span>dokka</span><span class="padded-icon"></span></a></span></div>
</div>
</div>
</body>
</html>
| shogo4405/HaishinKit.java | docs/haishinkit/com.haishinkit.amf.data/-as-xml-document/to-string.html | HTML | bsd-3-clause | 3,613 |
<?php
/**
* OWASP Enterprise Security API (ESAPI).
*
* This file is part of the Open Web Application Security Project (OWASP)
* Enterprise Security API (ESAPI) project.
*
* LICENSE: This source file is subject to the New BSD license. You should read
* and accept the LICENSE before you use, modify, and/or redistribute this
* software.
*
* PHP version 5.2
*
* @category OWASP
*
* @package ESAPI_Errors
*
* @author Andrew van der Stock <vanderaj@owasp.org>
* @author Mike Boberski <boberski_michael@bah.com>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
*
* @version SVN: $Id$
*
* @link http://www.owasp.org/index.php/ESAPI
*/
/**
* EnterpriseSecurityException is the base class for all security related
* exceptions. You should pass in the root cause exception where possible.
* Constructors for classes extending EnterpriseSecurityException should be
* sure to call the appropriate super() method in order to ensure that logging
* and intrusion detection occur properly.
* <p>
* All EnterpriseSecurityExceptions have two messages, one for the user and one
* for the log file. This way, a message can be shown to the user that doesn't
* contain sensitive information or unnecessary implementation details. Meanwhile,
* all the critical information can be included in the exception so that it gets
* logged.
* <p>
* Note that the "logMessage" for ALL EnterpriseSecurityExceptions is logged in
* the log file. This feature should be used extensively throughout ESAPI
* implementations and the result is a fairly complete set of security log records.
* ALL EnterpriseSecurityExceptions are also sent to the IntrusionDetector for use
* in detecting anomolous patterns of application usage.
* <p>.
*
* @category OWASP
*
* @package ESAPI_Errors
*
* @author Andrew van der Stock <vanderaj@owasp.org>
* @author Mike Boberski <boberski_michael@bah.com>
* @copyright 2009-2010 The OWASP Foundation
* @license http://www.opensource.org/licenses/bsd-license.php New BSD license
*
* @version Release: @package_version@
*
* @link http://www.owasp.org/index.php/ESAPI
*/
class EnterpriseSecurityException extends Exception
{
/** The logger. */
protected $logger;
protected $logMessage;
/**
* Creates a new instance of EnterpriseSecurityException that includes a
* root cause.
*
* @param string $userMessage The message displayed to the user
* @param string $logMessage the message logged
*/
public function __construct($userMessage = '', $logMessage = '')
{
$cause = 0;
if (empty($userMessage)) {
$userMessage = null;
}
parent::__construct($userMessage);
$this->logMessage = $logMessage;
$this->logger = ESAPI::getAuditor("EnterpriseSecurityException");
if (! ESAPI::getSecurityConfiguration()->getDisableIntrusionDetection()) {
ESAPI::getIntrusionDetector()->addException($this);
}
}
/**
* Returns a message that is safe to display to users.
*
* @return string A string containing a message that is safe to display to users
*/
public function getUserMessage()
{
return $this->getMessage();
}
/**
* Returns a message that is safe to display in logs, but probably not to users.
*
* @return string A string containing a message that is safe to display in
* logs, but probably not to users
*/
public function getLogMessage()
{
return $this->logMessage;
}
}
| najamelan/PHP-ESAPI | src/errors/EnterpriseSecurityException.php | PHP | bsd-3-clause | 3,671 |
from x86asm import codePackageFromFile
from x86cpToMemory import CpToMemory
from pythonConstants import PythonConstants
import cStringIO
import excmem
def pyasm(scope,s):
cp = codePackageFromFile(cStringIO.StringIO(s),PythonConstants)
mem = CpToMemory(cp)
mem.MakeMemory()
mem.BindPythonFunctions(scope)
| grant-olson/pyasm | __init__.py | Python | bsd-3-clause | 327 |
"""
Custom Authenticator to use MediaWiki OAuth with JupyterHub
Requires `mwoauth` package.
"""
import json
import os
from asyncio import wrap_future
from concurrent.futures import ThreadPoolExecutor
from jupyterhub.handlers import BaseHandler
from jupyterhub.utils import url_path_join
from mwoauth import ConsumerToken
from mwoauth import Handshaker
from mwoauth.tokens import RequestToken
from traitlets import Any
from traitlets import Integer
from traitlets import Unicode
from oauthenticator import OAuthCallbackHandler
from oauthenticator import OAuthenticator
# Name of cookie used to pass auth token between the oauth
# login and authentication phase
AUTH_REQUEST_COOKIE_NAME = 'mw_oauth_request_token_v2'
# Helpers to jsonify/de-jsonify request_token
# It is a named tuple with bytestrings, json.dumps balks
def jsonify(request_token):
return json.dumps(
[
request_token.key,
request_token.secret,
]
)
def dejsonify(js):
key, secret = json.loads(js)
return RequestToken(key, secret)
class MWLoginHandler(BaseHandler):
async def get(self):
consumer_token = ConsumerToken(
self.authenticator.client_id,
self.authenticator.client_secret,
)
handshaker = Handshaker(self.authenticator.mw_index_url, consumer_token)
redirect, request_token = await wrap_future(
self.authenticator.executor.submit(handshaker.initiate)
)
self.set_secure_cookie(
AUTH_REQUEST_COOKIE_NAME,
jsonify(request_token),
expires_days=1,
path=url_path_join(self.base_url, 'hub', 'oauth_callback'),
httponly=True,
)
self.log.info('oauth redirect: %r', redirect)
self.redirect(redirect)
class MWCallbackHandler(OAuthCallbackHandler):
"""
Override OAuthCallbackHandler to take out state parameter handling.
mwoauth doesn't seem to support it for now!
"""
def check_arguments(self):
pass
def get_state_url(self):
return None
class MWOAuthenticator(OAuthenticator):
login_service = 'MediaWiki'
login_handler = MWLoginHandler
callback_handler = MWCallbackHandler
mw_index_url = Unicode(
os.environ.get('MW_INDEX_URL', 'https://meta.wikimedia.org/w/index.php'),
config=True,
help='Full path to index.php of the MW instance to use to log in',
)
executor_threads = Integer(
12,
help="""Number of executor threads.
MediaWiki OAuth requests happen in this thread,
so it is mostly waiting for network replies.
""",
config=True,
)
executor = Any()
def normalize_username(self, username):
"""
Override normalize_username to avoid lowercasing usernames
"""
return username
def _executor_default(self):
return ThreadPoolExecutor(self.executor_threads)
async def authenticate(self, handler, data=None):
consumer_token = ConsumerToken(
self.client_id,
self.client_secret,
)
handshaker = Handshaker(self.mw_index_url, consumer_token)
request_token = dejsonify(handler.get_secure_cookie(AUTH_REQUEST_COOKIE_NAME))
handler.clear_cookie(AUTH_REQUEST_COOKIE_NAME)
access_token = await wrap_future(
self.executor.submit(
handshaker.complete, request_token, handler.request.query
)
)
identity = await wrap_future(
self.executor.submit(handshaker.identify, access_token)
)
if identity and 'username' in identity:
# this shouldn't be necessary anymore,
# but keep for backward-compatibility
return {
'name': identity['username'].replace(' ', '_'),
'auth_state': {
'ACCESS_TOKEN_KEY': access_token.key,
'ACCESS_TOKEN_SECRET': access_token.secret,
'MEDIAWIKI_USER_IDENTITY': identity,
},
}
else:
self.log.error("No username found in %s", identity)
| jupyterhub/oauthenticator | oauthenticator/mediawiki.py | Python | bsd-3-clause | 4,178 |
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_
#define NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_
#include <string>
#include <vector>
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "net/cert/scoped_nss_types.h"
#include "starboard/types.h"
typedef struct CERTCertificateStr CERTCertificate;
typedef struct PK11SlotInfoStr PK11SlotInfo;
namespace mozilla_security_manager {
// Initialize NSS PKCS#12 libs.
void EnsurePKCS12Init();
// Import the private key and certificate from a PKCS#12 blob into the slot.
// If |is_extractable| is false, mark the private key as non-extractable.
// Returns a net error code. |imported_certs|, if non-NULL, returns a list of
// certs that were imported.
int nsPKCS12Blob_Import(PK11SlotInfo* slot,
const char* pkcs12_data,
size_t pkcs12_len,
const base::string16& password,
bool is_extractable,
net::ScopedCERTCertificateList* imported_certs);
// Export the given certificates into a PKCS#12 blob, storing into output.
// Returns the number of certificates exported.
// TODO(mattm): provide better error return status?
int nsPKCS12Blob_Export(std::string* output,
const net::ScopedCERTCertificateList& certs,
const base::string16& password);
} // namespace mozilla_security_manager
#endif // NET_THIRD_PARTY_MOZILLA_SECURITY_MANAGER_NSPKCS12BLOB_H_
| youtube/cobalt | net/third_party/mozilla_security_manager/nsPKCS12Blob.h | C | bsd-3-clause | 3,284 |
using System;
namespace MvcApplication4.Areas.HelpPage
{
/// <summary>
/// This represents an image sample on the help page. There's a display template named ImageSample associated with this class.
/// </summary>
public class ImageSample
{
/// <summary>
/// Initializes a new instance of the <see cref="ImageSample"/> class.
/// </summary>
/// <param name="src">The URL of an image.</param>
public ImageSample(string src)
{
if (src == null)
{
throw new ArgumentNullException("src");
}
Src = src;
}
public string Src { get; private set; }
public override bool Equals(object obj)
{
ImageSample other = obj as ImageSample;
return other != null && Src == other.Src;
}
public override int GetHashCode()
{
return Src.GetHashCode();
}
public override string ToString()
{
return Src;
}
}
} | anhcop86/SN-Stock | WebAPIStockRealTime/MvcApplication4/Areas/HelpPage/SampleGeneration/ImageSample.cs | C# | bsd-3-clause | 1,058 |
<?php
namespace app\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\PhotoLocation;
/**
* PhotoLocationSearch represents the model behind the search form about `app\models\PhotoLocation`.
*/
class PhotoLocationSearch extends PhotoLocation
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id'], 'integer'],
[['photo_locations'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = PhotoLocation::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
]);
$query->andFilterWhere(['like', 'photo_locations', $this->photo_locations]);
return $dataProvider;
}
}
| michael-vostrikov/workorder | models/PhotoLocationSearch.php | PHP | bsd-3-clause | 1,422 |
<?php
namespace common\components;
use common\models\Image;
use \Imagick;
class ImageTransform
{
const ALIGN_MIDDLE = 1;
const ALIGN_TOP = 2;
protected $width;
protected $height;
/**
* @var Imagick
*/
protected $resource;
function __construct(Image $image)
{
if (!@class_exists('Imagick')) {
throw new \Exception('Imagick is not installed');
}
$fullPath = $_SERVER['DOCUMENT_ROOT'] . '/../../upload' . $image->path;
if (!file_exists($fullPath)) {
throw new \InvalidArgumentException('File ' . $image->path . ' does not exists');
}
$MB = min(256, ceil(filesize($fullPath) / 1000000) + 128);
try {
$this->resource = new Imagick();
$this->resource->setResourceLimit(Imagick::RESOURCETYPE_MEMORY, $MB);
$this->resource->readImage($fullPath);
} catch (\ImagickException $e) {
throw new \RuntimeException(sprintf('Could not open path "%s"', $image->path), $e->getCode(), $e);
}
$this->width = $this->resource->getImageWidth();
$this->height = $this->resource->getImageHeight();
}
function __destruct()
{
if ($this->resource) {
$this->resource->clear();
$this->resource->destroy();
}
}
public function getWidth()
{
return $this->width;
}
public function getHeight()
{
return $this->height;
}
public function getResource()
{
return $this->resource;
}
/**
* Изменяет размер изображения до заданных величин
*
* @param $width
* @param $height
* @return ImageTransform
* @throws \RuntimeException
*/
public function resize($width, $height)
{
if ($this->width == $width && $this->height == $height) {
return $this;
}
try {
$this->resource->resizeImage($width, $height, Imagick::FILTER_LANCZOS, 1);
switch (true) {
case $width < 210 && $height < 210:
$this->resource->sharpenImage(0, 0.65);
break;
case $width < 350 && $height < 350:
$this->resource->sharpenImage(0, 0.4);
break;
case $this->width > 2 * $width || $this->height > 2 * $height:
$this->resource->sharpenImage(0, 0.3);
break;
case $this->width > 1.5 * $width || $this->height > 1.5 * $height:
$this->resource->sharpenImage(0, 0.2);
break;
default:
$this->resource->sharpenImage(0, 0.1);
}
$this->width = $this->resource->getImageWidth();
$this->height = $this->resource->getImageHeight();
$this->resource->setImagePage($this->width, $this->height, 0, 0);
} catch (\ImagickException $e) {
throw new \RuntimeException('Resize operation failed', $e->getCode(), $e);
}
return $this;
}
/**
* Изменяет размер изображения до заданной высоты. Ширина вычисляется автоматически.
*
* @param $height
* @return ImageTransform
*/
public function resizeToHeight($height)
{
$ratio = $height / $this->height;
$width = $this->width * $ratio;
return $this->resize($width, $height);
}
/**
* Изменяет размер изображения до заданной ширины. Высота вычисляется автоматически.
*
* @param $width
* @return ImageTransform
*/
public function resizeToWidth($width)
{
$ratio = $width / $this->width;
$height = $this->height * $ratio;
return $this->resize($width, $height);
}
public function crop($width, $height, $align = self::ALIGN_MIDDLE)
{
if ($this->width == $width && $this->height == $height) {
return $this;
}
$ratio = $height / $width;
if ($ratio < ($this->height / $this->width)) {
$newHeight = $this->width * $ratio;
$srcY = ($this->height - $newHeight) / 2;
$offsetY = 0;
if ($align == self::ALIGN_TOP) {
$offsetY = (abs($this->height - $newHeight) / 2) * -1;
}
try {
$this->resource->cropImage($this->width, $newHeight, 0, $srcY + $offsetY);
} catch (\ImagickException $e) {
throw new \RuntimeException('Crop operation failed', $e->getCode(), $e);
}
}
else {
$newWidth = $this->height / $ratio;
$offsetX = ($this->width - $newWidth) / 2;
try {
$this->resource->cropImage($newWidth, $this->height, $offsetX, 0);
} catch (\ImagickException $e) {
throw new \RuntimeException('Crop operation failed', $e->getCode(), $e);
}
}
$this->resize($width, $height);
return $this;
}
public function fit($width, $height)
{
if ($this->height < $height && $this->width < $width) {
return $this;
}
$newD = $height / $width;
$oldD = $this->height / $this->width;
if ($oldD > $newD) {
$newHeight = $height;
$newWidth = $newHeight / $oldD;
}
else {
$newWidth = $width;
$newHeight = $newWidth * $oldD;
}
$this->resize($newWidth, $newHeight);
return $this;
}
public function saveJpeg($fileName, $quality = 86)
{
$quality = max(0, min($quality, 100));
try {
$this->resource->setImageFormat('jpeg');
$this->resource->setImageCompression(Imagick::COMPRESSION_JPEG);
$this->resource->setImageCompressionQuality($quality);
$this->resource->setInterlaceScheme(Imagick::INTERLACE_JPEG);
$this->resource->stripImage();
try {
$this->resource->optimizeImageLayers();
} catch (\ImagickException $e) {
}
$this->resource->writeImage($fileName);
chmod($fileName, 0774);
} catch (\ImagickException $e) {
throw new \RuntimeException('saveJpeg operation failed', $e->getCode(), $e);
}
}
public function savePng($fileName, $quality = 99)
{
$quality = max(0, min($quality, 100));
try {
$this->resource->setImageFormat('png');
$this->resource->setImageCompression(Imagick::COMPRESSION_ZIP);
$this->resource->setInterlaceScheme(Imagick::INTERLACE_PNG);
$this->resource->setImageCompressionQuality($quality);
$this->resource->stripImage();
$this->resource->optimizeImageLayers();
$this->resource->writeImage($fileName);
chmod($fileName, 0774);
} catch (\ImagickException $e) {
throw new \RuntimeException('savePng operation failed', $e->getCode(), $e);
}
}
}
| EQ-Port/site-2.0 | common/components/ImageTransform.php | PHP | bsd-3-clause | 7,316 |
package com.github.koraktor.steamcondenser.steam.community;
import static com.github.koraktor.steamcondenser.steam.community.XMLUtil.loadXml;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.powermock.api.mockito.PowerMockito.mockStatic;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.junit.After;
import org.junit.Before;
public abstract class StatsTestCase <STATS extends GameStats> {
String user;
String game;
DocumentBuilder parser = mock(DocumentBuilder.class);
DocumentBuilderFactory factory = mock(DocumentBuilderFactory.class);
public StatsTestCase(String user, String game){
this.user = user;
this.game = game;
}
@Before
public void setUp() throws Exception {
mockStatic(DocumentBuilderFactory.class);
when(DocumentBuilderFactory.newInstance()).thenReturn(factory);
when(factory.newDocumentBuilder()).thenReturn(parser);
when(parser.parse("http://steamcommunity.com/id/"+user+"?xml=1"))
.thenReturn(loadXml(user+".xml"));
when(parser.parse("http://steamcommunity.com/id/"+user+"/games?xml=1"))
.thenReturn(loadXml(user+"-games.xml"));
when(
parser.parse("http://steamcommunity.com/id/"+user+"/stats/"+game+"?xml=all"))
.thenReturn(loadXml(user+"-"+game+".xml"));
SteamId steamId = SteamId.create(user, true, true);
stats = (STATS) steamId.getGameStats(game);
}
STATS stats;
@After
public void tearDown() throws Exception{
verify(parser).parse("http://steamcommunity.com/id/"+user+"?xml=1");
verify(parser).parse("http://steamcommunity.com/id/"+user+"/games?xml=1");
verify(parser).parse("http://steamcommunity.com/id/"+user+"/stats/"+game+"?xml=all");
}
}
| gutomaia/steam-condenser-java | src/test/java/com/github/koraktor/steamcondenser/steam/community/StatsTestCase.java | Java | bsd-3-clause | 1,782 |
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This file was auto-generated via go generate.
// DO NOT UPDATE MANUALLY
/*
Command stressd runs the stress-test server.
Usage:
stressd [flags]
The stressd flags are:
-duration=0
Duration of the stress test to run; if zero, there is no limit.
-name=
Name to mount the server under. If emtpy, don't mount.
The global flags are:
-alsologtostderr=true
log to standard error as well as files
-log_backtrace_at=:0
when logging hits line file:N, emit a stack trace
-log_dir=
if non-empty, write log files to this directory
-logtostderr=false
log to standard error instead of files
-max_stack_buf_size=4292608
max size in bytes of the buffer to use for logging stack traces
-metadata=<just specify -metadata to activate>
Displays metadata for the program and exits.
-stderrthreshold=2
logs at or above this threshold go to stderr
-time=false
Dump timing information to stderr before exiting the program.
-v=0
log level for V logs
-v23.credentials=
directory to use for storing security credentials
-v23.i18n-catalogue=
18n catalogue files to load, comma separated
-v23.namespace.root=[/(dev.v.io:r:vprod:service:mounttabled)@ns.dev.v.io:8101]
local namespace root; can be repeated to provided multiple roots
-v23.permissions.file=map[]
specify a perms file as <name>:<permsfile>
-v23.permissions.literal=
explicitly specify the runtime perms as a JSON-encoded access.Permissions.
Overrides all --v23.permissions.file flags.
-v23.proxy=
object name of proxy service to use to export services across network
boundaries
-v23.tcp.address=
address to listen on
-v23.tcp.protocol=wsh
protocol to listen with
-v23.vtrace.cache-size=1024
The number of vtrace traces to store in memory.
-v23.vtrace.collect-regexp=
Spans and annotations that match this regular expression will trigger trace
collection.
-v23.vtrace.dump-on-shutdown=true
If true, dump all stored traces on runtime shutdown.
-v23.vtrace.sample-rate=0
Rate (from 0.0 to 1.0) to sample vtrace traces.
-v23.vtrace.v=0
The verbosity level of the log messages to be captured in traces
-vmodule=
comma-separated list of globpattern=N settings for filename-filtered logging
(without the .go suffix). E.g. foo/bar/baz.go is matched by patterns baz or
*az or b* but not by bar/baz or baz.go or az or b.*
-vpath=
comma-separated list of regexppattern=N settings for file pathname-filtered
logging (without the .go suffix). E.g. foo/bar/baz.go is matched by patterns
foo/bar/baz or fo.*az or oo/ba or b.z but not by foo/bar/baz.go or fo*az
*/
package main
| vanadium/go.ref | runtime/internal/rpc/stress/stressd/doc.go | GO | bsd-3-clause | 2,797 |
package java.net;
import edu.stanford.stamp.annotation.STAMP;
import edu.stanford.stamp.annotation.Flow;
public class StampURLInputStream extends java.io.InputStream
{
@STAMP(flows = {@Flow(from="this",to="@return")})
private int taintInt() { return 0; }
public int read() throws java.io.IOException {
return taintInt();
}
}
| petablox-project/petablox | android/models/src/java/net/StampURLInputStream.java | Java | bsd-3-clause | 337 |
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Menu */
$this->title = $model->caption;
$this->params['breadcrumbs'][] = ['label' => 'Menus', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="menu-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a('Update', ['update', 'id' => $model->menuid], ['class' => 'btn btn-primary']) ?>
<?= Html::a('Delete', ['delete', 'id' => $model->menuid], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => 'Are you sure you want to delete this item?',
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'caption',
'link',
'icon',
'description',
'index',
'activeText',
],
]) ?>
</div>
| prayogo/pms.yii2 | views/menu/view.php | PHP | bsd-3-clause | 993 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GFX_NATIVE_WIDGET_TYPES_H_
#define UI_GFX_NATIVE_WIDGET_TYPES_H_
#pragma once
#include "base/basictypes.h"
#include "ui/base/ui_export.h"
// This file provides cross platform typedefs for native widget types.
// NativeWindow: this is a handle to a native, top-level window
// NativeView: this is a handle to a native UI element. It may be the
// same type as a NativeWindow on some platforms.
// NativeViewId: Often, in our cross process model, we need to pass around a
// reference to a "window". This reference will, say, be echoed back from a
// renderer to the browser when it wishes to query its size. On Windows we
// use an HWND for this.
//
// As a rule of thumb - if you're in the renderer, you should be dealing
// with NativeViewIds. This should remind you that you shouldn't be doing
// direct operations on platform widgets from the renderer process.
//
// If you're in the browser, you're probably dealing with NativeViews,
// unless you're in the IPC layer, which will be translating between
// NativeViewIds from the renderer and NativeViews.
//
// NativeEditView: a handle to a native edit-box. The Mac folks wanted this
// specific typedef.
//
// NativeImage: The platform-specific image type used for drawing UI elements
// in the browser.
//
// The name 'View' here meshes with OS X where the UI elements are called
// 'views' and with our Chrome UI code where the elements are also called
// 'views'.
#if defined(USE_AURA)
class SkRegion;
namespace aura {
class Event;
class Window;
}
#endif // defined(USE_AURA)
#if defined(OS_WIN)
#include <windows.h> // NOLINT
typedef struct HFONT__* HFONT;
struct IAccessible;
#elif defined(OS_MACOSX)
struct CGContext;
#ifdef __OBJC__
@class NSEvent;
@class NSFont;
@class NSImage;
@class NSView;
@class NSWindow;
@class NSTextField;
#else
class NSEvent;
class NSFont;
class NSImage;
class NSView;
class NSWindow;
class NSTextField;
#endif // __OBJC__
#elif defined(OS_POSIX)
typedef struct _PangoFontDescription PangoFontDescription;
typedef struct _cairo cairo_t;
#endif
#if defined(USE_WAYLAND)
typedef struct _GdkPixbuf GdkPixbuf;
struct wl_egl_window;
namespace ui {
class WaylandWindow;
}
typedef struct _GdkRegion GdkRegion;
#elif defined(TOOLKIT_USES_GTK)
typedef struct _GdkCursor GdkCursor;
typedef union _GdkEvent GdkEvent;
typedef struct _GdkPixbuf GdkPixbuf;
typedef struct _GdkRegion GdkRegion;
typedef struct _GtkWidget GtkWidget;
typedef struct _GtkWindow GtkWindow;
#elif defined(OS_ANDROID)
class ChromeView;
#endif
class SkBitmap;
namespace gfx {
#if defined(USE_AURA)
// See ui/aura/cursor.h for values.
typedef int NativeCursor;
typedef aura::Window* NativeView;
typedef aura::Window* NativeWindow;
typedef SkRegion* NativeRegion;
typedef aura::Event* NativeEvent;
#elif defined(OS_WIN)
typedef HCURSOR NativeCursor;
typedef HWND NativeView;
typedef HWND NativeWindow;
typedef HRGN NativeRegion;
typedef MSG NativeEvent;
#elif defined(OS_MACOSX)
typedef void* NativeCursor;
typedef NSView* NativeView;
typedef NSWindow* NativeWindow;
typedef NSEvent* NativeEvent;
#elif defined(USE_WAYLAND)
typedef void* NativeCursor;
typedef ui::WaylandWindow* NativeView;
typedef ui::WaylandWindow* NativeWindow;
// TODO(dnicoara) This should be replaced with a cairo region or maybe
// a Wayland specific region
typedef GdkRegion* NativeRegion;
typedef void* NativeEvent;
#elif defined(TOOLKIT_USES_GTK)
typedef GdkCursor* NativeCursor;
typedef GtkWidget* NativeView;
typedef GtkWindow* NativeWindow;
typedef GdkRegion* NativeRegion;
typedef GdkEvent* NativeEvent;
#elif defined(OS_ANDROID)
typedef void* NativeCursor;
typedef ChromeView* NativeView;
typedef ChromeView* NativeWindow;
typedef void* NativeRegion;
typedef void* NativeEvent;
#endif
#if defined(OS_WIN)
typedef HFONT NativeFont;
typedef HWND NativeEditView;
typedef HDC NativeDrawingContext;
typedef HMENU NativeMenu;
typedef IAccessible* NativeViewAccessible;
#elif defined(OS_MACOSX)
typedef NSFont* NativeFont;
typedef NSTextField* NativeEditView;
typedef CGContext* NativeDrawingContext;
typedef void* NativeMenu;
typedef void* NativeViewAccessible;
#elif defined(USE_WAYLAND)
typedef PangoFontDescription* NativeFont;
typedef void* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef void* NativeMenu;
typedef void* NativeViewAccessible;
#elif defined(TOOLKIT_USES_GTK)
typedef PangoFontDescription* NativeFont;
typedef GtkWidget* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef GtkWidget* NativeMenu;
typedef void* NativeViewAccessible;
#elif defined(USE_AURA)
typedef PangoFontDescription* NativeFont;
typedef void* NativeEditView;
typedef cairo_t* NativeDrawingContext;
typedef void* NativeMenu;
typedef void* NativeViewAccessible;
#elif defined(OS_ANDROID)
typedef void* NativeFont;
typedef void* NativeEditView;
typedef void* NativeDrawingContext;
typedef void* NativeMenu;
typedef void* NativeViewAccessible;
#endif
// A constant value to indicate that gfx::NativeCursor refers to no cursor.
const gfx::NativeCursor kNullCursor = static_cast<gfx::NativeCursor>(NULL);
#if defined(OS_MACOSX)
typedef NSImage NativeImageType;
#elif defined(TOOLKIT_GTK)
typedef GdkPixbuf NativeImageType;
#else
typedef SkBitmap NativeImageType;
#endif
typedef NativeImageType* NativeImage;
// Note: for test_shell we're packing a pointer into the NativeViewId. So, if
// you make it a type which is smaller than a pointer, you have to fix
// test_shell.
//
// See comment at the top of the file for usage.
typedef intptr_t NativeViewId;
#if defined(OS_WIN) && !defined(USE_AURA)
// Convert a NativeViewId to a NativeView.
//
// On Windows, we pass an HWND into the renderer. As stated above, the renderer
// should not be performing operations on the view.
static inline NativeView NativeViewFromId(NativeViewId id) {
return reinterpret_cast<NativeView>(id);
}
#define NativeViewFromIdInBrowser(x) NativeViewFromId(x)
#elif defined(OS_POSIX) || defined(USE_AURA)
// On Mac, Linux and USE_AURA, a NativeView is a pointer to an object, and is
// useless outside the process in which it was created. NativeViewFromId should
// only be used inside the appropriate platform ifdef outside of the browser.
// (NativeViewFromIdInBrowser can be used everywhere in the browser.) If your
// cross-platform design involves a call to NativeViewFromId from outside the
// browser it will never work on Mac or Linux and is fundamentally broken.
// Please do not call this from outside the browser. It won't work; the name
// should give you a subtle hint.
static inline NativeView NativeViewFromIdInBrowser(NativeViewId id) {
return reinterpret_cast<NativeView>(id);
}
#endif // defined(OS_POSIX)
// PluginWindowHandle is an abstraction wrapping "the types of windows
// used by NPAPI plugins". On Windows it's an HWND, on X it's an X
// window id.
#if defined(OS_WIN)
typedef HWND PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = NULL;
#elif defined(USE_WAYLAND)
typedef struct wl_egl_window* PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = NULL;
#elif defined(USE_X11)
typedef unsigned long PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
#elif defined(USE_AURA) && defined(OS_MACOSX)
// Mac-Aura uses NSView-backed GLSurface. Regular Mac does not.
// TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551.
typedef NSView* PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
#elif defined(OS_ANDROID)
typedef uint64 PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
const PluginWindowHandle kDummyPluginWindow = 0xFEEDBEEF;
#else
// On OS X we don't have windowed plugins.
// We use a NULL/0 PluginWindowHandle in shared code to indicate there
// is no window present, so mirror that behavior here.
//
// The GPU plugin is currently an exception to this rule. As of this
// writing it uses some NPAPI infrastructure, and minimally we need
// to identify the plugin instance via this window handle. When the
// GPU plugin becomes a full-on GPU process, this typedef can be
// returned to a bool. For now we use a type large enough to hold a
// pointer on 64-bit architectures in case we need this capability.
typedef uint64 PluginWindowHandle;
const PluginWindowHandle kNullPluginWindow = 0;
#endif
// AcceleratedWidget provides a surface to compositors to paint pixels.
#if defined(OS_WIN)
typedef HWND AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = NULL;
#elif defined(USE_WAYLAND)
typedef struct wl_egl_window* AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = NULL;
#elif defined(USE_X11)
typedef unsigned long AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(USE_AURA) && defined(OS_MACOSX)
// Mac-Aura uses NSView-backed GLSurface. Regular Mac does not.
// TODO(dhollowa): Rationalize these two definitions. http://crbug.com/104551.
typedef NSView* AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = 0;
#else
typedef void* AcceleratedWidget;
const AcceleratedWidget kNullAcceleratedWidget = NULL;
#endif
} // namespace gfx
#endif // UI_GFX_NATIVE_WIDGET_TYPES_H_
| aYukiSekiguchi/ACCESS-Chromium | ui/gfx/native_widget_types.h | C | bsd-3-clause | 9,426 |
/* $NetBSD: dl.c,v 1.14 2000/06/05 00:09:18 matt Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Jason R. Thorpe.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Copyright (c) 1997 Ben Harris. All rights reserved.
* Copyright (c) 1996 Ken C. Wellsch. All rights reserved.
* Copyright (c) 1982, 1986, 1990, 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ralph Campbell and Rick Macklem.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* dl.c -- Device driver for the DL11 and DLV11 serial cards.
*
* OS-interface code derived from the dz and dca (hp300) drivers.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/map.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/device.h>
#include <machine/bus.h>
#include <dev/qbus/ubavar.h>
#include <dev/qbus/dlreg.h>
#include "ioconf.h"
struct dl_softc {
struct device sc_dev;
struct evcnt sc_rintrcnt;
struct evcnt sc_tintrcnt;
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
struct tty *sc_tty;
};
static int dl_match (struct device *, struct cfdata *, void *);
static void dl_attach (struct device *, struct device *, void *);
static void dlrint (void *);
static void dlxint (void *);
static void dlstart (struct tty *);
static int dlparam (struct tty *, struct termios *);
static void dlbrk (struct dl_softc *, int);
struct tty * dltty (dev_t);
int dlopen (dev_t, int, int, struct proc *);
int dlclose (dev_t, int, int, struct proc *);
int dlread (dev_t, struct uio *, int);
int dlwrite (dev_t, struct uio *, int);
int dlioctl (dev_t, unsigned long, caddr_t, int, struct proc *);
void dlstop (struct tty *, int);
struct cfattach dl_ca = {
sizeof(struct dl_softc), dl_match, dl_attach
};
#define DL_READ_WORD(reg) \
bus_space_read_2(sc->sc_iot, sc->sc_ioh, reg)
#define DL_WRITE_WORD(reg, val) \
bus_space_write_2(sc->sc_iot, sc->sc_ioh, reg, val)
#define DL_WRITE_BYTE(reg, val) \
bus_space_write_1(sc->sc_iot, sc->sc_ioh, reg, val)
/* Autoconfig handles: setup the controller to interrupt, */
/* then complete the housecleaning for full operation */
static int
dl_match (struct device *parent, struct cfdata *cf, void *aux)
{
struct uba_attach_args *ua = aux;
#ifdef DL_DEBUG
printf("Probing for dl at %lo ... ", (long)ua->ua_iaddr);
#endif
bus_space_write_2(ua->ua_iot, ua->ua_ioh, DL_UBA_XCSR, DL_XCSR_TXIE);
if (bus_space_read_2(ua->ua_iot, ua->ua_ioh, DL_UBA_XCSR) !=
(DL_XCSR_TXIE | DL_XCSR_TX_READY)) {
#ifdef DL_DEBUG
printf("failed (step 1; XCSR = %.4b)\n",
bus_space_read_2(ua->ua_iot, ua->ua_ioh, DL_UBA_XCSR),
DL_XCSR_BITS);
#endif
return 0;
}
/*
* We have to force an interrupt so the uba driver can work
* out where we are. Unfortunately, the only way to make a
* DL11 interrupt is to get it to send or receive a
* character. We'll send a NUL and hope it doesn't hurt
* anything.
*/
bus_space_write_1(ua->ua_iot, ua->ua_ioh, DL_UBA_XBUFL, '\0');
#if 0 /* This test seems to fail 2/3 of the time :-( */
if (dladdr->dl_xcsr != (DL_XCSR_TXIE)) {
#ifdef DL_DEBUG
printf("failed (step 2; XCSR = %.4b)\n", dladdr->dl_xcsr,
DL_XCSR_BITS);
#endif
return 0;
}
#endif
DELAY(100000); /* delay 1/10 s for character to transmit */
if (bus_space_read_2(ua->ua_iot, ua->ua_ioh, DL_UBA_XCSR) !=
(DL_XCSR_TXIE | DL_XCSR_TX_READY)) {
#ifdef DL_DEBUG
printf("failed (step 3; XCSR = %.4b)\n",
bus_space_read_2(ua->ua_iot, ua->ua_ioh, DL_UBA_XCSR),
DL_XCSR_BITS);
#endif
return 0;
}
/* What else do I need to do? */
return 1;
}
static void
dl_attach (struct device *parent, struct device *self, void *aux)
{
struct dl_softc *sc = (void *)self;
struct uba_attach_args *ua = aux;
sc->sc_iot = ua->ua_iot;
sc->sc_ioh = ua->ua_ioh;
/* Tidy up the device */
DL_WRITE_WORD(DL_UBA_RCSR, DL_RCSR_RXIE);
DL_WRITE_WORD(DL_UBA_XCSR, DL_XCSR_TXIE);
/* Initialize our softc structure. Should be done in open? */
sc->sc_tty = ttymalloc();
tty_attach(sc->sc_tty);
/* Now register the TX & RX interrupt handlers */
uba_intr_establish(ua->ua_icookie, ua->ua_cvec,
dlxint, sc, &sc->sc_tintrcnt);
uba_intr_establish(ua->ua_icookie, ua->ua_cvec - 4,
dlrint, sc, &sc->sc_rintrcnt);
evcnt_attach_dynamic(&sc->sc_rintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt,
sc->sc_dev.dv_xname, "rintr");
evcnt_attach_dynamic(&sc->sc_tintrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt,
sc->sc_dev.dv_xname, "tintr");
printf("\n");
}
/* Receiver Interrupt Handler */
static void
dlrint(void *arg)
{
struct dl_softc *sc = arg;
if (DL_READ_WORD(DL_UBA_RCSR) & DL_RCSR_RX_DONE) {
struct tty *tp = sc->sc_tty;
unsigned c;
int cc;
c = DL_READ_WORD(DL_UBA_RBUF);
cc = c & 0xFF;
if (!(tp->t_state & TS_ISOPEN)) {
wakeup((caddr_t)&tp->t_rawq);
return;
}
if (c & DL_RBUF_OVERRUN_ERR) {
/*
* XXX: This should really be logged somwhere
* else where we can afford the time.
*/
log(LOG_WARNING, "%s: rx overrun\n",
sc->sc_dev.dv_xname);
}
if (c & DL_RBUF_FRAMING_ERR)
cc |= TTY_FE;
if (c & DL_RBUF_PARITY_ERR)
cc |= TTY_PE;
(*linesw[tp->t_line].l_rint)(cc, tp);
#if defined(DIAGNOSTIC)
} else {
log(LOG_WARNING, "%s: stray rx interrupt\n",
sc->sc_dev.dv_xname);
#endif
}
}
/* Transmitter Interrupt Handler */
static void
dlxint(void *arg)
{
struct dl_softc *sc = arg;
struct tty *tp = sc->sc_tty;
tp->t_state &= ~(TS_BUSY | TS_FLUSH);
if (tp->t_line)
(*linesw[tp->t_line].l_start)(tp);
else
dlstart(tp);
return;
}
int
dlopen(dev_t dev, int flag, int mode, struct proc *p)
{
struct tty *tp;
struct dl_softc *sc;
int unit;
unit = minor(dev);
if (unit >= dl_cd.cd_ndevs || dl_cd.cd_devs[unit] == NULL)
return ENXIO;
sc = dl_cd.cd_devs[unit];
tp = sc->sc_tty;
if (tp == NULL)
return ENODEV;
tp->t_oproc = dlstart;
tp->t_param = dlparam;
tp->t_dev = dev;
if (!(tp->t_state & TS_ISOPEN)) {
ttychars(tp);
tp->t_iflag = TTYDEF_IFLAG;
tp->t_oflag = TTYDEF_OFLAG;
/* No modem control, so set CLOCAL. */
tp->t_cflag = TTYDEF_CFLAG | CLOCAL;
tp->t_lflag = TTYDEF_LFLAG;
tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
dlparam(tp, &tp->t_termios);
ttsetwater(tp);
} else if ((tp->t_state & TS_XCLUDE) && p->p_ucred->cr_uid != 0)
return EBUSY;
return ((*linesw[tp->t_line].l_open)(dev, tp));
}
/*ARGSUSED*/
int
dlclose(dev_t dev, int flag, int mode, struct proc *p)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
(*linesw[tp->t_line].l_close)(tp, flag);
/* Make sure a BREAK state is not left enabled. */
dlbrk(sc, 0);
return (ttyclose(tp));
}
int
dlread(dev_t dev, struct uio *uio, int flag)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
return ((*linesw[tp->t_line].l_read)(tp, uio, flag));
}
int
dlwrite(dev_t dev, struct uio *uio, int flag)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
return ((*linesw[tp->t_line].l_write)(tp, uio, flag));
}
int
dlioctl(dev_t dev, unsigned long cmd, caddr_t data, int flag, struct proc *p)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
struct tty *tp = sc->sc_tty;
int error;
error = (*linesw[tp->t_line].l_ioctl)(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
error = ttioctl(tp, cmd, data, flag, p);
if (error >= 0)
return (error);
switch (cmd) {
case TIOCSBRK:
dlbrk(sc, 1);
break;
case TIOCCBRK:
dlbrk(sc, 0);
break;
case TIOCMGET:
/* No modem control, assume they're all low. */
*(int *)data = 0;
break;
default:
return (ENOTTY);
}
return (0);
}
struct tty *
dltty(dev_t dev)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(dev)];
return sc->sc_tty;
}
void
dlstop(struct tty *tp, int flag)
{
int s = spltty();
if ((tp->t_state & (TS_BUSY|TS_TTSTOP)) == TS_BUSY)
tp->t_state |= TS_FLUSH;
splx(s);
}
static void
dlstart(struct tty *tp)
{
struct dl_softc *sc = dl_cd.cd_devs[minor(tp->t_dev)];
int s = spltty();
if (tp->t_state & (TS_TIMEOUT|TS_BUSY|TS_TTSTOP))
goto out;
if (tp->t_outq.c_cc <= tp->t_lowat) {
if (tp->t_state & TS_ASLEEP) {
tp->t_state &= ~TS_ASLEEP;
wakeup((caddr_t)&tp->t_outq);
}
selwakeup(&tp->t_wsel);
}
if (tp->t_outq.c_cc == 0)
goto out;
if (DL_READ_WORD(DL_UBA_XCSR) & DL_XCSR_TX_READY) {
tp->t_state |= TS_BUSY;
DL_WRITE_BYTE(DL_UBA_XBUFL, getc(&tp->t_outq));
}
out:
splx(s);
return;
}
/*ARGSUSED*/
static int
dlparam(struct tty *tp, struct termios *t)
{
/*
* All this kind of stuff (speed, character format, whatever)
* is set by jumpers on the card. Changing it is thus rather
* tricky for a mere device driver.
*/
return 0;
}
static void
dlbrk(struct dl_softc *sc, int state)
{
int s = spltty();
if (state) {
DL_WRITE_WORD(DL_UBA_XCSR, DL_READ_WORD(DL_UBA_XCSR) |
DL_XCSR_TX_BREAK);
} else {
DL_WRITE_WORD(DL_UBA_XCSR, DL_READ_WORD(DL_UBA_XCSR) &
~DL_XCSR_TX_BREAK);
}
splx(s);
}
| MarginC/kame | netbsd/sys/dev/qbus/dl.c | C | bsd-3-clause | 13,082 |
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
vector<int> ret(digits);
int carry = 1;
for (vector<int>::reverse_iterator i = ret.rbegin(), iend = ret.rend(); i != iend; ++i) {
*i += carry;
carry = *i / 10;
*i %= 10;
}
if (carry)
ret.insert(ret.begin(), carry);
return ret;
}
};
int main(void)
{
return 0;
}
| buptlxb/leetcode | 2nd/066_plus_one.cpp | C++ | bsd-3-clause | 499 |
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This program wraps an arbitrary command since gn currently can only execute
scripts."""
import os
import subprocess
import sys
from shutil import copy2
args = sys.argv[1:]
args[0] = os.path.abspath(args[0])
#if sys.platform == 'darwin':
# copy2(os.path.join(os.path.dirname(args[0]), 'libffmpeg.dylib'), os.path.dirname(os.path.dirname(args[0])))
sys.exit(subprocess.call(args))
| nwjs/chromium.src | tools/v8_context_snapshot/run.py | Python | bsd-3-clause | 552 |
var searchData=
[
['save_5fcycles_5feeprom',['save_cycles_eeprom',['../interruptions_8c.html#ad86170580c30277d97216739e8508a13',1,'save_cycles_eeprom(): interruptions.c'],['../interruptions_8h.html#ad86170580c30277d97216739e8508a13',1,'save_cycles_eeprom(): interruptions.c']]],
['sendacknowledgment',['sendAcknowledgment',['../command__processing_8c.html#a1a2eafee01079c42ca1fb14aa7331933',1,'sendAcknowledgment(uint8 value): command_processing.c'],['../command__processing_8h.html#a1a2eafee01079c42ca1fb14aa7331933',1,'sendAcknowledgment(uint8 value): command_processing.c']]],
['setzeros',['setZeros',['../command__processing_8c.html#ac8969cb5fdb4916f259075029741e727',1,'setZeros(): command_processing.c'],['../command__processing_8h.html#ac8969cb5fdb4916f259075029741e727',1,'setZeros(): command_processing.c']]]
];
| NMMI/SoftHand | docs/html/search/functions_b.js | JavaScript | bsd-3-clause | 857 |
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
namespace app\Repo;
use Yii;
use GuzzleHttp\Client;
use phpQuery;
class autooriginal extends BaseRepo {
public function find($article, $brand = '')
{
$client = new Client();
$res = $client->request('GET', 'http://autooriginal.de/?a=&p=&search='.$article);
$body = $res->getBody();
$document = phpQuery::newDocumentHTML($body,'UTF8');
$links = pq($document)->find('.results tr:eq(1)');
$valid = pq($links)->find('td:eq(2)')->text();
if(strcasecmp($article, $valid) == 0){
foreach ($links as $link) {
$manufacturer = pq($link)->find('td:eq(1)')->text();
$number = pq($link)->find('td:eq(2)')->text();
$name = pq($link)->find('td:eq(3)')->text();
$price = pq($link)->find('td:eq(4)')->text();
$available = pq($link)->find('td:eq(6)')->text();
$order_links = '<a href = http://autooriginal.de/?a=&p=&search='.$article.'>Корзина</a>';
$this->result['Origin'][$this->siteUrl][] = array(
'manufacturer'=>$manufacturer,
'number'=>$number,
'name'=>$name,
'price'=>$price,
'available'=>$available,
'order_links'=>$order_links
);
}
}
return $this->result;
}
}
| ZsarkZ/parsingProduct | Repo/autooriginal.php | PHP | bsd-3-clause | 1,672 |
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
use kartik\popover\PopoverX;
use kartik\form\ActiveForm;
use kartik\daterange\DateRangePicker;
/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Картриджи архив';
$this->params['breadcrumbs'][] = ['label' => 'Картриджи', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Архив';
?>
<div class="cartridges-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php
if (Yii::$app->user->can('admin')) {
$form = ActiveForm::begin(['fieldConfig' => ['showLabels' => false], 'action' => 'export']);
PopoverX::begin([
'placement' => PopoverX::ALIGN_BOTTOM,
'toggleButton' => ['label' => 'Экспорт', 'class' => 'btn btn-success'],
'header' => '<i class="fa fa-calendar"></i> Выберите дату',
'footer' => Html::submitButton('Экспортировать', ['class' => 'btn btn-sm btn-primary']) .
Html::resetButton('Очистить', ['class' => 'btn btn-sm btn-default'])
]);
echo DateRangePicker::widget([
'name' => 'date_range',
'convertFormat' => true,
'pluginOptions' => [
'locale' => [
'format' => 'd.m.Y',
'separator' => ' - ',
],
]
]);
PopoverX::end();
ActiveForm::end();
}
?>
<?php Pjax::begin() ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'tableOptions' => [
'class' => 'table table-bordered'
],
'rowOptions' => function ($model) {
switch ($model->status) {
case(1):
return ['class' => 'warning'];
break;
case(2):
return ['class' => 'success'];
break;
case(3):
return ['class' => 'active'];
break;
default:
return ['class' => ''];
break;
}
},
'columns' => [
'id',
'client',
[
'attribute' => 'master',
'value' => function ($data) {
return isset($data->masterName->username) ? $data->masterName->username : $data->master;
},
],
'phone',
[
'attribute' => 'date_in',
'format' => ['date', 'php:d.m.Y']
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{print} {view}',
'buttons' => [
'print' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-print"></span>', $url, [
'title' => Yii::t('app', 'Печать'),
]);
},
'view' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, [
'title' => Yii::t('app', 'Просмотр'),
]);
},
],
'urlCreator' => function ($action, $model, $key, $index) {
if ($action === 'print') {
$url = 'print/' . $model->id;
return $url;
} elseif ($action === 'view') {
$url = 'view/' . $model->id;
return $url;
}
}
],
]
]); ?>
<?php Pjax::end() ?>
</div>
| leo141198/basa | modules/cartridges/views/reception/archive_disabled.php | PHP | bsd-3-clause | 3,838 |
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.team4189.season2013.CB.commands;
import edu.wpi.first.wpilibj.command.PIDCommand;
import org.team4189.season2013.CB.subsystems.Shooter;
import org.team4189.season2013.CB.subsystems.VisionControl;
import org.team4189.season2013.CB.subsystems.VisionControl.TargetScores;
/**
*
* @author Developer
*/
public class AimControl extends PIDCommand {
VisionControl visionControl;
Shooter shooter;
protected double returnPIDInput() {
int goalWeWant = VisionControl.TargetScores.med;
int goalWeUse = 1;
TargetScores[] targets = visionControl.visionAnalyze();
for(int i = 0; i < targets.length; i++){
if(targets[i].goal == goalWeWant){
goalWeUse=i; //select the value from the array that we want to use.
}
}
return targets[goalWeUse].yValAim;
}
protected void usePIDOutput(double d) {
shooter.adjustLauncher(d);
}
protected void initialize() {
this.getPIDController().enable();
}
protected void execute() {
//this.getPIDController();
}
protected boolean isFinished() {
boolean isF = false;
isF |= isTimedOut();
isF |= this.getPIDController().onTarget();
return isF;
}
protected void end() {
shooter.adjustLauncherStop();
this.getPIDController().disable();
this.getPIDController().free();
}
protected void interrupted() {
shooter.adjustLauncherStop();
this.getPIDController().disable();
}
public AimControl(){
super(1,1,1,.2);
this.setTimeout(30);
this.setSetpoint(0);
}
}
| Team4189/2013robotCode | src/org/team4189/season2013/CB/commands/AimControl.java | Java | bsd-3-clause | 1,887 |
<?php
/**
* @link http://www.yiizh.com/
* @copyright Copyright (c) 2016 yiizh.com
* @license http://www.yiizh.com/license/
*/
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/params.php')
);
$config = [
'id' => APP_API,
'basePath' => dirname(__DIR__),
'bootstrap' => ['log'],
'controllerNamespace' => 'api\controllers',
'components' => [
'user' => [
'identityClass' => 'common\models\User'
],
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [],
],
'cache' => [
'class' => 'yii\caching\FileCache',
],
'errorHandler' => [
'errorAction' => 'site/error',
],
'log' => [
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
],
],
'assetManager' => [
'appendTimestamp' => true
],
'request' => [
// !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
'cookieValidationKey' => '527273ddaa3adfc8sdfsds47bc500f590sdfs24e84',
],
],
'params' => $params,
];
if (getenv('APP_ENV') == 'dev') {
$config['bootstrap'][] = 'debug';
$config['modules']['debug'] = [
'class' => 'yii\debug\Module',
'allowedIPs' => [
'*',
]
];
$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
'class' => 'yii\gii\Module',
'allowedIPs' => [
'*',
],
];
}
return $config;
| yiizh/yiizh.com | src/api/config/main.php | PHP | bsd-3-clause | 1,805 |
#
# FBrowserBase.py -- Base class for file browser plugin for fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os, glob
import stat, time
from ginga.misc import Bunch
from ginga import GingaPlugin
from ginga import AstroImage
from ginga.util import paths
from ginga.util.six.moves import map, zip
class FBrowserBase(GingaPlugin.LocalPlugin):
def __init__(self, fv, fitsimage):
# superclass defines some variables for us, like logger
super(FBrowserBase, self).__init__(fv, fitsimage)
self.keywords = ['OBJECT', 'UT']
self.columns = [('Name', 'name'),
('Size', 'st_size'),
('Mode', 'st_mode'),
('Last Changed', 'st_mtime')
]
self.jumpinfo = []
homedir = paths.home
self.curpath = os.path.join(homedir, '*')
self.do_scanfits = False
self.moving_cursor = False
def close(self):
chname = self.fv.get_channelName(self.fitsimage)
self.fv.stop_local_plugin(chname, str(self))
return True
def file_icon(self, bnch):
if bnch.type == 'dir':
pb = self.folderpb
elif bnch.type == 'fits':
pb = self.fitspb
else:
pb = self.filepb
return pb
def open_file(self, path):
self.logger.debug("path: %s" % (path))
if path == '..':
curdir, curglob = os.path.split(self.curpath)
path = os.path.join(curdir, path, curglob)
if os.path.isdir(path):
path = os.path.join(path, '*')
self.browse(path)
elif os.path.exists(path):
#self.fv.load_file(path)
uri = "file://%s" % (path)
self.fitsimage.make_callback('drag-drop', [uri])
else:
self.browse(path)
def get_info(self, path):
dirname, filename = os.path.split(path)
name, ext = os.path.splitext(filename)
ftype = 'file'
if os.path.isdir(path):
ftype = 'dir'
elif os.path.islink(path):
ftype = 'link'
elif ext.lower() == '.fits':
ftype = 'fits'
try:
filestat = os.stat(path)
bnch = Bunch.Bunch(path=path, name=filename, type=ftype,
st_mode=filestat.st_mode, st_size=filestat.st_size,
st_mtime=filestat.st_mtime)
except OSError as e:
# TODO: identify some kind of error with this path
bnch = Bunch.Bunch(path=path, name=filename, type=ftype,
st_mode=0, st_size=0,
st_mtime=0)
return bnch
def browse(self, path):
self.logger.debug("path: %s" % (path))
if os.path.isdir(path):
dirname = path
globname = None
else:
dirname, globname = os.path.split(path)
dirname = os.path.abspath(dirname)
# check validity of leading path name
if not os.path.isdir(dirname):
self.fv.show_error("Not a valid path: %s" % (dirname))
return
if not globname:
globname = '*'
path = os.path.join(dirname, globname)
# Make a directory listing
self.logger.debug("globbing path: %s" % (path))
filelist = list(glob.glob(path))
filelist.sort(key=str.lower)
filelist.insert(0, os.path.join(dirname, '..'))
self.jumpinfo = list(map(self.get_info, filelist))
self.curpath = path
if self.do_scanfits:
self.scan_fits()
self.makelisting(path)
def scan_fits(self):
for bnch in self.jumpinfo:
if not bnch.type == 'fits':
continue
if 'kwds' not in bnch:
try:
in_f = AstroImage.pyfits.open(bnch.path, 'readonly')
try:
kwds = {}
for kwd in self.keywords:
kwds[kwd] = in_f[0].header.get(kwd, 'N/A')
bnch.kwds = kwds
finally:
in_f.close()
except Exception as e:
continue
def refresh(self):
self.browse(self.curpath)
def scan_headers(self):
self.browse(self.curpath)
def make_thumbs(self):
path = self.curpath
self.logger.info("Generating thumbnails for '%s'..." % (
path))
filelist = glob.glob(path)
filelist.sort(key=str.lower)
# find out our channel
chname = self.fv.get_channelName(self.fitsimage)
# Invoke the method in this channel's Thumbs plugin
# TODO: don't expose gpmon!
rsobj = self.fv.gpmon.getPlugin('Thumbs')
self.fv.nongui_do(rsobj.make_thumbs, chname, filelist)
def start(self):
self.win = None
self.browse(self.curpath)
def pause(self):
pass
def resume(self):
pass
def stop(self):
pass
def redo(self):
return True
#END
| bsipocz/ginga | ginga/misc/plugins/FBrowserBase.py | Python | bsd-3-clause | 5,421 |
from .cuda_products import gmt_func as gp_device
from .cuda_products import imt_func as ip_device
import numpy as np
import numba.cuda
import numba
import math
import random
from . import *
def sequential_rotor_estimation_chunks(reference_model_array, query_model_array, n_samples, n_objects_per_sample, mutation_probability=None):
# Stack up a list of numbers
total_matches = n_samples*n_objects_per_sample
sample_indices = random.sample(range(total_matches), total_matches)
n_mvs = reference_model_array.shape[0]
sample_indices = [i % n_mvs for i in sample_indices]
if mutation_probability is not None:
reference_model_array_new = []
mutation_flag = np.random.binomial(1, mutation_probability, total_matches)
for mut, i in zip(mutation_flag, sample_indices):
if mut:
ref_ind = random.sample(range(len(reference_model_array)), 1)[0]
else:
ref_ind = i
reference_model_array_new.append(reference_model_array[ref_ind, :])
reference_model_array_new = np.array(reference_model_array_new)
else:
reference_model_array_new = np.array([reference_model_array[i, :] for i in sample_indices], dtype=np.float64)
query_model_array_new = np.array([query_model_array[i, :] for i in sample_indices], dtype=np.float64)
output = np.zeros((n_samples, 32), dtype=np.float64)
cost_array = np.zeros(n_samples, dtype=np.float64)
sequential_rotor_estimation_chunks_jit(reference_model_array_new, query_model_array_new, output, cost_array)
return output, cost_array
def sequential_rotor_estimation_chunks_mvs(reference_model_list, query_model_list, n_samples, n_objects_per_sample, mutation_probability=None):
query_model_array = np.array([l.value for l in query_model_list])
reference_model_array = np.array([l.value for l in reference_model_list])
output, cost_array = sequential_rotor_estimation_chunks(reference_model_array, query_model_array, n_samples, n_objects_per_sample, mutation_probability=mutation_probability)
output_mvs = [query_model_list[0]._newMV(output[i, :]) for i in range(output.shape[0])]
return output_mvs, cost_array
@numba.cuda.jit(device=True)
def set_as_unit_rotor_device(array):
for j in range(1, 32):
array[j] = 0.0
array[0] = 1.0
@numba.cuda.jit(device=True)
def sequential_rotor_estimation_device(reference_model, query_model, rotor_output):
n_iterations = 20
cost_tolerance = 10 * (10 ** -16)
# Allocate memory
r_set = numba.cuda.local.array(32, dtype=numba.float64)
r_running = numba.cuda.local.array(32, dtype=numba.float64)
r_root = numba.cuda.local.array(32, dtype=numba.float64)
r_temp = numba.cuda.local.array(32, dtype=numba.float64)
C1 = numba.cuda.local.array(32, dtype=numba.float64)
# Set up the running rotor estimate
set_as_unit_rotor_device(r_running)
# Start iterating for convergence
for iteration_number in range(n_iterations):
# Set up the convergence check
set_as_unit_rotor_device(r_set)
# Iterate over the array of objects
for mv_ind in range(reference_model.shape[0]):
apply_rotor_device(query_model[mv_ind, :], r_running, C1)
normalise_mv_device(C1)
C2 = reference_model[mv_ind, :]
# Check if they are the same other than a sign flip
sum_abs = 0.0
for b_ind in range(32):
sum_abs += abs(C1[b_ind] + C2[b_ind])
if sum_abs < 0.0001:
set_as_unit_rotor_device(r_root)
else:
rotor_between_objects_device(C1, C2, r_temp)
square_root_of_rotor_device(r_temp, r_root)
# Update the set rotor and the running rotor
gp_device(r_root, r_set, r_temp)
normalise_mv_copy_device(r_temp, r_set)
gp_device(r_root, r_running, r_temp)
normalise_mv_copy_device(r_temp, r_running)
# Check if we have converged
if rotor_cost_device(r_set) < cost_tolerance:
normalise_mv_copy_device(r_running, rotor_output)
# Now calculate the cost of this transform
total_cost = 0.0
for object_ind in range(query_model.shape[0]):
apply_rotor_device(query_model[object_ind, :], rotor_output, r_temp)
total_cost += cost_between_objects_device(r_temp, reference_model[object_ind, :])
return total_cost
# Return whatever we have
normalise_mv_copy_device(r_running, rotor_output)
total_cost = 0.0
for object_ind in range(query_model.shape[0]):
apply_rotor_device(query_model[object_ind, :], rotor_output, r_temp)
total_cost += cost_between_objects_device(r_temp, reference_model[object_ind, :])
return total_cost
@numba.cuda.jit
def sequential_rotor_estimation_kernel(reference_model, query_model, output, cost_array):
# Break the model into n chunks and estimate the rotor based on each of those
n_chunks = output.shape[0]
n_objects_per_chunk = int(reference_model.shape[0]/n_chunks)
i = numba.cuda.grid(1)
if i < n_chunks:
ref = reference_model[i*n_objects_per_chunk:(i+1)*n_objects_per_chunk]
qer = query_model[i*n_objects_per_chunk:(i+1)*n_objects_per_chunk]
total_cost = sequential_rotor_estimation_device(ref, qer, output[i, :])
cost_array[i] = total_cost
def sequential_rotor_estimation_cuda(reference_model_array, query_model_array, n_samples=None, n_objects_per_sample=None, mutation_probability=None):
if n_samples is None:
n_samples = int(len(query_model_array)/2)
if n_objects_per_sample is None:
n_objects_per_sample = max(int(len(query_model_array)/10), 5)
# Stack up a list of numbers
total_matches = n_samples*n_objects_per_sample
sample_indices = random.sample(range(total_matches), total_matches)
n_mvs = reference_model_array.shape[0]
sample_indices = [i % n_mvs for i in sample_indices]
if mutation_probability is not None:
reference_model_array_new = []
mutation_flag = np.random.binomial(1, mutation_probability, total_matches)
for mut, i in zip(mutation_flag, sample_indices):
if mut:
ref_ind = random.sample(range(len(reference_model_array)), 1)[0]
else:
ref_ind = i
reference_model_array_new.append(reference_model_array[ref_ind, :])
reference_model_array_new = np.array(reference_model_array_new)
else:
reference_model_array_new = np.array([reference_model_array[i, :] for i in sample_indices], dtype=np.float64)
query_model_array_new = np.array([query_model_array[i, :] for i in sample_indices], dtype=np.float64)
output = np.zeros((n_samples, 32), dtype=np.float64)
cost_array = np.zeros(n_samples, dtype=np.float64)
blockdim = 64
griddim = int(math.ceil(reference_model_array_new.shape[0] / blockdim))
sequential_rotor_estimation_kernel[griddim, blockdim](reference_model_array_new, query_model_array_new, output, cost_array)
return output, cost_array
def sequential_rotor_estimation_cuda_mvs(reference_model_list, query_model_list, n_samples, n_objects_per_sample, mutation_probability=None):
query_model_array = np.array([l.value for l in query_model_list])
reference_model_array = np.array([l.value for l in reference_model_list])
output, cost_array = sequential_rotor_estimation_cuda(reference_model_array, query_model_array, n_samples, n_objects_per_sample, mutation_probability=mutation_probability)
output_mvs = [query_model_list[0]._newMV(output[i, :]) for i in range(output.shape[0])]
return output_mvs, cost_array
@numba.cuda.jit(device=True)
def apply_rotor_device(mv, rotor, output):
rotor_adjoint = numba.cuda.local.array(32, dtype=numba.float64)
temp = numba.cuda.local.array(32, dtype=numba.float64)
adjoint_device(rotor, rotor_adjoint)
gp_device(mv, rotor_adjoint, temp)
gp_device(rotor, temp, output)
@numba.cuda.jit
def apply_rotor_kernel(mv, rotor, output):
# This does elementwise gp with the input arrays into the ouput array
i = numba.cuda.grid(1)
if i < mv.shape[0]:
apply_rotor_device(mv[i, :], rotor[i, :], output[i, :])
@numba.cuda.jit(device=True)
def square_root_of_rotor_device(rotor, rotor_root):
k_value = numba.cuda.local.array(32, dtype=numba.float64)
sigma_val = numba.cuda.local.array(32, dtype=numba.float64)
C_val = numba.cuda.local.array(32, dtype=numba.float64)
for i in range(32):
C_val[i] = rotor[i]
C_val[0] += 1.0
gp_mult_with_adjoint(C_val, sigma_val)
positive_root_device(sigma_val, k_value)
annhilate_k_device(k_value, C_val, rotor_root)
@numba.cuda.jit
def square_root_of_rotor_kernel(value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
square_root_of_rotor_device(value[i, :], output[i, :])
@numba.cuda.jit(device=True)
def adjoint_device(value, output):
for j in range(0, 6):
output[j] = value[j]
output[6] = -value[6]
output[7] = -value[7]
output[8] = -value[8]
output[9] = -value[9]
output[10] = -value[10]
output[11] = -value[11]
output[12] = -value[12]
output[13] = -value[13]
output[14] = -value[14]
output[15] = -value[15]
output[16] = -value[16]
output[17] = -value[17]
output[18] = -value[18]
output[19] = -value[19]
output[20] = -value[20]
output[21] = -value[21]
output[22] = -value[22]
output[23] = -value[23]
output[24] = -value[24]
output[25] = -value[25]
for j in range(26, 32):
output[j] = value[j]
@numba.cuda.jit
def gp_kernel(value, other_value, output):
# This does elementwise gp with the input arrays into the ouput array
i = numba.cuda.grid(1)
if i < value.shape[0]:
gp_device(value[i, :], other_value[i, :], output[i, :])
@numba.cuda.jit
def adjoint_kernel(value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
adjoint_device(value[i, :], output[i, :])
@numba.cuda.jit
def ip_kernel(value, other_value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
ip_device(value[i, :], other_value[i, :], output[i, :])
@numba.cuda.jit(device=True)
def project_val_cuda(val, output, grade):
for i in range(32):
output[i] = 0.0
if grade == 0:
output[0] = val[0]
elif grade == 1:
for j in range(1, 6):
output[j] = val[j]
elif grade == 2:
for j in range(6, 16):
output[j] = val[j]
elif grade == 3:
for j in range(16, 26):
output[j] = val[j]
elif grade == 4:
for j in range(26, 31):
output[j] = val[j]
elif grade == 5:
output[31] = val[31]
@numba.njit
def calc_norm_device(mv_val):
adj_value = numba.cuda.local.array(32, dtype=numba.float64)
output_value = numba.cuda.local.array(32, dtype=numba.float64)
adjoint_device(mv_val, adj_value)
gp_device(adj_value, mv_val, output_value)
return math.sqrt(abs(output_value[0]))
@numba.njit(device=True)
def normalise_mv_device(mv_val):
norm = calc_norm_device(mv_val)
for i in range(32):
mv_val[i] = mv_val[i]/norm
@numba.njit(device=True)
def normalise_mv_copy_device(mv_val, copy_array):
norm = calc_norm_device(mv_val)
for i in range(32):
copy_array[i] = mv_val[i]/norm
@numba.cuda.jit
def normalise_mvs_kernel(value_array):
i = numba.cuda.grid(1)
if i < value_array.shape[0]:
normalise_mv_device(value_array[i, :])
@numba.cuda.jit(device=True)
def annhilate_k_device(K_val, C_val, output):
k_4 = numba.cuda.local.array(32, dtype=numba.float64)
project_val_cuda(K_val, k_4, 4)
for i in range(32):
k_4[i] = -k_4[i]
k_4[0] += K_val[0]
gp_device(k_4, C_val, output)
normalise_mv_device(output)
@numba.jit(device=True)
def dorst_norm_val_device(sigma_val):
""" Square Root of Rotors - Implements the norm of a rotor"""
s_4 = numba.cuda.local.array(32, dtype=numba.float64)
s_4_sqrd = numba.cuda.local.array(32, dtype=numba.float64)
project_val_cuda(sigma_val, s_4, 4)
gp_device(s_4, s_4, s_4_sqrd)
sqrd_ans = sigma_val[0]*sigma_val[0] - s_4_sqrd[0]
return math.sqrt(abs(sqrd_ans))
@numba.cuda.jit
def dorst_norm_val_kernel(value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
output[i] = dorst_norm_val_device(value[i, :])
@numba.cuda.jit(device=True)
def positive_root_device(sigma_val, result):
"""
Square Root of Rotors - Evaluates the positive root
"""
norm_s = dorst_norm_val_device(sigma_val)
denominator = (math.sqrt(2.0*sigma_val[0] + 2.0*norm_s))
for i in range(32):
result[i] = sigma_val[i]/denominator
result[0] = result[0] + norm_s/denominator
@numba.cuda.jit(device=True)
def rotor_between_objects_device(L1, L2, rotor):
L1sqrd_val = numba.cuda.local.array(32, dtype=numba.float64)
gp_device(L1, L1, L1sqrd_val)
if L1sqrd_val[0] > 0:
C_val = numba.cuda.local.array(32, dtype=numba.float64)
sigma_val = numba.cuda.local.array(32, dtype=numba.float64)
k_value = numba.cuda.local.array(32, dtype=numba.float64)
gp_device(L2, L1, C_val)
C_val[0] += 1.0
gp_mult_with_adjoint(C_val, sigma_val)
positive_root_device(sigma_val, k_value)
annhilate_k_device(k_value, C_val, rotor)
else:
L21 = numba.cuda.local.array(32, dtype=numba.float64)
L12 = numba.cuda.local.array(32, dtype=numba.float64)
gp_device(L2, L1, L21)
gp_device(L1, L2, L12)
sumval = 0.0
for i in range(32):
if i == 0:
sumval += abs(L12[i] + L21[i] - 2.0)
else:
sumval += abs(L12[i] + L21[i])
rotor[i] = -L21[i]
if sumval < 0.0000001:
rotor[0] = rotor[0] - 1.0
else:
rotor[0] = rotor[0] + 1.0
normalise_mv_device(rotor)
@numba.cuda.jit
def rotor_between_objects_kernel(value, other_value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
rotor_between_objects_device(value[i, :], other_value[i, :], output[i, :])
@numba.cuda.jit(device=True)
def cost_between_objects_device(L1, L2):
R_val = numba.cuda.local.array(32, dtype=numba.float64)
rotor_between_objects_device(L1, L2, R_val)
return rotor_cost_device(R_val)
@numba.cuda.jit
def cost_between_objects_kernel(value, other_value, output):
# This does elementwise gp with the input arrays into the output array
i = numba.cuda.grid(1)
if i < value.shape[0]:
output[i] = cost_between_objects_device(value[i, :], other_value[i, :])
@numba.cuda.jit
def object_set_cost_kernel(line_set_a, line_set_b, cost_matrix):
a_ind, b_ind = numba.cuda.grid(2)
if a_ind < line_set_a.shape[0]:
if b_ind < line_set_b.shape[0]:
cost_matrix[a_ind, b_ind] = cost_between_objects_device(line_set_a[a_ind, :], line_set_b[b_ind, :])
def object_set_cost_cuda_value(line_set_a, line_set_b):
threadsperblock = (16, 16)
blockspergrid_x = math.ceil(line_set_a.shape[0] / threadsperblock[0])
blockspergrid_y = math.ceil(line_set_b.shape[0] / threadsperblock[1])
blockspergrid = (blockspergrid_x, blockspergrid_y)
cost_matrix = np.zeros((line_set_a.shape[0], line_set_b.shape[0]))
object_set_cost_kernel[blockspergrid, threadsperblock](line_set_a, line_set_b, cost_matrix)
return cost_matrix
def object_set_cost_cuda_mvs(line_set_a, line_set_b):
line_set_a_vals = np.array([l.value for l in line_set_a])
line_set_b_vals = np.array([l.value for l in line_set_b])
return object_set_cost_cuda_value(line_set_a_vals, line_set_b_vals)
@numba.cuda.jit(device=True)
def rotor_between_lines_device(L1, L2, rotor):
L21_val = numba.cuda.local.array(32, dtype=numba.float64)
L12_val = numba.cuda.local.array(32, dtype=numba.float64)
gp_device(L2, L1, L21_val)
gp_device(L1, L2, L12_val)
beta_val = numba.cuda.local.array(32, dtype=numba.float64)
K_val = numba.cuda.local.array(32, dtype=numba.float64)
for i in range(32):
K_val[i] = L21_val[i] + L12_val[i]
beta_val[i] = 0.0
K_val[0] += 2.0
project_val_cuda(K_val, beta_val, 4)
alpha = 2.0 * K_val[0]
denominator = math.sqrt(alpha / 2)
normalisation_val = numba.cuda.local.array(32, dtype=numba.float64)
output_val = numba.cuda.local.array(32, dtype=numba.float64)
for i in range(32):
if i == 0:
numerator_val = 1.0 - beta_val[i] / alpha
else:
numerator_val = -beta_val[i] / alpha
normalisation_val[i] = numerator_val / denominator
output_val[i] = L21_val[i]
output_val[0] += 1
gp_device(normalisation_val, output_val, rotor)
@numba.cuda.jit
def rotor_between_lines_kernel(value, other_value, output):
i = numba.cuda.grid(1)
if i < value.shape[0]:
rotor_between_lines_device(value[i, :], other_value[i, :], output[i, :])
@numba.cuda.jit(device=True)
def gp_mult_with_adjoint_to_scalar(value):
other_value = numba.cuda.local.array(32, dtype=numba.float64)
adjoint_device(value, other_value)
return value[0] * other_value[0] + value[3] * other_value[3] + value[4] * other_value[4] - value[5] * other_value[
5] - value[6] * other_value[6] - value[7] * other_value[7] - value[8] * other_value[8] + value[9] * other_value[
9] - value[10] * other_value[10] - value[11] * other_value[11] + value[12] * other_value[12] - value[
13] * other_value[13] + value[14] * other_value[14] + value[15] * other_value[15] + value[2] * \
other_value[2] - value[16] * other_value[16] + value[18] * other_value[18] - value[19] * other_value[19] + \
value[20] * other_value[20] + value[21] * other_value[21] - value[22] * other_value[22] + value[23] * \
other_value[23] + value[24] * other_value[24] + value[25] * other_value[25] + value[26] * other_value[26] - \
value[27] * other_value[27] - value[28] * other_value[28] - value[29] * other_value[29] - value[30] * \
other_value[30] - value[17] * other_value[17] + value[1] * other_value[1] - value[31] * other_value[31]
@numba.cuda.jit(device=True)
def gp_mult_with_adjoint(value, output):
other_value = numba.cuda.local.array(32, dtype=numba.float64)
adjoint_device(value, other_value)
gp_device(value, other_value, output)
@numba.cuda.jit(device=True)
def rotor_cost_device(R_val):
translation_val = numba.cuda.local.array(32, dtype=numba.float64)
rotation_val = numba.cuda.local.array(32, dtype=numba.float64)
ep_val = numba.cuda.local.array(32, dtype=numba.float64)
for i in range(32):
ep_val[i] = 0.0
ep_val[4] = 1.0
ip_device(R_val, ep_val, translation_val)
for i in range(32):
rotation_val[i] = R_val[i]
rotation_val[0] -= 1
a = abs(gp_mult_with_adjoint_to_scalar(rotation_val))
b = abs(gp_mult_with_adjoint_to_scalar(translation_val))
return a + b
@numba.cuda.jit(device=True)
def cost_line_to_line_device(L1, L2):
R_val = numba.cuda.local.array(32, dtype=numba.float64)
rotor_between_lines_device(L1, L2, R_val)
return rotor_cost_device(R_val)
@numba.cuda.jit
def cost_line_to_line_kernel(value, other_value, output):
# This does elementwise gp with the input arrays into the output array
i = numba.cuda.grid(1)
if i < value.shape[0]:
output[i] = cost_line_to_line_device(value[i, :], other_value[i, :])
@numba.cuda.jit
def line_set_cost_kernel(line_set_a, line_set_b, cost_matrix):
a_ind, b_ind = numba.cuda.grid(2)
if a_ind < line_set_a.shape[0]:
if b_ind < line_set_b.shape[0]:
cost_matrix[a_ind, b_ind] = cost_line_to_line_device(line_set_a[a_ind, :], line_set_b[b_ind, :])
def line_set_cost_cuda_value(line_set_a, line_set_b):
threadsperblock = (16, 16)
blockspergrid_x = math.ceil(line_set_a.shape[0] / threadsperblock[0])
blockspergrid_y = math.ceil(line_set_b.shape[0] / threadsperblock[1])
blockspergrid = (blockspergrid_x, blockspergrid_y)
cost_matrix = np.zeros((line_set_a.shape[0], line_set_b.shape[0]))
line_set_cost_kernel[blockspergrid, threadsperblock](line_set_a, line_set_b, cost_matrix)
return cost_matrix
def line_set_cost_cuda_mvs(line_set_a, line_set_b):
line_set_a_vals = np.array([l.value for l in line_set_a])
line_set_b_vals = np.array([l.value for l in line_set_b])
return line_set_cost_cuda_value(line_set_a_vals, line_set_b_vals)
| arsenovic/clifford | clifford/tools/g3c/cuda.py | Python | bsd-3-clause | 20,805 |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34.c
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__sizeof.label.xml
Template File: sources-sink-34.tmpl.c
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Initialize the source buffer using the size of a pointer
* GoodSource: Initialize the source buffer using the size of the DataElementType
* Sinks:
* BadSink : Print then free data
* Flow Variant: 34 Data flow: use of a union containing two methods of accessing the same data (within the same function)
*
* */
#include "std_testcase.h"
typedef union
{
twoIntsStruct * unionFirst;
twoIntsStruct * unionSecond;
} CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_unionType;
#ifndef OMITBAD
void CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_bad()
{
twoIntsStruct * data;
CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_unionType myUnion;
/* Initialize data */
data = NULL;
/* INCIDENTAL: CWE-467 (Use of sizeof() on a pointer type) */
/* FLAW: Using sizeof the pointer and not the data type in malloc() */
data = (twoIntsStruct *)malloc(sizeof(data));
if (data == NULL) {exit(-1);}
data->intOne = 1;
data->intTwo = 2;
myUnion.unionFirst = data;
{
twoIntsStruct * data = myUnion.unionSecond;
/* POTENTIAL FLAW: Attempt to use data, which may not have enough memory allocated */
printStructLine(data);
free(data);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
static void goodG2B()
{
twoIntsStruct * data;
CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_unionType myUnion;
/* Initialize data */
data = NULL;
/* FIX: Using sizeof the data type in malloc() */
data = (twoIntsStruct *)malloc(sizeof(*data));
if (data == NULL) {exit(-1);}
data->intOne = 1;
data->intTwo = 2;
myUnion.unionFirst = data;
{
twoIntsStruct * data = myUnion.unionSecond;
/* POTENTIAL FLAW: Attempt to use data, which may not have enough memory allocated */
printStructLine(data);
free(data);
}
}
void CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_good()
{
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| JianpingZeng/xcc | xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s11/CWE122_Heap_Based_Buffer_Overflow__sizeof_struct_34.c | C | bsd-3-clause | 3,188 |
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Included first as it collides with the X11 headers.
#include "gtest/gtest.h"
#include "flutter/shell/platform/embedder/test_utils/proc_table_replacement.h"
#include "flutter/shell/platform/linux/fl_engine_private.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
#include "flutter/shell/platform/linux/public/flutter_linux/fl_json_message_codec.h"
#include "flutter/shell/platform/linux/testing/fl_test.h"
// Checks sending window metrics events works.
TEST(FlEngineTest, WindowMetrics) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->SendWindowMetricsEvent = MOCK_ENGINE_PROC(
SendWindowMetricsEvent,
([&called](auto engine, const FlutterWindowMetricsEvent* event) {
called = true;
EXPECT_EQ(event->width, static_cast<size_t>(3840));
EXPECT_EQ(event->height, static_cast<size_t>(2160));
EXPECT_EQ(event->pixel_ratio, 2.0);
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
fl_engine_send_window_metrics_event(engine, 3840, 2160, 2.0);
EXPECT_TRUE(called);
}
// Checks sending mouse pointer events works.
TEST(FlEngineTest, MousePointer) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->SendPointerEvent = MOCK_ENGINE_PROC(
SendPointerEvent,
([&called](auto engine, const FlutterPointerEvent* events,
size_t events_count) {
called = true;
EXPECT_EQ(events_count, static_cast<size_t>(1));
EXPECT_EQ(events[0].phase, kDown);
EXPECT_EQ(events[0].timestamp, static_cast<size_t>(1234567890));
EXPECT_EQ(events[0].x, 800);
EXPECT_EQ(events[0].y, 600);
EXPECT_EQ(events[0].device, static_cast<int32_t>(0));
EXPECT_EQ(events[0].signal_kind, kFlutterPointerSignalKindScroll);
EXPECT_EQ(events[0].scroll_delta_x, 1.2);
EXPECT_EQ(events[0].scroll_delta_y, -3.4);
EXPECT_EQ(events[0].device_kind, kFlutterPointerDeviceKindMouse);
EXPECT_EQ(events[0].buttons, kFlutterPointerButtonMouseSecondary);
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
fl_engine_send_mouse_pointer_event(engine, kDown, 1234567890, 800, 600, 1.2,
-3.4, kFlutterPointerButtonMouseSecondary);
EXPECT_TRUE(called);
}
// Checks dispatching a semantics action works.
TEST(FlEngineTest, DispatchSemanticsAction) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->DispatchSemanticsAction = MOCK_ENGINE_PROC(
DispatchSemanticsAction,
([&called](auto engine, uint64_t id, FlutterSemanticsAction action,
const uint8_t* data, size_t data_length) {
EXPECT_EQ(id, static_cast<uint64_t>(42));
EXPECT_EQ(action, kFlutterSemanticsActionTap);
EXPECT_EQ(data_length, static_cast<size_t>(4));
EXPECT_EQ(data[0], 't');
EXPECT_EQ(data[1], 'e');
EXPECT_EQ(data[2], 's');
EXPECT_EQ(data[3], 't');
called = true;
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
g_autoptr(GBytes) data = g_bytes_new_static("test", 4);
fl_engine_dispatch_semantics_action(engine, 42, kFlutterSemanticsActionTap,
data);
EXPECT_TRUE(called);
}
// Checks sending platform messages works.
TEST(FlEngineTest, PlatformMessage) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
FlutterEngineSendPlatformMessageFnPtr old_handler =
embedder_api->SendPlatformMessage;
embedder_api->SendPlatformMessage = MOCK_ENGINE_PROC(
SendPlatformMessage,
([&called, old_handler](auto engine,
const FlutterPlatformMessage* message) {
if (strcmp(message->channel, "test") != 0) {
return old_handler(engine, message);
}
called = true;
EXPECT_EQ(message->message_size, static_cast<size_t>(4));
EXPECT_EQ(message->message[0], 't');
EXPECT_EQ(message->message[1], 'e');
EXPECT_EQ(message->message[2], 's');
EXPECT_EQ(message->message[3], 't');
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
g_autoptr(GBytes) message = g_bytes_new_static("test", 4);
fl_engine_send_platform_message(engine, "test", message, nullptr, nullptr,
nullptr);
EXPECT_TRUE(called);
}
// Checks sending platform message responses works.
TEST(FlEngineTest, PlatformMessageResponse) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->SendPlatformMessageResponse = MOCK_ENGINE_PROC(
SendPlatformMessageResponse,
([&called](auto engine,
const FlutterPlatformMessageResponseHandle* handle,
const uint8_t* data, size_t data_length) {
called = true;
EXPECT_EQ(
handle,
reinterpret_cast<const FlutterPlatformMessageResponseHandle*>(42));
EXPECT_EQ(data_length, static_cast<size_t>(4));
EXPECT_EQ(data[0], 't');
EXPECT_EQ(data[1], 'e');
EXPECT_EQ(data[2], 's');
EXPECT_EQ(data[3], 't');
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
g_autoptr(GBytes) response = g_bytes_new_static("test", 4);
EXPECT_TRUE(fl_engine_send_platform_message_response(
engine, reinterpret_cast<const FlutterPlatformMessageResponseHandle*>(42),
response, &error));
EXPECT_EQ(error, nullptr);
EXPECT_TRUE(called);
}
// Checks settings plugin sends settings on startup.
TEST(FlEngineTest, SettingsPlugin) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->SendPlatformMessage = MOCK_ENGINE_PROC(
SendPlatformMessage,
([&called](auto engine, const FlutterPlatformMessage* message) {
called = true;
EXPECT_STREQ(message->channel, "flutter/settings");
g_autoptr(FlJsonMessageCodec) codec = fl_json_message_codec_new();
g_autoptr(GBytes) data =
g_bytes_new(message->message, message->message_size);
g_autoptr(GError) error = nullptr;
g_autoptr(FlValue) settings = fl_message_codec_decode_message(
FL_MESSAGE_CODEC(codec), data, &error);
EXPECT_NE(settings, nullptr);
EXPECT_EQ(error, nullptr);
FlValue* text_scale_factor =
fl_value_lookup_string(settings, "textScaleFactor");
EXPECT_NE(text_scale_factor, nullptr);
EXPECT_EQ(fl_value_get_type(text_scale_factor), FL_VALUE_TYPE_FLOAT);
FlValue* always_use_24hr_format =
fl_value_lookup_string(settings, "alwaysUse24HourFormat");
EXPECT_NE(always_use_24hr_format, nullptr);
EXPECT_EQ(fl_value_get_type(always_use_24hr_format),
FL_VALUE_TYPE_BOOL);
FlValue* platform_brightness =
fl_value_lookup_string(settings, "platformBrightness");
EXPECT_NE(platform_brightness, nullptr);
EXPECT_EQ(fl_value_get_type(platform_brightness), FL_VALUE_TYPE_STRING);
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
EXPECT_TRUE(called);
}
void on_pre_engine_restart_cb(FlEngine* engine, gpointer user_data) {
int* count = reinterpret_cast<int*>(user_data);
*count += 1;
}
void on_pre_engine_restart_destroy_notify(gpointer user_data) {
int* count = reinterpret_cast<int*>(user_data);
*count += 10;
}
// Checks restarting the engine invokes the correct callback.
TEST(FlEngineTest, OnPreEngineRestart) {
g_autoptr(FlEngine) engine = make_mock_engine();
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
OnPreEngineRestartCallback callback;
void* callback_user_data;
bool called = false;
embedder_api->Initialize = MOCK_ENGINE_PROC(
Initialize, ([&callback, &callback_user_data, &called](
size_t version, const FlutterRendererConfig* config,
const FlutterProjectArgs* args, void* user_data,
FLUTTER_API_SYMBOL(FlutterEngine) * engine_out) {
called = true;
callback = args->on_pre_engine_restart_callback;
callback_user_data = user_data;
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
EXPECT_TRUE(called);
EXPECT_NE(callback, nullptr);
// The following call has no effect but should not crash.
callback(callback_user_data);
int count = 0;
// Set a handler, and the call should has an effect.
fl_engine_set_on_pre_engine_restart_handler(
engine, on_pre_engine_restart_cb, &count,
on_pre_engine_restart_destroy_notify);
callback(callback_user_data);
EXPECT_EQ(count, 1);
// Disposal should call the destroy notify.
g_object_unref(engine);
EXPECT_EQ(count, 11);
}
TEST(FlEngineTest, DartEntrypointArgs) {
g_autoptr(FlDartProject) project = fl_dart_project_new();
GPtrArray* args_array = g_ptr_array_new();
g_ptr_array_add(args_array, (gpointer) "arg_one");
g_ptr_array_add(args_array, (gpointer) "arg_two");
g_ptr_array_add(args_array, (gpointer) "arg_three");
g_ptr_array_add(args_array, nullptr);
gchar** args = (gchar**)g_ptr_array_free(args_array, false);
fl_dart_project_set_dart_entrypoint_arguments(project, args);
g_autoptr(FlEngine) engine = make_mock_engine_with_project(project);
FlutterEngineProcTable* embedder_api = fl_engine_get_embedder_api(engine);
bool called = false;
embedder_api->Initialize = MOCK_ENGINE_PROC(
Initialize, ([&called, &set_args = args](
size_t version, const FlutterRendererConfig* config,
const FlutterProjectArgs* args, void* user_data,
FLUTTER_API_SYMBOL(FlutterEngine) * engine_out) {
called = true;
EXPECT_NE(set_args, args->dart_entrypoint_argv);
EXPECT_EQ(args->dart_entrypoint_argc, 3);
return kSuccess;
}));
g_autoptr(GError) error = nullptr;
EXPECT_TRUE(fl_engine_start(engine, &error));
EXPECT_EQ(error, nullptr);
EXPECT_TRUE(called);
}
| rmacnak-google/engine | shell/platform/linux/fl_engine_test.cc | C++ | bsd-3-clause | 11,319 |
/*
* Copyright (c) 2012, United States Government, as represented by the Secretary of Health and Human Services.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the United States Government nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package gov.hhs.fha.nhinc.patientcorrelation.nhinc;
import gov.hhs.fha.nhinc.common.nhinccommon.AssertionType;
import org.hl7.v3.AddPatientCorrelationResponseType;
import org.hl7.v3.AddPatientCorrelationSecuredRequestType;
import org.hl7.v3.AddPatientCorrelationSecuredResponseType;
import org.hl7.v3.RetrievePatientCorrelationsResponseType;
import org.hl7.v3.RetrievePatientCorrelationsSecuredRequestType;
import org.hl7.v3.RetrievePatientCorrelationsSecuredResponseType;
/**
*
* @author svalluripalli
*/
public class PatientCorrelationServiceSecuredServiceImpl
implements
PatientCorrelationService<RetrievePatientCorrelationsSecuredRequestType, RetrievePatientCorrelationsSecuredResponseType, AddPatientCorrelationSecuredRequestType, AddPatientCorrelationSecuredResponseType>
{
private PatientCorrelationOrch orchestration;
private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory
.getLog(PatientCorrelationServiceSecuredServiceImpl.class);
PatientCorrelationServiceSecuredServiceImpl(PatientCorrelationOrch orchestration) {
this.orchestration = orchestration;
}
public RetrievePatientCorrelationsSecuredResponseType retrievePatientCorrelations(
RetrievePatientCorrelationsSecuredRequestType request, AssertionType assertion) {
RetrievePatientCorrelationsSecuredResponseType response = new RetrievePatientCorrelationsSecuredResponseType();
log.info("Calling the Patient Correlation Retrieve Correlations Orch Impl");
RetrievePatientCorrelationsResponseType unsecureResp = orchestration.retrievePatientCorrelations(
request.getPRPAIN201309UV02(), assertion);
if (unsecureResp != null && unsecureResp.getPRPAIN201310UV02() != null) {
response.setPRPAIN201310UV02(unsecureResp.getPRPAIN201310UV02());
}
return response;
}
public AddPatientCorrelationSecuredResponseType addPatientCorrelation(
AddPatientCorrelationSecuredRequestType request, AssertionType assertion) {
AddPatientCorrelationSecuredResponseType response = new AddPatientCorrelationSecuredResponseType();
log.info("Calling the Patient Correlation Add Correlations Orch Impl");
AddPatientCorrelationResponseType unsecureResp = orchestration.addPatientCorrelation(
request.getPRPAIN201301UV02(), assertion);
if (unsecureResp != null && unsecureResp.getMCCIIN000002UV01() != null) {
response.setMCCIIN000002UV01(unsecureResp.getMCCIIN000002UV01());
}
return response;
}
}
| alameluchidambaram/CONNECT | Product/Production/Gateway/CONNECTGatewayWeb/src/main/java/gov/hhs/fha/nhinc/patientcorrelation/nhinc/PatientCorrelationServiceSecuredServiceImpl.java | Java | bsd-3-clause | 4,321 |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_USER_MANAGER_USER_INFO_IMPL_H_
#define COMPONENTS_USER_MANAGER_USER_INFO_IMPL_H_
#include <string>
#include "base/macros.h"
#include "components/account_id/account_id.h"
#include "components/user_manager/user_info.h"
#include "components/user_manager/user_manager_export.h"
#include "ui/gfx/image/image_skia.h"
namespace user_manager {
// Stub implementation of UserInfo interface. Used in tests.
class USER_MANAGER_EXPORT UserInfoImpl : public UserInfo {
public:
UserInfoImpl();
UserInfoImpl(const UserInfoImpl&) = delete;
UserInfoImpl& operator=(const UserInfoImpl&) = delete;
~UserInfoImpl() override;
// UserInfo:
std::u16string GetDisplayName() const override;
std::u16string GetGivenName() const override;
std::string GetDisplayEmail() const override;
const AccountId& GetAccountId() const override;
const gfx::ImageSkia& GetImage() const override;
private:
const AccountId account_id_;
gfx::ImageSkia user_image_;
};
} // namespace user_manager
#endif // COMPONENTS_USER_MANAGER_USER_INFO_IMPL_H_
| nwjs/chromium.src | components/user_manager/user_info_impl.h | C | bsd-3-clause | 1,227 |
<?php
/**
* HiSite Yii2 base project.
*
* @link https://github.com/hiqdev/hisite
* @package hisite
* @license BSD-3-Clause
* @copyright Copyright (c) 2016-2017, HiQDev (http://hiqdev.com/)
*/
/**
* Message translations.
*
* This file is automatically generated by 'yii message/extract' command.
* It contains the localizable messages extracted from source code.
* You may modify this file by translating the extracted messages.
*
* Each array element represents the translation (value) of a message (key).
* If the value is empty, the message is considered as not translated.
* Messages that no longer need translation will have their translations
* enclosed between a pair of '@@' marks.
*
* Message string can be used with plural forms format. Check i18n section
* of the guide for details.
*
* NOTE: this file must be saved in UTF-8 encoding.
*/
return [
'About' => 'О нас',
'Contact' => 'Контакты',
'Home' => 'Главная',
'tech support' => 'техническая поддержка',
'All rights reserved.' => 'Все права защищены.',
'You will be redirected in {sec} seconds' => 'Вы будете перенаправлены через {sec} сек.',
];
| hiqdev/hisite-core | src/messages/ru/hisite.php | PHP | bsd-3-clause | 1,251 |
var ExtractTextPlugin = require("extract-text-webpack-plugin");
var path = require("path");
var js = path.resolve(__dirname, "frontend");
module.exports = {
// Input files for the bundles of JS/CSS
entry: {
admin: path.resolve(js, "admin/main.js"),
user: path.resolve(js, "user/main.js"),
sharedDependencies: path.resolve(js, "sharedDependencies")
},
// Output bundle of JS
output: {
path: path.resolve(__dirname, "remoteappmanager/static/dist"),
filename: "[name].js"
},
// Aliases and file extensions supported
resolve: {
extensions: ["*", ".js", ".vue", ".css"],
alias: {
// CSS
"bootstrap-css": "admin-lte/bootstrap/css/bootstrap.min",
"font-awesome-css": "font-awesome/css/font-awesome.min",
"ionicons-css": "ionicons/dist/css/ionicons.min",
"admin-lte-css": "admin-lte/dist/css/AdminLTE.min",
"skin-black-css": "admin-lte/dist/css/skins/skin-black.min",
"skin-red-css": "admin-lte/dist/css/skins/skin-red.min",
"skin-blue-css": "admin-lte/dist/css/skins/skin-blue.min",
// JS
jquery: "admin-lte/plugins/jQuery/jquery-2.2.3.min",
bootstrap: "admin-lte/bootstrap/js/bootstrap.min",
vue: "vue/dist/vue.min",
"vue-router": "vue-router/dist/vue-router",
"admin-resources": path.resolve(js, "admin/admin-resources"),
"user-resources": path.resolve(js, "user/user-resources"),
gamodule: path.resolve(js, "gamodule"),
urlutils: path.resolve(js, "urlutils"),
utils: path.resolve(js, "utils"),
toolkit: path.resolve(js, "toolkit/toolkit"),
}
},
// Loaders for specific file extensions
module: {
rules: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader'
}
},
{
test: /\.vue$/,
use: {
loader: 'vue-loader'
}
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: 'css-loader' })
},
{
test: /\.(eot|svg|ttf|woff|woff2|jpg)$/,
// Output font files
loader: 'file-loader?name=files/[name].[ext]'
}
]
},
// Output bundle of CSS
plugins: [
new ExtractTextPlugin("[name].css")
]
};
| simphony/simphony-remote | webpackfile.js | JavaScript | bsd-3-clause | 2,304 |
<?php
namespace Theme\Service;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
class ThemeInvokable implements ServiceLocatorAwareInterface
{
private $serviceLocator;
/**
* The name of the current theme
* @var unknown
*/
private $name = 'default';
private $loaded = false;
public function load()
{
if ($this->loaded) {
return;
}
$storage = $this->serviceLocator->get('theme-storage');
$name = $storage->get();
if (!$name) {
return true;
}
$config = $this->serviceLocator->get('config');
if (!isset($config['themes'][$name])) {
return;
}
$this->name = $name;
}
public function setName($name)
{
$config = $this->serviceLocator->get('config');
if (!isset($config['themes'][$name])) {
throw new \Exception('Invalid Theme Specified');
}
$this->name = $name;
$storage = $this->serviceLocator->get('theme-storage');
$storage->set($name);
}
public function getName()
{
$this->load();
return $this->name;
}
public function getConfig()
{
$this->load();
$config = $this->serviceLocator->get('config');
return $config['themes'];
}
/* (non-PHPdoc)
* @see \Zend\ServiceManager\ServiceLocatorAwareInterface::setServiceLocator()
*/
public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
{
$this->serviceLocator = $serviceLocator;
}
/* (non-PHPdoc)
* @see \Zend\ServiceManager\ServiceLocatorAwareInterface::getServiceLocator()
*/
public function getServiceLocator()
{
return $this->serviceLocator;
}
}
| slaff/learnzf2-theme | src/Theme/Service/ThemeInvokable.php | PHP | bsd-3-clause | 1,839 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## @copyright
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, Jorge De La Cruz, Carmen Castano.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
__author__ = 'Jorge De La Cruz, Carmen Castano'
__copyright__ = 'Copyright (c) 2017 Jorge De La Cruz, Carmen Castano'
__license__ = 'BSD'
__maintainer__ = 'Jorge De La Cruz'
__email__ = 'delacruz@igm.rwth-aachen.de'
import sys
## Path to FreeCAD library
# change this by your FreeCAD library path
sys.path.append('/usr/lib/freecad/lib')
import FreeCAD as App
import Import
from datetime import datetime
class GetParameters:
def __init__(self):
self.filePath = '/home/jdelacruz/Downloads/KonzeptB_lang090715.stp'
def loadCAD(self):
print('Starting to load the CAD file, please be patient!...')
Import.open(self.filePath)
self.handler = App.ActiveDocument
self.parts = self.handler.Objects
print('CAD model loaded!')
def writeTxt(self):
f = open('data.txt','a')
print >>f, 'Name \t Label'
self.i = 0
self.size = len(self.parts)
self.names = range(self.size)
self.labels = range(self.size)
for self.part in self.parts:
self.names[self.i] = self.part.Name
self.labels[self.i] = self.part.Label
print >>f, self.part.Name+"\t"+self.part.Label
self.i += 1
f.close()
print('The txt file has been created successfully!')
if __name__ == '__main__':
data = GetParameters()
data.loadCAD()
data.writeTxt()
| jdelacruz26/misccode | cad2xls.py | Python | bsd-3-clause | 2,955 |
/*
* type and other definitions
*
* written by Yasha (ITOH Yasufumi)
* public domain
*
* $NetBSD: type_local.h,v 1.1 1998/09/01 19:51:09 itohy Exp $
*/
#ifdef __STDC__
# define PROTO(x) x
#else
# define PROTO(x) ()
# ifndef const
# define const
# endif
#endif
#ifndef __BIT_TYPES_DEFINED__
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
#endif
/*
* big-endian integer types
*/
typedef union be_uint16 {
u_int8_t val[2];
u_int16_t hostval;
} be_uint16_t;
typedef union be_uint32 {
u_int8_t val[4];
u_int32_t hostval;
be_uint16_t half[2];
} be_uint32_t;
#define SIZE_16 sizeof(be_uint16_t)
#define SIZE_32 sizeof(be_uint32_t)
| MarginC/kame | netbsd/sys/arch/x68k/stand/aout2hux/type_local.h | C | bsd-3-clause | 697 |
// Copyright 2016 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <vector>
#include "starboard/configuration_constants.h"
#include "starboard/decode_target.h"
#include "starboard/nplb/player_creation_param_helpers.h"
#include "starboard/nplb/player_test_util.h"
#include "starboard/player.h"
#include "starboard/testing/fake_graphics_context_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace starboard {
namespace nplb {
namespace {
using ::starboard::testing::FakeGraphicsContextProvider;
using ::testing::Values;
class SbPlayerTest : public ::testing::TestWithParam<SbPlayerOutputMode> {
public:
SbPlayerTest() : output_mode_(GetParam()) {}
void GetCurrentFrameIfSupported(SbPlayer player) {
if (output_mode_ != kSbPlayerOutputModeDecodeToTexture) {
return;
}
#if SB_HAS(GLES2)
fake_graphics_context_provider_.RunOnGlesContextThread([&]() {
ASSERT_TRUE(SbPlayerIsValid(player));
SbDecodeTarget frame = SbPlayerGetCurrentFrame(player);
if (SbDecodeTargetIsValid(frame)) {
SbDecodeTargetRelease(frame);
}
});
#endif // SB_HAS(GLES2)
}
protected:
FakeGraphicsContextProvider fake_graphics_context_provider_;
SbPlayerOutputMode output_mode_;
};
void DummyDeallocateSampleFunc(SbPlayer player,
void* context,
const void* sample_buffer) {}
void DummyDecoderStatusFunc(SbPlayer player,
void* context,
SbMediaType type,
SbPlayerDecoderState state,
int ticket) {}
void DummyStatusFunc(SbPlayer player,
void* context,
SbPlayerState state,
int ticket) {}
void DummyErrorFunc(SbPlayer player,
void* context,
SbPlayerError error,
const char* message) {}
TEST_P(SbPlayerTest, SunnyDay) {
SbMediaAudioSampleInfo audio_sample_info =
CreateAudioSampleInfo(kSbMediaAudioCodecAac);
if (!IsOutputModeSupported(output_mode_, kSbMediaAudioCodecAac,
kSbMediaVideoCodecH264)) {
return;
}
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
DummyDecoderStatusFunc, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_TRUE(SbPlayerIsValid(player));
GetCurrentFrameIfSupported(player);
SbPlayerDestroy(player);
}
TEST_P(SbPlayerTest, NullCallbacks) {
SbMediaAudioSampleInfo audio_sample_info =
CreateAudioSampleInfo(kSbMediaAudioCodecAac);
if (!IsOutputModeSupported(output_mode_, kSbMediaAudioCodecAac,
kSbMediaVideoCodecH264)) {
return;
}
{
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, NULL /* deallocate_sample_func */,
DummyDecoderStatusFunc, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_FALSE(SbPlayerIsValid(player));
SbPlayerDestroy(player);
}
{
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
NULL /* decoder_status_func */, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_FALSE(SbPlayerIsValid(player));
SbPlayerDestroy(player);
}
{
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
DummyDecoderStatusFunc, NULL /*status_func */, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_FALSE(SbPlayerIsValid(player));
SbPlayerDestroy(player);
}
{
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info, "",
DummyDeallocateSampleFunc, DummyDecoderStatusFunc, DummyStatusFunc,
NULL /* error_func */, NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_FALSE(SbPlayerIsValid(player));
SbPlayerDestroy(player);
}
}
TEST_P(SbPlayerTest, Audioless) {
if (!IsOutputModeSupported(output_mode_, kSbMediaAudioCodecNone,
kSbMediaVideoCodecH264)) {
return;
}
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecH264,
kSbMediaAudioCodecNone, kSbDrmSystemInvalid, NULL /* audio_sample_info */,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
DummyDecoderStatusFunc, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_TRUE(SbPlayerIsValid(player));
GetCurrentFrameIfSupported(player);
SbPlayerDestroy(player);
}
TEST_P(SbPlayerTest, AudioOnly) {
SbMediaAudioSampleInfo audio_sample_info =
CreateAudioSampleInfo(kSbMediaAudioCodecAac);
if (!IsOutputModeSupported(output_mode_, kSbMediaAudioCodecAac,
kSbMediaVideoCodecH264)) {
return;
}
SbPlayer player = CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kSbMediaVideoCodecNone,
kSbMediaAudioCodecAac, kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
DummyDecoderStatusFunc, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, output_mode_,
fake_graphics_context_provider_.decoder_target_provider());
EXPECT_TRUE(SbPlayerIsValid(player));
GetCurrentFrameIfSupported(player);
SbPlayerDestroy(player);
}
TEST_P(SbPlayerTest, MultiPlayer) {
SbMediaAudioSampleInfo audio_sample_info =
CreateAudioSampleInfo(kSbMediaAudioCodecAac);
SbDrmSystem kDrmSystem = kSbDrmSystemInvalid;
constexpr SbPlayerOutputMode kOutputModes[] = {
kSbPlayerOutputModeDecodeToTexture, kSbPlayerOutputModePunchOut};
constexpr SbMediaAudioCodec kAudioCodecs[] = {
kSbMediaAudioCodecNone,
kSbMediaAudioCodecAac, kSbMediaAudioCodecAc3, kSbMediaAudioCodecEac3,
kSbMediaAudioCodecOpus, kSbMediaAudioCodecVorbis,
};
// TODO: turn this into a macro.
// Perform a check to determine if new audio codecs have been added to the
// SbMediaAudioCodec enum, but not the array |audio_codecs|. If the compiler
// warns about a missing case here, the value must be added to |kAudioCodecs|.
SbMediaAudioCodec audio_codec = kAudioCodecs[0];
switch (audio_codec) {
case kAudioCodecs[0]:
case kAudioCodecs[1]:
case kAudioCodecs[2]:
case kAudioCodecs[3]:
case kAudioCodecs[4]:
case kAudioCodecs[5]:
break;
}
constexpr SbMediaVideoCodec kVideoCodecs[] = {
kSbMediaVideoCodecNone,
kSbMediaVideoCodecH264, kSbMediaVideoCodecH265, kSbMediaVideoCodecMpeg2,
kSbMediaVideoCodecTheora, kSbMediaVideoCodecVc1, kSbMediaVideoCodecAv1,
kSbMediaVideoCodecVp8, kSbMediaVideoCodecVp9,
};
// TODO: turn this into a macro.
// Perform a check to determine if new video codecs have been added to the
// SbMediaVideoCodec enum, but not the array |video_codecs|. If the compiler
// warns about a missing case here, the value must be added to |kVideoCodecs|.
SbMediaVideoCodec video_codec = kVideoCodecs[0];
switch (video_codec) {
case kVideoCodecs[0]:
case kVideoCodecs[1]:
case kVideoCodecs[2]:
case kVideoCodecs[3]:
case kVideoCodecs[4]:
case kVideoCodecs[5]:
case kVideoCodecs[6]:
case kVideoCodecs[7]:
case kVideoCodecs[8]:
break;
}
const int kMaxPlayersPerConfig = 16;
std::vector<SbPlayer> created_players;
int number_of_players = 0;
for (int i = 0; i < kMaxPlayersPerConfig; ++i) {
for (int j = 0; j < SB_ARRAY_SIZE_INT(kOutputModes); ++j) {
for (int k = 0; k < SB_ARRAY_SIZE_INT(kAudioCodecs); ++k) {
for (int l = 0; l < SB_ARRAY_SIZE_INT(kVideoCodecs); ++l) {
audio_sample_info.codec = kAudioCodecs[k];
created_players.push_back(CallSbPlayerCreate(
fake_graphics_context_provider_.window(), kVideoCodecs[l],
kAudioCodecs[k], kSbDrmSystemInvalid, &audio_sample_info,
"" /* max_video_capabilities */, DummyDeallocateSampleFunc,
DummyDecoderStatusFunc, DummyStatusFunc, DummyErrorFunc,
NULL /* context */, kOutputModes[j],
fake_graphics_context_provider_.decoder_target_provider()));
if (!SbPlayerIsValid(created_players.back())) {
created_players.pop_back();
}
}
}
}
if (created_players.size() == number_of_players) {
break;
}
number_of_players = created_players.size();
}
SB_DLOG(INFO) << "Created " << number_of_players << " players in total.";
for (auto player : created_players) {
SbPlayerDestroy(player);
}
}
INSTANTIATE_TEST_CASE_P(SbPlayerTests,
SbPlayerTest,
Values(kSbPlayerOutputModeDecodeToTexture,
kSbPlayerOutputModePunchOut));
} // namespace
} // namespace nplb
} // namespace starboard
| youtube/cobalt | starboard/nplb/player_create_test.cc | C++ | bsd-3-clause | 10,642 |
/*
*
* Copyright (c) 1999-2000, Vitaly V Belekhov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/netgraph/ng_split.h,v 1.2 2001/07/24 23:33:06 brooks Exp $
*
*/
#ifndef _NG_SPLIT_H
#define _NG_SPLIT_H
/* Node type name and magic cookie */
#define NG_SPLIT_NODE_TYPE "split"
#define NGM_NG_SPLIT_COOKIE 949409402
/* My hook names */
#define NG_SPLIT_HOOK_MIXED "mixed" /* Mixed stream (in/out) */
#define NG_SPLIT_HOOK_OUT "out" /* Output to outhook (sending out) */
#define NG_SPLIT_HOOK_IN "in" /* Input from inhook (recieving) */
#endif /* _NG_SPLIT_H */
| MarginC/kame | freebsd5/sys/netgraph/ng_split.h | C | bsd-3-clause | 1,872 |
#region License
// Copyright (c) 2014 The Sentry Team and individual contributors.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted
// provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of
// conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution.
//
// 3. Neither the name of the Sentry nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using System;
using System.Collections.Generic;
using SharpRaven.Data;
using SharpRaven.Logging;
namespace SharpRaven
{
/// <summary>
/// Empty (no-op) implementation for the Raven Client for use in dependency injection
/// and other places when a silent operation is needed.
/// </summary>
public partial class NoOpRavenClient : IRavenClient
{
private readonly Dsn currentDsn;
private readonly IDictionary<string, string> defaultTags;
/// <summary>
/// Initializes a new instance of the <see cref="NoOpRavenClient" /> class.
/// </summary>
public NoOpRavenClient()
{
currentDsn = new Dsn("http://ig:nore@sentry-dsn.invalid");
defaultTags = new Dictionary<string, string>();
}
/// <summary>
/// Gets or sets the <see cref="Action"/> to execute to manipulate or extract data from
/// the <see cref="IRequester"/> object before it is used in the <see cref="Send"/> method.
/// </summary>
/// <value>
/// The <see cref="Action"/> to execute to manipulate or extract data from the
/// <see cref="IRequester"/> object before it is used in the <see cref="Send"/> method.
/// </value>
public Func<IRequester, IRequester> BeforeSend { get; set; }
/// <summary>
/// Gets or sets the <see cref="Action"/> to execute if an error occurs when executing
/// <see cref="Capture"/>.
/// </summary>
/// <value>
/// The <see cref="Action"/> to execute if an error occurs when executing <see cref="Capture"/>.
/// </value>
public Action<Exception> ErrorOnCapture { get; set; }
/// <summary>
/// Enable Gzip Compression?
/// Defaults to <c>false</c>.
/// </summary>
public bool Compression { get; set; }
/// <summary>
/// The Dsn currently being used to log exceptions.
/// </summary>
public Dsn CurrentDsn
{
get { return currentDsn; }
}
/// <summary>
/// Interface for providing a 'log scrubber' that removes
/// sensitive information from exceptions sent to sentry.
/// </summary>
public IScrubber LogScrubber { get; set; }
/// <summary>
/// The name of the logger. The default logger name is "root".
/// </summary>
public string Logger { get; set; }
/// <summary>
/// The version of the application.
/// </summary>
public string Release { get; set; }
/// <summary>
/// The environment (e.g. production)
/// </summary>
public string Environment { get; set; }
/// <summary>
/// Default tags sent on all events.
/// </summary>
public IDictionary<string, string> Tags
{
get { return this.defaultTags; }
}
/// <summary>
/// Gets or sets the timeout value in milliseconds for the HTTP communication with Sentry.
/// </summary>
/// <value>
/// The number of milliseconds to wait before the request times out. The default is 5,000 milliseconds (5 seconds).
/// </value>
public TimeSpan Timeout { get; set; }
/// <summary>
/// Not register the <see cref="Breadcrumb"/> for tracking.
/// </summary>
public bool IgnoreBreadcrumbs { get; set; }
/// <summary>
/// Captures the last 100 <see cref="Breadcrumb" />.
/// </summary>
/// <param name="breadcrumb">The <see cref="Breadcrumb" /> to capture.</param>
public void AddTrail(Breadcrumb breadcrumb)
{
}
/// <summary>
/// Restart the capture of the <see cref="Breadcrumb"/> for tracking.
/// </summary>
public void RestartTrails()
{
}
/// <summary>Captures the specified <paramref name="event"/>.</summary>
/// <param name="event">The event to capture.</param>
/// <returns>
/// The <see cref="JsonPacket.EventID" /> of the successfully captured <paramref name="event" />, or <c>null</c> if it fails.
/// </returns>
public string Capture(SentryEvent @event)
{
return Guid.NewGuid().ToString("n");
}
/// <summary>
/// Captures the event.
/// </summary>
/// <param name="e">The <see cref="Exception" /> to capture.</param>
/// <returns></returns>
[Obsolete("Use CaptureException() instead.", true)]
public string CaptureEvent(Exception e)
{
return CaptureException(e);
}
/// <summary>
/// Captures the event.
/// </summary>
/// <param name="e">The <see cref="Exception" /> to capture.</param>
/// <param name="tags">The tags to annotate the captured exception with.</param>
/// <returns></returns>
[Obsolete("Use CaptureException() instead.", true)]
public string CaptureEvent(Exception e, Dictionary<string, string> tags)
{
return CaptureException(e, tags : tags);
}
/// <summary>
/// Captures the <see cref="Exception" />.
/// </summary>
/// <param name="exception">The <see cref="Exception" /> to capture.</param>
/// <param name="message">The optional message to capture. Default: <see cref="Exception.Message" />.</param>
/// <param name="level">The <see cref="ErrorLevel" /> of the captured <paramref name="exception" />. Default: <see cref="ErrorLevel.Error"/>.</param>
/// <param name="tags">The tags to annotate the captured <paramref name="exception" /> with.</param>
/// <param name="fingerprint">The custom fingerprint to annotate the captured <paramref name="message" /> with.</param>
/// <param name="extra">The extra metadata to send with the captured <paramref name="exception" />.</param>
/// <returns>
/// The <see cref="JsonPacket.EventID" /> of the successfully captured <paramref name="exception" />, or <c>null</c> if it fails.
/// </returns>
[Obsolete("Use Capture(SentryEvent) instead")]
public string CaptureException(Exception exception,
SentryMessage message = null,
ErrorLevel level = ErrorLevel.Error,
IDictionary<string, string> tags = null,
string[] fingerprint = null,
object extra = null)
{
return Guid.NewGuid().ToString("n");
}
/// <summary>
/// Captures the message.
/// </summary>
/// <param name="message">The message to capture.</param>
/// <param name="level">The <see cref="ErrorLevel" /> of the captured <paramref name="message"/>. Default <see cref="ErrorLevel.Info"/>.</param>
/// <param name="tags">The tags to annotate the captured <paramref name="message"/> with.</param>
/// <param name="fingerprint">The custom fingerprint to annotate the captured <paramref name="message" /> with.</param>
/// <param name="extra">The extra metadata to send with the captured <paramref name="message"/>.</param>
/// <returns>
/// The <see cref="JsonPacket.EventID"/> of the successfully captured <paramref name="message"/>, or <c>null</c> if it fails.
/// </returns>
[Obsolete("Use Capture(SentryEvent) instead")]
public string CaptureMessage(SentryMessage message,
ErrorLevel level = ErrorLevel.Info,
IDictionary<string, string> tags = null,
string[] fingerprint = null,
object extra = null)
{
return Guid.NewGuid().ToString("n");
}
/// <summary>Sends the specified user feedback to Sentry</summary>
/// <returns>An empty string if succesful, otherwise the server response</returns>
/// <param name="feedback">The user feedback to send</param>
public string SendUserFeedback(SentryUserFeedback feedback)
{
return string.Empty;
}
}
}
| getsentry/raven-csharp | src/app/SharpRaven/NoOpRavenClient.cs | C# | bsd-3-clause | 10,032 |
/* RawToCompressed.cpp
*
* Author : Alexander J. Yee
* Date Created : 02/10/2018
* Last Modified : 02/10/2018
*
*/
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// Dependencies
#include "PublicLibs/SystemLibs/ProcessorCapability/ProcessorCapability.h"
////////////////////////////////////////////////////////////////////////////////
#if 0
#elif defined YMP_Arch_2017_x64_Skylake
#include "Kernels/WordToRaw_x64_AVX512-BW.ipp"
#elif defined YMP_Arch_2013_x64_Haswell
#include "Kernels/WordToRaw_x64_AVX2.ipp"
#elif defined YMP_Arch_2007_x64_Penryn
#include "Kernels/WordToRaw_x64_SSE41.ipp"
#elif defined YMP_Arch_2000_x86
#include "Kernels/WordToRaw_LittleEndian.ipp"
#else
#error "No generic implementation available."
#endif
////////////////////////////////////////////////////////////////////////////////
namespace DigitViewer2{
namespace WordToRaw{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
}
}
| Mysticial/DigitViewer | Source/DigitViewer2/WordToRaw/WordToRaw.cpp | C++ | bsd-3-clause | 1,852 |
<?php
namespace app\models;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use app\models\Post;
/**
* PostSearch represents the model behind the search form about Post.
*/
class PostSearch extends Model
{
public $id;
public $title;
public $content;
public $category_id;
public $created_at;
public $updated_at;
public function rules()
{
return [
[['id', 'category_id'], 'integer'],
[['title', 'content', 'created_at', 'updated_at'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'title' => 'Title',
'content' => 'Content',
'category_id' => 'Category',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
public function search($params)
{
$query = Post::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
if (!($this->load($params) && $this->validate()))
{
return $dataProvider;
}
$query->andFilterWhere([
'id' => $this->id,
'category_id' => $this->category_id,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'title', $this->title])
->andFilterWhere(['like', 'content', $this->content]);
return $dataProvider;
}
protected function addCondition($query, $attribute, $partialMatch = false)
{
$value = $this->$attribute;
if (trim($value) === '')
{
return;
}
if ($partialMatch)
{
$value = '%' . strtr($value, ['%'=>'\%', '_'=>'\_', '\\'=>'\\\\']) . '%';
$query->andWhere(['like', $attribute, $value]);
}
else
{
$query->andWhere([$attribute => $value]);
}
}
}
| andrelinoge/yii2-skeleton-basic | models/PostSearch.php | PHP | bsd-3-clause | 1,693 |
// Copyright (c) 2009-2021 The Regents of the University of Michigan
// This file is part of the HOOMD-blue project, released under the BSD 3-Clause License.
#include "hoomd/ClockSource.h"
#include "hoomd/RNGIdentifiers.h"
#include "hoomd/RandomNumbers.h"
#include <iomanip>
#include <iostream>
#include <vector>
#include "hoomd/test/upp11_config.h"
HOOMD_UP_MAIN()
//! Test case for SpherePointGenerator
/*!
* When drawing uniformly on a sphere, the pdf should satisfy:
*
* \f[
* \int f(\omega) d\omega = 1 = \int d\theta d\phi f(\theta, \phi).
* \f]
*
* The proper distribution satisfying this is:
*
* \f[
* f(\theta, \phi) = sin(\phi) / 4\pi
* \f]
*
* because d\omega = sin(\phi) d\theta d\phi.
*
* The marginal probability of each spherical coordinate is then
* \f[
* f(\theta) = 1/2\pi \\
* f(\phi) = sin(\phi)/2
* \f]
*/
UP_TEST(sphere_point_test)
{
// initialize the histograms
const double mpcd_pi = 3.141592653589793;
const unsigned int nbins = 25;
const double dphi = mpcd_pi / static_cast<double>(nbins); // [0, pi)
const double dtheta = 2.0 * mpcd_pi / static_cast<double>(nbins); // [0, 2pi)
std::vector<unsigned int> fphi(nbins, 0), ftheta(nbins, 0);
hoomd::RandomGenerator rng(hoomd::Seed(0, 1, 2), hoomd::Counter(4, 5, 6));
hoomd::SpherePointGenerator<double> gen;
const unsigned int N = 500000;
for (unsigned int i = 0; i < N; ++i)
{
double3 v;
gen(rng, v);
// check norm of the point and make sure it lies on the unit sphere
const double r = slow::sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
CHECK_CLOSE(r, 1.0, tol_small);
// z = r cos(phi)
const double phi = std::acos(v.z / r);
const unsigned int phi_bin = static_cast<unsigned int>(phi / dphi);
UP_ASSERT(phi_bin < nbins);
fphi[phi_bin] += 1;
// bin theta
double theta = std::atan2(v.y, v.x);
if (theta < 0.0)
theta += 2.0 * mpcd_pi;
const unsigned int theta_bin = static_cast<unsigned int>(theta / dtheta);
UP_ASSERT(theta_bin < nbins);
ftheta[theta_bin] += 1;
}
for (unsigned int i = 0; i < nbins; ++i)
{
const double ftheta_i = static_cast<double>(ftheta[i]) / (dtheta * N);
const double fphi_i = static_cast<double>(fphi[i]) / (dphi * N);
CHECK_CLOSE(ftheta_i, 1.0 / (2.0 * mpcd_pi), 0.05);
CHECK_CLOSE(fphi_i, 0.5 * sin(dphi * (0.5 + i)), 0.05);
}
}
//! Kahan summation
class KahanSum
{
public:
KahanSum(double _s)
{
sum = _s;
}
void operator+=(double x)
{
// from https://en.wikipedia.org/wiki/Kahan_summation_algorithm
double y = x - c;
double t = sum + y;
c = (t - sum) - y;
sum = t;
}
operator double()
{
return sum;
}
private:
double sum;
double c = 0.0;
};
//! Check the moments of a distribution
/*!
* \param gen Distribution generator
* \param N Number of samples to draw
* \param ref_mean Mean of the distribution
* \param ref_var Variance of the distribution
* \param ref_tol Error tolerance
*/
template<class GeneratorType>
void check_moments(GeneratorType& gen,
const unsigned int N,
const double ref_mean,
const double ref_var,
const double ref_skew,
const double ref_exkurtosis,
const double ref_tol,
bool test_kurtosis = true)
{
hoomd::RandomGenerator rng(hoomd::Seed(0, 1, 2), hoomd::Counter(4, 5, 6));
// compute moments of the distribution
// use Kahan summation to prevent errors when summing over many samples
KahanSum sample_x(0), sample_x2(0), sample_x3(0), sample_x4(0);
std::vector<double> v(N);
double n = double(N);
for (unsigned int i = 0; i < N; ++i)
{
const auto rn = gen(rng);
sample_x += rn;
v[i] = rn;
}
double mean = sample_x / n;
// TODO: block sums to avoid round off error
for (unsigned int i = 0; i < N; ++i)
{
// use two pass method to compute moments
// this is more numerically stable: See
// https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance and unbiased
double x = v[i] - mean;
sample_x2 += x * x;
sample_x3 += x * x * x;
sample_x4 += x * x * x * x;
}
double var = sample_x2 / (n - 1);
// sample skewness: https://en.wikipedia.org/wiki/Skewness
double skew = (1.0 / n) * sample_x3 / (sqrt(var) * sqrt(var) * sqrt(var));
// sample excess kurtosis: https://en.wikipedia.org/wiki/Kurtosis
double exkurtosis
= (n + 1) * n * (n - 1) * sample_x4 / ((n - 2) * (n - 3) * sample_x2 * sample_x2)
- 3.0 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));
// check mean using close or small, depending on how close it is to zero
if (std::abs(ref_mean) > tol_small)
CHECK_CLOSE(mean, ref_mean, ref_tol);
else
CHECK_SMALL(mean, ref_tol);
if (std::abs(ref_var) > tol_small)
CHECK_CLOSE(var, ref_var, ref_tol);
else
CHECK_SMALL(var, ref_tol);
if (std::abs(ref_skew) > tol_small)
CHECK_CLOSE(skew, ref_skew, ref_tol);
else
CHECK_SMALL(skew, ref_tol);
// skip kurtosis checks for distributions where it is finicky
if (test_kurtosis)
{
if (std::abs(ref_exkurtosis) > tol_small)
CHECK_CLOSE(exkurtosis, ref_exkurtosis, ref_tol);
else
CHECK_SMALL(exkurtosis, ref_tol);
}
}
//! Check the range of a distribution
/*! \param gen Distribution generator
\param N Number of samples to draw
\param a Minimum of range (inclusive)
\param b Maximum of range (inclusive)
*/
template<class ValueType, class GeneratorType>
void check_range(GeneratorType& gen, const unsigned int N, const ValueType a, const ValueType b)
{
hoomd::RandomGenerator rng(hoomd::Seed(0, 1, 2), hoomd::Counter(4, 5, 6));
// check that every value generated is in the proper range
for (unsigned int i = 0; i < N; ++i)
{
const auto rn = gen(rng);
if (!(rn >= a))
{
std::cout << "Out of range: " << rn << std::endl;
}
UP_ASSERT(rn >= a);
if (!(rn <= b))
{
std::cout << "Out of range: " << rn << std::endl;
}
UP_ASSERT(rn <= b);
}
}
//! Test case for NormalDistribution
UP_TEST(normal_double_test)
{
double mu = 1.5, sigma = 2.0;
double mean = mu, var = sigma * sigma, skew = 0, exkurtosis = 0.0;
hoomd::NormalDistribution<double> gen(sigma, mu);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
}
//! Test case for NormalDistribution
UP_TEST(normal_default_double_test)
{
double mu = 0.0, sigma = 1.0;
double mean = mu, var = sigma * sigma, skew = 0, exkurtosis = 0.0;
hoomd::NormalDistribution<double> gen;
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
}
//! Test case for NormalDistribution -- float
UP_TEST(normal_float_test)
{
float mu = 2.0, sigma = 1.5;
double mean = mu, var = sigma * sigma, skew = 0, exkurtosis = 0.0;
hoomd::NormalDistribution<float> gen(sigma, mu);
check_moments(gen, 500000, mean, var, exkurtosis, skew, 0.01);
}
//! Test case for GammaDistribution -- double
UP_TEST(gamma_double_test)
{
double alpha = 2.5, b = 2.0;
double mean = alpha * b, var = alpha * b * b, skew = 2.0 / sqrt(alpha),
exkurtosis = 6.0 / alpha;
hoomd::GammaDistribution<double> gen(alpha, b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
}
//! Test case for GammaDistribution -- float
UP_TEST(gamma_float_test)
{
float alpha = 2.5, b = 2.0;
double mean = alpha * b, var = alpha * b * b, skew = 2.0 / sqrt(alpha),
exkurtosis = 6.0 / alpha;
hoomd::GammaDistribution<float> gen(alpha, b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
}
UP_TEST(r123_u01_range_test_float)
{
// equality tests on floats intentional, they validate the exact range of the RNG output
float smallest = r123::u01<float>(uint64_t(0x0000000000000000));
UP_ASSERT_EQUAL(smallest, (float)2.710505431213761e-20);
float largest = r123::u01<float>(uint64_t(0xffffffffffffffff));
UP_ASSERT_EQUAL(largest, 1.0f);
}
UP_TEST(canonical_float_moment)
{
struct gen
{
float operator()(hoomd::RandomGenerator& rng)
{
return hoomd::detail::generate_canonical<float>(rng);
}
};
float a = 2.710505431213761e-20f, b = 1.0f;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
gen canonical;
check_moments(canonical, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(canonical, 5000000, a, b);
}
UP_TEST(r123_u01_range_test_double)
{
// equality tests on floats intentional, they validate the exact range of the RNG output
double smallest = r123::u01<double>(uint64_t(0x0000000000000000));
UP_ASSERT_EQUAL(smallest, 2.710505431213761e-20);
double largest = r123::u01<double>(uint64_t(0xffffffffffffffff));
UP_ASSERT_EQUAL(largest, 1.0);
}
UP_TEST(canonical_double_moment)
{
struct gen
{
double operator()(hoomd::RandomGenerator& rng)
{
return hoomd::detail::generate_canonical<double>(rng);
}
};
double a = 2.710505431213761e-20, b = 1.0;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
gen canonical;
check_moments(canonical, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(canonical, 5000000, a, b);
}
//! Test case for UniformDistribution -- double
UP_TEST(uniform_double_test)
{
double a = 1, b = 3;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
hoomd::UniformDistribution<double> gen(a, b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(gen, 5000000, a, b);
}
//! Test case for UniformDistribution -- float
UP_TEST(uniform_float_test)
{
float a = -4, b = 0;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
hoomd::UniformDistribution<float> gen(a, b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(gen, 5000000, a, b);
}
//! Test case for UniformIntDistribution
UP_TEST(uniform_int_test_1000)
{
uint32_t a = 0, b = 1000;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
hoomd::UniformIntDistribution gen(b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(gen, 5000000, a, b);
}
//! Test case for UniformIntDistribution
UP_TEST(uniform_int_test_256)
{
uint32_t a = 0, b = 256;
double mean = (a + b) / 2.0, var = 1.0 / 12.0 * (b - a) * (b - a), skew = 0.0,
exkurtosis = -6.0 / 5.0;
hoomd::UniformIntDistribution gen(b);
check_moments(gen, 5000000, mean, var, skew, exkurtosis, 0.01);
check_range(gen, 5000000, a, b);
}
// use a wider tolerance and skip kurtosis checks for the Poisson distribution. These measures are
// finicky for this non-continuous distribution.
//! Test case for PoissonDistribution -- double
UP_TEST(poisson_small_double_test)
{
double m = 10;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<double> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test case for PoissonDistribution -- double
UP_TEST(poisson_medium_double_test)
{
double m = 20;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<double> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test case for PoissonDistribution -- double
UP_TEST(poisson_large_double_test)
{
double m = 120;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<double> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test case for PoissonDistribution -- float
UP_TEST(poisson_small_float_test)
{
float m = 10;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<float> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test case for PoissonDistribution -- float
UP_TEST(poisson_medium_float_test)
{
float m = 20;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<float> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test case for PoissonDistribution -- float
UP_TEST(poisson_large_float_test)
{
float m = 120;
double mean = m, var = m, skew = 1.0 / sqrt(m), exkurtosis = 1.0 / m;
hoomd::PoissonDistribution<float> gen(m);
check_moments(gen, 4000000, mean, var, skew, exkurtosis, 0.03, false);
}
//! Test that Seed initializes correctly
UP_TEST(seed_fromIDStepSeed)
{
auto s = hoomd::Seed(hoomd::RNGIdentifier::HPMCMonoShuffle, 0xabcdef1234567890, 0x5eed);
UP_ASSERT_EQUAL(s.getKey()[0], 0x015eed12);
UP_ASSERT_EQUAL(s.getKey()[1], 0x34567890);
}
//! Test that Counter initializes correctly
UP_TEST(counter)
{
auto a = hoomd::Counter();
UP_ASSERT_EQUAL(a.getCounter()[0], 0);
UP_ASSERT_EQUAL(a.getCounter()[1], 0);
UP_ASSERT_EQUAL(a.getCounter()[2], 0);
UP_ASSERT_EQUAL(a.getCounter()[3], 0);
auto b = hoomd::Counter(0xabcdef12);
UP_ASSERT_EQUAL(b.getCounter()[0], 0);
UP_ASSERT_EQUAL(b.getCounter()[1], 0);
UP_ASSERT_EQUAL(b.getCounter()[2], 0);
UP_ASSERT_EQUAL(b.getCounter()[3], 0xabcdef12);
auto c = hoomd::Counter(0x1234, 0x5678);
UP_ASSERT_EQUAL(c.getCounter()[0], 0);
UP_ASSERT_EQUAL(c.getCounter()[1], 0);
UP_ASSERT_EQUAL(c.getCounter()[2], 0x5678);
UP_ASSERT_EQUAL(c.getCounter()[3], 0x1234);
auto d = hoomd::Counter(0xabcd, 0xef123, 0x4567);
UP_ASSERT_EQUAL(d.getCounter()[0], 0);
UP_ASSERT_EQUAL(d.getCounter()[1], 0x4567);
UP_ASSERT_EQUAL(d.getCounter()[2], 0xef123);
UP_ASSERT_EQUAL(d.getCounter()[3], 0xabcd);
auto e = hoomd::Counter(0xabcd, 0xef123, 0x4567, 0x1234);
UP_ASSERT_EQUAL(e.getCounter()[0], 0x12340000);
UP_ASSERT_EQUAL(e.getCounter()[1], 0x4567);
UP_ASSERT_EQUAL(e.getCounter()[2], 0xef123);
UP_ASSERT_EQUAL(e.getCounter()[3], 0xabcd);
}
UP_TEST(rng_seeding)
{
auto s = hoomd::Seed(hoomd::RNGIdentifier::HPMCMonoShuffle, 0xabcdef1234567890, 0x5eed);
auto c = hoomd::Counter(0x9876, 0x5432, 0x10fe);
auto g = hoomd::RandomGenerator(s, c);
UP_ASSERT_EQUAL(g.getKey()[0], 0x015eed12);
UP_ASSERT_EQUAL(g.getKey()[1], 0x34567890);
UP_ASSERT_EQUAL(g.getCounter()[0], 0);
UP_ASSERT_EQUAL(g.getCounter()[1], 0x10fe);
UP_ASSERT_EQUAL(g.getCounter()[2], 0x5432);
UP_ASSERT_EQUAL(g.getCounter()[3], 0x9876);
g();
UP_ASSERT_EQUAL(g.getCounter()[0], 1);
UP_ASSERT_EQUAL(g.getCounter()[1], 0x10fe);
UP_ASSERT_EQUAL(g.getCounter()[2], 0x5432);
UP_ASSERT_EQUAL(g.getCounter()[3], 0x9876);
g();
UP_ASSERT_EQUAL(g.getCounter()[0], 2);
UP_ASSERT_EQUAL(g.getCounter()[1], 0x10fe);
UP_ASSERT_EQUAL(g.getCounter()[2], 0x5432);
UP_ASSERT_EQUAL(g.getCounter()[3], 0x9876);
}
// //! Find performance crossover
// /*! Note: this code was written for a one time use to find the empirical crossover. It requires
// that the private:
// be commented out in PoissonDistribution.
// */
// UP_TEST( poisson_perf_test )
// {
// unsigned int N = 1000000;
// double sum=0;
// hoomd::RandomGenerator rng(7, 7, 91);
// std::vector<double> small, large;
// for (int mean = 1; mean < 20; mean++)
// {
// hoomd::PoissonDistribution<double> gen(mean);
// {
// ClockSource t;
// for (int i = 0; i < N; i++)
// sum += gen.poissrnd_small(rng);
// small.push_back(double(t.getTime()) / double(N));
// }
// {
// ClockSource t;
// for (int i = 0; i < N; i++)
// sum += gen.poissrnd_large(rng);
// large.push_back(double(t.getTime()) / double(N));
// }
// }
// for (int i = 0; i < small.size(); i++)
// {
// std::cout << i+1 << " " << small[i] << " " << large[i] << std::endl;
// }
// }
| joaander/hoomd-blue | hoomd/test/random_numbers_test.cc | C++ | bsd-3-clause | 17,117 |
/* $OpenBSD: a_strnid.c,v 1.16 2014/07/10 13:58:22 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* licensing@OpenSSL.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <openssl/asn1.h>
#include <openssl/err.h>
#include <openssl/objects.h>
static STACK_OF(ASN1_STRING_TABLE) *stable = NULL;
static void st_free(ASN1_STRING_TABLE *tbl);
static int sk_table_cmp(const ASN1_STRING_TABLE * const *a,
const ASN1_STRING_TABLE * const *b);
/* This is the global mask for the mbstring functions: this is use to
* mask out certain types (such as BMPString and UTF8String) because
* certain software (e.g. Netscape) has problems with them.
*/
static unsigned long global_mask = B_ASN1_UTF8STRING;
void
ASN1_STRING_set_default_mask(unsigned long mask)
{
global_mask = mask;
}
unsigned long
ASN1_STRING_get_default_mask(void)
{
return global_mask;
}
/* This function sets the default to various "flavours" of configuration.
* based on an ASCII string. Currently this is:
* MASK:XXXX : a numerical mask value.
* nobmp : Don't use BMPStrings (just Printable, T61).
* pkix : PKIX recommendation in RFC2459.
* utf8only : only use UTF8Strings (RFC2459 recommendation for 2004).
* default: the default value, Printable, T61, BMP.
*/
int
ASN1_STRING_set_default_mask_asc(const char *p)
{
unsigned long mask;
char *end;
if (!strncmp(p, "MASK:", 5)) {
if (!p[5])
return 0;
mask = strtoul(p + 5, &end, 0);
if (*end)
return 0;
} else if (!strcmp(p, "nombstr"))
mask = ~((unsigned long)(B_ASN1_BMPSTRING|B_ASN1_UTF8STRING));
else if (!strcmp(p, "pkix"))
mask = ~((unsigned long)B_ASN1_T61STRING);
else if (!strcmp(p, "utf8only"))
mask = B_ASN1_UTF8STRING;
else if (!strcmp(p, "default"))
mask = 0xFFFFFFFFL;
else
return 0;
ASN1_STRING_set_default_mask(mask);
return 1;
}
/* The following function generates an ASN1_STRING based on limits in a table.
* Frequently the types and length of an ASN1_STRING are restricted by a
* corresponding OID. For example certificates and certificate requests.
*/
ASN1_STRING *
ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen,
int inform, int nid)
{
ASN1_STRING_TABLE *tbl;
ASN1_STRING *str = NULL;
unsigned long mask;
int ret;
if (!out)
out = &str;
tbl = ASN1_STRING_TABLE_get(nid);
if (tbl) {
mask = tbl->mask;
if (!(tbl->flags & STABLE_NO_MASK))
mask &= global_mask;
ret = ASN1_mbstring_ncopy(out, in, inlen, inform, mask,
tbl->minsize, tbl->maxsize);
} else
ret = ASN1_mbstring_copy(out, in, inlen, inform,
DIRSTRING_TYPE & global_mask);
if (ret <= 0)
return NULL;
return *out;
}
/* Now the tables and helper functions for the string table:
*/
/* size limits: this stuff is taken straight from RFC3280 */
#define ub_name 32768
#define ub_common_name 64
#define ub_locality_name 128
#define ub_state_name 128
#define ub_organization_name 64
#define ub_organization_unit_name 64
#define ub_title 64
#define ub_email_address 128
#define ub_serial_number 64
/* This table must be kept in NID order */
static const ASN1_STRING_TABLE tbl_standard[] = {
{NID_commonName, 1, ub_common_name, DIRSTRING_TYPE, 0},
{NID_countryName, 2, 2, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
{NID_localityName, 1, ub_locality_name, DIRSTRING_TYPE, 0},
{NID_stateOrProvinceName, 1, ub_state_name, DIRSTRING_TYPE, 0},
{NID_organizationName, 1, ub_organization_name, DIRSTRING_TYPE, 0},
{NID_organizationalUnitName, 1, ub_organization_unit_name, DIRSTRING_TYPE, 0},
{NID_pkcs9_emailAddress, 1, ub_email_address, B_ASN1_IA5STRING, STABLE_NO_MASK},
{NID_pkcs9_unstructuredName, 1, -1, PKCS9STRING_TYPE, 0},
{NID_pkcs9_challengePassword, 1, -1, PKCS9STRING_TYPE, 0},
{NID_pkcs9_unstructuredAddress, 1, -1, DIRSTRING_TYPE, 0},
{NID_givenName, 1, ub_name, DIRSTRING_TYPE, 0},
{NID_surname, 1, ub_name, DIRSTRING_TYPE, 0},
{NID_initials, 1, ub_name, DIRSTRING_TYPE, 0},
{NID_serialNumber, 1, ub_serial_number, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
{NID_friendlyName, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK},
{NID_name, 1, ub_name, DIRSTRING_TYPE, 0},
{NID_dnQualifier, -1, -1, B_ASN1_PRINTABLESTRING, STABLE_NO_MASK},
{NID_domainComponent, 1, -1, B_ASN1_IA5STRING, STABLE_NO_MASK},
{NID_ms_csp_name, -1, -1, B_ASN1_BMPSTRING, STABLE_NO_MASK}
};
static int
sk_table_cmp(const ASN1_STRING_TABLE * const *a,
const ASN1_STRING_TABLE * const *b)
{
return (*a)->nid - (*b)->nid;
}
DECLARE_OBJ_BSEARCH_CMP_FN(ASN1_STRING_TABLE, ASN1_STRING_TABLE, table);
static int
table_cmp(const ASN1_STRING_TABLE *a, const ASN1_STRING_TABLE *b)
{
return a->nid - b->nid;
}
IMPLEMENT_OBJ_BSEARCH_CMP_FN(ASN1_STRING_TABLE, ASN1_STRING_TABLE, table);
ASN1_STRING_TABLE *
ASN1_STRING_TABLE_get(int nid)
{
int idx;
ASN1_STRING_TABLE *ttmp;
ASN1_STRING_TABLE fnd;
fnd.nid = nid;
ttmp = OBJ_bsearch_table(&fnd, tbl_standard,
sizeof(tbl_standard)/sizeof(ASN1_STRING_TABLE));
if (ttmp)
return ttmp;
if (!stable)
return NULL;
idx = sk_ASN1_STRING_TABLE_find(stable, &fnd);
if (idx < 0)
return NULL;
return sk_ASN1_STRING_TABLE_value(stable, idx);
}
int
ASN1_STRING_TABLE_add(int nid, long minsize, long maxsize, unsigned long mask,
unsigned long flags)
{
ASN1_STRING_TABLE *tmp;
char new_nid = 0;
flags &= ~STABLE_FLAGS_MALLOC;
if (!stable)
stable = sk_ASN1_STRING_TABLE_new(sk_table_cmp);
if (!stable) {
ASN1err(ASN1_F_ASN1_STRING_TABLE_ADD, ERR_R_MALLOC_FAILURE);
return 0;
}
if (!(tmp = ASN1_STRING_TABLE_get(nid))) {
tmp = malloc(sizeof(ASN1_STRING_TABLE));
if (!tmp) {
ASN1err(ASN1_F_ASN1_STRING_TABLE_ADD,
ERR_R_MALLOC_FAILURE);
return 0;
}
tmp->flags = flags | STABLE_FLAGS_MALLOC;
tmp->nid = nid;
new_nid = 1;
} else tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags;
if (minsize != -1)
tmp->minsize = minsize;
if (maxsize != -1)
tmp->maxsize = maxsize;
tmp->mask = mask;
if (new_nid)
sk_ASN1_STRING_TABLE_push(stable, tmp);
return 1;
}
void
ASN1_STRING_TABLE_cleanup(void)
{
STACK_OF(ASN1_STRING_TABLE) *tmp;
tmp = stable;
if (!tmp)
return;
stable = NULL;
sk_ASN1_STRING_TABLE_pop_free(tmp, st_free);
}
static void
st_free(ASN1_STRING_TABLE *tbl)
{
if (tbl->flags & STABLE_FLAGS_MALLOC)
free(tbl);
}
IMPLEMENT_STACK_OF(ASN1_STRING_TABLE)
| GaloisInc/hacrypto | src/C/libressl/libressl-2.0.0/crypto/asn1/a_strnid.c | C | bsd-3-clause | 8,985 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 0, transform = "Fisher", sigma = 0.0, exog_count = 100, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Fisher/trend_MovingMedian/cycle_0/ar_/test_artificial_1024_Fisher_MovingMedian_0__100.py | Python | bsd-3-clause | 266 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file documents the GNU Assembler "as".
Copyright (C) 1991-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
-->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<!-- This file redirects to the location of a node or anchor -->
<head>
<title>Using as: arm_save</title>
<meta name="description" content="Using as: arm_save">
<meta name="keywords" content="Using as: arm_save">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
<meta http-equiv="Refresh" content="0; url=ARM-Directives.html#arm_005fsave">
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<p>The node you are looking for is at <a href="ARM-Directives.html#arm_005fsave">arm_save</a>.</p>
</body>
| AlbandeCrevoisier/ldd-athens | gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/share/doc/as.html/arm_005fsave.html | HTML | bsd-3-clause | 2,410 |
# Copyright (c) 2016,2017 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""
===========================
Upper Air Sounding Tutorial
===========================
Upper air analysis is a staple of many synoptic and mesoscale analysis
problems. In this tutorial we will gather weather balloon data, plot it,
perform a series of thermodynamic calculations, and summarize the results.
To learn more about the Skew-T diagram and its use in weather analysis and
forecasting, checkout `this <https://homes.comet.ucar.edu/~alanbol/aws-tr-79-006.pdf>`_
air weather service guide.
"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
import numpy as np
import pandas as pd
import metpy.calc as mpcalc
from metpy.cbook import get_test_data
from metpy.plots import Hodograph, SkewT
from metpy.units import units
#########################################################################
# Getting Data
# ------------
#
# Upper air data can be obtained using the siphon package, but for this tutorial we will use
# some of MetPy's sample data. This event is the Veterans Day tornado outbreak in 2002.
col_names = ['pressure', 'height', 'temperature', 'dewpoint', 'direction', 'speed']
df = pd.read_fwf(get_test_data('nov11_sounding.txt', as_file_obj=False),
skiprows=5, usecols=[0, 1, 2, 3, 6, 7], names=col_names)
df['u_wind'], df['v_wind'] = mpcalc.get_wind_components(df['speed'],
np.deg2rad(df['direction']))
# Drop any rows with all NaN values for T, Td, winds
df = df.dropna(subset=('temperature', 'dewpoint', 'direction', 'speed',
'u_wind', 'v_wind'), how='all').reset_index(drop=True)
##########################################################################
# We will pull the data out of the example dataset into individual variables and
# assign units.
p = df['pressure'].values * units.hPa
T = df['temperature'].values * units.degC
Td = df['dewpoint'].values * units.degC
wind_speed = df['speed'].values * units.knots
wind_dir = df['direction'].values * units.degrees
u, v = mpcalc.get_wind_components(wind_speed, wind_dir)
##########################################################################
# Thermodynamic Calculations
# --------------------------
#
# Often times we will want to calculate some thermodynamic parameters of a
# sounding. The MetPy calc module has many such calculations already implemented!
#
# * **Lifting Condensation Level (LCL)** - The level at which an air parcel's
# relative humidity becomes 100% when lifted along a dry adiabatic path.
# * **Parcel Path** - Path followed by a hypothetical parcel of air, beginning
# at the surface temperature/pressure and rising dry adiabatically until
# reaching the LCL, then rising moist adiabatially.
# Calculate the LCL
lcl_pressure, lcl_temperature = mpcalc.lcl(p[0], T[0], Td[0])
print(lcl_pressure, lcl_temperature)
# Calculate the parcel profile.
parcel_prof = mpcalc.parcel_profile(p, T[0], Td[0]).to('degC')
##########################################################################
# Basic Skew-T Plotting
# ---------------------
#
# The Skew-T (log-P) diagram is the standard way to view rawinsonde data. The
# y-axis is height in pressure coordinates and the x-axis is temperature. The
# y coordinates are plotted on a logarithmic scale and the x coordinate system
# is skewed. An explanation of skew-T interpretation is beyond the scope of this
# tutorial, but here we will plot one that can be used for analysis or
# publication.
#
# The most basic skew-T can be plotted with only five lines of Python.
# These lines perform the following tasks:
#
# 1. Create a ``Figure`` object and set the size of the figure.
#
# 2. Create a ``SkewT`` object
#
# 3. Plot the pressure and temperature (note that the pressure,
# the independent variable, is first even though it is plotted on the y-axis).
#
# 4. Plot the pressure and dewpoint temperature.
#
# 5. Plot the wind barbs at the appropriate pressure using the u and v wind
# components.
# Create a new figure. The dimensions here give a good aspect ratio
fig = plt.figure(figsize=(9, 9))
skew = SkewT(fig)
# Plot the data using normal plotting functions, in this case using
# log scaling in Y, as dictated by the typical meteorological plot
skew.plot(p, T, 'r', linewidth=2)
skew.plot(p, Td, 'g', linewidth=2)
skew.plot_barbs(p, u, v)
# Show the plot
plt.show()
##########################################################################
# Advanced Skew-T Plotting
# ------------------------
#
# Fiducial lines indicating dry adiabats, moist adiabats, and mixing ratio are
# useful when performing further analysis on the Skew-T diagram. Often the
# 0C isotherm is emphasized and areas of CAPE and CIN are shaded.
# Create a new figure. The dimensions here give a good aspect ratio
fig = plt.figure(figsize=(9, 9))
skew = SkewT(fig, rotation=30)
# Plot the data using normal plotting functions, in this case using
# log scaling in Y, as dictated by the typical meteorological plot
skew.plot(p, T, 'r')
skew.plot(p, Td, 'g')
skew.plot_barbs(p, u, v)
skew.ax.set_ylim(1000, 100)
skew.ax.set_xlim(-40, 60)
# Plot LCL temperature as black dot
skew.plot(lcl_pressure, lcl_temperature, 'ko', markerfacecolor='black')
# Plot the parcel profile as a black line
skew.plot(p, parcel_prof, 'k', linewidth=2)
# Shade areas of CAPE and CIN
skew.shade_cin(p, T, parcel_prof)
skew.shade_cape(p, T, parcel_prof)
# Plot a zero degree isotherm
skew.ax.axvline(0, color='c', linestyle='--', linewidth=2)
# Add the relevant special lines
skew.plot_dry_adiabats()
skew.plot_moist_adiabats()
skew.plot_mixing_lines()
# Show the plot
plt.show()
##########################################################################
# Adding a Hodograph
# ------------------
#
# A hodograph is a polar representation of the wind profile measured by the rawinsonde.
# Winds at different levels are plotted as vectors with their tails at the origin, the angle
# from the vertical axes representing the direction, and the length representing the speed.
# The line plotted on the hodograph is a line connecting the tips of these vectors,
# which are not drawn.
# Create a new figure. The dimensions here give a good aspect ratio
fig = plt.figure(figsize=(9, 9))
skew = SkewT(fig, rotation=30)
# Plot the data using normal plotting functions, in this case using
# log scaling in Y, as dictated by the typical meteorological plot
skew.plot(p, T, 'r')
skew.plot(p, Td, 'g')
skew.plot_barbs(p, u, v)
skew.ax.set_ylim(1000, 100)
skew.ax.set_xlim(-40, 60)
# Plot LCL as black dot
skew.plot(lcl_pressure, lcl_temperature, 'ko', markerfacecolor='black')
# Plot the parcel profile as a black line
skew.plot(p, parcel_prof, 'k', linewidth=2)
# Shade areas of CAPE and CIN
skew.shade_cin(p, T, parcel_prof)
skew.shade_cape(p, T, parcel_prof)
# Plot a zero degree isotherm
skew.ax.axvline(0, color='c', linestyle='--', linewidth=2)
# Add the relevant special lines
skew.plot_dry_adiabats()
skew.plot_moist_adiabats()
skew.plot_mixing_lines()
# Create a hodograph
# Create an inset axes object that is 40% width and height of the
# figure and put it in the upper right hand corner.
ax_hod = inset_axes(skew.ax, '40%', '40%', loc=1)
h = Hodograph(ax_hod, component_range=80.)
h.add_grid(increment=20)
h.plot_colormapped(u, v, wind_speed) # Plot a line colored by wind speed
# Show the plot
plt.show()
| metpy/MetPy | v0.8/_downloads/upperair_soundings.py | Python | bsd-3-clause | 7,536 |
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Photos
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: NumPhotos.php,v 1.1 2010-10-25 15:19:57 h.wang Exp $
*/
/**
* @see Zend_Gdata_Extension
*/
require_once 'Zend/Gdata/Extension.php';
/**
* @see Zend_Gdata_Photos
*/
require_once 'Zend/Gdata/Photos.php';
/**
* Represents the gphoto:numphotos element used by the API.
* This indicates the number of photos in an album.
*
* @category Zend
* @package Zend_Gdata
* @subpackage Photos
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Gdata_Photos_Extension_NumPhotos extends Zend_Gdata_Extension
{
protected $_rootNamespace = 'gphoto';
protected $_rootElement = 'numphotos';
/**
* Constructs a new Zend_Gdata_Photos_Extension_NumPhotos object.
*
* @param string $text (optional) The value to represent.
*/
public function __construct($text = null)
{
$this->registerAllNamespaces(Zend_Gdata_Photos::$namespaces);
parent::__construct();
$this->setText($text);
}
}
| linkorb/ZendFramework-1.10.8-minimal-patched | library/Zend/Gdata/Photos/Extension/NumPhotos.php | PHP | bsd-3-clause | 1,793 |
using System;
using System.Web;
using System.Web.Mvc;
using Orchard.DisplayManagement;
using Orchard.Localization;
using Orchard.Localization.Services;
using Orchard.Mvc.Html;
using Orchard.Services;
namespace Orchard.Core.Shapes {
public class DateTimeShapes : IDependency {
private readonly IClock _clock;
private readonly IDateLocalizationServices _dateLocalizationServices;
private readonly IDateTimeFormatProvider _dateTimeLocalization;
public DateTimeShapes(
IClock clock,
IDateLocalizationServices dateLocalizationServices,
IDateTimeFormatProvider dateTimeLocalization
) {
_clock = clock;
_dateLocalizationServices = dateLocalizationServices;
_dateTimeLocalization = dateTimeLocalization;
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
[Shape]
public IHtmlString DateTimeRelative(dynamic Display, DateTime DateTimeUtc, DateTime dateTimeUtc) {
DateTimeUtc = DateTimeUtc != System.DateTime.MinValue ? DateTimeUtc : dateTimeUtc; // Both capitalizations retained for compatibility.
var time = _clock.UtcNow - DateTimeUtc;
if (time.TotalYears() > 1)
return T.Plural("1 year ago", "{0} years ago", time.TotalYears());
if (time.TotalYears() < -1)
return T.Plural("in 1 year", "in {0} years", -time.TotalYears());
if (time.TotalMonths() > 1)
return T.Plural("1 month ago", "{0} months ago", time.TotalMonths());
if (time.TotalMonths() < -1)
return T.Plural("in 1 month", "in {0} months", -time.TotalMonths());
if (time.TotalWeeks() > 1)
return T.Plural("1 week ago", "{0} weeks ago", time.TotalWeeks());
if (time.TotalWeeks() < -1)
return T.Plural("in 1 week", "in {0} weeks", -time.TotalWeeks());
if (time.TotalHours > 24)
return T.Plural("1 day ago", "{0} days ago", time.Days);
if (time.TotalHours < -24)
return T.Plural("in 1 day", "in {0} days", -time.Days);
if (time.TotalMinutes > 60)
return T.Plural("1 hour ago", "{0} hours ago", time.Hours);
if (time.TotalMinutes < -60)
return T.Plural("in 1 hour", "in {0} hours", -time.Hours);
if (time.TotalSeconds > 60)
return T.Plural("1 minute ago", "{0} minutes ago", time.Minutes);
if (time.TotalSeconds < -60)
return T.Plural("in 1 minute", "in {0} minutes", -time.Minutes);
if (time.TotalSeconds > 10)
return T.Plural("1 second ago", "{0} seconds ago", time.Seconds); //aware that the singular won't be used
if (time.TotalSeconds < -10)
return T.Plural("in 1 second", "in {0} seconds", -time.Seconds);
return time.TotalMilliseconds > 0
? T("a moment ago")
: T("in a moment");
}
[Shape]
public IHtmlString DateTime(DateTime DateTimeUtc, LocalizedString CustomFormat) {
//using a LocalizedString forces the caller to use a localizable format
if (CustomFormat == null || string.IsNullOrWhiteSpace(CustomFormat.Text)) {
return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, _dateTimeLocalization.LongDateTimeFormat));
}
return new MvcHtmlString(_dateLocalizationServices.ConvertToLocalizedString(DateTimeUtc, CustomFormat.Text));
}
}
public static class TimespanExtensions {
public static int TotalWeeks(this TimeSpan time) {
return (int)time.TotalDays / 7;
}
public static int TotalMonths(this TimeSpan time) {
return (int)time.TotalDays / 31;
}
public static int TotalYears(this TimeSpan time) {
return (int)time.TotalDays / 365;
}
}
}
| fassetar/Orchard | src/Orchard.Web/Core/Shapes/DateTimeShapes.cs | C# | bsd-3-clause | 4,086 |
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule LayoutAndTransformPropTypes
* @flow
*/
'use strict';
const LayoutPropTypes = require('LayoutPropTypes');
const TransformPropTypes = require('TransformPropTypes');
/**
* Warning: Some of these properties may not be supported in all releases.
*/
const LayoutAndTransformPropTypes = {
...LayoutPropTypes,
...TransformPropTypes,
};
module.exports = LayoutAndTransformPropTypes;
| ichengde/react-vr | Libraries/StyleSheet/LayoutAndTransformPropTypes.js | JavaScript | bsd-3-clause | 712 |
#include "Modules/ModernPropertiesModule/Editors/ModernPropertyEditor.h"
#include "Model/ControlProperties/ValueProperty.h"
#include "Model/ControlProperties/RootProperty.h"
#include "Model/PackageHierarchy/ControlNode.h"
#include "Modules/DocumentsModule/DocumentData.h"
#include "QECommands/ChangePropertyValueCommand.h"
#include "QECommands/ChangeBindingCommand.h"
#include "QECommands/ChangePropertyForceOverrideCommand.h"
#include <TArc/Core/ContextAccessor.h>
#include <TArc/DataProcessing/DataContext.h>
#include <Base/Any.h>
#include <Engine/Engine.h>
#include <UI/UIControl.h>
#include <UI/UIControlSystem.h>
#include <UI/Styles/UIStyleSheetSystem.h>
#include <UI/Layouts/UILayoutSystem.h>
#include <UI/Layouts/UILayoutIsolationComponent.h>
#include <QHBoxLayout>
#include <QLabel>
#include <QAction>
#include <QLineEdit>
#include <QStyle>
#include <QEvent>
#include <QMenu>
ModernPropertyContext::ModernPropertyContext(RootProperty* root_, DAVA::ContextAccessor* accessor_, DAVA::OperationInvoker* invoker_, QWidget* parent_)
: accessor(accessor_)
, invoker(invoker_)
, parent(parent_)
{
root = root_;
}
ModernPropertyContext::~ModernPropertyContext()
{
}
RootProperty* ModernPropertyContext::GetRoot() const
{
return root.Get();
}
DAVA::ContextAccessor* ModernPropertyContext::GetAccessor() const
{
return accessor;
}
DAVA::OperationInvoker* ModernPropertyContext::GetInvoker() const
{
return invoker;
}
QWidget* ModernPropertyContext::GetParent() const
{
return parent;
}
ModernPropertyEditor::ModernPropertyEditor(const std::shared_ptr<ModernPropertyContext>& context_, ValueProperty* property_)
: QObject(context_->GetParent())
, context(context_)
{
property = property_;
isLayoutSensitive = property->GetName() == "size" || property->GetName() == "position";
resetAction = new QAction("Reset", context->GetParent());
QObject::connect(resetAction, &QAction::triggered, this, &ModernPropertyEditor::ResetProperty);
forceOverrideAction = new QAction("Force Override", context->GetParent());
QObject::connect(forceOverrideAction, &QAction::triggered, this, &ModernPropertyEditor::ForceOverride);
bindAction = new QAction("Bind", context->GetParent());
QObject::connect(bindAction, &QAction::triggered, this, &ModernPropertyEditor::BindProperty);
GetRootProperty()->propertyChanged.Connect(this, &ModernPropertyEditor::PropertyChanged);
DAVA::GetEngineContext()->uiControlSystem->GetStyleSheetSystem()->stylePropertiesChanged.Connect(this, &ModernPropertyEditor::OnStylePropertiesChanged);
DAVA::GetEngineContext()->uiControlSystem->GetLayoutSystem()->controlLayouted.Connect(this, &ModernPropertyEditor::OnControlLayouted);
}
ModernPropertyEditor::~ModernPropertyEditor()
{
GetRootProperty()->propertyChanged.Disconnect(this);
DAVA::GetEngineContext()->uiControlSystem->GetStyleSheetSystem()->stylePropertiesChanged.Disconnect(this);
DAVA::GetEngineContext()->uiControlSystem->GetLayoutSystem()->controlLayouted.Disconnect(this);
}
bool ModernPropertyEditor::IsBindingEditor() const
{
return false;
}
ValueProperty* ModernPropertyEditor::GetProperty() const
{
return property.Get();
}
void ModernPropertyEditor::ChangeProperty(const DAVA::Any& value)
{
if (!property->IsReadOnly())
{
DAVA::DataContext* activeContext = context->GetAccessor()->GetActiveContext();
if (activeContext)
{
DocumentData* documentData = activeContext->GetData<DocumentData>();
DVASSERT(documentData != nullptr);
RootProperty* root = DAVA::DynamicTypeCheck<RootProperty*>(property->GetRootProperty());
documentData->ExecCommand<ChangePropertyValueCommand>(root->GetControlNode(), property.Get(), value);
}
}
}
void ModernPropertyEditor::ChangeBinding(const DAVA::String& expr, DAVA::int32 mode)
{
if (!property->IsReadOnly())
{
DAVA::DataContext* activeContext = context->GetAccessor()->GetActiveContext();
if (activeContext)
{
DocumentData* documentData = activeContext->GetData<DocumentData>();
DVASSERT(documentData != nullptr);
RootProperty* root = DAVA::DynamicTypeCheck<RootProperty*>(property->GetRootProperty());
documentData->ExecCommand<ChangeBindingCommand>(root->GetControlNode(), property.Get(), expr, mode);
}
}
}
void ModernPropertyEditor::ApplyStyleToWidget(QWidget* widget)
{
widget->setProperty("overriden", overriden);
widget->setProperty("setByStyle", setByStyle);
widget->setProperty("inherited", inherited);
widget->style()->unpolish(widget);
widget->style()->polish(widget);
}
void ModernPropertyEditor::OnPropertyChanged()
{
overriden = property->IsOverriddenLocally();
setByStyle = false;
DAVA::int32 propertyIndex = property->GetStylePropertyIndex();
DAVA::UIControl* control = context->GetRoot()->GetControlNode()->GetControl();
if (propertyIndex != -1 && !control->GetLocalPropertySet().test(propertyIndex))
{
setByStyle = control->GetStyledPropertySet().test(propertyIndex);
}
inherited = property->GetFlags() & AbstractProperty::EF_INHERITED;
}
RootProperty* ModernPropertyEditor::GetRootProperty() const
{
return context->GetRoot();
}
DAVA::ContextAccessor* ModernPropertyEditor::GetAccessor() const
{
return context->GetAccessor();
}
DAVA::OperationInvoker* ModernPropertyEditor::GetInvoker() const
{
return context->GetInvoker();
}
QWidget* ModernPropertyEditor::GetParentWidget() const
{
return context->GetParent();
}
void ModernPropertyEditor::PropertyChanged(AbstractProperty* property_)
{
if (property.Get() == property_)
{
OnPropertyChanged();
}
}
void ModernPropertyEditor::OnStylePropertiesChanged(DAVA::UIControl* control, const DAVA::UIStyleSheetPropertySet& properties)
{
DAVA::int32 propertyIndex = property->GetStylePropertyIndex();
if (propertyIndex != -1 &&
properties.test(propertyIndex) &&
control == context->GetRoot()->GetControlNode()->GetControl())
{
OnPropertyChanged();
}
}
void ModernPropertyEditor::OnControlLayouted(DAVA::UIControl* control)
{
DAVA::UIControl* propertyControl = GetRootProperty()->GetControlNode()->GetControl();
if (isLayoutSensitive)
{
for (DAVA::UIControl* p = propertyControl; p != nullptr; p = p->GetParent())
{
if (p == control)
{
OnPropertyChanged();
break;
}
if (p->GetComponent<DAVA::UILayoutIsolationComponent>() != nullptr)
{
break;
}
}
}
}
void ModernPropertyEditor::ResetProperty()
{
if (!property->IsReadOnly())
{
DAVA::DataContext* activeContext = context->GetAccessor()->GetActiveContext();
DVASSERT(activeContext != nullptr);
DocumentData* documentData = activeContext->GetData<DocumentData>();
DVASSERT(documentData != nullptr);
RootProperty* root = DAVA::DynamicTypeCheck<RootProperty*>(property->GetRootProperty());
documentData->ExecCommand<ChangePropertyValueCommand>(root->GetControlNode(), property.Get(), DAVA::Any());
}
}
void ModernPropertyEditor::BindProperty()
{
if (!property->IsReadOnly())
{
DAVA::DataContext* activeContext = context->GetAccessor()->GetActiveContext();
DVASSERT(activeContext != nullptr);
DocumentData* documentData = activeContext->GetData<DocumentData>();
DVASSERT(documentData != nullptr);
RootProperty* root = DAVA::DynamicTypeCheck<RootProperty*>(property->GetRootProperty());
documentData->ExecCommand<ChangeBindingCommand>(root->GetControlNode(), property.Get(), "", 0);
}
}
void ModernPropertyEditor::ShowActionsMenu(const QPoint& pos)
{
QMenu menu;
menu.addAction(resetAction);
menu.addAction(forceOverrideAction);
if (property->IsBindable() && !property->IsBound())
{
menu.addAction(bindAction);
}
menu.exec(pos);
}
void ModernPropertyEditor::ForceOverride()
{
if (!property->IsReadOnly())
{
DAVA::DataContext* activeContext = context->GetAccessor()->GetActiveContext();
DVASSERT(activeContext != nullptr);
DocumentData* documentData = activeContext->GetData<DocumentData>();
DVASSERT(documentData != nullptr);
RootProperty* root = DAVA::DynamicTypeCheck<RootProperty*>(property->GetRootProperty());
documentData->ExecCommand<ChangePropertyForceOverrideCommand>(root->GetControlNode(), property.Get());
}
}
bool ModernPropertyEditor::eventFilter(QObject* o, QEvent* e)
{
if (e->type() == QEvent::Wheel)
{
e->ignore();
return true;
}
return QObject::eventFilter(o, e);
}
| dava/dava.engine | Programs/QuickEd/Classes/Modules/ModernPropertiesModule/Editors/ModernPropertyEditor.cpp | C++ | bsd-3-clause | 8,866 |
/**************************************************************************
Copyright (c) 2007-2008, Intel Corporation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the Intel Corporation nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
#ifndef _I_WMX_SDK_H
#define _I_WMX_SDK_H
#include "VersionUtils.h"
#include "WrappersCommon.h"
#include "WiMaxAPI.h"
#define VERSION_MAX_LEN 100
#define WRAPPER_NAME_LEN 30
#define WRAPPER_NAME "iWmxSDK"
/// <summary>
/// This API initializes the iWmxSDK wrappers DLL.
///
/// A call to this API should preceed calls to specific wrappers' wmxXXX_Init() API.
/// This API should be called only once for all threads of a user application.
/// If the user wishes to "reset" the wrappers DLL he should call the wmxSDK_Finalize() API before calling wmxSDK_Init() again.
/// </summary>
///
/// <returns>A wmx_Status_t value indicating the API call's success/error.</returns>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_Init();
/// <summary>
/// This API finalizes the iWmxSDK wrappers DLL.
///
/// A call to this API should be preceeded with calls to the wmxXXX_Finalize() API of all specific wrappers used.
/// </summary>
void WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_Finalize();
/// <summary>
/// This API allows the user to obtain the version of the WiMAX SDK.
/// </summary>
///
/// <param name="version">(OUT) A pointer to a user-allocated wmx_pVersion_t struct in which the API will fill the WiMAX SDK's version.</param>
/// <param name="versionStr">(OUT) A pointer to a user-allocated wmx_pVersionStr_t string in which the API will fill the WiMAX SDK's version. VERSION_SDK_STR_MAX_SIZE can be used.</param>
/// <param name="versionStr">(IN) The size of the user-allocated string.</param>
///
/// <returns>A wmx_Status_t value indicating the API call's success/error.</returns>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_GetVersion( wmx_pVersion_t version, wmx_pVersionStr_t versionStr, wmx_VersionStrLen_t *verMaxLen ) ;
/// <summary>
/// This API allows the user to register a callback for SDK control status updates.
/// </summary>
///
/// <param name="ctrlStatusUpdateCB">(IN) A pointer to the application function to be called upon SDK control status change.</param>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_RegisterCtrlStatusUpdatesCB(wmx_pCtrlStatusUpdateCB_t ctrlStatusUpdateCB);
/// <summary>
/// This API allows the user to de-register for SDK control status updates.
/// </summary>
///
/// <param name="ctrlStatusUpdateCB">(IN) A pointer to the application function to be called upon SDK control status change.</param>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_UnregisterCtrlStatusUpdatesCB(wmx_pCtrlStatusUpdateCB_t ctrlStatusUpdateCB);
/// <summary>
/// This API allows the user to obtain the status of the WiMAX SDK.
///
/// SDK status info includes the extraction/insertion status of the card, the status of the driver and the AppSrv service.
/// </summary>
///
/// <returns>A wmx_CtrlStatus_t value indicating the control status of the SDK.</returns>
wmx_CtrlStatus_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_GetCtrlStatus();
/// <summary>
/// This API allows the user to set the IP address and port number of AppSrv.
///
/// The SDK first looks for IP address and port number settings in the Registry under
/// [HKEY_LOCAL_MACHINE\SOFTWARE\PipeConfig\SdkIpAddress & SdkPortNum].
///
/// The application can override the Registry settings using this API.
///
/// If the application already initialized the SDK and it is already connected to the AppSrv service,
/// then calling this API will only have effect after the SDK was finalized and re-initialized.
/// </summary>
///
/// <param name="szHostName">(IN) A string containing the IP address or host name of AppSrv.</param>
/// <param name="nPort">(IN) The port number of AppSrv (a decimal value).</param>
///
/// <returns>A wmx_Status_t value indicating the API call's success/error.</returns>
wmx_Status_t WMX_WRAPPER_API WMX_EXT_CALL_CONV wmxSDK_SetConnParams(char *szHostName, int nPort);
WIMAX_API_RET WIMAX_API DetachFromSDK();
#endif // _I_WMX_SDK_H
| ago/wimax-ns | InfraStack/OSAgnostic/WiMax/Wrappers/Include/iWmxSDK.h | C | bsd-3-clause | 5,590 |
#!/bin/bash
set -e
BUILD_DIRECTORY=build
CLI_E2E_PATH=fbsimctl/cli-tests/executable-under-test
function assert_xcode_version() {
local version=$1
if ! xcodebuild -version | grep -q "Xcode $version\."; then
echo "building fbsimctl requires Xcode $version"
exit 1
fi
}
function assert_has_carthage() {
if ! command -v carthage; then
echo "build needs 'carthage' to bootstrap dependencies"
echo "You can install it using brew. E.g. $ brew install carthage"
exit 1;
fi
}
function build_fbsimctl_deps() {
assert_xcode_version 8
assert_has_carthage
pushd fbsimctl
carthage bootstrap --platform Mac
popd
}
function build_test_deps() {
assert_has_carthage
carthage bootstrap --platform Mac
}
function framework_build() {
local name=$1
local output_directory=$2
xcodebuild \
-project FBSimulatorControl.xcodeproj \
-scheme $name \
-sdk macosx \
-derivedDataPath $BUILD_DIRECTORY \
build
if [[ -n $output_directory ]]; then
framework_install $name $output_directory
fi
}
function framework_install() {
local name=$1
local output_directory=$2
local artifact="$BUILD_DIRECTORY/Build/Products/Debug/$name.framework"
local output_directory_framework="$output_directory/Frameworks"
echo "Copying Build output of $artifact to $output_directory_framework"
mkdir -p "$output_directory_framework"
cp -R $artifact "$output_directory_framework/"
}
function framework_test() {
local name=$1
xcodebuild \
-project FBSimulatorControl.xcodeproj \
-scheme $name \
-sdk macosx \
-derivedDataPath $BUILD_DIRECTORY \
test
}
function core_framework_build() {
framework_build FBControlCore $1
}
function core_framework_test() {
framework_test FBControlCore
}
function xctest_framework_build() {
framework_build XCTestBootstrap $1
}
function xctest_framework_test() {
framework_test XCTestBootstrap
}
function simulator_framework_build() {
framework_build FBSimulatorControl $1
}
function simulator_framework_test() {
framework_test FBSimulatorControl
}
function device_framework_build() {
framework_build FBDeviceControl $1
}
function device_framework_test() {
framework_test FBDeviceControl
}
function all_frameworks_build() {
local output_directory=$1
core_framework_build $output_directory
xctest_framework_build $output_directory
simulator_framework_build $output_directory
device_framework_build $output_directory
}
function all_frameworks_test() {
core_framework_test
xctest_framework_test
simulator_framework_test
device_framework_test
}
function strip_framework() {
local FRAMEWORK_PATH="$BUILD_DIRECTORY/Build/Products/Debug/$1"
if [ -d "$FRAMEWORK_PATH" ]; then
echo "Stripping Framework $FRAMEWORK_PATH"
rm -r "$FRAMEWORK_PATH"
fi
}
function cli_build() {
local name=$1
local output_directory=$2
local script_directory=$1/Scripts
xcodebuild \
-workspace $name/$name.xcworkspace \
-scheme $name \
-sdk macosx \
-derivedDataPath $BUILD_DIRECTORY \
build
strip_framework "FBSimulatorControlKit.framework/Versions/Current/Frameworks/FBSimulatorControl.framework"
strip_framework "FBSimulatorControlKit.framework/Versions/Current/Frameworks/FBDeviceControl.framework"
strip_framework "FBSimulatorControl.framework/Versions/Current/Frameworks/XCTestBootstrap.framework"
strip_framework "FBSimulatorControl.framework/Versions/Current/Frameworks/FBControlCore.framework"
strip_framework "FBDeviceControl.framework/Versions/Current/Frameworks/XCTestBootstrap.framework"
strip_framework "FBDeviceControl.framework/Versions/Current/Frameworks/FBControlCore.framework"
strip_framework "XCTestBootstrap.framework/Versions/Current/Frameworks/FBControlCore.framework"
if [[ -n $output_directory ]]; then
cli_install $output_directory $script_directory
fi
}
function cli_install() {
local output_directory=$1
local script_directory=$2
local cli_artifact="$BUILD_DIRECTORY/Build/Products/Debug/!(*.framework)"
local framework_artifact="$BUILD_DIRECTORY/Build/Products/Debug/*.framework"
local output_directory_cli="$output_directory/bin"
local output_directory_framework="$output_directory/Frameworks"
mkdir -p "$output_directory_cli"
mkdir -p "$output_directory_framework"
shopt -s extglob
echo "Copying Build output from $cli_artifact to $output_directory_cli"
cp -R $cli_artifact "$output_directory_cli"
echo "Copying Build output from $framework_artifact to $output_directory_framework"
cp -R $framework_artifact "$output_directory_framework"
if [[ -d $script_directory ]]; then
echo "Copying Scripts from $script_directory to $output_directory_cli"
cp -R "$2"/* "$output_directory_cli"
fi
shopt -u extglob
}
function cli_framework_test() {
NAME=$1
xcodebuild \
-workspace $NAME/$NAME.xcworkspace \
-scheme $NAME \
-sdk macosx \
-derivedDataPath $BUILD_DIRECTORY \
test
}
function cli_e2e_test() {
NAME=$1
pushd $NAME/cli-tests
./tests.py
popd
}
function print_usage() {
cat <<EOF
./build.sh usage:
/build.sh <target> <command> [<arg>]*
Supported Commands:
help
Print usage.
framework build <output-directory>
Build the FBSimulatorControl.framework. Optionally copies the Framework to <output-directory>
framework test
Build then Test the FBSimulatorControl.framework.
fbsimctl build <output-directory>
Build the fbsimctl exectutable. Optionally copies the executable and it's dependencies to <output-directory>
fbsimctl test
Build the FBSimulatorControlKit.framework and runs the tests.
fbsimctl e2e-test
Build the fbsimctl executable and run the e2e CLI Tests against it. Requires python3
fbxctest build <output-directory>
Build the xctest exectutable. Optionally copies the executable and it's dependencies to <output-directory>
fbxctest test
Builds the FBXCTestKit.framework and runs the tests.
EOF
}
if [[ -n $TARGET ]]; then
echo "using target $TARGET"
elif [[ -n $1 ]]; then
TARGET=$1
echo "using target $TARGET"
else
echo "No target argument or $TARGET provided"
print_usage
exit 1
fi
if [[ -n $COMMAND ]]; then
echo "using command $COMMAND"
elif [[ -n $2 ]]; then
COMMAND=$2
echo "using command $COMMAND"
else
echo "No command argument or $COMMAND provided"
print_usage
exit 1
fi
if [[ -n $OUTPUT_DIRECTORY ]]; then
echo "using output directory $OUTPUT_DIRECTORY"
elif [[ -n $3 ]]; then
echo "using output directory $3"
OUTPUT_DIRECTORY=$3
else
echo "No output directory specified"
fi
case $TARGET in
help)
print_usage;;
framework)
case $COMMAND in
build)
all_frameworks_build $OUTPUT_DIRECTORY;;
test)
build_test_deps
all_frameworks_test;;
*)
echo "Unknown Command $2"
exit 1;;
esac;;
fbsimctl)
build_fbsimctl_deps
case $COMMAND in
build)
cli_build fbsimctl $OUTPUT_DIRECTORY;;
test)
build_test_deps
cli_framework_test fbsimctl;;
e2e-test)
rm -r "$CLI_E2E_PATH" || true
cli_build fbsimctl "$CLI_E2E_PATH"
cli_e2e_test fbsimctl;;
*)
echo "Unknown Command $COMMAND"
exit 1;;
esac;;
fbxctest)
case $COMMAND in
build)
cli_build fbxctest $OUTPUT_DIRECTORY;;
test)
build_test_deps
cli_framework_test fbxctest;;
*)
echo "Unknown Command $COMMAND"
exit 1;;
esac;;
*)
echo "Unknown Command $TARGET"
exit 1;;
esac
# vim: set tabstop=2 shiftwidth=2 filetype=sh:
| ichu501/FBSimulatorControl | build.sh | Shell | bsd-3-clause | 7,599 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Book Chapters</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../js/d3.3.5.5.min.js" charset="utf-8"></script>
<script type="text/javascript" src="../keshif.js" charset="utf-8"></script>
<link rel="stylesheet" href="../keshif.css"/ type="text/css">
<link rel="stylesheet" href="../font-awesome/css/font-awesome.min.css">
<script type="text/javascript" src="./js/demo.js" charset="utf-8"></script>
<link rel="stylesheet" href="./css/style.css"/ type="text/css">
<script type="text/javascript">
function pad(num, size) {
var s = num+"";
while (s.length < size) s = "0" + s;
return s;
};
google.setOnLoadCallback(function(){
browser = new kshf.Browser({
domID: "#chart_div",
barChartWidth: 90,
leftPanelLabelWidth: 230,
source: {
gdocId: '1nqZTWMr2xsYawyQlT6zjwV4pW5ZKRiQPd24jOkNJVYM',
tables: "Book Chapters"
},
summaries: [
{ title: "Domain Properties",
value: function(){
var r=[];
if(this['Number & Quantity']===1) r.push('Number & Quantity = 1.0');
if(this['Shape & Space']===1) r.push('Shape & Space = 1.0');
if(this['Shape & Space']===0.5) r.push('Shape & Space = 0.5');
if(this['Function']===1) r.push('Function = 1.0');
if(this['Function']===0.5) r.push('Function = 0.5');
if(this['Chance & Data']===1) r.push('Chance & Data = 1.0');
if(this['Arrangement']===1) r.push('Arrangement = 1.0');
return r;
},
catSortBy: function(){
switch(this.id){
case 'Number & Quantity = 1.0': return 1;
case 'Shape & Space = 0.5': return 2;
case 'Shape & Space = 1.0': return 3;
case 'Function = 0.5': return 4;
case 'Function = 1.0': return 5;
case 'Chance & Data = 1.0': return 6;
case 'Arrangement = 1.0': return 7;
}
} },
{ title: "Modeling / Formulating" },
{ title: "Manipulating / Transforming" },
{ title: "Inferring / Drawing Conclusions" },
{ title: "Communicating" },
],
itemDisplay: {
sortColWidth: 45,
detailsToggle: "zoom",
sortingOpts: { title: 'id', label: function(){ return this.Code+pad(this.id,3); }, inverse: true },
textSearch: "Name",
recordView: function(){
var str="";
str+="<div class='chapterTitle'>"+this.Name+"</div>";
str+="<span class='numTable'>";
str+="<span class='act_mf act_"+this["Modeling / Formulating"]+"'>M/F</span>"
str+="<span class='act_tf act_"+this["Manipulating / Transforming"]+"'>M/T</span>"
str+="<span class='act_id act_"+this["Inferring / Drawing Conclusions"]+"'>I/D</span>"
str+="<span class='act_c act_"+this["Communicating"]+"'>C</span>"
str+="</span>";
str+="<span class='attrGroup'>Domains:</span> <span class='attrList'>";
if(this['Number & Quantity']){
str+="Number & Quantity ["+this['Number & Quantity']+"], ";
}
if(this['Shape & Space']){
str+="Shape & Space ["+this['Shape & Space']+"], ";
}
if(this['Function']){
str+="Function ["+this['Function']+"], ";
}
if(this['Arrangement']){
str+="Arrangement ["+this['Arrangement']+"], ";
}
if(this['Chance & Data']){
str+="Chance & Data ["+this['Chance & Data']+"], ";
}
str+="</span>";
return str;
}
}
});
});
</script>
<style>
#chart_div {
width: 1000px;
height: 690px;
}
.chapterTitle{
font-weight: 700;
text-decoration: underline;
font-size: 1.1em;
}
.attrGroup{
font-weight: 300;
font-size: 0.9em;
}
.attrList{
font-size: 0.9em;
font-weight: 300;
color: gray;
}
.listItem{
border-top: solid 1px lightgray;
}
.numTable{
float: right;
}
.numTable span{
display: inline-block;
width: 45px;
border-left: solid 1px gray;
border-right: solid 1px gray;
padding: 0px 3px;
text-align: center;
font-size: 0.8em;
color: gray;
}
.act_0:after{
content: ":0"; color:;
}
.act_1:after{
content: ":1";
}
.act_2:after{
content: ":2";
}
.act_3:after{
content: ":3";
}
.act_4:after{
content: ":4";
}
.act_0{
background-color: rgba(255, 204, 204,0.1);
}
.act_1{
background-color: rgba(255, 204, 204,0.4);
}
.act_2{
background-color: rgba(255, 204, 204,0.6);
}
.act_3{
background-color: rgba(255, 204, 204,0.8);
}
.act_4{
background-color: rgba(255, 204, 204,1);
}
</style>
</head>
<body>
<div class="contents"><div id="chart_div"></div></div>
</body>
</html> | IntegralExplorer/Keshif | demo/book_chapters.html | HTML | bsd-3-clause | 5,277 |
<?php
/**
* Отображение для _search:
*
* @category YupeView
* @package yupe
* @author Yupe Team <team@yupe.ru>
* @license https://github.com/yupe/yupe/blob/master/LICENSE BSD
* @link http://yupe.ru
**/
$form = $this->beginWidget(
'bootstrap.widgets.TbActiveForm', array(
'action' => Yii::app()->createUrl($this->route),
'method' => 'get',
'type' => 'vertical',
'htmlOptions' => array('class' => 'well'),
)
);
?>
<fieldset>
<div class="row">
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'id', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('id'), 'data-content' => $model->getAttributeDescription('id'))))); ?>
</div>
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'name', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('name'), 'data-content' => $model->getAttributeDescription('name'))))); ?>
</div>
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'status', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('status'), 'data-content' => $model->getAttributeDescription('status'))))); ?>
</div>
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'alias', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('alias'), 'data-content' => $model->getAttributeDescription('alias'))))); ?>
</div>
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'lang', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('lang'), 'data-content' => $model->getAttributeDescription('lang'))))); ?>
</div>
<div class="col-sm-3">
<?php echo $form->textFieldGroup($model, 'code', array('widgetOptions' => array('htmlOptions' => array('class' => 'popover-help', 'data-original-title' => $model->getAttributeLabel('code'), 'data-content' => $model->getAttributeDescription('code'))))); ?>
</div>
</div>
</fieldset>
<?php
$this->widget(
'bootstrap.widgets.TbButton', array(
'context' => 'primary',
'encodeLabel' => false,
'buttonType' => 'submit',
'label' => '<i class="fa fa-search"> </i> ' . Yii::t('country', 'Искать страну'),
)
); ?>
<?php $this->endWidget(); ?> | elorian/crm.inreserve.kz | protected/modules/country/views/countryBackend/_search.php | PHP | bsd-3-clause | 2,889 |
<?php
use common\models\User;
use common\models\League;
use yii\helpers\Url;
$display_role = Yii::$app->user->identity->role;
$items = [];
if(Yii::$app->user->identity->isA([User::ROLE_ADMIN, User::ROLE_DEVELOPER])) {
$items[] = [
'label' => 'Engine',
'icon' => 'fa fa-cog',
'url' => '#',
'items' => [
$subitems[] = ['label' => 'Devices', 'icon' => 'fa fa-plane', 'url' => ['/coreengine/device']],
$subitems[] = ['label' => 'Device Groups', 'icon' => 'fa fa-truck', 'url' => ['/coreengine/device-group']],
$subitems[] = ['label' => 'Zones', 'icon' => 'fa fa-square-o', 'url' => ['/coreengine/zone']],
$subitems[] = ['label' => 'Zone Groups', 'icon' => 'fa fa-cog', 'url' => ['/coreengine/zone-group']],
$subitems[] = ['label' => 'Display Statuses', 'icon' => 'fa fa-info', 'url' => ['/coreengine/display-status-type']],
$subitems[] = ['label' => 'Notifications', 'icon' => 'fa fa-rss', 'url' => ['/coreengine/notification']],
$subitems[] = ['label' => 'Notification Groups', 'icon' => 'fa fa-share-alt', 'url' => ['/coreengine/notification-group']],
$subitems[] = ['label' => 'Services', 'icon' => 'fa fa-inbox', 'url' => ['/coreengine/service']],
$subitems[] = ['label' => 'Rules', 'icon' => 'fa fa-gavel', 'url' => ['/coreengine/rule']],
$subitems[] = ['label' => 'Subscriptions', 'icon' => 'fa fa-check-circle', 'url' => ['/coreengine/subscription']],
],
];
}
if(Yii::$app->user->identity->isA([User::ROLE_ADMIN, User::ROLE_DEVELOPER])) {
$items[] = [
'label' => 'Input',
'icon' => 'fa fa-terminal',
'url' => '#',
'items' => [
$subitems[] = ['label' => 'Events', 'icon' => 'fa fa-list-ul', 'url' => ['/inputbroker/event']],
$subitems[] = ['label' => 'Providers', 'icon' => 'fa fa-arrow-right', 'url' => ['/inputbroker/provider']],
$subitems[] = ['label' => 'Processings', 'icon' => 'fa fa-cog', 'url' => ['/inputbroker/processing']],
],
];
}
if(Yii::$app->user->identity->isA([User::ROLE_ADMIN, User::ROLE_DEVELOPER])) {
$items[] = [
'label' => 'Viewer',
'icon' => 'fa fa-eye',
'url' => '#',
'items' => [
$subitems[] = ['label' => 'Dashboards', 'icon' => 'fa fa-dashboard', 'url' => ['/viewer/dashboard']],
$subitems[] = ['label' => 'GIPlets', 'icon' => 'fa fa-bar-chart', 'url' => ['/viewer/giplet']],
$subitems[] = ['label' => 'Maps', 'icon' => 'fa fa-map', 'url' => ['/viewer/map']],
$subitems[] = ['label' => 'Backgrounds', 'icon' => 'fa fa-globe', 'url' => ['/viewer/background']],
$subitems[] = ['label' => 'Layers', 'icon' => 'fa fa-car', 'url' => ['/viewer/layer']],
$subitems[] = ['label' => 'Tool Sets', 'icon' => 'fa fa-wrench', 'url' => ['/viewer/tool-group']],
],
];
}
if(Yii::$app->user->identity->isA([User::ROLE_ADMIN, User::ROLE_DEVELOPER, User::ROLE_INTERNAL])) {
$items[] = [
'label' => 'Developer',
'icon' => 'fa fa-code',
'url' => '#',
'items' => [
$subitems[] = ['label' => 'Entity Types', 'icon' => 'fa fa-file-o', 'url' => ['/developer/type']],
$subitems[] = ['label' => 'Styles', 'icon' => 'fa fa-pencil', 'url' => ['/developer/style']],
$subitems[] = ['label' => 'Lists of Values', 'icon' => 'fa fa-list', 'url' => ['/developer/list-of-values']],
$subitems[] = ['label' => 'Attribute Types', 'icon' => 'fa fa-font', 'url' => ['/developer/attribute-type']],
$subitems[] = ['label' => 'Attributes', 'icon' => 'fa fa-font', 'url' => ['/developer/attribute']],
$subitems[] = ['label' => 'Event Types', 'icon' => 'fa fa-file-o', 'url' => ['/developer/event-type']],
$subitems[] = ['label' => 'Detection Types', 'icon' => 'fa fa-gavel', 'url' => ['/developer/detection-type']],
$subitems[] = ['label' => 'Notification Types', 'icon' => 'fa fa-envelope', 'url' => ['/developer/notification-type']],
$subitems[] = ['label' => 'Provider Types', 'icon' => 'fa fa-arrow-right', 'url' => ['/developer/provider-type']],
$subitems[] = ['label' => 'Target Types', 'icon' => 'fa fa-arrow-left', 'url' => ['/developer/target-type']],
$subitems[] = ['label' => 'Targets', 'icon' => 'fa fa-arrow-left', 'url' => ['/developer/target']],
$subitems[] = ['label' => 'GIPlet Types', 'icon' => 'fa fa-bar-chart', 'url' => ['/developer/giplet-type']],
$subitems[] = ['label' => 'Map Tools', 'icon' => 'fa fa-wrench', 'url' => ['/developer/tool']],
$subitems[] = ['label' => 'Map Layer Types', 'icon' => 'fa fa-bar-chart', 'url' => ['/developer/layer-type']],
$subitems[] = ['label' => 'Map Background Types', 'icon' => 'fa fa-globe', 'url' => ['/developer/background-type']],
$subitems[] = ['label' => 'The Wire', 'icon' => 'fa fa-hashtag', 'url' => ['/developer/wire']],
$subitems[] = ['label' => 'Dashboards', 'icon' => 'fa fa-dashboard', 'url' => ['/dashboard']],
],
];
}
if(in_array(Yii::$app->user->identity->role, [User::ROLE_ADMIN, User::ROLE_DEVELOPER, User::ROLE_INTERNAL])) {
$subitems = [];
if(Yii::$app->user->identity->isA([User::ROLE_ADMIN])) {
$subitems[] = ['label' => 'User Accounts', 'icon' => 'fa fa-user', 'url' => ['/user/admin']];
$subitems[] = ['label' => 'Backup', 'icon' => 'fa fa-download', 'url' => ['/admin/backup']];
}
$items[] = [
'label' => 'Site',
'icon' => 'fa fa-dashboard',
'url' => '#',
'items' => $subitems,
];
}
if(defined('YII_DEBUG')) {
$items[] = [
'label' => 'Development',
'icon' => 'fa fa-cog',
'url' => '#',
'items' => [
// ['label' => 'Menu Yii2', 'options' => ['class' => 'header']],
['label' => 'Debug', 'icon' => 'fa fa-bug', 'url' => ['/debug']],
['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']],
['label' => 'Frontend', 'icon' => 'fa fa-heart', 'url' => ['/../gip']],
['label' => 'Documentation', 'icon' => 'fa fa-support', 'url' => ['/../gip/doc/guide-README.html']],
// ['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest],
],
];
}
?><aside class="main-sidebar">
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img src="<?= Yii::$app->user->identity->getProfilePicture() ?>" class="img-circle" alt="User Image"/>
</div>
<div class="pull-left info">
<p><?= Yii::$app->user->identity->username ?></p>
<a href="#"><i class="fa fa-circle text-success"></i> Online - <?= $display_role ?></a>
</div>
</div>
<!-- search form -->
<form action="<?= Url::to(['/site/search']) ?>" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..."/>
<span class="input-group-btn">
<button type='submit' class="btn btn-flat"><i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
<!-- /.search form -->
<?= dmstr\widgets\Menu::widget(
[
'options' => ['class' => 'sidebar-menu'],
'items' => $items,
]
) ?>
</section>
</aside>
| devleaks/gip | backend/views/layouts/left.php | PHP | bsd-3-clause | 7,294 |
<?php
declare(strict_types=1);
namespace LizardsAndPumpkins\DataPool\SearchEngine\Elasticsearch\Operator;
use LizardsAndPumpkins\DataPool\SearchEngine\Elasticsearch\Bool\ElasticsearchQueryBoolMustNot;
class ElasticsearchQueryOperatorNotDefined implements ElasticsearchQueryOperator
{
public function getFormattedArray(string $fieldName, string $fieldValue): array
{
return (new ElasticsearchQueryBoolMustNot())->getFormattedArray([
'exists' => [
'field' => $fieldName
],
]);
}
}
| adrianco48/lib-search-engine-elasticsearch | src/Operator/ElasticsearchQueryOperatorNotDefined.php | PHP | bsd-3-clause | 551 |
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Zend Framework API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css"></link><link rel="stylesheet" href="css/jquery.treeview.css" type="text/css"></link><link rel="stylesheet" href="css/theme.css" type="text/css"></link><script type="text/javascript" src="js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="js/jquery.cookie.js"></script><script type="text/javascript" src="js/jquery.treeview.js"></script><script type="text/javascript">
$(document).ready(function() {
$(".filetree").treeview({
collapsed: true,
persist: "cookie"
});
$("#accordion").accordion({
collapsible: true,
autoHeight: false,
fillSpace: true
});
$(".tabs").tabs();
});
</script></head><body><div xmlns="" class="content">
<div class="sub-page-main-header-api-documentation"><h2>API Documentation</h2></div>
<div class="dotted-line"></div>
</div>
<div xmlns="" id="content">
<script type="text/javascript" src="js/menu.js"></script><script>
$(document).ready(function() {
$('a.gripper').click(function() {
$(this).nextAll('div.code-tabs').slideToggle();
$(this).children('img').toggle();
return false;
});
$('div.code-tabs').hide();
$('a.gripper').show();
$('div.file-nav').show();
});
</script><h1 class="file">XmlRpc/Generator/XmlWriter.php</h1>
<div class="file-nav"><ul id="file-nav">
<li><a href="#top">Global</a></li>
<li>
<a href="#classes"><img src="images/icons/class.png" height="14">
Classes
</a><ul><li><a href="#%5CZend_XmlRpc_Generator_XmlWriter">\Zend_XmlRpc_Generator_XmlWriter</a></li></ul>
</li>
</ul></div>
<a name="top"></a><div id="file-description">
<p class="short-description">Zend Framework</p>
<div class="long-description"><p>LICENSE</p>
<p>This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.</p>
</div>
</div>
<dl class="file-info">
<dt>category</dt>
<dd>Zend
</dd>
<dt>copyright</dt>
<dd>Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
</dd>
<dt>license</dt>
<dd>
<a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
</dd>
<dt>package</dt>
<dd>Zend_XmlRpc
</dd>
<dt>subpackage</dt>
<dd>Generator
</dd>
<dt>version</dt>
<dd>$Id: XmlWriter.php 24479 2011-09-26 20:10:08Z matthew $
</dd>
</dl>
<a name="classes"></a><a id="\Zend_XmlRpc_Generator_XmlWriter"></a><h2 class="class">\Zend_XmlRpc_Generator_XmlWriter<div class="to-top"><a href="#top">jump to top</a></div>
</h2>
<div class="class">
<p class="short-description">XML generator adapter based on XMLWriter</p>
<div class="long-description">
</div>
<dl class="class-info">
<dt>Extends from</dt>
<dd><a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract">\Zend_XmlRpc_Generator_GeneratorAbstract</a></dd>
</dl>
<h3>Properties</h3>
<div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::$_xmlWriter"></a><div class="property">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/property.png" alt="Property"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected">\XMLWriter
<span class="highlight">$_xmlWriter</span>= ''
</code><div class="description">
<p class="short-description">XMLWriter instance</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Details</strong><dl class="property-info">
<dt>Type</dt>
<dd><a href="http://php.net/manual/en/class.xmlwriter.php">\XMLWriter</a></dd>
</dl>
</div>
<div class="clear"></div>
</div>
</div>
<h3>Methods</h3>
<div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::__construct()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">__construct</span><span class="nb-faded-text">(
string $encoding
=
UTF-8
)
</span>
:
void</code><div class="description">
<p class="short_description">Construct new instance of the generator</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::__construct()">\Zend_XmlRpc_Generator_GeneratorAbstract::__construct()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$encoding</th>
<td>string</td>
<td><em><p>XML encoding, default UTF-8</p>
</em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::__toString()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">__toString</span><span class="nb-faded-text">(
)
</span>
:
string</code><div class="description">
<p class="short_description">Returns XML without document declaration</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::__toString()">\Zend_XmlRpc_Generator_GeneratorAbstract::__toString()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::_closeElement()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">_closeElement</span><span class="nb-faded-text">(
string $name
)
</span>
:
void</code><div class="description"><p class="short_description">Close an previously opened XML element</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$name</th>
<td>string</td>
<td><em></em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::_init()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">_init</span><span class="nb-faded-text">(
)
</span>
:
void</code><div class="description"><p class="short_description">Initialized XMLWriter instance</p></div>
<div class="code-tabs"><div class="long-description">
</div></div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::_openElement()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">_openElement</span><span class="nb-faded-text">(
string $name
)
</span>
:
void</code><div class="description"><p class="short_description">Open a new XML element</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$name</th>
<td>string</td>
<td><em>XML element name</em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::_writeTextData()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"><span class="highlight">_writeTextData</span><span class="nb-faded-text">(
string $text
)
</span>
:
void</code><div class="description"><p class="short_description">Write XML text data into the currently opened XML element</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$text</th>
<td>string</td>
<td><em>XML text data</em></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::closeElement()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">closeElement</span><span class="nb-faded-text">(
string $name
)
</span>
:
\Zend_XmlRpc_Generator_Abstract</code><div class="description">
<p class="short_description">End of an XML element</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::closeElement()">\Zend_XmlRpc_Generator_GeneratorAbstract::closeElement()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>Method marks the end of an XML element</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$name</th>
<td>string</td>
<td><em>XML tag name</em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>\Zend_XmlRpc_Generator_Abstract</td>
<td>Fluent interface</td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::flush()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">flush</span><span class="nb-faded-text">(
)
</span>
:
string</code><div class="description">
<p class="short_description">Returns the XML as a string and flushes all internal buffers</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::flush()">\Zend_XmlRpc_Generator_GeneratorAbstract::flush()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::getEncoding()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">getEncoding</span><span class="nb-faded-text">(
)
</span>
:
string</code><div class="description">
<p class="short_description">Return encoding</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::getEncoding()">\Zend_XmlRpc_Generator_GeneratorAbstract::getEncoding()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::openElement()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">openElement</span><span class="nb-faded-text">(
string $name, string $value
=
null
)
</span>
:
\Zend_XmlRpc_Generator_Abstract</code><div class="description">
<p class="short_description">Start XML element</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::openElement()">\Zend_XmlRpc_Generator_GeneratorAbstract::openElement()</a></small>
</div>
<div class="code-tabs">
<div class="long-description"><p>Method opens a new XML element with an element name and an optional value</p>
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$name</th>
<td>string</td>
<td><em>XML tag name</em></td>
</tr>
<tr>
<th>$value</th>
<td>string</td>
<td><em>Optional value of the XML tag</em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>\Zend_XmlRpc_Generator_Abstract</td>
<td>Fluent interface</td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::saveXml()"></a><div class="method">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">saveXml</span><span class="nb-faded-text">(
)
</span>
:
string</code><div class="description"><p class="short_description">Return XML as a string</p></div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
<a id="\Zend_XmlRpc_Generator_XmlWriter::stripDeclaration()"></a><div class="method inherited_from ">
<a href="#" class="gripper"><img src="images/icons/arrow_right.png"><img src="images/icons/arrow_down.png" style="display: none;"></a><code><img src="images/icons/method.png" alt="method"><img src="images/icons/visibility_public.png" style="margin-right: 5px" alt="public"><span class="highlight">stripDeclaration</span><span class="nb-faded-text">(
string $xml
)
</span>
:
string</code><div class="description">
<p class="short_description">Removes XML declaration from a string</p>
<small>Inherited from:
<a href="db_XmlRpc_Generator_GeneratorAbstract.html#%5CZend_XmlRpc_Generator_GeneratorAbstract::stripDeclaration()">\Zend_XmlRpc_Generator_GeneratorAbstract::stripDeclaration()</a></small>
</div>
<div class="code-tabs">
<div class="long-description">
</div>
<strong>Parameters</strong><table class="argument-info">
<thead><tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<th>$xml</th>
<td>string</td>
<td><em></em></td>
</tr>
</table>
<strong>Returns</strong><table class="argument-info">
<thead><tr>
<th>Type</th>
<th>Description</th>
</tr></thead>
<tr>
<td>string</td>
<td></td>
</tr>
</table>
</div>
<div class="clear"></div>
</div>
</div>
</div>
</div>
<small xmlns="" class="footer">Documentation was generated by <a href="http://docblox-project.org">DocBlox 0.13.3</a>.
</small></body></html>
| wukchung/Home-development | documentation/api/core/db_XmlRpc_Generator_XmlWriter.html | HTML | bsd-3-clause | 17,958 |
/**
* An open source web application development framework for PHP 5 and above.
*
* @author ArticulateLogic Labs
* @author Abdullah Al Zakir Hossain, Email: aazhbd@yahoo.com
* @author Syeda Tasneem Rumy, Email: tasneemrumy@gmail.com
* @author Abdullah Al Zakir Hossain, Email: aazhbd@yahoo.com
* @copyright Copyright (c)2009-2010 ArticulateLogic Labs, creative software engineering
* @license www.articulatelogic.com/a/privacy, www.articulatelogic.com/a/terms
* @link http://www.articulatelogic.com
* @since Version 1.0
*
*/
form {
margin: 0;
width: auto;
}
fieldset {
color:#000;
padding: 0;
border-radius: 0.5em;
-moz-border-radius: 0.5em;
-webkit-border-radius: 0.5em;
min-height: 30px;
overflow: hidden;
text-align: left;
}
fieldset > legend {
text-align: left;
color: #000;
border-radius: 0.5em;
-moz-border-radius: 0.5em;
-webkit-border-radius: 0.5em;
}
fieldset > span, fieldset > div {
margin: 10px;
}
fieldset > span, fieldset > div > span {
display: block;
float: left;
text-align:left;
}
fieldset > span, fieldset > div > span {
margin-right: 1em;
}
fieldset > legend, fieldset label {
/*font-weight: bold;*/
}
fieldset label > label {
font-weight: normal;
}
fieldset ul, fieldset ol {
margin-top: 0;
margin-bottom: 0;
}
fieldset label > span, fieldset label > div, fieldset label > p {
font-weight: normal;
}
form .info {
font-size: 0.8em;
}
textarea, select {
margin: 0;
vertical-align: top;
font: .9em "Tahoma", Verdana, Helvetica, sans-serif;
}
.relatedcheckboxes, .relatedselects {
margin: 0;
}
.relatedcheckboxes > label > label {
font-size: 0.5em;
width: 17em;
display: block;
float: left;
}
input ,[type=text],[type=password], textarea, select {
border: 1px solid silver;
}
form .actions {
text-align: right;
}
form fieldset legend {
background: #F6F6F6 url('../images/menubgi.jpg') top left no-repeat;
border: none;
position: relative;
width: 80%;
padding: 0.5em;
border-bottom: 0.01em solid #DFEFEF;
border-radius: 0.5em;
-moz-border-radius: 0.5em;
-webkit-border-radius: 0.5em;
}
form fieldset {
overflow: hidden;
background: #F6F6F6 url(../images/menubg.jpg) bottom right no-repeat;
border: none;
}
form .frmbtn {
color:#fff;
font: "Tahoma" 0.5em;
font-weight:bold;
background: url(../images/btnface.gif) #eee;
padding: 0.4em;
border: 1px solid #bbb;
}
form .frmbtn:hover {
border: 1px solid #ffc;
}
form #txtsrch{
width:280px;
}
form .log{
width:180px;
}
/* end of form formats */
| aazhbd/qurananalyst01 | static/css/forms.css | CSS | bsd-3-clause | 2,853 |
## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
""" Deploy and install a package to a target
"""
import os
import sys
import zipfile
from qisys import ui
import qisys.command
import qisys.parsers
import qipkg.package
def configure_parser(parser):
qisys.parsers.default_parser(parser)
qisys.parsers.deploy_parser(parser)
parser.add_argument("pkg_path")
def do(args):
urls = qisys.parsers.get_deploy_urls(args)
pkg_path = args.pkg_path
for url in urls:
deploy(pkg_path, url)
def deploy(pkg_path, url):
ui.info(ui.green, "Deploying",
ui.reset, ui.blue, pkg_path,
ui.reset, ui.green, "to",
ui.reset, ui.blue, url.as_string)
pkg_name = qipkg.package.name_from_archive(pkg_path)
scp_cmd = ["scp",
pkg_path,
"%s@%s:" % (url.user, url.host)]
qisys.command.call(scp_cmd)
try:
_install_package(url, pkg_name, pkg_path)
except Exception as e:
ui.error("Unable to install package on target")
ui.error("Error was: ", e)
rm_cmd = ["ssh", "%s@%s" % (url.user, url.host),
"rm", os.path.basename(pkg_path)]
qisys.command.call(rm_cmd)
def _install_package(url, pkg_name, pkg_path):
import qi
app = qi.Application()
session = qi.Session()
session.connect("tcp://%s:9559" % (url.host))
package_manager = session.service("PackageManager")
package_manager.removePkg(pkg_name)
ret = package_manager.install(
"/home/%s/%s" % (url.user, os.path.basename(pkg_path)))
ui.info("PackageManager returned: ", ret)
| dmerejkowsky/qibuild | python/qipkg/actions/deploy_package.py | Python | bsd-3-clause | 1,732 |
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/storage_monitor/media_storage_util.h"
#include <vector>
#include "base/callback.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/storage_monitor/removable_device_constants.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "content/public/browser/browser_thread.h"
using content::BrowserThread;
namespace chrome {
namespace {
// MediaDeviceNotification.DeviceInfo histogram values.
enum DeviceInfoHistogramBuckets {
MASS_STORAGE_DEVICE_NAME_AND_UUID_AVAILABLE,
MASS_STORAGE_DEVICE_UUID_MISSING,
MASS_STORAGE_DEVICE_NAME_MISSING,
MASS_STORAGE_DEVICE_NAME_AND_UUID_MISSING,
MTP_STORAGE_DEVICE_NAME_AND_UUID_AVAILABLE,
MTP_STORAGE_DEVICE_UUID_MISSING,
MTP_STORAGE_DEVICE_NAME_MISSING,
MTP_STORAGE_DEVICE_NAME_AND_UUID_MISSING,
DEVICE_INFO_BUCKET_BOUNDARY
};
#if !defined(OS_WIN)
const char kRootPath[] = "/";
#endif
void ValidatePathOnFileThread(
const base::FilePath& path,
const MediaStorageUtil::BoolCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(callback, file_util::PathExists(path)));
}
typedef std::vector<StorageInfo> StorageInfoList;
bool IsRemovableStorageAttached(const std::string& id) {
StorageInfoList devices = StorageMonitor::GetInstance()->GetAttachedStorage();
for (StorageInfoList::const_iterator it = devices.begin();
it != devices.end(); ++it) {
if (it->device_id == id)
return true;
}
return false;
}
base::FilePath::StringType FindRemovableStorageLocationById(
const std::string& device_id) {
StorageInfoList devices = StorageMonitor::GetInstance()->GetAttachedStorage();
for (StorageInfoList::const_iterator it = devices.begin();
it != devices.end(); ++it) {
if (it->device_id == device_id)
return it->location;
}
return base::FilePath::StringType();
}
void FilterAttachedDevicesOnFileThread(MediaStorageUtil::DeviceIdSet* devices) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
MediaStorageUtil::DeviceIdSet missing_devices;
for (MediaStorageUtil::DeviceIdSet::const_iterator it = devices->begin();
it != devices->end();
++it) {
StorageInfo::Type type;
std::string unique_id;
if (!StorageInfo::CrackDeviceId(*it, &type, &unique_id)) {
missing_devices.insert(*it);
continue;
}
if (type == StorageInfo::FIXED_MASS_STORAGE ||
type == StorageInfo::ITUNES) {
if (!file_util::PathExists(base::FilePath::FromUTF8Unsafe(unique_id)))
missing_devices.insert(*it);
continue;
}
if (!IsRemovableStorageAttached(*it))
missing_devices.insert(*it);
}
for (MediaStorageUtil::DeviceIdSet::const_iterator it =
missing_devices.begin();
it != missing_devices.end();
++it) {
devices->erase(*it);
}
}
} // namespace
// static
bool MediaStorageUtil::HasDcim(const base::FilePath& mount_point) {
DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
base::FilePath::StringType dcim_dir(kDCIMDirectoryName);
if (!file_util::DirectoryExists(mount_point.Append(dcim_dir))) {
// Check for lowercase 'dcim' as well.
base::FilePath dcim_path_lower(
mount_point.Append(StringToLowerASCII(dcim_dir)));
if (!file_util::DirectoryExists(dcim_path_lower))
return false;
}
return true;
}
// static
bool MediaStorageUtil::CanCreateFileSystem(const std::string& device_id,
const base::FilePath& path) {
StorageInfo::Type type;
if (!StorageInfo::CrackDeviceId(device_id, &type, NULL))
return false;
if (type == StorageInfo::MAC_IMAGE_CAPTURE)
return true;
return path.IsAbsolute() && !path.ReferencesParent();
}
// static
void MediaStorageUtil::FilterAttachedDevices(DeviceIdSet* devices,
const base::Closure& done) {
if (BrowserThread::CurrentlyOn(BrowserThread::FILE)) {
FilterAttachedDevicesOnFileThread(devices);
done.Run();
return;
}
BrowserThread::PostTaskAndReply(BrowserThread::FILE,
FROM_HERE,
base::Bind(&FilterAttachedDevicesOnFileThread,
devices),
done);
}
// TODO(kmadhusu) Write unit tests for GetDeviceInfoFromPath().
bool MediaStorageUtil::GetDeviceInfoFromPath(const base::FilePath& path,
StorageInfo* device_info,
base::FilePath* relative_path) {
if (!path.IsAbsolute())
return false;
StorageInfo info;
StorageMonitor* monitor = StorageMonitor::GetInstance();
bool found_device = monitor->GetStorageInfoForPath(path, &info);
if (found_device && StorageInfo::IsRemovableDevice(info.device_id)) {
base::FilePath sub_folder_path;
base::FilePath device_path(info.location);
if (path != device_path) {
bool success = device_path.AppendRelativePath(path, &sub_folder_path);
DCHECK(success);
}
if (device_info)
*device_info = info;
if (relative_path)
*relative_path = sub_folder_path;
return true;
}
// TODO(vandebo) Check to see if the path points to an iTunes library file.
// On Posix systems, there's one root so any absolute path could be valid.
// TODO(gbillock): Delete this stanza? Posix systems should have the root
// volume information. If not, we should move the below into the
// right GetStorageInfoForPath implementations.
#if !defined(OS_POSIX)
if (!found_device)
return false;
#endif
// Handle non-removable devices. Note: this is just overwriting
// good values from StorageMonitor.
// TODO(gbillock): Make sure return values from that class are definitive,
// and don't do this here.
info.device_id = StorageInfo::MakeDeviceId(StorageInfo::FIXED_MASS_STORAGE,
path.AsUTF8Unsafe());
if (device_info)
*device_info = info;
if (relative_path)
*relative_path = base::FilePath();
return true;
}
// static
base::FilePath MediaStorageUtil::FindDevicePathById(
const std::string& device_id) {
StorageInfo::Type type;
std::string unique_id;
if (!StorageInfo::CrackDeviceId(device_id, &type, &unique_id))
return base::FilePath();
if (type == StorageInfo::FIXED_MASS_STORAGE || type == StorageInfo::ITUNES) {
// For this type, the unique_id is the path.
return base::FilePath::FromUTF8Unsafe(unique_id);
}
// For ImageCapture, the synthetic filesystem will be rooted at a fake
// top-level directory which is the device_id.
if (type == StorageInfo::MAC_IMAGE_CAPTURE) {
#if !defined(OS_WIN)
return base::FilePath(kRootPath + device_id);
#endif
}
DCHECK(type == StorageInfo::MTP_OR_PTP ||
type == StorageInfo::REMOVABLE_MASS_STORAGE_WITH_DCIM ||
type == StorageInfo::REMOVABLE_MASS_STORAGE_NO_DCIM);
return base::FilePath(FindRemovableStorageLocationById(device_id));
}
// static
void MediaStorageUtil::RecordDeviceInfoHistogram(bool mass_storage,
const std::string& device_uuid,
const string16& device_label) {
unsigned int event_number = 0;
if (!mass_storage)
event_number = 4;
if (device_label.empty())
event_number += 2;
if (device_uuid.empty())
event_number += 1;
enum DeviceInfoHistogramBuckets event =
static_cast<enum DeviceInfoHistogramBuckets>(event_number);
if (event >= DEVICE_INFO_BUCKET_BOUNDARY) {
NOTREACHED();
return;
}
UMA_HISTOGRAM_ENUMERATION("MediaDeviceNotifications.DeviceInfo", event,
DEVICE_INFO_BUCKET_BOUNDARY);
}
} // namespace chrome
| loopCM/chromium | chrome/browser/storage_monitor/media_storage_util.cc | C++ | bsd-3-clause | 8,202 |
"""
SMQTK Web Applications
"""
import inspect
import logging
import os
import flask
import smqtk.utils
from smqtk.utils import plugin
class SmqtkWebApp (flask.Flask, smqtk.utils.Configurable, plugin.Pluggable):
"""
Base class for SMQTK web applications
"""
@classmethod
def impl_directory(cls):
"""
:return: Directory in which this implementation is contained.
:rtype: str
"""
return os.path.dirname(os.path.abspath(inspect.getfile(cls)))
@classmethod
def get_default_config(cls):
"""
Generate and return a default configuration dictionary for this class.
This will be primarily used for generating what the configuration
dictionary would look like for this class without instantiating it.
This should be overridden in each implemented application class to add
appropriate configuration.
:return: Default configuration dictionary for the class.
:rtype: dict
"""
return {
"flask_app": {
"SECRET_KEY": "MySuperUltraSecret",
"BASIC_AUTH_USERNAME": "demo",
"BASIC_AUTH_PASSWORD": "demo"
},
"server": {
'host': "127.0.0.1",
'port': 5000
}
}
@classmethod
def from_config(cls, config_dict):
return cls(config_dict)
def __init__(self, json_config):
"""
Initialize application based of supplied JSON configuration
:param json_config: JSON configuration dictionary
:type json_config: dict
"""
super(SmqtkWebApp, self).__init__(
self.__class__.__name__,
static_folder=os.path.join(self.impl_directory(), 'static'),
template_folder=os.path.join(self.impl_directory(), 'templates')
)
#
# Configuration setup
#
self.json_config = json_config
# Factor 'flask_app' configuration properties into self.config
for k in self.json_config['flask_app']:
self.config[k] = self.json_config['flask_app'][k]
#
# Security
#
self.secret_key = self.config['SECRET_KEY']
def get_config(self):
return self.json_config
@property
def log(self):
return logging.getLogger('.'.join((self.__module__,
self.__class__.__name__)))
def run(self, host=None, port=None, debug=False, **options):
"""
Override of the run method, drawing running host and port from
configuration by default. 'host' and 'port' values specified as argument
or keyword will override the app configuration.
"""
super(SmqtkWebApp, self)\
.run(host=(host or self.json_config['server']['host']),
port=(port or self.json_config['server']['port']),
debug=debug,
**options)
def get_web_applications(reload_modules=False):
"""
Discover and return SmqtkWebApp implementation classes found in the plugin
directory. Keys in the returned map are the names of the discovered classes
and the paired values are the actual class type objects.
We look for modules (directories or files) that start with and alphanumeric
character ('_' prefixed files/directories are hidden, but not recommended).
Within a module, we first look for a helper variable by the name
``APPLICATION_CLASS``, which can either be a single class object or
an iterable of class objects, to be exported. If the variable is set to
None, we skip that module and do not import anything. If the variable is not
present, we look for a class by the same na e and casing as the module's
name. If neither are found, the module is skipped.
:param reload_modules: Explicitly reload discovered modules from source.
:type reload_modules: bool
:return: Map of discovered class objects of type ``SmqtkWebApp`` whose
keys are the string names of the classes.
:rtype: dict[str, type]
"""
import os
from smqtk.utils.plugin import get_plugins
this_dir = os.path.abspath(os.path.dirname(__file__))
env_var = "APPLICATION_PATH"
helper_var = "APPLICATION_CLASS"
return get_plugins(__name__, this_dir, env_var, helper_var, SmqtkWebApp,
reload_modules=reload_modules)
| kfieldho/SMQTK | python/smqtk/web/__init__.py | Python | bsd-3-clause | 4,457 |
<?php
require_once 'ESys/Calendar.php';
class ESys_CalendarTest extends PHPUnit_Framework_TestCase {
public function setup ()
{
date_default_timezone_set('America/New_York');
}
public function testCalculatesIfYearIsALeapYear ()
{
$leapYear = 2004;
$nonLeapYear = 1900;
$this->assertTrue(ESys_Calendar::isLeapYear($leapYear));
$this->assertFalse(ESys_Calendar::isLeapYear($nonLeapYear));
}
public function testCalculatesDaysInMonth ()
{
$this->assertEquals(31, ESys_Calendar::daysInMonth(1));
}
public function testCalculatesDaysInMonthWithYearContext ()
{
$leapYear = 2004;
$nonLeapYear = 1900;
$this->assertEquals(28, ESys_Calendar::daysInMonth(2, $nonLeapYear));
$this->assertEquals(29, ESys_Calendar::daysInMonth(2, $leapYear));
}
public function testCalculatesDaysInYear ()
{
$leapYear = 2004;
$nonLeapYear = 1900;
$this->assertEquals(365, ESys_Calendar::daysInYear($nonLeapYear));
$this->assertEquals(366, ESys_Calendar::daysInYear($leapYear));
}
} | dellsala/ESys-Framework | test/ESys/CalendarTest.php | PHP | bsd-3-clause | 1,142 |
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for license. */
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
#ifndef _NITRANSPARENTPROPERTY_H_
#define _NITRANSPARENTPROPERTY_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "NiProperty.h"
namespace Niflib
{
class NiTransparentProperty;
typedef Ref<NiTransparentProperty> NiTransparentPropertyRef;
/*! Unknown */
class NiTransparentProperty : public NiProperty
{
public:
/*! Constructor */
NIFLIB_API NiTransparentProperty();
/*! Destructor */
NIFLIB_API virtual ~NiTransparentProperty();
/*!
* A constant value which uniquly identifies objects of this type.
*/
NIFLIB_API static const Type TYPE;
/*!
* A factory function used during file reading to create an instance of this type of object.
* \return A pointer to a newly allocated instance of this type of object.
*/
NIFLIB_API static NiObject * Create();
/*!
* Summarizes the information contained in this object in English.
* \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
* \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same.
*/
NIFLIB_API virtual string asString(bool verbose = false) const;
/*!
* Used to determine the type of a particular instance of this object.
* \return The type constant for the actual type of the object.
*/
NIFLIB_API virtual const Type & GetType() const;
//--This object has no eligable attributes. No example implementation generated--//
//--BEGIN MISC CUSTOM CODE--//
//--END CUSTOM CODE--//
protected:
/*! Unknown. */
array<6, byte > unknown;
public:
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Read(istream& in, list<unsigned int> & link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Write(ostream& out, const map<NiObjectRef, unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info) const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void FixLinks(const map<unsigned int, NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info);
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
};
//--BEGIN FILE FOOT CUSTOM CODE--//
//--END CUSTOM CODE--//
} //End Niflib namespace
#endif
| BlazesRus/niflib | include/obj/NiTransparentProperty.h | C | bsd-3-clause | 3,156 |
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/assistant/model/assistant_ui_model.h"
#include "ash/assistant/test/assistant_ash_test_base.h"
#include "ash/assistant/ui/assistant_ui_constants.h"
#include "ash/assistant/ui/main_stage/suggestion_chip_view.h"
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "chromeos/services/assistant/public/cpp/default_assistant_interaction_subscriber.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
#include "ui/events/event.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/focus/focus_manager.h"
#include "ui/views/widget/widget.h"
namespace ash {
namespace {
using chromeos::assistant::mojom::AssistantInteractionMetadata;
using chromeos::assistant::mojom::AssistantInteractionType;
#define EXPECT_INTERACTION_OF_TYPE(type_) \
({ \
base::Optional<AssistantInteractionMetadata> interaction = \
current_interaction(); \
ASSERT_TRUE(interaction.has_value()); \
EXPECT_EQ(interaction->type, type_); \
})
#define EXPECT_NO_INTERACTION() \
({ \
base::Optional<AssistantInteractionMetadata> interaction = \
current_interaction(); \
ASSERT_FALSE(interaction.has_value()); \
})
// Ensures that the given view has the focus. If it doesn't, this will print a
// nice error message indicating which view has the focus instead.
#define EXPECT_HAS_FOCUS(expected_) \
({ \
const views::View* actual = GetFocusedView(); \
EXPECT_TRUE(expected_->HasFocus()) \
<< "Expected focus on '" << expected_->GetClassName() \
<< "' but it is on '" << (actual ? actual->GetClassName() : "<null>") \
<< "'."; \
})
// Ensures that the given view does not have the focus. If it does, this will
// print a nice error message.
#define EXPECT_NOT_HAS_FOCUS(expected_) \
({ \
EXPECT_FALSE(expected_->HasFocus()) \
<< "'" << expected_->GetClassName() \
<< "' should not have the focus (but it does)."; \
})
views::View* AddTextfield(views::Widget* widget) {
auto* result = widget->GetContentsView()->AddChildView(
std::make_unique<views::Textfield>());
// Give the text field a non-zero size, otherwise things like tapping on it
// will fail.
result->SetSize(gfx::Size(20, 10));
return result;
}
// Stubbed |FocusChangeListener| that simply remembers all the views that
// received focus.
class FocusChangeListenerStub : public views::FocusChangeListener {
public:
explicit FocusChangeListenerStub(views::View* view)
: focus_manager_(view->GetFocusManager()) {
focus_manager_->AddFocusChangeListener(this);
}
~FocusChangeListenerStub() override {
focus_manager_->RemoveFocusChangeListener(this);
}
void OnWillChangeFocus(views::View* focused_before,
views::View* focused_now) override {}
void OnDidChangeFocus(views::View* focused_before,
views::View* focused_now) override {
focused_views_.push_back(focused_now);
}
// Returns all views that received the focus at some point.
const std::vector<views::View*>& focused_views() const {
return focused_views_;
}
private:
std::vector<views::View*> focused_views_;
views::FocusManager* focus_manager_;
DISALLOW_COPY_AND_ASSIGN(FocusChangeListenerStub);
};
// |ViewObserver| that simply remembers whether the given view was drawn
// on the screen at least once during the lifetime of this observer.
// Note this checks |IsDrawn| and not |GetVisible| because visibility is a
// local property which does not take any of the ancestors into account, and
// we do not care if the |observed_view| is marked as visible but its parent
// is not visible.
class VisibilityObserver : public views::ViewObserver {
public:
explicit VisibilityObserver(views::View* observed_view)
: observed_view_(observed_view) {
observed_view_->AddObserver(this);
UpdateWasDrawn();
}
~VisibilityObserver() override { observed_view_->RemoveObserver(this); }
void OnViewVisibilityChanged(views::View* view_or_ancestor,
views::View* starting_view) override {
UpdateWasDrawn();
}
bool was_drawn() const { return was_drawn_; }
private:
void UpdateWasDrawn() {
if (observed_view_->IsDrawn())
was_drawn_ = true;
}
views::View* const observed_view_;
bool was_drawn_ = false;
};
// Simply constructs a GestureEvent for test.
class GestureEventForTest : public ui::GestureEvent {
public:
GestureEventForTest(const gfx::Point& location,
ui::GestureEventDetails details)
: GestureEvent(location.x(),
location.y(),
/*flags=*/ui::EF_NONE,
base::TimeTicks(),
details) {}
private:
DISALLOW_COPY_AND_ASSIGN(GestureEventForTest);
};
class AssistantPageViewTest : public AssistantAshTestBase {
public:
AssistantPageViewTest() = default;
void ShowAssistantUiInTextMode() {
ShowAssistantUi(AssistantEntryPoint::kUnspecified);
EXPECT_TRUE(IsVisible());
}
void ShowAssistantUiInVoiceMode() {
ShowAssistantUi(AssistantEntryPoint::kHotword);
EXPECT_TRUE(IsVisible());
}
// Returns a point in the AppList, but outside the Assistant UI.
gfx::Point GetPointInAppListOutsideAssistantUi() {
gfx::Point result = GetPointOutside(page_view());
// Sanity check
EXPECT_TRUE(app_list_view()->bounds().Contains(result));
EXPECT_FALSE(page_view()->bounds().Contains(result));
return result;
}
gfx::Point GetPointOutside(const views::View* view) {
return gfx::Point(view->origin().x() - 10, view->origin().y() - 10);
}
gfx::Point GetPointInside(const views::View* view) {
return view->GetBoundsInScreen().CenterPoint();
}
void PressKey(ui::KeyboardCode key_code) {
// Any key press consists of 2 events, namely |press| and |release|.
GetEventGenerator()->PressKey(key_code, /*flags=*/ui::EF_NONE);
GetEventGenerator()->ReleaseKey(key_code, /*flags=*/ui::EF_NONE);
}
void PressKeyAndWait(ui::KeyboardCode key_code) {
PressKey(key_code);
base::RunLoop().RunUntilIdle();
}
ash::SuggestionChipView* CreateAndGetSuggestionChip(
const std::string& chip_query) {
MockTextInteraction().WithSuggestionChip(chip_query);
auto suggestion_chips = GetSuggestionChips();
DCHECK_EQ(suggestion_chips.size(), 1u);
return suggestion_chips[0];
}
const views::View* GetFocusedView() {
return main_view()->GetFocusManager()->GetFocusedView();
}
private:
DISALLOW_COPY_AND_ASSIGN(AssistantPageViewTest);
};
// Counts the number of Assistant interactions that are started.
class AssistantInteractionCounter
: private chromeos::assistant::DefaultAssistantInteractionSubscriber {
public:
explicit AssistantInteractionCounter(
chromeos::assistant::mojom::Assistant* service) {
service->AddAssistantInteractionSubscriber(BindNewPipeAndPassRemote());
}
AssistantInteractionCounter(AssistantInteractionCounter&) = delete;
AssistantInteractionCounter& operator=(AssistantInteractionCounter&) = delete;
~AssistantInteractionCounter() override = default;
int interaction_count() const { return interaction_count_; }
private:
// DefaultAssistantInteractionSubscriber implementation:
void OnInteractionStarted(
chromeos::assistant::mojom::AssistantInteractionMetadataPtr) override {
interaction_count_++;
}
int interaction_count_ = 0;
};
} // namespace
TEST_F(AssistantPageViewTest, ShouldStartAtMinimumHeight) {
ShowAssistantUi();
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kMinHeightEmbeddedDip, main_view()->size().height());
}
TEST_F(AssistantPageViewTest,
ShouldRemainAtMinimumHeightWhenDisplayingOneLiner) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse("Short one-liner");
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kMinHeightEmbeddedDip, main_view()->size().height());
}
TEST_F(AssistantPageViewTest, ShouldGetBiggerWithMultilineText) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse(
"This\ntext\nhas\na\nlot\nof\nlinebreaks.");
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kMaxHeightEmbeddedDip, main_view()->size().height());
}
TEST_F(AssistantPageViewTest, ShouldGetBiggerWhenWrappingTextLine) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse(
"This is a very long text without any linebreaks. "
"This will wrap, and should cause the Assistant view to get bigger. "
"If it doesn't, this looks really bad. This is what caused b/134963994.");
base::RunLoop().RunUntilIdle();
EXPECT_EQ(kMaxHeightEmbeddedDip, main_view()->size().height());
}
TEST_F(AssistantPageViewTest, ShouldNotRequestFocusWhenOtherAppWindowOpens) {
// This tests the root cause of b/141945964.
// Namely, the Assistant code should not request the focus while being closed.
ShowAssistantUi();
// Start observing all focus changes.
FocusChangeListenerStub focus_listener(main_view());
// Steal the focus by creating a new App window.
SwitchToNewAppWindow();
// This causes the Assistant UI to close.
ASSERT_FALSE(window()->IsVisible());
// Now check that no child view of our UI received the focus.
for (const views::View* view : focus_listener.focused_views()) {
EXPECT_FALSE(page_view()->Contains(view))
<< "Focus was received by Assistant view '" << view->GetClassName()
<< "' while Assistant was closing";
}
}
TEST_F(AssistantPageViewTest, ShouldFocusTextFieldWhenOpeningWithHotkey) {
ShowAssistantUi(AssistantEntryPoint::kHotkey);
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest, ShouldNotLoseTextfieldFocusWhenSendingTextQuery) {
ShowAssistantUi();
SendQueryThroughTextField("The query");
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest,
ShouldNotLoseTextfieldFocusWhenDisplayingResponse) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse("The response");
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest, ShouldNotLoseTextfieldFocusWhenResizing) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse(
"This\ntext\nis\nbig\nenough\nto\ncause\nthe\nassistant\nscreen\nto\n"
"resize.");
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest, FocusShouldRemainInAssistantViewWhenPressingTab) {
constexpr int kMaxIterations = 100;
ShowAssistantUi();
const views::View* initial_focused_view = GetFocusedView();
const views::View* focused_view;
int num_views = 0;
do {
PressKeyAndWait(ui::VKEY_TAB);
focused_view = GetFocusedView();
EXPECT_TRUE(page_view()->Contains(focused_view))
<< "Focus advanced to view '" << focused_view->GetClassName()
<< "' which is not a part of the Assistant UI";
// Sanity check to ensure we do not loop forever
num_views++;
ASSERT_LT(num_views, kMaxIterations);
} while (focused_view != initial_focused_view);
}
TEST_F(AssistantPageViewTest, ShouldFocusMicWhenOpeningWithHotword) {
ShowAssistantUi(AssistantEntryPoint::kHotword);
EXPECT_HAS_FOCUS(mic_view());
}
TEST_F(AssistantPageViewTest, ShouldShowGreetingLabelWhenOpening) {
ShowAssistantUi();
EXPECT_TRUE(greeting_label()->GetVisible());
}
TEST_F(AssistantPageViewTest, ShouldDismissGreetingLabelAfterQuery) {
ShowAssistantUi();
MockTextInteraction().WithTextResponse("The response");
EXPECT_FALSE(greeting_label()->GetVisible());
}
TEST_F(AssistantPageViewTest, ShouldShowGreetingLabelAgainAfterReopening) {
ShowAssistantUi();
// Cause the label to be hidden.
MockTextInteraction().WithTextResponse("The response");
ASSERT_FALSE(greeting_label()->GetVisible());
// Close and reopen the Assistant UI.
CloseAssistantUi();
ShowAssistantUi();
EXPECT_TRUE(greeting_label()->GetVisible());
}
TEST_F(AssistantPageViewTest,
ShouldNotShowGreetingLabelWhenOpeningFromSearchResult) {
ShowAssistantUi(AssistantEntryPoint::kLauncherSearchResult);
EXPECT_FALSE(greeting_label()->GetVisible());
}
TEST_F(AssistantPageViewTest, ShouldFocusMicViewWhenPressingVoiceInputToggle) {
ShowAssistantUiInTextMode();
ClickOnAndWait(voice_input_toggle());
EXPECT_HAS_FOCUS(mic_view());
}
TEST_F(AssistantPageViewTest,
ShouldStartVoiceInteractionWhenPressingVoiceInputToggle) {
ShowAssistantUiInTextMode();
ClickOnAndWait(voice_input_toggle());
EXPECT_INTERACTION_OF_TYPE(AssistantInteractionType::kVoice);
}
TEST_F(AssistantPageViewTest,
ShouldStopVoiceInteractionWhenPressingKeyboardInputToggle) {
ShowAssistantUiInVoiceMode();
EXPECT_INTERACTION_OF_TYPE(AssistantInteractionType::kVoice);
ClickOnAndWait(keyboard_input_toggle());
EXPECT_FALSE(current_interaction().has_value());
}
TEST_F(AssistantPageViewTest, ShouldShowOptInViewUnlessUserHasGivenConsent) {
ShowAssistantUi();
const views::View* suggestion_chips = suggestion_chip_container();
const views::View* opt_in = opt_in_view();
SetConsentStatus(ConsentStatus::kUnauthorized);
EXPECT_TRUE(opt_in->IsDrawn());
EXPECT_FALSE(suggestion_chips->IsDrawn());
SetConsentStatus(ConsentStatus::kNotFound);
EXPECT_TRUE(opt_in->IsDrawn());
EXPECT_FALSE(suggestion_chips->IsDrawn());
SetConsentStatus(ConsentStatus::kUnknown);
EXPECT_TRUE(opt_in->IsDrawn());
EXPECT_FALSE(suggestion_chips->IsDrawn());
SetConsentStatus(ConsentStatus::kActivityControlAccepted);
EXPECT_FALSE(opt_in->IsDrawn());
EXPECT_TRUE(suggestion_chips->IsDrawn());
}
TEST_F(AssistantPageViewTest, ShouldSubmitQueryWhenClickingOnSuggestionChip) {
ShowAssistantUi();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
ClickOnAndWait(suggestion_chip);
EXPECT_INTERACTION_OF_TYPE(AssistantInteractionType::kText);
EXPECT_EQ("<suggestion chip query>", current_interaction()->query);
}
TEST_F(AssistantPageViewTest,
ShouldSubmitQueryWhenPressingEnterOnSuggestionChip) {
ShowAssistantUi();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
suggestion_chip->RequestFocus();
PressKeyAndWait(ui::VKEY_RETURN);
EXPECT_INTERACTION_OF_TYPE(AssistantInteractionType::kText);
EXPECT_EQ("<suggestion chip query>", current_interaction()->query);
}
TEST_F(AssistantPageViewTest,
ShouldNotSubmitQueryWhenPressingSpaceOnSuggestionChip) {
ShowAssistantUi();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
suggestion_chip->RequestFocus();
PressKeyAndWait(ui::VKEY_SPACE);
EXPECT_NO_INTERACTION();
}
TEST_F(AssistantPageViewTest,
ShouldOnlySubmitOneQueryWhenClickingSuggestionChipMultipleTimes) {
ShowAssistantUi();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
AssistantInteractionCounter counter{assistant_service()};
ClickOnAndWait(suggestion_chip, /*check_if_view_can_process_events=*/false);
ClickOnAndWait(suggestion_chip, /*check_if_view_can_process_events=*/false);
ClickOnAndWait(suggestion_chip, /*check_if_view_can_process_events=*/false);
ClickOnAndWait(suggestion_chip, /*check_if_view_can_process_events=*/false);
EXPECT_EQ(1, counter.interaction_count());
}
TEST_F(AssistantPageViewTest,
ShouldOnlySubmitQueryFromFirstSuggestionChipClickedOn) {
ShowAssistantUi();
MockTextInteraction()
.WithSuggestionChip("<first query>")
.WithSuggestionChip("<second query>")
.WithSuggestionChip("<third query>");
auto suggestion_chips = GetSuggestionChips();
AssistantInteractionCounter counter{assistant_service()};
ClickOnAndWait(suggestion_chips[0]);
// All next clicks should be no-ops.
ClickOnAndWait(suggestion_chips[0],
/*check_if_view_can_process_events=*/false);
ClickOnAndWait(suggestion_chips[1],
/*check_if_view_can_process_events=*/false);
ClickOnAndWait(suggestion_chips[2],
/*check_if_view_can_process_events=*/false);
EXPECT_EQ(1, counter.interaction_count());
EXPECT_EQ("<first query>", current_interaction()->query);
}
TEST_F(AssistantPageViewTest,
SuggestionChipsShouldNotBeFocusableAfterSubmittingQuery) {
ShowAssistantUi();
MockTextInteraction()
.WithSuggestionChip("<first query>")
.WithSuggestionChip("<second query>")
.WithSuggestionChip("<third query>");
auto suggestion_chips = GetSuggestionChips();
suggestion_chips[0]->RequestFocus();
PressKeyAndWait(ui::VKEY_RETURN);
for (auto* suggestion_chip : suggestion_chips) {
EXPECT_FALSE(suggestion_chip->IsFocusable())
<< "Suggestion chip '" << suggestion_chip->GetText()
<< "' is still focusable";
}
}
TEST_F(AssistantPageViewTest,
ShouldFocusTextFieldWhenSubmittingSuggestionChipInTextMode) {
ShowAssistantUiInTextMode();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
suggestion_chip->RequestFocus();
PressKeyAndWait(ui::VKEY_RETURN);
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest,
ShouldFocusMicWhenSubmittingSuggestionChipInVoiceMode) {
ShowAssistantUi();
ash::SuggestionChipView* suggestion_chip =
CreateAndGetSuggestionChip("<suggestion chip query>");
ClickOnAndWait(voice_input_toggle());
suggestion_chip->RequestFocus();
PressKeyAndWait(ui::VKEY_RETURN);
EXPECT_HAS_FOCUS(mic_view());
}
TEST_F(AssistantPageViewTest,
ShouldFocusTextFieldWhenPressingKeyboardInputToggle) {
ShowAssistantUiInVoiceMode();
ClickOnAndWait(keyboard_input_toggle());
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTest,
ShouldNotScrollSuggestionChipsWhenSubmittingQuery) {
ShowAssistantUiInTextMode();
MockTextInteraction()
.WithSuggestionChip("there are x")
.WithSuggestionChip("enough queries x")
.WithSuggestionChip("to ensure x")
.WithSuggestionChip("the x")
.WithSuggestionChip("suggestion chips container x")
.WithSuggestionChip("can scroll. x");
views::View* chip = GetSuggestionChips()[3];
chip->RequestFocus();
chip->ScrollViewToVisible();
gfx::Rect initial_bounds = chip->GetBoundsInScreen();
PressKeyAndWait(ui::VKEY_RETURN);
gfx::Rect final_bounds = chip->GetBoundsInScreen();
EXPECT_EQ(initial_bounds, final_bounds);
}
TEST_F(AssistantPageViewTest, RememberAndShowHistory) {
ShowAssistantUiInTextMode();
EXPECT_HAS_FOCUS(input_text_field());
MockTextInteraction().WithQuery("query 1").WithTextResponse("response 1");
MockTextInteraction().WithQuery("query 2").WithTextResponse("response 2");
EXPECT_HAS_FOCUS(input_text_field());
EXPECT_TRUE(input_text_field()->GetText().empty());
PressKey(ui::VKEY_UP);
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 2"));
PressKey(ui::VKEY_UP);
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 1"));
PressKey(ui::VKEY_UP);
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 1"));
PressKey(ui::VKEY_DOWN);
EXPECT_EQ(input_text_field()->GetText(), base::UTF8ToUTF16("query 2"));
PressKey(ui::VKEY_DOWN);
EXPECT_TRUE(input_text_field()->GetText().empty());
}
TEST_F(AssistantPageViewTest, ShouldNotClearQueryWhenSwitchingToTabletMode) {
const base::string16 query_text = base::UTF8ToUTF16("unsubmitted query");
ShowAssistantUiInTextMode();
input_text_field()->SetText(query_text);
SetTabletMode(true);
EXPECT_HAS_FOCUS(input_text_field());
EXPECT_EQ(query_text, input_text_field()->GetText());
}
// Tests the |AssistantPageView| with tablet mode enabled.
class AssistantPageViewTabletModeTest : public AssistantPageViewTest {
public:
AssistantPageViewTabletModeTest() = default;
void SetUp() override {
AssistantPageViewTest::SetUp();
SetTabletMode(true);
}
// Ensures all views are created by showing and hiding the UI.
void CreateAllViews() {
ShowAssistantUi();
CloseAssistantUi();
}
void ShowAssistantUiInTextMode() {
// Note we launch in voice mode and switch to text because that was the
// easiest way I could get this working (we can't simply use |kUnspecified|
// as that puts us in voice mode.
ShowAssistantUiInVoiceMode();
TapOnAndWait(keyboard_input_toggle());
}
private:
DISALLOW_COPY_AND_ASSIGN(AssistantPageViewTabletModeTest);
};
TEST_F(AssistantPageViewTabletModeTest,
ShouldFocusMicWhenOpeningWithLongPressLauncher) {
ShowAssistantUi(AssistantEntryPoint::kLongPressLauncher);
EXPECT_HAS_FOCUS(mic_view());
}
TEST_F(AssistantPageViewTabletModeTest, ShouldFocusMicWhenOpeningWithHotword) {
ShowAssistantUi(AssistantEntryPoint::kHotword);
EXPECT_HAS_FOCUS(mic_view());
}
TEST_F(AssistantPageViewTabletModeTest, ShouldFocusTextFieldAfterSendingQuery) {
ShowAssistantUiInTextMode();
SendQueryThroughTextField("The query");
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissKeyboardAfterSendingQuery) {
ShowAssistantUiInTextMode();
EXPECT_TRUE(IsKeyboardShowing());
SendQueryThroughTextField("The query");
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotShowKeyboardWhenOpeningLauncherButNotAssistantUi) {
OpenLauncher();
base::RunLoop().RunUntilIdle();
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldShowKeyboardAfterTouchingInputTextbox) {
ShowAssistantUiInTextMode();
DismissKeyboard();
EXPECT_FALSE(IsKeyboardShowing());
TapOnAndWait(input_text_field());
EXPECT_TRUE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest, ShouldNotShowKeyboardWhenItsDisabled) {
// This tests the scenario where the keyboard is disabled even in tablet mode,
// e.g. when an external keyboard is connected to a tablet.
DisableKeyboard();
ShowAssistantUiInTextMode();
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldFocusTextFieldAfterPressingKeyboardInputToggle) {
ShowAssistantUiInVoiceMode();
EXPECT_NOT_HAS_FOCUS(input_text_field());
TapOnAndWait(keyboard_input_toggle());
EXPECT_HAS_FOCUS(input_text_field());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldShowKeyboardAfterPressingKeyboardInputToggle) {
ShowAssistantUiInVoiceMode();
EXPECT_FALSE(IsKeyboardShowing());
TapOnAndWait(keyboard_input_toggle());
EXPECT_TRUE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissKeyboardAfterPressingVoiceInputToggle) {
ShowAssistantUiInTextMode();
EXPECT_TRUE(IsKeyboardShowing());
TapOnAndWait(voice_input_toggle());
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissKeyboardWhenOpeningUiInVoiceMode) {
// Start by focussing a text field so the system has a reason to show the
// keyboard.
views::Widget* widget = SwitchToNewWidget();
auto* textfield = AddTextfield(widget);
TapOnAndWait(textfield);
ASSERT_TRUE(IsKeyboardShowing());
ShowAssistantUiInVoiceMode();
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissAssistantUiIfLostFocusWhenOtherAppWindowOpens) {
ShowAssistantUi();
// Create a new window to steal the focus which should dismiss the Assistant
// UI.
SwitchToNewAppWindow();
EXPECT_FALSE(IsVisible());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotShowKeyboardWhenClosingAssistantUI) {
// Note: This checks for a bug where the closing sequence of the UI switches
// the input mode to text which then shows the keyboard.
ShowAssistantUiInVoiceMode();
CloseAssistantUi();
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissKeyboardWhenClosingAssistantUI) {
ShowAssistantUiInTextMode();
EXPECT_TRUE(IsKeyboardShowing());
// Enable the animations because the fact that the switch-modality animation
// runs changes the timing enough that it triggers a potential bug where the
// keyboard remains visible after the UI is closed.
ui::ScopedAnimationDurationScaleMode enable_animations{
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION};
CloseAssistantUi();
EXPECT_FALSE(IsKeyboardShowing());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissAssistantUiWhenTappingAppListView) {
ShowAssistantUiInVoiceMode();
TapAndWait(GetPointInAppListOutsideAssistantUi());
EXPECT_FALSE(IsVisible());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldDismissKeyboardButNotAssistantUiWhenTappingAppListView) {
// Note: This is consistent with how the app list search box works;
// the first tap will dismiss the keyboard but not change the state of the
// search box.
ShowAssistantUiInTextMode();
EXPECT_TRUE(IsKeyboardShowing());
TapAndWait(GetPointInAppListOutsideAssistantUi());
EXPECT_FALSE(IsKeyboardShowing());
EXPECT_TRUE(IsVisible());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotDismissKeyboardWhenTappingInsideAssistantUi) {
ShowAssistantUiInTextMode();
EXPECT_TRUE(IsKeyboardShowing());
TapAndWait(GetPointInside(page_view()));
EXPECT_TRUE(IsKeyboardShowing());
EXPECT_TRUE(IsVisible());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotDismissAssistantUiWhenTappingInsideAssistantUi) {
ShowAssistantUi();
TapAndWait(GetPointInside(page_view()));
EXPECT_TRUE(IsVisible());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotFlickerTextInputWhenOpeningAssistantUI) {
// If the text input field is visible at any time when opening the Assistant
// UI, it will cause an unwanted visible animation (of the voice input
// animating in).
CreateAllViews();
VisibilityObserver text_field_observer(input_text_field());
ShowAssistantUiInVoiceMode();
EXPECT_FALSE(text_field_observer.was_drawn());
}
TEST_F(AssistantPageViewTabletModeTest,
ShouldNotFlickerTextInputWhenClosingAssistantUI) {
// Same as above but for the closing animation.
ShowAssistantUiInVoiceMode();
VisibilityObserver text_field_observer(input_text_field());
CloseAssistantUi();
EXPECT_FALSE(text_field_observer.was_drawn());
}
TEST_F(AssistantPageViewTabletModeTest, ShouldCloseAssistantUIInOverviewMode) {
ShowAssistantUi(AssistantEntryPoint::kLongPressLauncher);
EXPECT_TRUE(IsVisible());
StartOverview();
EXPECT_FALSE(IsVisible());
}
} // namespace ash
| endlessm/chromium-browser | ash/app_list/views/assistant/assistant_page_view_unittest.cc | C++ | bsd-3-clause | 27,575 |
from __future__ import unicode_literals
from django.db import models
from smartmin.models import SmartModel, ActiveManager
class Post(SmartModel):
title = models.CharField(max_length=128,
help_text="The title of this blog post, keep it relevant")
body = models.TextField(help_text="The body of the post, go crazy")
order = models.IntegerField(help_text="The order for this post, posts with smaller orders come first")
tags = models.CharField(max_length=128,
help_text="Any tags for this post")
objects = models.Manager()
active = ActiveManager()
@classmethod
def pre_create_instance(cls, field_dict):
field_dict['body'] = "Body: %s" % field_dict['body']
return field_dict
@classmethod
def prepare_fields(cls, field_dict, import_params=None, user=None):
field_dict['order'] = int(float(field_dict['order']))
return field_dict
@classmethod
def validate_import_header(cls, header):
if 'title' not in header:
raise Exception('missing "title" header')
def __unicode__(self):
return self.title
class Category(SmartModel):
name = models.SlugField(max_length=64, unique=True,
help_text="The name of this category")
| caktus/smartmin | test_runner/blog/models.py | Python | bsd-3-clause | 1,319 |
from __future__ import absolute_import
import pkgutil
import six
MODEL_MOVES = {
"sentry.models.tagkey.TagKey": "sentry.tagstore.legacy.models.tagkey.TagKey",
"sentry.models.tagvalue.tagvalue": "sentry.tagstore.legacy.models.tagvalue.TagValue",
"sentry.models.grouptagkey.GroupTagKey": "sentry.tagstore.legacy.models.grouptagkey.GroupTagKey",
"sentry.models.grouptagvalue.GroupTagValue": "sentry.tagstore.legacy.models.grouptagvalue.GroupTagValue",
"sentry.models.eventtag.EventTag": "sentry.tagstore.legacy.models.eventtag.EventTag",
}
class ModuleProxyCache(dict):
def __missing__(self, key):
if "." not in key:
return __import__(key)
module_name, class_name = key.rsplit(".", 1)
module = __import__(module_name, {}, {}, [class_name])
handler = getattr(module, class_name)
# We cache a NoneType for missing imports to avoid repeated lookups
self[key] = handler
return handler
_cache = ModuleProxyCache()
def import_string(path):
"""
Path must be module.path.ClassName
>>> cls = import_string('sentry.models.Group')
"""
path = MODEL_MOVES.get(path, path)
result = _cache[path]
return result
def import_submodules(context, root_module, path):
"""
Import all submodules and register them in the ``context`` namespace.
>>> import_submodules(locals(), __name__, __path__)
"""
for loader, module_name, is_pkg in pkgutil.walk_packages(path, root_module + "."):
# this causes a Runtime error with model conflicts
# module = loader.find_module(module_name).load_module(module_name)
module = __import__(module_name, globals(), locals(), ["__name__"])
for k, v in six.iteritems(vars(module)):
if not k.startswith("_"):
context[k] = v
context[module_name] = module
| mvaled/sentry | src/sentry/utils/imports.py | Python | bsd-3-clause | 1,880 |
from pyelectro import analysis as pye_analysis
from matplotlib import pyplot
file_name = "100pA_1a.csv"
t, v = pye_analysis.load_csv_data(file_name)
analysis_var = {
"peak_delta": 0.1,
"baseline": 0,
"dvdt_threshold": 2,
"peak_threshold": 0,
}
analysis = pye_analysis.IClampAnalysis(
v, t, analysis_var, start_analysis=150, end_analysis=900
)
res = analysis.analyse()
print res
pyplot.plot(t, v)
pyplot.suptitle("Data read in from: %s" % file_name)
pyplot.show()
| NeuralEnsemble/neurotune | examples/example_1/data_analysis.py | Python | bsd-3-clause | 489 |
// Copyright (c) 2017 Vivaldi Technologies AS. All rights reserved
#ifndef APP_VIVALDI_VERSION_CONSTANTS_H_
#define APP_VIVALDI_VERSION_CONSTANTS_H_
namespace vivaldi {
// All constants in alphabetical order. The constants should be documented
// alongside the definition of their values in the .cc file.
extern const char kVivaldiVersion[];
} // namespace vivaldi
#endif // APP_VIVALDI_VERSION_CONSTANTS_H_
| ric2b/Vivaldi-browser | app/vivaldi_version_constants.h | C | bsd-3-clause | 416 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.