有了shell为毛还要ruby呢?话不能这么说,有些小功能用ruby还是很方便的,比如说字符串的反转再加1功能用shell来写就比较麻烦.str="123456",我们定义一个反转后再+1的小方法:
2.1.5 :020 > class String
2.1.5 :021?> def r_add_1
2.1.5 :022?> replace reverse.each_byte.map...
分类:
系统相关 时间:
2014-12-11 12:27:20
阅读次数:
250
1.使用CTime类CString str;//获取系统时间CTime tm;tm=CTime:: GetCurrentTime_r();str=tm.Format("现在时间是%Y年%m月%d日 %X");MessageBox(str,NULL,MB_OK);2: 得到系统时间日期(使用GetLo...
分类:
其他好文 时间:
2014-12-11 12:15:25
阅读次数:
147
原文: 一步一步写算法(之 回数) 【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing @163.com】 回数的概念比较好玩,就是说有这么一个字符串str, 长度为n, 现在index开始从0->index/2遍历,那么str[index] = str[n-1-in...
分类:
编程语言 时间:
2014-12-11 11:46:33
阅读次数:
187
原型: 1 package com.java7; 2 // Try this 2-2: a truth table for the logical operators. 3 public class LogicalOpTable { 4 public static void main(Str...
分类:
其他好文 时间:
2014-12-11 01:35:03
阅读次数:
279
以前看过一本关于精简工作内容的书,要把工作中重复的东西都简化今天我就来简化cocos3建立.h文件和.cpp文件ClassName="TestSprite"Type="Sprite"#.h file writefile = open(ClassName+'.h', 'w')str='''#pragm...
分类:
编程语言 时间:
2014-12-11 00:08:53
阅读次数:
230
#include #include using namespace std;#define mod 20071027int dic[401000][28],val[401000];char str[301000];int dp[301000];int s,sz;char T[110];void in...
分类:
其他好文 时间:
2014-12-11 00:03:10
阅读次数:
188
今天《C++ Primer》学完第9章,关于string类型,找道题目测试一下效果。题目描述:输入一个字符串,以回车结束(字符串长度#include #include using namespace std; int main(){ string str,word; string wo...
分类:
编程语言 时间:
2014-12-10 22:27:44
阅读次数:
207
<?php$str="你好123";$res = trim($str,'\"\"');echo $res;rtrimltrimtrim($str,'符号');同理。
分类:
其他好文 时间:
2014-12-10 19:37:17
阅读次数:
215
类的扩展和继承class Fixnum def dosome(str) puts str end def abs puts "覆盖了原有的方法" endendputs 1.class1.dosome("动态添加的方法")1.abs#覆盖原有的方法 freeze冻结对象class ...
分类:
其他好文 时间:
2014-12-10 19:34:00
阅读次数:
250
疑惑了很久的at end of 算是弄明白了……哈哈TYPES: begin of ty_tab ,num(3) type i,str(3) type c,end of ty_tab.data: gw_tab TYPE ty_tab ,gt_tab TYPE TABLE OF ty_tab WITH...
分类:
其他好文 时间:
2014-12-10 17:53:53
阅读次数:
899