Tags » 技术笔记

Compare two lists of objects by specific properties

Credit goes: http://stackoverflow.com/questions/19790211/comparing-two-lists-according-to-specific-properties .Net Except with IEqualityComparer
// define the Animal class
public class Animal
	public Guid Id { get; set; }
	public string AnimalName { get; set; }
	public bool HasTail { get; set; }
… 228 more words

Fastest way to insert 1 million rows

Here is the fastest way to insert 1 million rows to a table in SQL Server

Credit goes this post: Generate and Insert 1 million rows into simple table… 118 more words


Quick tip: start visual studio 2015 from git bash without hanging in terminal

Add one alias in your ~/.bashrc file:

alias vs='nohup /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio\ 14.0/Common7/IDE/devenv.exe $1 < /dev/null > /dev/null 2>&1 &'

Get table or view name by search column name keyword

Here is the script:

SELECT c.object_id,
     WHEN OBJECTPROPERTY(c.object_id, 'isTable') = 1
     THEN 'Yes' ELSE 'No' END AS IsTable,
     WHEN OBJECTPROPERTY(c.object_id, 'isView')  = 1
     THEN 'Yes' ELSE 'No' END AS IsView,
 OBJECT_SCHEMA_NAME(c.object_id) AS SchemaName,
 OBJECT_NAME(c.object_id) AS TableName,
 c.name AS ColumnName
 FROM sys.columns c
 WHERE c.name LIKE '%MyColumnName%'


    <meta content="width=device-width, 
initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />


$.ajaxFileUpload 不进success,前面加domain这一句

document.domain = 'localhost';        
$.ajaxFileUpload(            {                
url: "<?php echo base_url('index.php/Niche/do_upload')?>", //用于文件上传的服务器端请求地址                
secureuri: false, //是否需要安全协议,一般设置为false                
fileElementId:   "images", //文件上传域的ID                
dataType: 'json', //返回值类型 一般设置为json                
success: function (data)  //服务器成功响应处理函数                
//                    $("#img1").attr("src", data.imgurl);
//                    if (typeof (data.error) != 'undefined') {
//                        if (data.error != '') {
//                            alert(data.error);
//                        } else {
//                            alert(data.msg);
//                        }
//                    }                    alert('图片上传成功');                
},                error: function (data, e)//服务器响应失败处理函数                
{                    alert(e);                }            }        )

GRIFF's Prayer: Love For The Losers [EXCLUSIVE AUDIO]

In this edition of GRIFF’s Prayer, GRIFF is dealing with some questions he has about the Olympics. After watching Michael Phelps land a major win for the USA, he wondered about all of the athletes who made it all the way to the Olympics this year but didn’t win. 148 more words

Get Up!