public class Utility:Page
{ #region 数据转换
/// <summary>
/// 返回对象obj的String值,obj为null时返回空值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>字符串。</returns>
public static string ToObjectString(object obj)
{
return null == obj ? String.Empty : obj.ToString();
} /// <summary>
/// 将对象转换为数值(Int32)类型,转换失败返回-1。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Int32数值。</returns>
public static int ToInt(object obj)
{
try
{
return int.Parse(ToObjectString(obj));
}
catch
{ return -; }
} /// <summary>
/// 将对象转换为数值(Int32)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Int32数值。</returns>
public static int ToInt(object obj,int returnValue)
{
try
{
return int.Parse(ToObjectString(obj));
}
catch
{ return returnValue; }
}
/// <summary>
/// 将对象转换为数值(Long)类型,转换失败返回-1。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Long数值。</returns>
public static long ToLong(object obj)
{
try
{
return long.Parse(ToObjectString(obj));
}
catch
{ return -1L; }
}
/// <summary>
/// 将对象转换为数值(Long)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Long数值。</returns>
public static long ToLong(object obj,long returnValue)
{
try
{
return long.Parse(ToObjectString(obj));
}
catch
{ return returnValue; }
}
/// <summary>
/// 将对象转换为数值(Decimal)类型,转换失败返回-1。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Decimal数值。</returns>
public static decimal ToDecimal(object obj)
{
try
{
return decimal.Parse(ToObjectString(obj));
}
catch
{ return -1M; }
} /// <summary>
/// 将对象转换为数值(Decimal)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Decimal数值。</returns>
public static decimal ToDecimal(object obj,decimal returnValue)
{
try
{
return decimal.Parse(ToObjectString(obj));
}
catch
{ return returnValue; }
}
/// <summary>
/// 将对象转换为数值(Double)类型,转换失败返回-1。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Double数值。</returns>
public static double ToDouble(object obj)
{
try
{
return double.Parse(ToObjectString(obj));
}
catch
{ return -; }
} /// <summary>
/// 将对象转换为数值(Double)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Double数值。</returns>
public static double ToDouble(object obj,double returnValue)
{
try
{
return double.Parse(ToObjectString(obj));
}
catch
{ return returnValue; }
}
/// <summary>
/// 将对象转换为数值(Float)类型,转换失败返回-1。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Float数值。</returns>
public static float ToFloat(object obj)
{
try
{
return float.Parse(ToObjectString(obj));
}
catch
{ return -; }
} /// <summary>
/// 将对象转换为数值(Float)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Float数值。</returns>
public static float ToFloat(object obj,float returnValue)
{
try
{
return float.Parse(ToObjectString(obj));
}
catch
{ return returnValue; }
}
/// <summary>
/// 将对象转换为数值(DateTime)类型,转换失败返回Now。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>DateTime值。</returns>
public static DateTime ToDateTime(object obj)
{
try
{
DateTime dt = DateTime.Parse(ToObjectString(obj));
if( dt > DateTime.MinValue && DateTime.MaxValue > dt)
return dt;
return DateTime.Now;
}
catch
{ return DateTime.Now; }
} /// <summary>
/// 将对象转换为数值(DateTime)类型。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>DateTime值。</returns>
public static DateTime ToDateTime(object obj,DateTime returnValue)
{
try
{
DateTime dt = DateTime.Parse(ToObjectString(obj));
if( dt > DateTime.MinValue && DateTime.MaxValue > dt)
return dt;
return returnValue;
}
catch
{ return returnValue; }
}
/// <summary>
/// 从Boolean转换成byte,转换失败返回0。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Byte值。</returns>
public static byte ToByteByBool( object obj )
{
string text = ToObjectString(obj).Trim();
if( text == string.Empty)
return ;
else
{
try
{
return (byte)(text.ToLower()=="true"?:);
}
catch
{
return ;
}
}
} /// <summary>
/// 从Boolean转换成byte。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Byte值。</returns>
public static byte ToByteByBool( object obj, byte returnValue )
{
string text = ToObjectString(obj).Trim();
if( text == string.Empty)
return returnValue;
else
{
try
{
return (byte)(text.ToLower()=="true"?:);
}
catch
{
return returnValue;
}
}
}
/// <summary>
/// 从byte转换成Boolean,转换失败返回false。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Boolean值。</returns>
public static bool ToBoolByByte( object obj )
{
try
{
string s = ToObjectString(obj).ToLower();
return s == "" || s== "true"?true:false;
}
catch
{
return false;
}
}
/// <summary>
/// 从byte转换成Boolean。
/// </summary>
/// <param name="obj">对象。</param>
/// <param name="returnValue">转换失败返回该值。</param>
/// <returns>Boolean值。</returns>
public static bool ToBoolByByte( object obj, bool returnValue )
{
try
{
string s = ToObjectString(obj).ToLower();
return s == "" || s== "true"?true:false;
}
catch
{
return returnValue;
}
}
#endregion #region 数据判断
/// <summary>
/// 判断文本obj是否为空值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Boolean值。</returns>
public static bool IsEmpty(string obj)
{
return ToObjectString(obj).Trim() == String.Empty ? true : false;
} /// <summary>
/// 判断对象是否为正确的日期值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Boolean。</returns>
public static bool IsDateTime(object obj)
{
try
{
DateTime dt = DateTime.Parse(ToObjectString(obj));
if( dt > DateTime.MinValue && DateTime.MaxValue > dt)
return true;
return false;
}
catch
{ return false; }
} /// <summary>
/// 判断对象是否为正确的Int32值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Int32值。</returns>
public static bool IsInt(object obj)
{
try
{
int.Parse(ToObjectString(obj));
return true;
}
catch
{ return false; }
} /// <summary>
/// 判断对象是否为正确的Long值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Long值。</returns>
public static bool IsLong(object obj)
{
try
{
long.Parse(ToObjectString(obj));
return true;
}
catch
{ return false; }
} /// <summary>
/// 判断对象是否为正确的Float值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Float值。</returns>
public static bool IsFloat(object obj)
{
try
{
float.Parse(ToObjectString(obj));
return true;
}
catch
{ return false; }
} /// <summary>
/// 判断对象是否为正确的Double值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Double值。</returns>
public static bool IsDouble(object obj)
{
try
{
double.Parse(ToObjectString(obj));
return true;
}
catch
{ return false; }
} /// <summary>
/// 判断对象是否为正确的Decimal值。
/// </summary>
/// <param name="obj">对象。</param>
/// <returns>Decimal值。</returns>
public static bool IsDecimal(object obj)
{
try
{
decimal.Parse(ToObjectString(obj));
return true;
}
catch
{ return false; }
}
#endregion #region 数据操作
/// <summary>
/// 去除字符串的所有空格。
/// </summary>
/// <param name="text">字符串</param>
/// <returns>字符串</returns>
public static string StringTrimAll( string text )
{
string _text = ToObjectString(text);
string returnText = String.Empty;
char[] chars = _text.ToCharArray();
for( int i=;i<chars.Length;i++)
{
if( chars[i].ToString() != string.Empty)
returnText += chars[i].ToString();
}
return returnText;
} /// <summary>
/// 去除数值字符串的所有空格。
/// </summary>
/// <param name="numricString">数值字符串</param>
/// <returns>String</returns>
public static string NumricTrimAll( string numricString )
{
string text = ToObjectString(numricString).Trim();
string returnText = String.Empty;
char[] chars = text.ToCharArray();
for( int i=;i<chars.Length;i++)
{
if( chars[i].ToString() == "+" || chars[i].ToString() == "-" || IsDouble( chars[i].ToString()) )
returnText += chars[i].ToString();
}
return returnText;
} /// <summary>
/// 在数组中查找匹配对象类型
/// </summary>
/// <param name="array">数组</param>
/// <param name="obj">对象</param>
/// <returns>Boolean</returns>
public static bool ArrayFind(Array array,object obj)
{
bool b = false;
foreach(object obj1 in array)
{
if(obj.Equals(obj1))
{
b = true;
break;
}
}
return b;
} /// <summary>
/// 在数组中查找匹配字符串
/// </summary>
/// <param name="array">数组</param>
/// <param name="obj">对象</param>
/// <param name="unUpLower">是否忽略大小写</param>
/// <returns>Boolean</returns>
public static bool ArrayFind(Array array,string obj,bool unUpLower)
{
bool b = false;
foreach(string obj1 in array)
{
if(!unUpLower)
{
if(obj.Trim().Equals(obj1.ToString().Trim()))
{
b = true;
break;
}
}
else
{
if(obj.Trim().ToUpper().Equals(obj1.ToString().Trim().ToUpper()))
{
b = true;
break;
}
}
}
return b;
}
/// <summary>
/// 替换字符串中的单引号。
/// </summary>
/// <param name="inputString">字符串</param>
/// <returns>String</returns>
public static string ReplaceInvertedComma( string inputString )
{
return inputString.Replace("'","''");
} /// <summary>
/// 判断两个字节数组是否具有相同值.
/// </summary>
/// <param name="bytea">字节1</param>
/// <param name="byteb">字节2</param>
/// <returns>Boolean</returns>
public static bool CompareByteArray(byte[] bytea,byte[] byteb)
{
if(null == bytea || null == byteb)
{
return false;
}
else
{
int aLength = bytea.Length;
int bLength = byteb.Length;
if(aLength != bLength)
return false;
else
{
bool compare = true;
for(int index = ; index < aLength; index++)
{
if(bytea[index].CompareTo(byteb[index]) != )
{
compare = false;
break;
}
}
return compare;
}
}
} /// <summary>
/// 日期智能生成。
/// </summary>
/// <param name="inputText">字符串</param>
/// <returns>DateTime</returns>
public static string BuildDate( string inputText )
{
try
{
return DateTime.Parse( inputText ).ToShortDateString();
}
catch
{
string text = NumricTrimAll( inputText );
string year = DateTime.Now.Year.ToString();
string month = DateTime.Now.Month.ToString();
string day = DateTime.Now.Day.ToString();
int length = text.Length;
if( length == )
return String.Empty;
else
{
if( length<= )
day = text;
else if( length<= )
{
month = text.Substring(,);
day = text.Substring(,length-);
}
else if( length<= )
{
year = text.Substring(,);
month = text.Substring(,length-);
}
else if( length>)
{
year = text.Substring(,);
month = text.Substring(,);
day = text.Substring(,length-);
}
try
{
return DateTime.Parse( year+"-"+month+"-"+day ).ToShortDateString();
}
catch
{
return String.Empty;
}
}
}
} /// <summary>
/// 检查文件是否真实存在。
/// </summary>
/// <param name="path">文件全名(包括路径)。</param>
/// <returns>Boolean</returns>
public static bool IsFileExists(string path)
{
try
{
return File.Exists(path);
}
catch
{ return false; }
} /// <summary>
/// 检查目录是否真实存在。
/// </summary>
/// <param name="path">目录路径.</param>
/// <returns>Boolean</returns>
public static bool IsDirectoryExists(string path)
{
try
{
return Directory.Exists(Path.GetDirectoryName(path));
}
catch
{ return false; }
} /// <summary>
/// 查找文件中是否存在匹配行。
/// </summary>
/// <param name="fi">目标文件.</param>
/// <param name="lineText">要查找的行文本.</param>
/// <param name="lowerUpper">是否区分大小写.</param>
/// <returns>Boolean</returns>
public static bool FindLineTextFromFile(FileInfo fi,string lineText,bool lowerUpper)
{
bool b = false;
try
{
if(fi.Exists)
{
StreamReader sr=new StreamReader(fi.FullName);
string g = "";
do
{
g=sr.ReadLine();
if(lowerUpper)
{
if(ToObjectString(g).Trim() == ToObjectString(lineText).Trim())
{
b = true;
break;
}
}
else
{
if(ToObjectString(g).Trim().ToLower() == ToObjectString(lineText).Trim().ToLower())
{
b = true;
break;
}
}
}
while(sr.Peek()!=-);
sr.Close();
}
}
catch
{ b =false; }
return b;
} /// <summary>
/// 判断父子级关系是否正确。
/// </summary>
/// <param name="table">数据表。</param>
/// <param name="columnName">子键列名。</param>
/// <param name="parentColumnName">父键列名。</param>
/// <param name="inputString">子键值。</param>
/// <param name="compareString">父键值。</param>
/// <returns></returns>
public static bool IsRightParent(DataTable table,string columnName,string parentColumnName,string inputString,string compareString)
{
ArrayList array = new ArrayList();
SearchChild(array,table,columnName,parentColumnName,inputString,compareString);
return array.Count == ;
} // 内部方法
private static void SearchChild(ArrayList array,DataTable table,string columnName,string parentColumnName,string inputString,string compareString)
{
DataView view = new DataView(table);
view.RowFilter = parentColumnName+"='"+ReplaceInvertedComma(inputString.Trim())+"'";//找出所有的子类。
//查找表中的数据的ID是否与compareString相等,相等返回 false;不相等继续迭代。
for(int index = ;index < view.Count;index ++)
{
if(Utility.ToObjectString(view[index][columnName]).ToLower() == compareString.Trim().ToLower())
{
array.Add("");
break;
}
else
{
SearchChild(array,table,columnName,parentColumnName,Utility.ToObjectString(view[index][columnName]),compareString);
}
}
} #endregion #region 日期 /// <summary>
/// 格式化日期类型,返回字符串
/// </summary>
/// <param name="dtime">日期</param>
/// <param name="s">日期年月日间隔符号</param>
/// <returns></returns>
public static String Fomatdate(DateTime dtime,String s)
{
String datestr="";
datestr=dtime.Year.ToString() + s + dtime.Month.ToString().PadLeft(,'')+ s +dtime.Day.ToString().PadLeft(,'');
return datestr;
} /// <summary>
/// 返回日期差
/// </summary>
/// <param name="sdmin">开始日期</param>
/// <param name="sdmax">结束日期</param>
/// <returns>日期差:负数为失败</returns>
public static int Datediff(DateTime sdmin,DateTime sdmax)
{
try
{
double i=;
while(sdmin.AddDays(i)<sdmax)
{
i++;
}
return Utility.ToInt(i);
}
catch
{
return -;
}
} /// <summary>
/// 返回日期差
/// </summary>
/// <param name="sdmin">开始日期</param>
/// <param name="sdmax">结束日期</param>
/// <returns>日期差:负数为失败</returns>
public static int Datediff(String sdmin,String sdmax)
{
try
{
DateTime dmin;
DateTime dmax;
dmin=DateTime.Parse(sdmin);
dmax=DateTime.Parse(sdmax);
double i=;
while(dmin.AddDays(i)<dmax)
{
i++;
}
return Utility.ToInt(i);
}
catch
{
return -;
}
} #endregion #region 转换用户输入 /// <summary>
/// 将用户输入的字符串转换为可换行、替换Html编码、无危害数据库特殊字符、去掉首尾空白、的安全方便代码。
/// </summary>
/// <param name="inputString">用户输入字符串</param>
public static string ConvertStr(string inputString)
{
string retVal=inputString;
//retVal=retVal.Replace("&","&amp;");
retVal=retVal.Replace("\"","&quot;");
retVal=retVal.Replace("<","&lt;");
retVal=retVal.Replace(">","&gt;");
retVal=retVal.Replace(" ","&nbsp;");
retVal=retVal.Replace(" ","&nbsp;&nbsp;");
retVal=retVal.Replace("\t","&nbsp;&nbsp;");
retVal=retVal.Replace("\r", "<br>");
return retVal;
} public static string InputText(string inputString)
{
string retVal=inputString;
retVal= ConvertStr(retVal);
retVal=retVal.Replace("[url]", "");
retVal=retVal.Replace("[/url]", "");
return retVal;
} /// <summary>
/// 将html代码显示在网页上
/// </summary>
/// <param name="inputString"></param>
/// <returns></returns>
public static string OutputText(string inputString)
{
string retVal=System.Web.HttpUtility.HtmlDecode(inputString);
retVal=retVal.Replace("<br>","");
retVal=retVal.Replace("&amp","&;");
retVal=retVal.Replace("&quot;","\"");
retVal=retVal.Replace("&lt;","<");
retVal=retVal.Replace("&gt;",">");
retVal=retVal.Replace("&nbsp;"," ");
retVal=retVal.Replace("&nbsp;&nbsp;"," ");
return retVal;
} public static string ToUrl(string inputString)
{
string retVal=inputString;
retVal= ConvertStr(retVal);
return Regex.Replace(retVal,@"\[url](?<x>[^\]]*)\[/url]",@"<a href=""$1"" target=""_blank"">$1</a>",RegexOptions.IgnoreCase);
} public static string GetSafeCode(string str)
{
str=str.Replace("'","");
str=str.Replace(char.Parse(""),' ');
str=str.Replace(";","");
return str;
} #endregion //#region 弹出框 ///// <summary>
///// 服务器端弹出alert对话框
///// </summary>
///// <param name="str_Message">提示信息,例子:"请输入您姓名!"</param>
///// <param name="page">Page类</param>
//public static void Alert(string str_Message,Page page)
//{
// page.RegisterStartupScript("","<script>alert('"+str_Message+"');</script>");
//}
///// <summary>
///// 服务器端弹出alert对话框
///// </summary>
///// <param name="str_Ctl_Name">获得焦点控件Id值,比如:txt_Name</param>
///// <param name="str_Message">提示信息,例子:"请输入您姓名!"</param>
///// <param name="page">Page类</param>
//public static void Alert(string str_Ctl_Name,string str_Message,Page page)
//{
// page.RegisterStartupScript("","<script>alert('"+str_Message+"');document.forms(0)."+str_Ctl_Name+".focus(); document.forms(0)."+str_Ctl_Name+".select();</script>");
//}
///// <summary>
///// 服务器端弹出confirm对话框,该函数有个弊端,必须放到响应事件的最后,目前没有妥善解决方案
///// </summary>
///// <param name="str_Message">提示信息,例子:"您是否确认删除!"</param>
///// <param name="btn">隐藏Botton按钮Id值,比如:btn_Flow</param>
///// <param name="page">Page类</param>
//public static void Confirm(string str_Message,string btn,Page page)
//{
// page.RegisterStartupScript("","<script> if (confirm('"+str_Message+"')==true){document.forms(0)."+btn+".click();}</script>");
//}
///// <summary>
///// 服务器端弹出confirm对话框,询问用户准备转向相应操作,包括“确定”和“取消”时的操作
///// </summary>
///// <param name="str_Message">提示信息,比如:"成功增加数据,单击\"确定\"按钮填写流程,单击\"取消\"修改数据"</param>
///// <param name="btn_Redirect_Flow">"确定"按钮id值</param>
///// <param name="btn_Redirect_Self">"取消"按钮id值</param>
///// <param name="page">Page类</param>
//public static void Confirm(string str_Message,string btn_Redirect_Flow,string btn_Redirect_Self,Page page)
//{
// page.RegisterStartupScript("","<script> if (confirm('"+str_Message+"')==true){document.forms(0)."+btn_Redirect_Flow+".click();}else{document.forms(0)."+btn_Redirect_Self+".click();}</script>");
//} //#endregion /// <summary>
/// 设置绑定到DataGrid的DataTable的记录行数,如不够则添加空行
/// </summary>
/// <param name="myDataTable">数据表</param>
/// <param name="intPageCount">DataGrid分页时每页行数</param>
public static void SetTableRows(DataTable myDataTable,int intPageCount)
{
try
{
int intTemp=myDataTable.Rows.Count%intPageCount;
if ((myDataTable.Rows.Count==) || (intTemp!=))
{
for(int i=;i<(intPageCount-intTemp);i++)
{
DataRow myDataRow=myDataTable.NewRow();
myDataTable.Rows.Add(myDataRow);
}
}
}
catch
{
throw;
}
} public static string GetGuid(string guid)
{
return guid.Replace("-", "");
} public static string ReadConfig(string filePath)
{
return System.Configuration.ConfigurationManager.AppSettings[filePath];
} #region 字符串长度区分中英文截取
/// <summary>
/// 截取文本,区分中英文字符,中文算两个长度,英文算一个长度
/// </summary>
/// <param name="str">待截取的字符串</param>
/// <param name="length">需计算长度的字符串</param>
/// <returns>string</returns>
public static string GetSubString(string str, int length)
{
string temp = str;
int j = ;
int k = ;
for (int i = ; i < temp.Length; i++)
{
if (Regex.IsMatch(temp.Substring(i, ), @"[\u4e00-\u9fa5]+"))
{
j += ;
}
else
{
j += ;
}
if (j <= length)
{
k += ;
}
if (j > length)
{
return temp.Substring(, k) + "...";
}
}
return temp;
}
#endregion
}

C#常用方法集合的更多相关文章

  1. android 常用方法集合

    private static Contextcontext; privatestatic Displaydisplay; private static String TAG = "MyToo ...

  2. php 操作 mysql 数据库常用方法集合

    参考: https://www.runoob.com/php/php-pdo.html https://www.cnblogs.com/feng18/p/6523646.html https://bl ...

  3. java String 常用方法集合

    String a = "abc";String b = "abc";a==b ;//返回true,因为a,b指向的是同一个地址 String a = new S ...

  4. JS 数组,对象常用方法 集合

    数组 1.数组去重:   主要是使用的 new Set() 方法     https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Referen ...

  5. selenium常用方法集合

    一.selenium定位元素的8种方法: 1.find_element_by_id() 2.find_element_by_name() 3.find_element_by_css() 4.find_ ...

  6. java常用方法集合

    1.获取当前日期 // 获取当前日期 public Date getDate(int num) { Calendar cal = new GregorianCalendar(); cal.setTim ...

  7. js常用方法集合

    1.数组去重 // 思路:获取没重复的最右一值放入新数组 /* * 推荐的方法 * * 方法的实现代码相当酷炫, * 实现思路:获取没重复的最右一值放入新数组. * (检测到有重复值时终止当前循环同时 ...

  8. Python 全栈开发二 python基础 字符串 字典 集合

    一.字符串 1,在python中,字符串是最为常见的数据类型,一般情况下用引号来创建字符串. >>ch = "wallace" >>ch1 = 'walla ...

  9. Postman-常用方法集合

    postman常用方法集合: 1.设置环境变量 postman.setEnvironmentVariable("key", "value"); pm.envir ...

随机推荐

  1. WPF QuickStart系列之样式和模板(Style and Template)

    在WPF桌面程序中,当我们想构建一个统一的UI表现时(在不同操作系统下,显示效果一致),此时我们就需要使用到WPF中的样式和模板技术.简单来说,如果我们需要简单的给一个Button设置宽,高,Marg ...

  2. bbed的使用--查看数据文件信息 & sid信息

    1.得到文件的块大小和数据块个数 在Linux和Unix上,oracle提供了一个小工具dbfsize用于查看文件块大小 (可以参看[ID:360032.1]How to detect and fix ...

  3. HDU 2896 病毒侵袭(AC自动机)

    病毒侵袭 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  4. barabasilab-networkScience学习笔记6-evolving networks

    第一次接触复杂性科学是在一本叫think complexity的书上,Allen博士很好的讲述了数据结构与复杂性科学,barabasi是一个知名的复杂性网络科学家,barabasilab则是他所主导的 ...

  5. Spring官网改版后下载

    Spring官网改版后找了好久都没有找到直接下载Jar包的链接,下面汇总些网上提供的方法,亲测可用. 1.直接输入地址,改相应版本即可:http://repo.springsource.org/lib ...

  6. SecureCRT上传和下载文件(下载默认目录)

    SecureCR 下的文件传输协议有ASCII .Xmodem .Ymodem .Zmodem ASCII:这是最快的传输协议,但只能传送文本文件. Xmodem:这种古老的传输协议速度较慢,但由于使 ...

  7. POJ 3067 Japan(经典树状数组)

    基础一维树状数组  题意:左边一排 1-n 的城市,右边一排 1-m 的城市,都从上到下依次对应.接着给你一些城市对,表示城市这两个城市相连,最后问你一共有多少个交叉,其中处于城市处的交叉不算并且每个 ...

  8. Liferay 6.2 改造系列之十六:关闭OpenID模式的单点登录

    在/portal-master/portal-impl/src/portal.properties文件中,有如下配置: # # Set this to true to enable OpenId au ...

  9. shell-bash学习01基础、打印、环境变量

    基础 终端提示符: username@hostname$; $: 一般用户 #:root用户 运行脚本 Bash执行: * bash script.sh; 直接运行: 脚本开头添加shebang起始: ...

  10. Delphi 2009 泛型容器单元(Generics.Collections)[1]: TList<T>

    Delphi 2009 新增了泛型容器单元: Generics.Collections, 同时还有一个 Generics.Defaults 单元做支持. Generics.Collections 包含 ...