自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

BruceXiaoYY的博客

4 day day up

  • 博客(24)
  • 收藏
  • 关注

原创 [Perl]继承SUPER,-norequire,use parent

parentpackage Baz;use parent qw(Foo Bar);is equivalent to:package Baz;BEGIN { require Foo; require Bar; push @ISA, qw(Foo Bar);}-norequirepackage Foo;sub exclaim { "I CAN HAS PERL" }package

2016-10-13 10:06:30 1236

原创 [Python]Compare __repr__ & __str__

__repr__, callsed by built-inrepr(), return string representation of a set __str__, called by built-instr() Phython Set - unordered - makes the elements uniqure>>> list = [1,1,2,2,3,3]>>> s

2016-08-05 13:46:49 580

原创 ARP spoofing 实验与分析

定义 ARP spoofing, ARP cache poisoning, or ARP poison routing, is a technique by which an attacker sends (spoofed) Address Resolution Protocol (ARP) messages onto a local area network. Generally, the a

2016-07-07 13:39:54 1089

原创 [Reaver] crack wireless AP

About WPSWhat WIKI says: Created by the Wi-Fi Alliance and introduced in 2006, the goal of the protocol is to allow home users who know little of wireless security and may be intimidated by the avail

2016-06-21 15:59:19 555

原创 [Python]BS4 与 一个KDS 美图爬虫

BS4BeautifulSoup是用来从HTML or XML中提取数据的Python lib。BeautifulSoup将文档转化为树形结构(DOM),每个节点都是下述四种类型的Python对象:BeautifulSoup <class 'bs4.BeatifulSoup'>Tag <class 'bs4.element.Tag'>NavigableString <class 'bs4.el

2016-06-05 00:56:44 2006 2

原创 HTTP header

HTTP基于TCP协议之上的应用层协议,服务于Web浏览器和Web服务器的通信。是通用的、无状态的面向对象的协议。PS: 无状态指的是同一个客户端的多次请求没有对应关系。HTTP headerHTTP headers主要可分为:Request header & Response headerThe header fields are transmitted after the request or

2016-06-03 00:50:15 611

原创 [Python note] Namespaces & scope

NamespacesEverything in Python is an object. A name helps Python to invoke the object that it refer to. A namespace is a space that holds a bunch of names. Imagine it a ‘namespace table’ or a ‘namespa

2016-05-26 17:08:30 440

原创 [Perl] 常见signals解析

介绍系统实现 中断机制 依赖于Signals,而其存在是为了当一个程序(Process)运行时,响应“用户请求” or 系统强制介入。 Signals are software interrupts sent to a program to indicate that an important event has occurred. The events can vary from user r

2016-04-24 23:12:02 866

原创 [Perl] $SIG{HUP}

Scenarios: 为daemon process重新加载配置 Solution: 可通过接收SIGHUP,并定义操作。如下实现了向 a daemon process 发送SIGHUP,并restart该process。当然,也可以是加载配置。#!/usr/bin/perluse strict;use warnings;use POSIX ();use FindBin ();use F

2016-04-24 22:59:32 1014

原创 [Perl]$SIG{INT}

Scenarios: 在程序运行过程中,受到外界终端干扰,如Ctrl+C,导致意外中断 Solution: 可通过 $SIG{INT} 接受 SIGINT 并处理中断,如回收临时文件[root@localhost tmp]# perl /test_sigint.pl$SIG{'INT'} = 'my_int_handler';my $temp_directory = "/tmp/myprog.

2016-04-24 15:08:50 1903

原创 [Perl] $SIG{ALRM}

Scenarios: 可能出现hang的操作,如 connect remote server… Solution: 设置alarm,并通过SIGALRM终止操作 local $@;eval { local $SIG{ALRM} = sub { print "Got SIGALRM\n"; die "alarm clock restart" };

2016-04-24 02:18:49 2165

原创 [Perl]REAPER

场景在程序中遇到耗时较长的操作(如等待用户响应,连接remote server),通常会想到创建 Child process 去处理。在Perl 中 使用fork()## fork a child processdie "$@" unless defined( my $child_pid = fork());if ($child_pid) { # If I have a child PID,

2016-04-22 02:14:43 772

原创 [Platform]Phantom -- Programmable Security Controller

简介2016 RSA conference 明星产品,可以将其认为是一个整合企业内部所使用的安全工具或产品的管理平台。初次使用,总结如下:主要功能Phantom platform (Programmable Security Controller) 集成&管理安全工具 获取&处理事件 通知责任人(Oweners)响应(Actions)WorkflowThe below diagram des

2016-04-21 01:33:49 660

原创 Ruby notes #1 Environment setup on Win32 platform

正式学习Ruby on Rails之前,首先在 Windows 7 平台上进行环境搭建。以下会按照搭建顺序进行展开,当然在安装过程中碰到的 issues 也一并附上。需要下载的安装文件如下:rubyinstaller 1.9.3DevKit 4.5.2rails 3.2.13 #后续gem install 获取netbeans 6.9.1 #当然也可以使用其他,注意6.9.1支持Ruby,

2016-04-14 22:55:46 983

原创 Static block(class initializer)

static block static {}The code inside static block is executed only once: the first time you make an object of that class or the first time you access a static member of that class (even if you never m

2016-04-10 21:41:33 623

原创 [Android]java.lang.OutOfMemoryError

Description: Run APP and get runtime error, OOMImageView imageView1 = new ImageView(this);imageView1.setImageResource(R.drawable.welcome_guilde_1);guideList.add(imageView1);ImageView imageView2 = n

2016-04-07 14:11:20 530

原创 [Android]INSTALL_FAILED_NO_MATCHING_ABIS when installing apk

Description: [INSTALL_FAILED_NO_MATCHING_ABIS] when install apk on Genymotion.Reason: reason on stackoverflow,由于Genymotion模拟的CPU架构与用户预期不同导致(点击link)Resolution: 下载genymotion-arm-translation_v1.1.zip 并dr

2016-03-29 02:45:20 948

原创 Perl 5 中的三大OO特性

Encapsulation首先,将代码段进行封装,成函数。使用中可以优化,并降低代码冗余度,将先前的函数泛化。再次,总结所处理对象特性,提取重构成类。 code block —–> subroutine —–> generalization —–> rarefaction (Class) Inheritance继承是 OO 呈上启后的特性。在Perl 5 中使用 use parent xxx;

2016-03-20 23:42:39 733

原创 OO in Perl5

OO说起 OO 首先跳出“Object”与“Class”这个两个概念。Perl也不例外,在 Perl5 中对 OO programming进行了设计与支持。如下图所示: Perl 5 中设计了一个Base class UNIVERSAL, 它是所有Class的最终父类。如下所述: All classes inherit from the UNIVERSAL class implicitly.T

2016-03-20 22:29:07 471

原创 @EXPORT and @EXPORT_OK

@EXPORTExport souroutines with no need to initialize an object.use File::Basename; ## likeBEGIN { require File::Basename; File::Basename->import }其中的import没有传入list,并不意味着import nothing,而是将 @EXPORT 里所有

2016-03-20 21:11:58 754

原创 How a Perl5 program works

运行一个Perl5 程序分为两个阶段:Complication time & Run time 。Complication time由Source code最终解析成特定的数据结构 optree 。中间可以利用 BEGIN block 触发Complication time 过程中的 Run time 即中断编译,执行代码(其实是数据结构中的内容)Run time

2016-03-16 20:31:38 487

原创 use vs require in Perl5

Perl5 的程序执行分为两个阶段:compilation time & run time。而 use 与 require 依次发生在这两个不同的阶段。 值得注意的是:Parser对use的处理等同如下:use strict;likeBEGIN{ require 'strict.pm'; strict->import();}NOTE:BEGIN block是在compilatio

2016-03-16 17:58:31 718

原创 Layout

LinearLayout 线型顺序布局(垂直的 水平的) RelativeLayout 灵活,每个Child Layout or View需指定相对位置 FrameLayout 里面的View 层层覆盖,非线性排布 TableLayout GridView替代,不常用 AbsoluteLayout 不建议使用Note: 隐含顺序按照

2016-03-07 17:42:46 306

原创 px in pt dp(dip) sp in Android

pxPixels - corresponds to actual pixels on the screen.inInches - based on the physical size of the screen. 1 Inch = 2.54 centimetersmmMillimeters - based on the physical size of the screen.ptPoints -

2016-03-06 23:58:05 364

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除