整理自统计之都论坛
方法一 使用strsplit函数
a <- "aggcacggaaaaacgggaataacggaggaggacttggcacggcattacacggagg"
b <- strsplit(as.character(a),"ag")
length(b[[1]]) - 1 ##子字符串"ag"的出现个数
方法二 使用正则式函数
a <- "aggcacgg...
分类:
其他好文 时间:
2014-07-22 23:02:52
阅读次数:
288
1 //桶排序思想 2 //假如要排序的是数字是 2 4 5 5 5 8 8 9 1 1 3
#include 4 #define length 10 5 int main() 6 { 7 //数组元素值全部初始化为0 8 int
array[length]={0}; 9 ...
分类:
其他好文 时间:
2014-05-01 22:19:46
阅读次数:
342
>>> for i in range(0,10):if i >
10:break;else:print "hello world";输出:hello world>>> for i in
range(0,10):if i > 5:break;else:print "hello world";没有输出-...
分类:
编程语言 时间:
2014-05-01 21:13:53
阅读次数:
368
题目: Given a string S, find the longest palindromic
substring in S. You may assume that the maximum length of S is 1000, and there
exists one unique lo...
分类:
其他好文 时间:
2014-05-01 20:07:13
阅读次数:
429
/**js Unicode编码转换*/vardecToHex =function(str)
{varres=[];for(vari=0;i < str.length;i++)
res[i]=("00"+str.charCodeAt(i).toString(16)).slice(-4);return"...
分类:
Web程序 时间:
2014-05-01 19:36:51
阅读次数:
427
冒泡排序
思路:就是每次将最大或最小的元素放到数组的最后,so easy!时间复杂度为(O(n^2))
public class BubbleSort {
public static void bubbleSort(int[] a) {
for (int j = 1; j < a.length; j++) {
for (int i = 0; i < a.length - j; i+...
分类:
编程语言 时间:
2014-04-30 22:12:40
阅读次数:
309
UITextView上如何加上类似于UITextField的placeholder呢,其实在UITextView上加上一个UILabel,然后再实现
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text这个代理方法就可以了。
...
分类:
移动开发 时间:
2014-04-29 13:42:21
阅读次数:
337
使用函数操作链表
1:计算链表中结点的个数:定义一个Length_list()函数用于计算链表中结点的个数
函数代码:
//计算链表中结点的个数
void Length_list(PNODE pHead)
{
PNODE p = pHead->pNext;
int len = 0;
while(NULL != p)
{
len++;
p = p->pNext;
...
分类:
其他好文 时间:
2014-04-29 13:28:21
阅读次数:
302
jQuery 滑动改变价格演示 XML/HTML Codesection id="content" > div class="cube"> div class="a">div> div class="b">div> div class="c">div> div class="d">div> div id="slider-range-min">div> div> input type...
分类:
Web程序 时间:
2014-04-29 13:27:21
阅读次数:
595