I'm new to Cake php.
I have a problem using bake

I set up a migration with user table

```
public $migration = array(
        'up' => array(
            'create_table' => array(
                'users' => array(
                    'user_id' => array('type' => 'integer', 'null' => false, 'key' => 'primary'),
                    'username' => array('type' => 'string', 'null' => false, 'length' => 250),
                    'password' => array('type' => 'text', 'null' => false),
                    'created' => array('type' => 'string', 'null' => false, 'length' => 14),
                    'modified' => array('type' => 'string', 'null' => true, 'default' => null, 'length' => 14),
                    'indexes' => array(
                        'PRIMARY' => array('column' => 'user_id', 'unique' => 1)
                    )
                )
            )
        ),
        'down' => array(
            'drop_table' => array(
                'users'
            )
        )
    );

```

and migrate this file on the db then I tried to do the command "cake bake all"
the problem is that User made a reference to itself with belongsTo and hasMany
is that the default of using bake?

```
class User extends AppModel {

/**
 * Validation rules
 *
 * @var array
 */
    public $validate = array(
        'user_id' => array(
            'numeric' => array(
                'rule' => array('numeric'),
                //'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'username' => array(
            'notEmpty' => array(
                'rule' => array('notEmpty'),
                //'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
        'date_created' => array(
            'notEmpty' => array(
                'rule' => array('notEmpty'),
                //'message' => 'Your custom message here',
                //'allowEmpty' => false,
                //'required' => false,
                //'last' => false, // Stop validation after this rule
                //'on' => 'create', // Limit validation to 'create' or 'update' operations
            ),
        ),
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed

/**
 * belongsTo associations
 *
 * @var array
 */
    public $belongsTo = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            'conditions' => '',
            'fields' => '',
            'order' => ''
        )
    );

/**
 * hasMany associations
 *
 * @var array
 */
    public $hasMany = array(
        'User' => array(
            'className' => 'User',
            'foreignKey' => 'user_id',
            'dependent' => false,
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'limit' => '',
            'offset' => '',
            'exclusive' => '',
            'finderQuery' => '',
            'counterQuery' => ''
        )
    );

}

```

is there something I missing here?
Should I leave that and modify it manually or there's a config that I missed.
['https://Stackoverflow.com/questions/26739981', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1097307/']
> 
> Today I have the need to allocate a vector with size 100000 in Matlab. 
> 
> 
> 

Now, as noted in the comments and such, the method you tried (`a=ones(100000);`) creates a 100000x100000 matrix, which is not what you want.

I would suggest you try:

```
a = ones(1, 100000);

```

Since that creates a vector rather than a matrix.
Arguments Matter
================

Calling Matlab's `ones()` or `zeros()` or `magic()` with a single argument `n`, creates a *square* matrix with size `n-by-n`:

```matlab
>> a = ones(5)
  a = 1 1 1 1 1 
      1 1 1 1 1 
      1 1 1 1 1 
      1 1 1 1 1 
      1 1 1 1 1

```

Calling the same functions with 2 arguments `(r, c)` instead creates a matrix of size `r-by-c`:

```matlab
>> a = ones(2, 5)
  a = 1 1 1 1 1 
      1 1 1 1 1 

```

This is all well documented in [Matlab's documentation](http://www.mathworks.de/help/matlab/ref/zeros.html).

Size Matters Too
================

Doubles
-------

Having said this, when you do `a = zeros(1e6)` you are creating a square matrix of size `1e6 * 1e6 = 1e12`. Since these are doubles the total allocated size would be `8 * 1e12 Bytes` which is circa `(8 * 1e12) / 1024^3 = 7450.6GB`. Do you have this much RAM on your machine?

Compare this with `a = zeros(1, 1e6)` which creates a column-vector of size `1 * 1e6 = 1e6`, for a total allocated size of `(8 * 1e6) / 1024^3 = 7.63MB`.

Logicals
--------

Logical values, on the other hand are boolean values, which can be set to either `0` or `1` representing `False` or `True`. With this in mind, you can allocate matrices of logicals using either [`false()`](http://www.mathworks.de/help/matlab/ref/false.html) or [`true()`](http://www.mathworks.de/help/matlab/ref/true.html). Here the same single-argument rule applies, hence `a = false(1e6)` creates a square matrix of size `1e6 * 1e6 = 1e12`. Matlab today, as many other programming languages, stores bit values, such as booleans, into single Bytes. Even though there is a clear cost in terms of memory usage, such a mechanism provides significant performance improvements. This is because it is [accessing single bits is a slow operation](http://www.mathworks.com/matlabcentral/answers/22439-logical-array-memory-allocation). 

The total allocated size of our `a = false(1e6)` matrix would therefore be `1e12 Bytes` which is circa `1e12 / 1024^3 = 931.32GB`.