用Swift语言重写Web Color这个类。

这次是用函数实现的,感觉也非常简洁。眼下(2014.6.28) Xcode 6的方法提示还不健全,就仅仅实现了用颜色名字创建颜色的功能。

最新代码&相关资料下载地址:https://github.com/duzixi/WebColors-with-Swift (持续维护)

使用方法说明:

WebColor.swift文件导入project,然后直接就能够使用:

self.view.backgroundColor =webColor("天蓝色");

以下上代码:

//
// WebColor.swift
//
// Created by 杜子兮 on 14-6-28.
// Copyright (c) 2014年 lanou. All rights reserved.
// import UIKit func webColor(value: String) -> UIColor { switch value {
case "lightPink", "浅粉红":
return UIColor(red: 255/255.0, green: 182/255.0, blue: 193/255.0, alpha: 1.0)
case "pink", "粉红":
return UIColor(red: 255/255.0, green: 192/255.0, blue: 203/255.0, alpha: 1.0)
case "crimson", "猩红":
return UIColor(red: 220/255.0, green: 20/255.0, blue: 60/255.0, alpha: 1.0)
case "lavenderBlush", "脸红的淡紫色":
return UIColor(red: 255/255.0, green: 240/255.0, blue: 245/255.0, alpha: 1.0)
case "paleVoiletRed", "苍白的紫罗兰红色":
return UIColor(red: 219/255.0, green: 112/255.0, blue: 147/255.0, alpha: 1.0)
case "hotPink", "热情的粉红":
return UIColor(red: 255/255.0, green: 105/255.0, blue: 180/255.0, alpha: 1.0)
case "deepPink", "深粉红":
return UIColor(red: 255/255.0, green: 20/255.0, blue: 147/255.0, alpha: 1.0)
case "mediumVoiletRed", "适中的紫罗兰红色":
return UIColor(red: 199/255.0, green: 21/255.0, blue: 133/255.0, alpha: 1.0)
case "orchid", "兰花的紫色":
return UIColor(red: 218/255.0, green: 112/255.0, blue: 214/255.0, alpha: 1.0)
case "thistle", "蓟":
return UIColor(red: 216/255.0, green: 191/255.0, blue: 216/255.0, alpha: 1.0)
case "plum", "李子":
return UIColor(red: 221/255.0, green: 160/255.0, blue: 221/255.0, alpha: 1.0)
case "violet", "紫罗兰":
return UIColor(red: 238/255.0, green: 130/255.0, blue: 238/255.0, alpha: 1.0)
case "magenta", "洋红":
return UIColor(red: 255/255.0, green: 0/255.0, blue: 255/255.0, alpha: 1.0)
case "fuchsia", "紫红色","灯笼海棠":
return UIColor(red: 255/255.0, green: 0/255.0, blue: 225/255.0, alpha: 1.0)
case "darkMagenta", "深洋红色":
return UIColor(red: 139/255.0, green: 0/255.0, blue: 139/255.0, alpha: 1.0)
case "purple", "紫色":
return UIColor(red: 128/255.0, green: 0/255.0, blue: 128/255.0, alpha: 1.0)
case "mediumOrchid", "适中的兰花紫":
return UIColor(red: 186/255.0, green: 85/255.0, blue: 211/255.0, alpha: 1.0)
case "darkViolet", "深紫罗兰色":
return UIColor(red: 148/255.0, green: 0/255.0, blue: 211/255.0, alpha: 1.0)
case "darkOrchid", "深兰花紫":
return UIColor(red: 153/255.0, green: 50/255.0, blue: 204/255.0, alpha: 1.0)
case "indigo", "靛青":
return UIColor(red: 75/255.0, green: 0/255.0, blue: 130/255.0, alpha: 1.0)
case "blueViolet", "紫罗兰的蓝色":
return UIColor(red: 138/255.0, green: 43/255.0, blue: 226/255.0, alpha: 1.0)
case "mediumPurple", "适中的紫色":
return UIColor(red: 147/255.0, green: 112/255.0, blue: 219/255.0, alpha: 1.0)
case "mediumSlateBlue", "适中的板岩暗蓝灰色":
return UIColor(red: 123/255.0, green: 104/255.0, blue: 238/255.0, alpha: 1.0)
case "slateBlue", "板岩暗蓝灰色":
return UIColor(red: 106/255.0, green: 90/255.0, blue: 205/255.0, alpha: 1.0)
case "darkSlateBlue", "深板岩暗蓝灰色":
return UIColor(red: 72/255.0, green: 61/255.0, blue: 139/255.0, alpha: 1.0)
case "lavender", "薰衣草花的淡紫色":
return UIColor(red: 230/255.0, green: 230/255.0, blue: 250/255.0, alpha: 1.0)
case "ghostWhite", "幽灵的白色":
return UIColor(red: 248/255.0, green: 248/255.0, blue: 255/255.0, alpha: 1.0)
case "blue", "纯蓝":
return UIColor(red: 0/255.0, green: 0/255.0, blue: 255/255.0, alpha: 1.0)
case "mediumBlue", "适中的蓝色":
return UIColor(red: 0/255.0, green: 0/255.0, blue: 205/255.0, alpha: 1.0)
case "midnightBlue", "午夜的蓝色":
return UIColor(red: 25/255.0, green: 25/255.0, blue: 112/255.0, alpha: 1.0)
case "darkBlue", "深蓝色":
return UIColor(red: 0/255.0, green: 0/255.0, blue: 139/255.0, alpha: 1.0)
case "navy", "海军蓝":
return UIColor(red: 0/255.0, green: 0/255.0, blue: 128/255.0, alpha: 1.0)
case "royalBlue", "皇家蓝":
return UIColor(red: 65/255.0, green: 105/255.0, blue: 225/255.0, alpha: 1.0)
case "cornflowerBlue", "矢车菊的蓝色":
return UIColor(red: 100/255.0, green: 149/255.0, blue: 237/255.0, alpha: 1.0)
case "lightSteelBlue", "淡钢蓝":
return UIColor(red: 176/255.0, green: 196/255.0, blue: 222/255.0, alpha: 1.0)
case "lightSlateGray", "浅石板灰":
return UIColor(red: 119/255.0, green: 136/255.0, blue: 153/255.0, alpha: 1.0)
case "slateGray", "石板灰":
return UIColor(red: 112/255.0, green: 128/255.0, blue: 144/255.0, alpha: 1.0)
case "dodgerBlue", "道奇蓝":
return UIColor(red: 30/255.0, green: 144/255.0, blue: 255/255.0, alpha: 1.0)
case "aliceBlue", "爱丽丝蓝":
return UIColor(red: 240/255.0, green: 248/255.0, blue: 255/255.0, alpha: 1.0)
case "steelBlue", "钢蓝":
return UIColor(red: 70/255.0, green: 130/255.0, blue: 180/255.0, alpha: 1.0)
case "lightSkyBlue", "淡天蓝色":
return UIColor(red: 135/255.0, green: 206/255.0, blue: 250/255.0, alpha: 1.0)
case "skyBlue", "天蓝色":
return UIColor(red: 135/255.0, green: 206/255.0, blue: 235/255.0, alpha: 1.0)
case "deepSkyBlue", "深天蓝":
return UIColor(red: 0/255.0, green: 191/255.0, blue: 255/255.0, alpha: 1.0)
case "lightBlue", "淡蓝":
return UIColor(red: 173/255.0, green: 216/255.0, blue: 230/255.0, alpha: 1.0)
case "powderBlue", "火药蓝":
return UIColor(red: 176/255.0, green: 224/255.0, blue: 230/255.0, alpha: 1.0)
case "cadetBlue", "军校蓝":
return UIColor(red: 95/255.0, green: 158/255.0, blue: 160/255.0, alpha: 1.0)
case "azure", "蔚蓝色":
return UIColor(red: 240/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)
case "lightCyan", "淡青色":
return UIColor(red: 224/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)
case "paleTurquoise", "苍白的绿宝石":
return UIColor(red: 175/255.0, green: 238/255.0, blue: 238/255.0, alpha: 1.0)
case "cyan", "青色":
return UIColor(red: 0/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)
case "aqua", "水绿色":
return UIColor(red: 0/255.0, green: 255/255.0, blue: 225/255.0, alpha: 1.0)
case "darkTurquoise", "深绿宝石":
return UIColor(red: 0/255.0, green: 206/255.0, blue: 209/255.0, alpha: 1.0)
case "darkSlateGray", "深石板灰":
return UIColor(red: 47/255.0, green: 79/255.0, blue: 79/255.0, alpha: 1.0)
case "darkCyan", "深青色":
return UIColor(red: 0/255.0, green: 139/255.0, blue: 139/255.0, alpha: 1.0)
case "teal", "水鸭色":
return UIColor(red: 0/255.0, green: 128/255.0, blue: 128/255.0, alpha: 1.0)
case "mediumTurquoise", "适中的绿宝石":
return UIColor(red: 72/255.0, green: 209/255.0, blue: 204/255.0, alpha: 1.0)
case "lightSeaGreen", "浅海洋绿":
return UIColor(red: 32/255.0, green: 178/255.0, blue: 170/255.0, alpha: 1.0)
case "turquoise", "绿宝石":
return UIColor(red: 64/255.0, green: 224/255.0, blue: 208/255.0, alpha: 1.0)
case "aquamarine", "碧绿色","绿玉":
return UIColor(red: 127/255.0, green: 255/255.0, blue: 212/255.0, alpha: 1.0)
case "mediumAquamarine", "适中的碧绿色":
return UIColor(red: 102/255.0, green: 205/255.0, blue: 170/255.0, alpha: 1.0)
case "mediumSpringGreen", "适中的春天的绿色":
return UIColor(red: 0/255.0, green: 250/255.0, blue: 154/255.0, alpha: 1.0)
case "mintCream", "薄荷奶油":
return UIColor(red: 245/255.0, green: 255/255.0, blue: 250/255.0, alpha: 1.0)
case "springGreen", "春天的绿色":
return UIColor(red: 0/255.0, green: 255/255.0, blue: 127/255.0, alpha: 1.0)
case "mediumSeaGreen", "适中的海洋绿":
return UIColor(red: 60/255.0, green: 179/255.0, blue: 113/255.0, alpha: 1.0)
case "seaGreen", "海洋绿":
return UIColor(red: 46/255.0, green: 139/255.0, blue: 87/255.0, alpha: 1.0)
case "honeydew", "蜂蜜":
return UIColor(red: 240/255.0, green: 255/255.0, blue: 240/255.0, alpha: 1.0)
case "lightGreen", "浅绿色":
return UIColor(red: 144/255.0, green: 238/255.0, blue: 144/255.0, alpha: 1.0)
case "paleGreen", "苍白的绿色":
return UIColor(red: 152/255.0, green: 251/255.0, blue: 152/255.0, alpha: 1.0)
case "darkSeaGreen", "深海洋绿":
return UIColor(red: 143/255.0, green: 188/255.0, blue: 143/255.0, alpha: 1.0)
case "limeGreen", "酸橙绿":
return UIColor(red: 50/255.0, green: 205/255.0, blue: 50/255.0, alpha: 1.0)
case "lime", "酸橙色":
return UIColor(red: 0/255.0, green: 255/255.0, blue: 0/255.0, alpha: 1.0)
case "forestGreen", "森林绿":
return UIColor(red: 34/255.0, green: 139/255.0, blue: 34/255.0, alpha: 1.0)
case "green", "纯绿":
return UIColor(red: 0/255.0, green: 128/255.0, blue: 0/255.0, alpha: 1.0)
case "darkGreen", "深绿色":
return UIColor(red: 0/255.0, green: 100/255.0, blue: 0/255.0, alpha: 1.0)
case "chartreuse", "查特酒绿":
return UIColor(red: 127/255.0, green: 255/255.0, blue: 0/255.0, alpha: 1.0)
case "lawnGreen", "草坪绿":
return UIColor(red: 124/255.0, green: 252/255.0, blue: 0/255.0, alpha: 1.0)
case "greenYellow", "绿黄色":
return UIColor(red: 173/255.0, green: 255/255.0, blue: 47/255.0, alpha: 1.0)
case "darkOliveGreen", "深橄榄绿":
return UIColor(red: 85/255.0, green: 107/255.0, blue: 47/255.0, alpha: 1.0)
case "yellowGreen", "黄绿色":
return UIColor(red: 154/255.0, green: 205/255.0, blue: 50/255.0, alpha: 1.0)
case "oliveDrab", "橄榄土褐色":
return UIColor(red: 107/255.0, green: 142/255.0, blue: 35/255.0, alpha: 1.0)
case "beige", "米色", "浅褐色":
return UIColor(red: 245/255.0, green: 245/255.0, blue: 220/255.0, alpha: 1.0)
case "lightGoldenrodYellow", "浅秋麒麟黄":
return UIColor(red: 250/255.0, green: 250/255.0, blue: 210/255.0, alpha: 1.0)
case "ivory", "象牙":
return UIColor(red: 255/255.0, green: 255/255.0, blue: 240/255.0, alpha: 1.0)
case "lightYellow", "浅黄色":
return UIColor(red: 255/255.0, green: 255/255.0, blue: 224/255.0, alpha: 1.0)
case "yellow", "纯黄":
return UIColor(red: 255/255.0, green: 255/255.0, blue: 0/255.0, alpha: 1.0)
case "olive", "橄榄":
return UIColor(red: 128/255.0, green: 128/255.0, blue: 0/255.0, alpha: 1.0)
case "darkKhaki", "深卡其布":
return UIColor(red: 189/255.0, green: 183/255.0, blue: 107/255.0, alpha: 1.0)
case "lemonChiffon", "柠檬薄纱":
return UIColor(red: 255/255.0, green: 250/255.0, blue: 205/255.0, alpha: 1.0)
case "paleGoldenrod", "灰秋麒麟":
return UIColor(red: 238/255.0, green: 232/255.0, blue: 170/255.0, alpha: 1.0)
case "khaki", "卡其布":
return UIColor(red: 240/255.0, green: 230/255.0, blue: 140/255.0, alpha: 1.0)
case "gold", "金":
return UIColor(red: 255/255.0, green: 215/255.0, blue: 0/255.0, alpha: 1.0)
case "cornsilk", "玉米色":
return UIColor(red: 255/255.0, green: 248/255.0, blue: 220/255.0, alpha: 1.0)
case "goldenrod", "秋麒麟":
return UIColor(red: 218/255.0, green: 165/255.0, blue: 32/255.0, alpha: 1.0)
case "darkGoldenrod", "深秋麒麟":
return UIColor(red: 218/255.0, green: 165/255.0, blue: 32/255.0, alpha: 1.0)
case "floralWhite", "花的白色":
return UIColor(red: 255/255.0, green: 250/255.0, blue: 240/255.0, alpha: 1.0)
case "oldLace", "老饰带":
return UIColor(red: 253/255.0, green: 245/255.0, blue: 230/255.0, alpha: 1.0)
case "wheat", "小麦色":
return UIColor(red: 245/255.0, green: 222/255.0, blue: 179/255.0, alpha: 1.0)
case "mocassin", "鹿皮鞋":
return UIColor(red: 255/255.0, green: 228/255.0, blue: 181/255.0, alpha: 1.0)
case "orange", "橙色":
return UIColor(red: 255/255.0, green: 165/255.0, blue: 0/255.0, alpha: 1.0)
case "papayaWhip", "番木瓜":
return UIColor(red: 255/255.0, green: 239/255.0, blue: 213/255.0, alpha: 1.0)
case "blanchedAlmond", "漂白的杏仁":
return UIColor(red: 255/255.0, green: 235/255.0, blue: 205/255.0, alpha: 1.0)
case "navajoWhite", "Navajo白":
return UIColor(red: 255/255.0, green: 222/255.0, blue: 173/255.0, alpha: 1.0)
case "antiqueWhite", "古代的白色":
return UIColor(red: 250/255.0, green: 235/255.0, blue: 215/255.0, alpha: 1.0)
case "tan", "晒黑":
return UIColor(red: 210/255.0, green: 180/255.0, blue: 140/255.0, alpha: 1.0)
case "burlyWood", "结实的树":
return UIColor(red: 222/255.0, green: 184/255.0, blue: 135/255.0, alpha: 1.0)
case "bisque", "浓汤":
return UIColor(red: 255/255.0, green: 228/255.0, blue: 196/255.0, alpha: 1.0)
case "darkOrange", "深橙色":
return UIColor(red: 255/255.0, green: 140/255.0, blue: 0/255.0, alpha: 1.0)
case "linen", "亚麻布":
return UIColor(red: 250/255.0, green: 240/255.0, blue: 230/255.0, alpha: 1.0)
case "peru", "秘鲁":
return UIColor(red: 205/255.0, green: 133/255.0, blue: 63/255.0, alpha: 1.0)
case "peachBuff", "桃色":
return UIColor(red: 255/255.0, green: 218/255.0, blue: 185/255.0, alpha: 1.0)
case "sandyBrown", "沙棕色":
return UIColor(red: 244/255.0, green: 164/255.0, blue: 96/255.0, alpha: 1.0)
case "chocolate", "巧克力":
return UIColor(red: 210/255.0, green: 105/255.0, blue: 30/255.0, alpha: 1.0)
case "saddleBrown", "马鞍棕色":
return UIColor(red: 139/255.0, green: 69/255.0, blue: 19/255.0, alpha: 1.0)
case "seaShell", "海贝壳":
return UIColor(red: 255/255.0, green: 245/255.0, blue: 238/255.0, alpha: 1.0)
case "sienna", "黄土赭色":
return UIColor(red: 160/255.0, green: 82/255.0, blue: 45/255.0, alpha: 1.0)
case "lightSalmon", "浅鲑鱼色", "浅鲜肉色":
return UIColor(red: 255/255.0, green: 160/255.0, blue: 122/255.0, alpha: 1.0)
case "coral", "珊瑚":
return UIColor(red: 255/255.0, green: 127/255.0, blue: 80/255.0, alpha: 1.0)
case "orangeRed", "橙红色":
return UIColor(red: 255/255.0, green: 69/255.0, blue: 0/255.0, alpha: 1.0)
case "darkSalmon", "深鲑鱼色", "深鲜肉色":
return UIColor(red: 233/255.0, green: 150/255.0, blue: 122/255.0, alpha: 1.0)
case "tomtato", "番茄":
return UIColor(red: 255/255.0, green: 99/255.0, blue: 71/255.0, alpha: 1.0)
case "mistyRose", "薄雾玫瑰":
return UIColor(red: 255/255.0, green: 228/255.0, blue: 225/255.0, alpha: 1.0)
case "salmon", "鲑鱼色", "鲜肉":
return UIColor(red: 250/255.0, green: 128/255.0, blue: 114/255.0, alpha: 1.0)
case "snow", "雪":
return UIColor(red: 255/255.0, green: 250/255.0, blue: 250/255.0, alpha: 1.0)
case "lightCoral", "淡珊瑚色":
return UIColor(red: 240/255.0, green: 128/255.0, blue: 128/255.0, alpha: 1.0)
case "rosyBrown", "玫瑰棕色":
return UIColor(red: 188/255.0, green: 143/255.0, blue: 143/255.0, alpha: 1.0)
case "indianRed", "印度红":
return UIColor(red: 205/255.0, green: 92/255.0, blue: 92/255.0, alpha: 1.0)
case "red", "纯红":
return UIColor(red: 255/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
case "brown", "棕色":
return UIColor(red: 165/255.0, green: 42/255.0, blue: 42/255.0, alpha: 1.0)
case "fireBrick", "耐火砖":
return UIColor(red: 178/255.0, green: 34/255.0, blue: 34/255.0, alpha: 1.0)
case "darkRed", "深红色":
return UIColor(red: 139/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
case "maroon", "栗色":
return UIColor(red: 128/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
case "white", "纯白":
return UIColor(red: 255/255.0, green: 255/255.0, blue: 255/255.0, alpha: 1.0)
case "whiteSmoke", "白烟":
return UIColor(red: 245/255.0, green: 245/255.0, blue: 245/255.0, alpha: 1.0)
case "gainsboro", "gainsboro":
return UIColor(red: 220/255.0, green: 220/255.0, blue: 220/255.0, alpha: 1.0)
case "lightGray", "浅灰色":
return UIColor(red: 211/255.0, green: 211/255.0, blue: 211/255.0, alpha: 1.0)
case "silver", "银白色":
return UIColor(red: 192/255.0, green: 192/255.0, blue: 192/255.0, alpha: 1.0)
case "darkGray", "深灰色":
return UIColor(red: 128/255.0, green: 128/255.0, blue: 128/255.0, alpha: 1.0)
case "gray", "灰色":
return UIColor(red: 169/255.0, green: 169/255.0, blue: 169/255.0, alpha: 1.0)
case "dimGray", "暗淡的灰色":
return UIColor(red: 105/255.0, green: 105/255.0, blue: 105/255.0, alpha: 1.0)
case "black", "纯黑":
return UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
default:
return UIColor.blackColor();
}
}

Web Color 颜色板:

写在后面:

中文名字做了一些调整,尽可能严格依照參照图上的名字做了修正。

英文名保持不变,首字母依旧小写。名字匹配功能会在日后慢慢完好。

【iOS】Web Color 的 Swift 实现的更多相关文章

  1. 《从零开始学Swift》学习笔记(Day2)——使用Web网站编写Swift代码

    Swift 2.0学习笔记——使用Web网站编写Swift代码 原创文章,欢迎转载.转载请注明:关东升的博客 Swift程序不能在Windows其他平台编译和运行,有人提供了一个网站swiftstub ...

  2. iOS Swift-简单值(The Swift Programming Language)

    iOS Swift-简单值(The Swift Programming Language) 常量的声明:let 在不指定类型的情况下声明的类型和所初始化的类型相同. //没有指定类型,但是初始化的值为 ...

  3. Swift技术之如何在iOS 8下使用Swift设计一个自定义的输入法 (主要是NSLayoutConstraint 的使用)

    当前位置: > Swift新手入门 > Swift技术之如何在iOS 8下使用Swift设计一个自定义的输入法 时间:2014-09-10 16:49来源:未知 作者:啊成 举报 点击:5 ...

  4. 【读书笔记】iOS-优化iOS Web应用

    一,代码优化: 代码优化是任何优化技术的第一步,因为归根结底网页上的一切都是构建在代码之上的.优秀的代码可以节省宽带,减少渲染延迟,以及提高页面的可读性和长远的可维护性.下面列出了一些在Web应用中编 ...

  5. iOS Web应用开发:运用HTML5、CSS3与JavaScript

    <iOS Web应用开发:运用HTML5.CSS3与JavaScript> 基本信息 原书名:Pro iOS web design and development:HTML5, CSS3, ...

  6. iOS圆角view的Swift实现(利用Core Graphics绘制)

    iOS圆角view的Swift实现(利用Core Graphics绘制) 因为app的列表用用到了圆形图片的头像,所以去探究并思考了一下这个问题.首先这个问题有两个方向的解决方案: 把图片弄成圆形的. ...

  7. 阻止iOS Web APP中点击链接跳转到Safari 浏览器新标签页

    问题:ios封装完之后,点击里边的按钮会跳转到网页上 ——小卡遇到这个问题就是这样解决的↓↓↓ 解决方法:建议将代码放到</head>标签前,当然,另外存为一个js 文件引用也是可以的呦~ ...

  8. iOS开发——技术精华Swift篇&Swift 2.0和Objective-C2.0混编之第三方框架的使用

    swift 语言是苹果公司在2014年的WWDC大会上发布的全新的编程语言.Swift语言继承了C语言以及Objective-C的特性,且克服了C语言的兼容性问题.Swift语言采用安全编程模式,且引 ...

  9. iOS开发——图形编程Swift篇&CAShapeLayer实现圆形图片加载动画

    CAShapeLayer实现圆形图片加载动画 几个星期之前,Michael Villar在Motion试验中创建一个非常有趣的加载动画. 下面的GIF图片展示这个加载动画,它将一个圆形进度指示器和圆形 ...

随机推荐

  1. Drools学习笔记-01-在eclipse indgo集成Drools5.5

    1.1.条件 Drools它是一个基于Java开源规则引擎.因此,使用Drools以及前需要安装在开发机器JDK周边环境,Drools5.5需要JDK版本号的1.5或者更多. 1.2.开发环境搭建 大 ...

  2. vs2008+opencv2.4.9 +win7X64位系统 2.

    小编用自身血淋淋的例子,来给大家做个参考,共耗时近2天时间,终于屈服于安装vs2010,然后配置成功了.但是在这个配置成功后,我终于发现了我08配置不成功的原因,写下心得,供各位参考 1.准备工具 v ...

  3. 前端编程提高之旅(六)----backbone实现todoMVC

                乐帝当年学习backbone时.最開始是看官网todoMVC的实现.后来了解到requireJS便于管理JS代码.就对官网代码做了requireJS管理.但此时乐帝感觉此时的t ...

  4. 淘宝分布式 key/value 存储引擎Tair安装部署过程及Javaclient測试一例

    文件夹 1. 简单介绍 2. 安装步骤及问题小记 3. 部署配置 4. Javaclient測试 5. 參考资料 声明 1. 以下的安装部署基于Linux系统环境:centos 6(64位),其他Li ...

  5. EF一次请求公用一个实例

    应用场景: 我们在程序开发时,对数据库的操作是必不可少的部分,常规的做法是直接使用Using()语句块,在用完后立即释放连接资源,这种做法在桌面应用程序中毫无问题,但是在Web程序中,尤其是在当今大数 ...

  6. MYSQL查询一周内的数据(最近7天的)、最近一个月、最近三个月数据

    如果你要严格要求是某一年的,那可以这样 查询一天: select * from table where to_days(column_time) = to_days(now()); select * ...

  7. c/c++中main函数参数讲解

    参考地址: http://blog.csdn.net/cnctloveyu/article/details/3905720 我们经常用的main函数都是不带参数的.因此main 后的括号都是空括号.实 ...

  8. 图像库---Image Datasets---OpenSift源代码---openSurf源代码

    1.Computer Vision Datasets on the web http://www.cvpapers.com/datasets.html 2.Dataset Reference http ...

  9. java中线程机制

    java中线程机制,一开始我们都用的单线程.现在接触到多线程了. 多线性首先要解决的问题是:创建线程,怎么创建线程的问题: 1.线程的创建: 四种常用的实现方法 1.继承Thread. Thread是 ...

  10. JDBC与反射

    什么是JDBC Java定义了一套关于连接使用数据库的规范(接口)叫做JDBC,许多数据库厂商实现了这个规范,所以我们可以通过Java提供的接口编程,使得我们更换数据库的时候不用修改原来的代码,只需要 ...