Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Solution: 1 public class Solution { 2 pu...
分类:
其他好文 时间:
2014-11-26 14:03:51
阅读次数:
216
DateTime today = dt.Date;//今天 00:00:00DateTime tomorrow = dt.Date.AddDays(1);//明天 00:00:00DateTime startWeek = dt.AddDays(1 - Convert.ToInt32(dt.DayOf...
Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ...
分类:
其他好文 时间:
2014-11-26 01:20:04
阅读次数:
233
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.分析:我们比较熟悉由一个sorted array生成一个BST,不同的是这里的数据...
分类:
其他好文 时间:
2014-11-25 23:01:58
阅读次数:
213
说明:
(1)日期以年月形式显示:convert(varchar(7),字段名,120) ,
(2)加一列
(3)自编号:
row_number() over(order by 字段名 desc) as RowID
row_number() over(partition by 字段1 order by 字段2) as RowID
(4)自编号的限制(不可直接在WHERE条件中加)...
分类:
数据库 时间:
2014-11-25 16:30:56
阅读次数:
379
//一般情况下用 iconv,只有当遇到无法确定原编码是何种编码,或者iconv转化后无法正常显示时才用mb_convert_encoding 函数. iconv('GB2312', 'UTF-8', $str); //将字符串的编码从GB2312转到UTF-8
分类:
其他好文 时间:
2014-11-25 15:53:56
阅读次数:
167
前几天在编写一个自定义控件的时候,出现了这个这个异常:
Caused by: java.lang.UnsupportedOperationException: Can't convert to integer: type=0x3
然后定位到代码中的时候,发现是自定义控件中引用资源的时候报的错误,代码片段如下:
int iconId = mTypedArray.getInteger...
分类:
编程语言 时间:
2014-11-25 12:49:05
阅读次数:
181
select [Document No_],STUFF ((select ' ,'+[Item No_]+': '+Convert(varchar(20),Convert(int,[Qty_ Per Pallet]))+' '+[Packing Unit of Measure]+' * '+Conv...
分类:
其他好文 时间:
2014-11-25 12:14:03
阅读次数:
161
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have t...
分类:
其他好文 时间:
2014-11-25 10:46:27
阅读次数:
196
【题目】
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.
【解析】
分治:用快慢指针找到链表的中点,作为树的root,然后二分——中点之前的链表和中点之后的链表分别再构造二叉平衡树。
/**
* Defin...
分类:
其他好文 时间:
2014-11-24 22:39:00
阅读次数:
218