terça-feira, 9 de fevereiro de 2016

cakephp 3 installation issue - unexpected T_OBJECT_OPERATOR in config/bootstrap.php on line 107

Hi!

You have just deployed your applicaton and you received this error

unexpected T_OBJECT_OPERATOR
?

Don't worry, it's the version of your PHP.

I changed from 5.3 to 5.5.

Yeah, I have no time keep investigating, so I decided to go to 5.5.

It worked.

Good Luck!



segunda-feira, 8 de fevereiro de 2016

Can't logout on Chrome? Maybe Chrome is not the problem.


Hi!

I was having this issue. Then I found Raffi's answer. Which is perfect.
In my case, only admin was able to logout.
Then he made me understand that I forgot to define that, if you are not admin, you also can logout!

        public function isAuthorized($user)
        {

                $action = $this->request->params['action'];

                if (in_array($action, ['logout']))

                {
                   return true; // If user wants to logout, ok for everyone.
                }
                else
                {
                    // If he or she is not trying to logout, then, if the role of the user is admin, anything goes
                    if (isset($user['role']) && $user['role'] === 'admin')
                    {
                         return true;
                    }                  

                    return false;
                }



                // Default deny
                //return false;
         
        }

Hope it helps!

Good luck!

http://stackoverflow.com/questions/27232679/cakephp-3-users-not-allowed-to-logout

Login, Logout is making you insane? / CakePHP 3.0 / That's how I did.

Hi!

This thing of login, logout is p. in the a.. Well that's how I did mine

        $this->loadComponent('Auth', [
                'authorize' => 'Controller',
                'authenticate' => [
                'Form' => [
                'fields' => [
                'username',
                'password' => 'password'
                ]
                ]
                ],
                'loginAction' => [
                'controller' => 'Users',
                'action' => 'login'
                ],
                'loginRedirect' => [
                                'controller' => 'Users',
                                'action' => 'index'
                            ],
                'logoutRedirect' => [
                                'controller' => 'Users',
                                'action' => 'login'
                            ]                        
                ]);
                // Allow the display action so our pages controller
                // continues to work.
                $this->Auth->allow(['display']);
    }

Hope it helps.

Good Luck!


quarta-feira, 3 de fevereiro de 2016

Does PowerPivot from Microsoft works? Yes!

Hi!

I have been recently working with million of records.
Normal excel worksheets do not support more than 1.000.000 records or lines, as you prefer.
But I still have to work with excel (this is a client compliance).
How did I deal with that?
Using PowerPivot.
It imports 2.600.000 records in less than a minute.
The performance of his pivot table is as well as good.
So, if you are facing the same scenario as I am, PowerPivot can be your solution.

Good luck!


segunda-feira, 1 de fevereiro de 2016

A different way to create temporary table

Hi!

Today somebody teached me a new way to create temporary table and I found it really cool.

This is a way to create a temporary table cloning only the definition of the original table.

SELECT * INTO #TEMP_CLIENT FROM  CLIENT  WHERE 0 = 1

Isn't it cool?

Good luck!
 

domingo, 31 de janeiro de 2016

Short cut for symbols

Hi!
Have you ever asked yourself how to access those symbols?
So, here it is.
Enjoy it.

Alt + 1= ☺
Alt + 2= ☻
Alt + 3= ♥
Alt + 4= ♦
Alt + 5= ♣
Alt + 6= ♠
Alt + 7= •
Alt + 8= ◘
Alt + 9= ○
Alt + 10= ◙
Alt + 11= ♂
Alt + 12= ♀
Alt + 13= ♪
Alt + 14= ♫
Alt + 15= ☼
Alt + 16= ►
Alt + 17= ◄
Alt + 18= ↕
Alt + 19= ‼
Alt + 20= ¶
Alt + 21= §
Alt + 22= ▬
Alt + 23= ý
Alt + 24= ↑
Alt + 25= ↓
Alt + 26= →
Alt + 27= ←
Alt + 28= ∟
Alt + 29= ↔
Alt + 30= ▲
Alt + 31= ▼
Alt + 32=
Do Alt + 33 até o Alt + 126 são caractéres numéricos e de letras comuns do teclado... continuando
Alt + 127= ⌂
Alt + 128= Ç
Alt + 129= ü
Alt + 131= â
Alt + 132= ä
Alt + 133= à
Alt + 134= å
Alt + 135= ç
Alt + 136= ê
Alt + 137= ë
Alt + 138= è
Alt + 139= ï
Alt + 140= ¥
Alt + 141= ì
Alt + 142= Ä
Alt + 143= Å
Alt + 144= É
Alt + 145= æ
Alt + 146= Æ
Alt + 147= ô
Alt + 148= ö
Alt + 149= ò
Alt + 150= û
Alt + 151= ù
Alt + 152= ÿ
Alt + 153= Ö
Alt + 154= Ü
Alt + 155= ø
Alt + 156= £
Alt + 157= Ø
Alt + 158= ×
Alt + 159= ƒ
Alt + 160= á
Alt + 161= í
Alt + 162= ó
Alt + 163= ú
Alt + 164= ñ
Alt + 165= Ñ
Alt + 166= ª
Alt + 167= º
Alt + 168= ¿
Alt + 169= ®
Alt + 170= ¬
Alt + 171= ½
Alt + 172= ¼
Alt + 173= ¡
Alt + 174= «
Alt + 175= »
Alt + 176= ░
Alt + 177= ▒
Alt + 178= ▓
Alt + 179= │
Alt + 180= ┤
Alt + 181= Á
Alt + 182= Â
Alt + 183= À
Alt + 184= ©
Alt + 185= ╣
Alt + 186= ║
Alt + 187= ╗
Alt + 188= ╝
Alt + 189= ¢
Alt + 190= ¥
Alt + 191= ┐
Alt + 192= └
Alt + 193= ┴
Alt + 194= ┬
Alt + 195= ├
Alt + 196= ─
Alt + 197= ┼
Alt + 198= ã
Alt + 199= Ã
Alt + 200= ╚
Alt + 201= ╔
Alt + 202= ╩
Alt + 203= ╦
Alt + 204= ╠
Alt + 205= ═
Alt + 206= ╬
Alt + 207= ¤
Alt + 208= ð
Alt + 209= Ð
Alt + 210= Ê
Alt + 211= Ë
Alt + 212= È
Alt + 213= ı
Alt + 214= Í
Alt + 215= Î
Alt + 216= Ï
Alt + 217= ┘
Alt + 218= ┌
Alt + 219= █
Alt + 220= ▄
Alt + 221= ¦
Alt + 222= Ì
Alt + 223= ▀
Alt + 224= Ó
Alt + 225= ß
Alt + 226= Ô
Alt + 227= Ò
Alt + 228= õ
Alt + 229= Õ
Alt + 230= µ
Alt + 231= þ
Alt + 232= Þ
Alt + 233= Ú
Alt + 234= Û
Alt + 235= Ù
Alt + 236= ý
Alt + 237= Ý
Alt + 238= ¯
Alt + 239= ´
Alt + 241= ±
Alt + 242= ‗
Alt + 243= ¾
Alt + 244= ¶
Alt + 245= §
Alt + 246= ÷
Alt + 247= ¸
Alt + 248= °
Alt + 249= ¨
Alt + 250= •
Alt + 250= •
Alt + 251= ¹
Alt + 252= ³
Alt + 253= ²
Alt + 254= ■
Alt + 255=
Alt + 256=.

Estrelas:


Alt+10017= ✡
Alt+10022= ✦
Alt+10023= ✧
Alt+10025= ✩
Alt+10026= ✪
Alt+10027= ✫
Alt+10028= ✬
Alt+10029= ✭
Alt+10030= ✮
Alt+10031= ✯
Alt+10032= ✰
Alt+10037= ✵
Alt+10038= ✶
Alt+10039= ✷
Alt+10040= ✸
Alt+10041= ✹
Alt+10059= ❋

Xadrez:
Alt+9812= ♔ Rei branco
Alt+9813= ♕ Rainha branca
Alt+9814= ♖ Torre branca
Alt+9815= ♗ Bispo branco
Alt+9816= ♘ Cavalo branco
Alt+9817= ♙ Peão branco
Alt+9818= ♚ Rei negro
Alt+9819= ♛ Rainha negra
Alt+9820= ♜ Torre negra
Alt+9821= ♝ Bispo negro
Alt+9822= ♞ Cavalo negro
Alt+9823= ♟ Peão negro

Signos do Zodíaco:
Alt+9800= ♈ Áries
Alt+9801= ♉ Touro
Alt+9802= ♊ Gemêos
Alt+9803= ♋ Cancer
Alt+9804= ♌ Leão
Alt+9805= ♍ Virgem
Alt+9806= ♎ Libra
Alt+9807= ♏ Escorpião
Alt+9808= ♐ Sagitário
Alt+9809= ♑ Capricórnio
Alt+9810= ♒ Aquário
Alt+9811= ♓ Peixes

Planetas:
Alt+9788= ☼ Sol
Alt+9790= ☾ Lua
Alt+9791= ☿ Mercúrio
Alt+9792= ♀ Vênus
Alt+9793= ♁
Alt+9794= ♂ Marte
Alt+9795= ♃ Júpiter
Alt+9796=♄ saturno
Alt+9797=♅ Urano
Alt+9798=♆ Netuno
Alt+9799=♇ Plutão

Quadrados:
Alt+10063= ❏
Alt+10064= ❐
Alt+10065= ❑
Alt+0066= ❒

Mãos:
Alt+9754= ☚ mão negra apontando a esquerda
Alt+9755= ☛mão negra apontando p/ a direita
Alt+9756= ☜ mão branca apontando a esquerda
Alt+9757= ☝mão apontando p/ o alto
Alt+9758= ☞ mão apontando p/ a direita
Alt+9759= ☟ mão apontando p/ baixo
Alt+9996= ✌ paz e amor
Alt+9997= ✍ assinando

Astrologia e Astronomia:
Alt+9737= ☉ sol
Alt+9740= ☌ conjunção
Alt+9741= ☍ oposição
Alt+9738= ☊ nó ascendente
Alt+9739= ☋ nó descendente
Alt+9729= ☁ nuvem
Alt+9732= ☄ cometa
Alt+9728= ☀ sol preto
Alt+10042=✺ sol preto-2
Alt+9832= ♨ tempo quente
Alt+10061=❍ lua minguando

Setas:
Alt+10174= ➾
Alt+10162= ➲
Alt+10161= ➱
Alt+10159= ➯
Alt+10158= ➮
Alt+10157= ➭
Alt+10156= ➬
Alt+10155= ➫
Alt+10154= ➪
Alt+10153= ➩
Alt+10152= ➨
Alt+10151= ➧
Alt+10150= ➦
Alt+10149= ➥
Alt+10148= ➤
Alt+10147= ➣
Alt+10146= ➢
Alt+10145= ➡
Alt+10144= ➠
Alt+10143= ➟
Alt+10142= ➞
Alt+10141= ➝
Alt+10140= ➜
Alt+10139= ➛
Alt+10138= ➚
Alt+10137= ➙
Alt+10136= ➘
Alt+10132= ➔


Flechas:
Alt+10163= ➳
Alt+10164= ➴
Alt+10165= ➵
Alt+10166= ➶
Alt+10167= ➷
Alt+10168= ➸
Alt+10169= ➹
Alt+10170= ➺
Alt+10171= ➻
Alt+10172= ➼
Alt+10173= ➽

Flores:
Alt+10045= ✽
Alt+10046= ✾
Alt+10047= ✿
Alt+10048= ❀
Alt+10049= ❁
Alt+10051= ❃
Alt+10052= ❄
Alt+10053= ❅
Alt+10054= ❆
Alt+10058= ❊

Cruzes:
Alt+10009= ✙
Alt+10010= ✚
Alt+10011= ✛
Alt+10013= ✝
Alt+10014= ✞
Alt+10015= ✟
Alt+10016= ✠
Alt+10018= ✢
Alt+10019= ✣
Alt+10020= ✤
Alt+10021= ✥
Alt+9580= ╬
Alt+9766= ☦
Alt+9768= ☨
Alt+9769= ☩
Alt+10056=❈
Alt+8889= ⊹

Pontos e traços:
Alt+8756= ∴
Alt+8757= ∵
Alt+8758= ∶
Alt+8759= ∷
Alt+8760= ∸
Alt+8761= ∹
Alt+8762= ∺
Alt+8763= ∻
Alt+8781= ≍
Alt+8782= ≎
Alt+8783= ≏
Alt+8784= ≐
Alt+8785= ≑
Alt+8786= ≒
Alt+8787= ≓
Alt+8788= ≔
Alt+8789= ≕
Alt+8790= ≖

Símbolos variados:
Alt+9990 = ✆
Alt+9742 = ☎
Alt+9743 = ☏
Alt+9773 = ☭
Alt+10085= ❥
Alt+8987 = ⌛
Alt+8986 = ⌚
Alt+9993 = ✉
Alt+9992 = ✈
Alt+9985 = ✁
Alt+9986 = ✂
Alt+9987 = ✃
Alt+9988 = ✄
Alt+9762 = ☢
Alt+9999 = ✏
Alt+9998 = ✎
Alt+9730 = ☂
Alt+9763 = ☣
Alt+9765 = ☥
Alt+9760 = ☠
Alt+9767 = ☧
Alt+10000= ✐
Alt+10001= ✑
Alt+10002= ✒
Alt+10070= ❖
Alt+10075= ❛
Alt+10076= ❜
Alt+10077= ❝
Alt+10078= ❞
Alt+10081= ❡
Alt+10082= ❢
Alt+10083= ❣
Alt+10086= ❦
Alt+10087= ❧
Alt+9731 = ☃
Alt+8754 = ∲
Alt+8755 = ∳
Alt+9770 = ☪
Alt+9771 = ☫
Alt+9708 = ◬
Alt+9774 = ☮
Alt+9772 = ☬
Alt+9775 = ☯
Alt+9784 = ☸
Alt+9764 = ☤
Alt+10055= ❇
Alt+10056= ❈
Alt+10057= ❉
Alt+10050= ❂
Alt+10033= ✱
Alt+10034= ✲
Alt+9785 = ☹
Alt+8984 = ⌘
Alt+9673 = ◉
Alt+8661 = ⇕
Alt+9641 = ▩
Alt+8865 = ⊡
Alt+8864 = ⊠
Alt+8863 = ⊟
Alt+8862 = ⊞
Alt+8861 = ⊝
Alt+8860 = ⊜
Alt+8859 = ⊛
Alt+8858 = ⊚
Alt+8857 = ⊙
Alt+8880 = ⊰
Alt+8881 = ⊱
Alt+8882 = ⊲
Alt+8883 = ⊳
Alt+8887 = ⊷
Alt+8865 = ⊡
Alt+3356 = ജ
Alt+9637 = ▥
Alt+9689 = ◙
Alt+9680 = ◐
Alt+8813 = ≭

sábado, 30 de janeiro de 2016

Strict (2048): Declaration of App\Controller\UsersController::beforeFilter() should be compatible with App\Controller\AppController::beforeFilter(Cake\Event\Event $event) [APP/Controller\UsersController.php, line 12]

Strict (2048): Declaration of App\Controller\UsersController::beforeFilter() should be compatible with App\Controller\AppController::beforeFilter(Cake\Event\Event $event) [APP/Controller\UsersController.php, line 12]
Warning (4096): Argument 1 passed to App\Controller\UsersController::beforeFilter() must be an instance of App\Controller\Event, instance of Cake\Event\Event given, called in C:\Users\daniel\blog\vendor\cakephp\cakephp\src\Event\EventManager.php on line 385 and defined [APP/Controller\UsersController.php, line 14]

Hi!

If you are just like me studying the tutorial

CakePHP Cookbook Documentation
Release 3.x
Cake Software Foundation
January 18, 2016

You should have been found this problem when you finished the blog example.

Solution


Change this

    public function beforeFilter(Event $event)
    {
        parent::beforeFilter($event);
        // Allow users to register and logout.
        // You should not add the "login" action to allow list. Doing so would
        // cause problems with normal functioning of AuthComponent.
        $this->Auth->allow(['add', 'logout']);
    }

For this

    public function beforeFilter(\Cake\Event\Event $event)
    {
        $this->Auth->allow(['add','logout']);
    }
 
Good luck!