domingo, 25 de agosto de 2013
Resolvendo erros de permissão ao instalar Yeoman
http://www.joyent.com/blog/installing-node-and-npm
Utilizei a primeira solução proposta, que se encontra aqui:
https://gist.github.com/isaacs/579814
Depois disto, tudo funcionou!
quarta-feira, 10 de julho de 2013
AngularJS: Conceitos Principais
quinta-feira, 18 de abril de 2013
Conhecimento Eletrônico rejeitado por falta de informações de seguro
Rejeição: As informações do seguro da carga devem ser preenchidas para o modal rodoviário
não se assuste, veja no portal da fazenda, norma técnica 2013.001:
http://www.cte.fazenda.gov.br/listaConteudo.aspx?tipoConteudo=Y0nErnoZpsg=
Que agora (abril de 2013) realmente este campo passa a ser obrigatório para cte normal ou de substituição (0 ou 3).
A obrigatoriedade é, em homologação, a partir de 15/04/2013 e, em produção, a partir de 15/05/2013.
domingo, 18 de novembro de 2012
Cuidado ao comprar produtos LG
http://www.reclameaqui.com.br/3872545/lg-electronics/problemas-nos-notebooks-lg-a520pbe51p1-e-a530-t-be76p1/
Enfim, estou decepcionado com a marca e fica o post pra registrar isto. Cuidado com a LG! Já tive notebooks da Dell e HP antes e nenhum deles me deu tanto trabalho.
sexta-feira, 1 de julho de 2011
Using commas instead of dots to represent decimal numbers in Flex NumericStepper
The problem is that when we're using a Flex NumericStepper there isn't a place to set this. The only way I've found to get NumericStepper working with commas was to change the behaviour of the NumericStepper's TextInput. So I've created a different TextInput, called BrazilianNumberTextInput. Here it is:
package com.blogspot.wagnermezaroba.components
{
import mx.controls.TextInput;
public class BrazilianNumberTextInput extends TextInput {
override public function get text():String {
var t:String = super.text;
if ( t != null )
t = t.replace(/\./g, '').replace(/,/g, '.');
return t;
}
}
}
What I've done is simple. I replaced all the dots for nothing (that was the desired effect that we needed) and all the commas for dots. So NumericStepper will be able to parse the values. But we need to set NumericStepper to use our new TextInput component. I've done this in my css file:
mx|NumericStepper {
textInputClass: ClassReference("com.blogspot.wagnermezaroba.components.BrazilianNumberTextInput");
}
It's an ugly solution. But I haven't found any solution on the internet and so far I do not believe there is a different way to go.
And that's it. If you're going to use it, it would be good to set the restrict property, to constrain the user input and allow just numbers and commas.
terça-feira, 31 de maio de 2011
Enter working as Tab in a Flex DataGrid
If you're using a Flex DataGrid with the editable property set to true, the default behaviour of the Tab key is moving from one editable cell to another one while the Enter key move from one row to another one. There isn't any DataGrid option to easily make Enter key behaves like Tab key. And you can't override the KEY_DOWN event handler method of the DataGrid directly. However, you can register your own handler with a higher priority than the default DataGrid handler. By doing this, your handler will be called before DataGrid handler giving you the possibility to customize the action of the pressed keys. That's what we're going to do.
In your own handler you can check if the pressed key is Enter and than simply stop the propagation of the KeyboardEvent. Ok, this disables the default Enter event. But how can we make Enter works as Tab? We can just dispatch a fake KEY_FOCUS_CHANGE event. And that's it! Let's see the code:
public class CustomDataGrid extends DataGrid {
public function CustomDataGrid() {
super();
}
/*
* After Flex register its own handler in the createItemEditor method,
* we register our event listener with a higher priority (100).
*/
override public function createItemEditor(colIndex:int, rowIndex:int):void {
super.createItemEditor(colIndex, rowIndex);
DisplayObject(itemEditorInstance).addEventListener(KeyboardEvent.KEY_DOWN, onEditorKeyDown, false, 100);
}
/*
* If the pressed key is Enter, stop the propagation and
* dispatch a fake Tab Event.
*/
protected function onEditorKeyDown(event:KeyboardEvent):void {
if (event.charCode == Keyboard.ENTER && event.keyCode != 229) {
event.stopImmediatePropagation();
dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true, false, null, event.shiftKey, Keyboard.TAB));
}
}
}
Be careful with itemRenderers and itemEditors
If you are using a custom itemRenderer or itemEditor, I recommend you to pay attention to the events they dispatch. They can dispatch extra events that make your Enter key not behaves exactly like the Tab key, specially if you're listening to the ITEM_EDIT_END event. It depends on the case, but if you're having problems with this use the same technique to interrupt not convenient events on your itemEditor or itemRenderer.
And that's it!
quarta-feira, 5 de agosto de 2009
Zope 3 no Ubuntu Jaunty -(9.04)
$sudo /usr/lib/zope3/bin/mkzopeinstance
eu tentava subir o Zope com:
$sudo /etc/init.d/zope3
e a instância simplesmente falhava. Então tentei subir a instância diretamente com:
$sudo /local_da_minha_instancia/test/bin/zopectl fg
E foi acusado um erro no arquivo /local_da_minha_instancia/test/etc/zdaemon.conf. Basicamente faltava colocar um % em frente ao define da segunda linha. Coloquei e resolveu meu problema.
Acredito que esse arquivo seja gerado automaticamente, daí o erro. De qualquer maneira deixo relatado aqui pra quem tiver o mesmo problema (ou uma explicação melhor pra ele!).
Abraço.