package
{
import flash.events.Event;
public class CustomEvent extends Event
{
public static const START:String = "START";
public static const STOP:String = "STOP";
public var data:*;
public function CustomEvent(type:Strin...
/**
* @param year Full year as int (ex: 2000).
* @param month Month as int, zero-based (ex: 0=January, 11=December).
*/
function daysInMonth(year:int, month:int):int {
return (new Date(year, ++month, 0)).date;
}
function isDaylightSavings(d:Date):Boolean {
var months:uint = 12;
var offset:uint = d.timezoneOffset;
var offsetCheck:Number;
while (months--) {
offsetCheck = (new Date(d.getFullYear(), months, 1)).timezoneOffset;
if (offsetCheck != offset)
ret...
The right-hand side of the assignment in a for loop can be any row vector. The left-hand side of the assignment can be any valid variable name. The for loop assigns a different element of this vector to the variable each run.
other_row_vector = [4, 3, 5, 1, 2];
for any_name = other_row_vector
...
If the right-hand side of the assignment is a matrix, then in each iteration the variable is assigned subsequent columns of this matrix.
some_matrix = [1, 2, 3; 4, 5, 6]; % 2 by 3 matrix
for some_column = some_matrix
display(some_column)
end
(The row vector version is a normal case of thi...
yii migrate/create <name>
The required name argument gives a brief description about the new migration. For example, if the migration is about creating a new table named news, you may use the name create_news_table and run the following command
yii migrate/create create_news_table
<?php
use yii\db\Migration;
class m150101_185401_create_news_table extends Migration
{
public function up()
{
}
public function down()
{
echo "m101129_185401_create_news_table cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migra...
By default, migrations are applied to the same database specified by the db application component. If you want them to be applied to a different database, you may specify the db command-line option like shown below:
yii migrate --db=db2