Thursday, April 30, 2015

php - Calling the variable property directly vs getter/setters - OOP Design - Stack Overflow

php - Calling the variable property directly vs getter/setters - OOP Design - Stack Overflow:

abstract class Object
{
    public function __call($method, $args)
    {
        $key = '_' . strtolower(substr($method, 3, 1)) . substr($method, 4);
        $value = isset($args[0]) ? $args[0] : null;
        switch (substr($method, 0, 3)) {
            case 'get':
                if (property_exists($this, $key)) {
                    return $this->$key;
                }
                break;

            case 'set':
                if (property_exists($this, $key)) {
                    $this->$key = $value;
                    return $this;
                }
                break;

            case 'has':
                return property_exists($this, $key);
                break;
        }

        throw new Exception('Method "' . $method . '" does not exist and was not trapped in __call()');
    }
}

ALGORITHMS: DESIGN AND ANALYSIS, PART

https://www.coursera.org/course/algo
https://www.coursera.org/course/algo2
http://online.stanford.edu/courses/algorithms-spring-2014
http://online.stanford.edu/course/algorithms-design-and-analysis-part-2-0

Resume Structure

Work Experience


Responsibilities 
Accomplishments
Skill Used 
My resume
https://hired.com/profile


Wednesday, April 29, 2015

Learning JavaScript Design Patterns

[http://addyosmani.com/resources/essentialjsdesignpatterns/book/]
https://github.com/addyosmani/essential-js-design-patterns

Events vs Hooks

Events vs Hooks
[http://programmers.stackexchange.com/questions/237876/what-should-plugins-use-hooks-events-or-something-else]
Hooks loose coupling, event - tight coupling.
Hooks: generic api for all hooks

Hooking - In computer programming, the term hooking covers a range of techniques used to alter or augment the behavior of an operating system, of applications, or of other software components by intercepting function calls or messages or events passed between software components. Code that handles such intercepted function calls, events or messages is called a "hook".
Usefull script for querring all columns from table
SELECT GROUP_CONCAT(COLUMN_NAME) as columns
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'customer'

Projects to implement (from ESTI)

1. Create library for reports based on eloquent. and subscr reports
2. Library for auto-reports
3. Library for configs based on qb integration configs: array, yml, mixed, with extension and aggre
4. How to use Laravel event standalone
5. Laravel Events like in qb integration. traits. class::on(), class::fire(); class event subscriber
6. Create class for periods based on carbon: with iteration; formatting; etc
ORM Models field types.

Web2py:
Computed fields: eg wiki page stores html
Virtual fields: lambda that calc field from other fields, analog of Eloquent field modificators

I would call Virtual as calculated.

Eloquent: field modificators geter/setter
Start/Stop mysql and apach

c:\mysql\bin\mysqld
c:\apache\bin\httpd

c:\apache\bin\httpd -k shutdown
c:\apache\bin\httpd -k shutdown

c:\mysql\bin\mysqladmin -u root shutdown



Via Win Services
net start Apache2
net start MySQL
Programming principals

SOLID
Coupling
Cohesion
Robustness
DB notmal forms

Floyd–Warshall algorithm