自定义Sessiona.知识储备#!/usr/bin/envpython#-*-coding:utf-8-*-classFoo(object):def__getitem__(self,key):print‘__getitem__‘,keydef__setitem__(self,key,value):print‘__setitem__‘,key,valuedef__delitem__(self,key):print‘__delitem__‘,keyobj=Foo()result=obj[‘k1‘]..
分类:
其他好文 时间:
2016-04-23 01:47:44
阅读次数:
227
我现在在廖雪峰的官方网站上学习Python刚刚学会了一个,跟大家分享一下当a>=14时输出“true”,否则输出“flease”a=input(‘pleaseanumber:‘)
a=int(a)
ifa>=14:
print(‘true‘)
else:
print(‘flease‘)
结果
分类:
编程语言 时间:
2016-04-22 21:07:14
阅读次数:
141
0x00 这一节我们主要讨论对象的拷贝构造函数的汇编实现。 0x01 我们直接看C++代码: Test.h:#ifndef _TEST_H_
#define _TEST_H_
#include
#define LOG_TAG "lesson5"
#define ALOGD(...) ((void)__android_log_print(ANDROID_LOG_D...
分类:
移动开发 时间:
2016-04-22 19:41:17
阅读次数:
172
0x00 这一节我们要讨论对象的继承和虚函数的汇编实现。 0x01 我们先直接看汇编代码:#include "com_example_ndkreverse6_Lesson6.h"
#include
#define LOG_TAG "lesson6"
#define ALOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, ...
分类:
移动开发 时间:
2016-04-22 18:57:02
阅读次数:
217
基本语法
名称
作用 print
控制台输出语句
var
声明一个变量
let
声明一个常量
if…else..
判断语句
switch…case..
分支语句
for
循环语句
while
判断循环语句,先判断后循环
print
向控制台输出文本log
print("hello world")//输出纯字符串
print("1 +...
分类:
编程语言 时间:
2016-04-22 18:50:46
阅读次数:
329
cat 192.168.101.* | grep load | awk '{sum+=$4} END {print "average=", sum/NR}' cat 192.168.101.* | grep Memory | awk '{sum+=$3} END {print "average=", ...
分类:
其他好文 时间:
2016-04-22 18:08:43
阅读次数:
170
4.5.2计算用户输入的数字的总和下面的程序让用户输入一些数字,然后打印出这些数字的总和。①这是使用for循环的版本:#forsum.pyn=int(input(‘Howmanynumberstosum?‘))total=0foriinrange(n):s=input(‘Enternumber‘+str(i+1)+‘:‘)total=total+int(s)print(‘Thesumis‘+str(total..
分类:
其他好文 时间:
2016-04-22 16:54:11
阅读次数:
133
批量修改文件后缀第一种:#!/bin/bash
forfnin*.$1
do
mv$fn${fn%$1}$2
done第二种:find.-name"*.txt"|awk-F‘[./]+‘‘{print$2}‘|xargs-i-tmv{}.txt{}.shGREP用户小技巧文件如下:#cattest.txt
Thisisatestfile
agooddayandnocoludy
Sithereandsingasong
missagaoisting
butmon..
分类:
系统相关 时间:
2016-04-22 16:47:48
阅读次数:
207
netstat-antup|grepESTABLISHED|awk‘{print$5}‘|grep-o"\([0-9]\{1,3\}\.\)\{1,3\}[0-9]\{1,3\}"|sort-rn|uniq-c|awk‘{print$2}‘|sed‘s/\.[0-9]*$/\.0\/24/g‘sed‘s/\.[0-9]*$/\.0\/24/g‘sed里面用{}匹配不了次数..不知道什么原因,于是利用.和$结合匹配最后一位改成.0/24
分类:
其他好文 时间:
2016-04-22 16:43:28
阅读次数:
183
总体的思路是利用print_r 进行打印调试,遇到object就用->读取,遇到Array就用[]读取,在调试的时候遇到中文编码的问题用header("Content-Type: text/html; charset=UTF-8"); 由于个人水平有限,调试花了一个多小时,希望看到这Blog的人少与 ...
分类:
Web程序 时间:
2016-04-22 16:12:01
阅读次数:
218