三元运算符Vb中的iif(expr,truepart,falsepart)和C#中的expr?truepart:falsepart.无论expr的结果是true还是false,true/falsepart都会被执行.所以不能写类似于obj!=null?obj.name:string.empty.tr...
分类:
其他好文 时间:
2014-06-10 21:38:50
阅读次数:
212
//正确:if(empty($a))$a=1//错误写法$b = if(empty($a))$a=1
//if前面不能带 等号
分类:
Web程序 时间:
2014-06-10 20:28:29
阅读次数:
221
题目
Follow up for "Unique Paths":
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respective...
分类:
其他好文 时间:
2014-06-10 18:28:49
阅读次数:
207
在我们开发过程中,判断数组为空时你会想到什么方法呢?首先想到的应该是empty函数,不过直接用empty函数判断为空是不对的,因为当这个值是多维数的时候,empty结果是有值的
其实我们可以利用array_filter函数轻松去掉多维空值,而数组的下标没有改变,下面是举例用法:...
分类:
Web程序 时间:
2014-06-10 13:59:37
阅读次数:
224
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2014-06-10 10:52:03
阅读次数:
180
binary search\sort\find operations
status InsertNode(Node* root, data x, Node* father)
{
if(root==NULL)
{
if(father==NULL)
Tree empty;
else
{
if(xdata)
{
father->left=new Node//inital l...
分类:
其他好文 时间:
2014-06-10 08:09:49
阅读次数:
234
1.一个比较头疼的问题:
jackson + spring 支持rest接口,输出的JSON 对于null的字符串是invoiceTitle: null,但是接受方希望返回的是invoiceTitle:
""。解决方法重写ObjectMapper
2.代码如下:
public JsonMapper() {
//this(Include.NON_EMPTY);
// 空值...
分类:
其他好文 时间:
2014-06-10 07:28:26
阅读次数:
354
public class CSVHelper {
System.Windows.Forms.SaveFileDialog saveFileDialog1;//保存 private string header =
string.Empty;//标题 //...
分类:
其他好文 时间:
2014-06-09 19:17:52
阅读次数:
322
原题地址:https://oj.leetcode.com/problems/scramble-string/题意:Given
a strings1, we may represent it as a binary tree by partitioning it to two
non-empty su...
分类:
编程语言 时间:
2014-06-09 19:02:59
阅读次数:
197
Follow up for "Unique Paths":Now consider if
some obstacles are added to the grids. How many unique paths would there be?An
obstacle and empty space i...
分类:
其他好文 时间:
2014-06-08 00:33:42
阅读次数:
339