本文均来自PythonCookbook,本博文励志将Cookbook中的string部位,文件,面向对象编程部分完成,本系列博文陆续还会介绍flask框架,每篇博文都以一个个小例子展示。#-*-coding:utf-8-*-
‘‘‘
文件相关的操作:
read()
open()
两个参数:
第一个:文件路径
第二个:打开文件的模式
常..
分类:
编程语言 时间:
2014-05-03 02:00:18
阅读次数:
417
本文均来自PythonCookbook,本博文励志将Cookbook中的string部位,文件,面向对象编程部分完成,本系列博文陆续还会介绍flask框架,每篇博文都以一个个小例子展示。#-*-coding:utf-8-*-
‘‘‘
检查一个文本是字符串还是二进制
思想:如果字符串中包含了空值或者其中含有超过30%的..
分类:
编程语言 时间:
2014-05-03 00:55:27
阅读次数:
375
const : 指定字段或者本地变量不能被修改。readonly :
声明一个字段只能在定义的时候赋值或者在构造函数中赋值。( readonly 可以有不同的值,取决于构造函数的值。 const
是一个编译时的常量,readonly是一个运行时的常量,example:public static re...
分类:
其他好文 时间:
2014-05-02 09:26:05
阅读次数:
304
NSString *str1 = @"a string"; NSString *str2 =
[[NSString alloc] init]; str2 = @"a string"; [str2 release]; NSString *str3 =
[[NSString...
分类:
其他好文 时间:
2014-05-02 09:04:17
阅读次数:
185
许多次通过,主要是没有考虑到这种情况:“A C ”结尾有多重空格的情况。 1 public class
Solution { 2 public int lengthOfLastWord(String s) { 3 int j, k; 4 if(s == nu...
分类:
其他好文 时间:
2014-05-02 08:21:00
阅读次数:
300
最近在看Jdk6中String的源码的时候发现String的有个这样的构造方法,源代码内容如下:
public String(String original) {
int size = original.count;
char[] originalValue = original.value;
char[] v;
if (originalValue.length > size) {
...
分类:
其他好文 时间:
2014-05-02 06:34:52
阅读次数:
237
Java代码
importjava.io.File;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.FileWriter;importjava.io.IOException;import...
分类:
编程语言 时间:
2014-05-02 06:13:08
阅读次数:
477
foreach (var item in ViewBag.PhotoGroupList) {//
这里很奇怪 item.IS_DISPLAY 是布尔值如果直接写 @item.IS_DISPLAY 如果值为True会变成值会变成 ‘onclick’
,fa...
分类:
Web程序 时间:
2014-05-02 06:00:10
阅读次数:
399
内容如下:
#include "cocos2d.h"
#include "cocostudio/CocoStudio.h"
//精灵猫和其他精灵的tag
typedef enum{
catTag =1,
};
//cocostudio 动画帧tag
typedef enum{
catWalkTag = 1001,
};
class Base :public coco...
分类:
其他好文 时间:
2014-05-02 05:08:11
阅读次数:
319
usingSystem;
usingSystem.Collections.Generic;
usingSystem.IO;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
namespace读文件案例
{
classProgram
{
staticvoidMain(string[]args)
{
Console.WriteLine("请输入文件名");
stringfileName=Console.Read..
分类:
其他好文 时间:
2014-05-02 04:00:58
阅读次数:
289