自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

贾亮的专栏

Do something hard

  • 博客(34)
  • 资源 (5)
  • 收藏
  • 关注

原创 Ruby meta programming 4(eval/class_eval/module_eval/instance_eval)

之所以有不同的eval方法,只是因为在不同的上下文中;你也可以使用eval+bind参数完全替换class_eval/module_eval/instance_eval的# "#{exp}" evaluates it as a string and not as an expression, whereas eval( exp ) evaluates a string as an expressi

2016-08-18 13:04:54 376

原创 Ruby meta programming 3(closure)

# closure10.times{ |i| print("=")}puts("closure")x = "hello world"ablock = Proc.new { puts( x ) }def aMethod( aBlockArg ) x = "goodbye" aBlockArg.callendputs( x )ablock.call#this will out

2016-08-18 12:55:24 445

转载 Ruby meta programming 2(define_method/attr_accessor)

下面是使用四种方式来完成同一个类的方法。 第一种是直接定义get和set方法; 第二种是通过define_method来动态的定义; 第三种是通过attr_accessor来动态的定义; 第四种也是通过attr_accessor来动态的定义,只是去除了冗余;10.times{ |i| print("=")}puts("Writing Code That Writes Code")clas

2016-08-18 12:47:56 489

原创 Ruby meta programming 1(binding/send/freeze/remove_method)

#binding#like Dependency Injection in java 10.times{ |i| print("=")}puts("binding")class Demo def initialize(n) @secret = n end def get_binding return binding() endendk1 = Demo.new

2016-08-18 12:42:08 429

原创 Ruby的method_missing可以定义client调用不存在的方法时的行为

class X def method_missing( methodname, *args ) puts( "Class #{self.class} does not understand: #{methodname}( #{args.inspect} )" ) end endclass Y < X def aaa puts( "aaa me

2016-08-18 11:30:53 582

原创 Ruby的Block

一般来说,用花括号括起来的代码段,称之为blockSome codes segmetn in “The Book for Ruby” can’t run successful in Ruby 2.3 like below code: a = “hello world”.split(//).each{ |x| newstr << x.capitalize } will throw undefi

2016-08-18 11:28:16 374

原创 Ruby中的 class method, instance method, singleton method/class

singleton method/class 从效果来说,两者没有什么区别# class method10.times{ |i| print("=")}puts("class/instance method")class MyClass def MyClass.classMethod puts( "This is a class method" ) end

2016-08-18 11:17:35 946

原创 Ruby中的Symbol

A symbol is an identifier whose first character is a colon ( : ), so :this is a symbol and so is :that. symbol是以:开头的。 A symbol is not: it is not a string, it is not a constant and it is not a variab

2016-08-18 11:12:48 377

原创 Ruby 中的各种变量(local/instance/class/global variable and assignment method)

从注释中可以看出每段代码中使用的变量类型# local variable10.times{ |i| print("=")}puts("local variable")1.times do a = 1 b = "a" puts "local variables in the block: #{local_variables.join ", "}"endputs "no local

2016-08-18 11:06:17 582

原创 PHP post combine

if you post as below, PHP will parse below post as array[0] == Country, Country has three propertyCountry%5Bcode%5D=1&Country%5Bname%5D=2&Country%5Bpopulation%5D=1Country[code]:1Country[name]:2Count

2016-08-12 08:26:03 232

原创 attention when you debug bootstrap's form layout

debug bootstrap’s form layout, need close developer’s view, or the bootstrap’s layout will difference with full screen layout, because it’s responsive layout

2016-08-12 08:25:03 160

原创 PHP self:: vs static::

PHP self:: vs static:: self just means current method’s container class’s context static means the caller’s context, it will set when you real call it with get_called_class method

2016-08-12 08:24:25 197 1

原创 553 Requested action not taken: Local user only

553 Requested action not taken: Local user only SMTP类型的机器只允许发信人是本站用户; For example: the sender must be [email protected] if you use 126’s smtp

2016-08-12 08:23:42 2576

原创 fop's font

what’s fop: http://xmlgraphics.apache.org/fop/ 1. using TTF reader to generate metric xml file and let fop using itcd to fop's main directory,java -cp "build/*;lib/*" org.apache.fop.fonts.apps.TTFRe

2016-08-12 08:22:05 917

原创 mpdf export chinese character

mpdf export chinese char: vendor/mpdf/mpdf/config.php, change below two line to true, for v6$this->autoScriptToLang = true;$this->autoLangToFont = true;autoScriptToLang is variable to indicate whethe

2016-08-11 15:51:24 760

原创 some method in PHP

php is_null: use === intstead of is_null isset($var) and is_null($var) 是相反的;is_null只有在变量是NULL或者变量声明了但是没有赋值时返回true is_callable: if the application could call a method on the object, from the curren

2016-08-11 15:49:06 222

原创 debug codeception in Eclipse

config eclipse’s php cli’s debug to using xdebugcopy file to codeceptioncp vendor\codeception\codeception\codecept to vendor\codeception\codeception\codecept.phpthen add this file to eclipse’s cli ru

2016-08-11 15:48:01 257

原创 Yii2 UT

run below command to instanll codeception:composer require "codeception/codeception=2.1.*"composer require "codeception/specify=*"composer require "codeception/verify=*"add project/vendor/bin to you

2016-08-11 15:44:52 226

原创 change composer's repo to china's mirror

change composer’s repo to china’s mirror project config: composer config repo.packagist composer https://packagist.phpcomposer.com global config: composer config -g repo.packagist composer https://

2016-08-11 15:42:57 224

原创 how to solve git detached HEAD

how to solve git detached HEAD 1. checkout to other branch 2. or create a new branch with : git checkout -b branch_name 3. or prevent to use git checkout commit_id, this will cause detac

2016-08-11 15:42:36 247

原创 .htaccess file not work

.htaccess file not work 1. check AllowOverride option; 2. or just add the rewrite content to httpd.conf file to prevent use .htaccess file

2016-08-11 15:42:00 189

原创 Change Yii2 language

you can using request header/cookie to change Yii’s language dynamic or using below code:// change target language to Chinese\Yii::$app->language = 'zh-CN';

2016-08-11 15:41:24 235

原创 change MySQL's config file and let it use utf-8 by default

change MySQL’s config file and let it use utf-8 by default for xampp, the config file is under bin\my.ini[mysqld]character-set-server=utf8collation-server=utf8_general_ci

2016-08-11 15:40:23 213

原创 change charset of existed MySQL db

change charset of existed dbALTER/CREATE DATABASE `yii2basic` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

2016-08-11 15:39:46 352

原创 using yii command extract message which need i18n

using yii command extract message which need i18n first you should create a config file for yii command:.\yii message/config-template path/to/config.php`such as messages/config.php made some modify t

2016-08-11 15:39:13 337

原创 change eclipse default text encoding to UTF-8 to support php i18n

change eclipse default text encoding to UTF-8 to support php i18n Window -> Preferences -> General -> Workspace : Text file encoding

2016-08-11 15:37:46 328

原创 install Composer fail from xampp in windows

you should change below config in php.ini to absolute path for you xampp:extension_dir = "E:\xampp\php\ext"browscap = "E:\xampp\php\extras\browscap.ini"

2016-08-11 15:37:13 303

原创 some valuable Yii2 extension

Yii2 extension http://codemix.github.io/yii2-bs3activeform/horizontal.html http://demos.krajee.com/

2016-08-11 15:36:18 238

原创 xampp can't start MySQL

xampp can’t start MySQL, using xampp_stop.bat clear env, then retry

2016-08-11 15:35:38 249

原创 php xdebug php5.dll missing

php xdebug php5.dll missing make sure your xdebug is nts or ts version dlldisplay static variable in Eclipse’s variable view self::$aliases

2016-08-11 15:34:34 619

原创 Yii2 alias

Alias You can find below default alias in yii2\BaseYii.php’s $alias:$aliases variable's init:@yii D:\xampp\htdocs\basic\vendor\yiisoft\yii2basic\vendor\yiisoft\extensions.php file add extension path

2016-08-11 15:28:23 657

原创 Yii2 use spl_autoload_register to create autoload feature

Yii2 use spl_autoload_register to create autoload feature yii2\Yii.php:spl_autoload_register(['Yii', 'autoload'], true, true);Yii::$classMap = require(__DIR__ . '/classes.php');Yii::$container = ne

2016-08-11 15:27:17 518

原创 Yii2 componet list and where init it

yii2\base\Application.php:[ 'log' => ['class' => 'yii\log\Dispatcher'], 'view' => ['class' => 'yii\web\View'], 'formatter' => ['class' => 'yii\i18n\Formatter'], 'i18n' => ['class' => 'y

2016-08-11 15:26:19 202

原创 yii2 mail config

change web.php file to support php send file'useFileTransport' => true,'fileTransportPath' => '@app/mail',send with transport'transport' => [ 'class' => 'Swift_SmtpTransport', 'host'

2016-08-11 15:25:08 225

Soft-Test.zip

Soft-Test sample ADC_tutorial DFT_TOC DSPSampling FunctionalTest RF_Test ScanSample SRAM

2021-01-20

SEMI E37-0298 HIGH-SPEED SECS MESSAGE SERVICES (HSMS) GENERIC.pdf

SEMI E37-0298 HIGH-SPEED SECS MESSAGE SERVICES (HSMS) GENERIC SERVICES

2021-01-20

RF engineering basic concepts the Smith chart.pdf

The Smith chart is a very valuable and important tool that facilitates interpretation of S-parameter measurements. This paper will give a brief overview on why and more importantly on how to use the chart. Its definition as well as an introduction on how to navigate inside the chart are illustrated. Useful examples show the broad possibilities for use of the chart in a variety of applications.

2020-05-05

Waveform Generation Language from Fluence Technology, Inc

The Waveform Generation Language (WGL) is a data description language. It is used to convey an editable ASCII representation of the data contained in a Waveform DataBase (WDB), allowing you to use your system’s text editor to fully customize the database

2020-04-29

Standard Test Interface Language (STIL) for Digital Test Vectors原版

Standard Test Interface Language (STIL) for Digital Test Vectors原版

2020-04-27

空空如也

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

TA关注的人

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