码迷,mamicode.com
首页 >  
搜索关键字:if then else    ( 23991个结果
按字节截取字符串
按字节截取字符串,参数:字符串,截取的字符 function getStr(str, n) { if (lenFor(str) 255) { byteLen += 2; } else { byteLen++; } } return byteLen; } else { ret...
分类:其他好文   时间:2014-07-31 12:11:56    阅读次数:215
线段树心得
核心知识点:(i)如何构造一颗线段树:void build(int rt,int L,int R){ if(L==R) scanf("%d",&Max[rt]); else { int M=(L+R)/2; build(rt*2,L,M); build...
分类:其他好文   时间:2014-07-31 12:09:06    阅读次数:308
水晶报表中公式字段if else 语句无法正常执行的问题
公式字段内容如下:if {MainTable.bOtherDoc}="on" thenchrw(254)elsechrw(168)MainTable.bOtherDoc来自于复选框直接通过FromConnection获得的字符串值,当选中时为“on",不选中时候为null上述公式字段只有当值为on时...
分类:其他好文   时间:2014-07-31 02:25:15    阅读次数:319
POJ 3169 Layout (差分约束+SPFA)
LayoutTime Limit:1000MSMemory Limit:65536KTotal Submissions:6832Accepted:3292DescriptionLike everyone else, cows like to stand close to their friends ...
分类:其他好文   时间:2014-07-30 23:50:55    阅读次数:317
jQuery -- 如何使用jQuery判断某个元素是否存在
通常我们要判断某个元素是否存在是用:[javascript]view plaincopyif(document.getElementById('example')){//dosomething}else{//dosomethingelse}然而在使用jQuery时,我们可以使用:[javascrip...
分类:Web程序   时间:2014-07-30 20:17:44    阅读次数:269
shell 检查一个单词是否在字典中
#!/bin/bash#文件名:checkword.shword=$1grep "^$1$" /usr/share/dict/linux.words -qif [ $? -eq 0 ];then echo $word is a dictionary word;else e...
分类:其他好文   时间:2014-07-30 17:10:13    阅读次数:180
python新手常犯的17个错误
1)忘记在?if?,?elif?,?else?,?for?,?while?,?class?,def?声明末尾添加 :(导致 “SyntaxError :invalid syntax”) 该错误将发生在类似如下代码中: 1 2 if?spam==?42 ????print(‘Hello!‘)...
分类:编程语言   时间:2014-07-30 12:38:24    阅读次数:334
case when遇到空串转成0
需要注意:如果字段为varchar类型,when后的条件要加上引号SELECT (CASE 'marital_status' WHEN 0 THEN '已婚' WHEN 1 THEN '未婚' ELSE 'WEIZHI' END) AS marital_status FROM tj_archive WHERE id='D1407280006' 用上面的语句,如果marital_status...
分类:其他好文   时间:2014-07-30 10:00:43    阅读次数:189
Windows 环境下运用Python制作网络爬虫
import webbrowser as web import time import os i = 0 MAXNUM = 1 while i <= MAXNUM: web.open_new_tab('要刷的网络地址') os.system('taskkill /F /IM 浏览器文件名(chrome.exe)') i += 1 else:...
分类:编程语言   时间:2014-07-29 22:08:12    阅读次数:324
Django模板用法
django模板原理#创建template对象,由context对象传递template所需要的值,有render方法进行模板的呈现#写模板,创建Template对象,创建Context,调用render()方法。#Python字符串都有upper()和isdigit()方法,你在模板中调用#执行变量 {{abc}} #判断 {%ifx>0%} {%else%} {%e..
分类:其他好文   时间:2014-07-29 18:16:03    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!