For those who do not know, this year saw the first Javascript Conference 2009.
I decided to post here what happened there.
Firstly, this is an initiative of the team Iterative Designs(American company that works with Web development),to contribute to the Javascript community.
In the official site has the following: “JSConf 2009 is a conference devoted to the programming language we all love to hate and hate to love, JavaScript”.
And the appeal of the event was exactly that. Taking all kinds of people to the event, both those who love JavaScript, or you do not like at all, or even strangers.
A total of 16 speakers at the conference. But not “only” speakers … The event was attended by big names such as John Resig, JQuery creator. Peter Higgins, leading of Dojo project and Richard Worth, one of leading of JQueryUI.
Some presentations were made available:
These are the lecture by John Resig, is well worth watching. The talk of it encompassed matters 3: Measuring performance, games and Testing Javascript
Today I came to talk about one of the methods that I find very interesting in Jquery, the serialize().
As its name implies, this method serializes a set of inputs of a form on a string.
This string is standardized and compatible with most server-side language.
This is very useful for example when we want to send a series of data to the server with Ajax.
Note that we have created a form of traditional way, but omit the method attribute in the tag <form>, because this will be addressed later.
How to Serialize?
With a line the Jquery lets you do this, let the example:
var formdata = $('#my_form').serialize();
Now the formdata variable is a string serialized like:
input_1=valor1&input_2=valor2&input_3=valor3
The string is in this format key/value concatenated with “&”.
Now that we have the string, just pass it to the server. How? Quite simply with the jQuery Ajax() method:
Remember that we omit the method attribute of the form?
We did this because we are making an Ajax request using the POST method, anyway it would be ignored in our example.
Ajax: type – Specify the method how data will be sent to the server. In our example we’re using POST. url - Specifies the page to which the data will be submitted. In our example I’m taking the action attribute of the form, which will cause the data to be submitted to the file page.php. data – The data to be submitted. The serialized string is passed here. success – Function to perform when we are successful. In the example, an alert.
Done!
We have created a form, all inputs serialized in a string, send all data to a PHP page via Ajax.
Simple.
Várias palestras interessantes no #PHP SC Conf deste ano.
A palestra que abriu o evento foi do projeto theWebMind, cujo qual sou mebro e que vocês já devem conhecer.
Fora alguns problemas técnicos conseguimos apresentar o projeto em primeira mão para o pessoal que estava presente. Obtivemos vários feed-backs positivos a respeito do projeto.
Intervalo para o almoço e em seguida foi a vez de Felipe L. Pereira e Marcelo Magnani apresentando Aplicações desenvolvidas para o Governo com Symfony. Achei bem interessante a palestra a abordagem deles sobre o uso de Simfony, mas mesmo com cases de sucesso não consigo me adaptar a esse Framework.
Logo após foi a vez do Filipe Ibaldo Gomes apresentar conceitos do mesmo Simfony e montar uma pequena Aplicação utilizando o Framework. No meu ponto de vista a palestra foi boa, o Filipe conseguiu demonstrar bastante conhecimento sobre Simfony, mas me deixou com menos interesse ainda de partir para esse caminho. Achei muito complicada a maneira de como se trabalha, mas essa é só a minha opnião.
Coofee-Break, porque ninguém é de ferro, e falando nisso, ninguém comentou mas estava muito bom.
Depois de forrar o estomago chegou o palestrante Eduardo Kraus, sua palestra foi “Integração do Flex com PHP“. O Eduardo conseguiu entusiasmar o pessoal com exemplos práticos e uma bela explicação sobre como funciona esse processo de integração do Flex com PHP. No final da sua palestra ainda trocamos uma idéia e ele nos passou uma série de códigos prontos para quem sabe desenvolvermos um módulo Flex para o Mind.
Não consegui acompanhar a palestra do Samuel Crescêncio sobre “Lean”, mas ouvi de todos participantes ótimas críticas sobre sua apresentação.
Ainda tivemos o Erico Vasconcelos com a palestra “Suporte da ZEND para o ciclo de vida de aplicação PHP”.
O figuraça Walker de Alencar palestrou sobre PHP Coding Standards e PHPDoc.
Sábado começou bem, com mais uma figura carimbada da comunidade PHP.Er Galvão Abbott, Diretor de Conteúdo do PHP Conference Brasil e conhecido por vários outros projetos apresentou “Preto, branco e as sombras de cinza: Filtrando e validando strings”. Depois tivemos mais Zend com Adler Medrado e para fechar a manhã, Samuel Crescêncio, mostrando muito conhecimento sobre o assunto, palestrou sobre SCRUM.
O Rafael Kassner fez uma boa apresentação sobre Frameworks PHP, mostrando os pontos positivos e negativos de se adotar um Framework, e o que botar na balança na hora de decidir usar um Framework. Sua apresentação gerou um bom debate, assim contribuindo para todos que ali estavam, experientes ou iniciantes.
A palestra “Cases em multinacionais de telefonia utilizando PHP” da Flávia Jobstraibizer gerou um pouco de inquietação do pessoal, mas foi uma boa apresentação, mostrando a força do PHP dentro de uma empresa do nível da Telefônica. Não posso deixar de citar algumas coisas bem interessantes que ela falou: A Microsoft adotou PHP em um projeto pelo fato do custo benefício! O aumento de cinquenta e tantos por cento no salário de toda a equipe PHP da Telefônica.
A Claro utiliza PHP porque é mais rápido que JAVA.
Mais uma figuraça sobe ao palco: Guilherme Blanco, cheio de estilo e de gravata laranja(bem laranja) apresentou “Desenvolvimento Ágil com Doctrine ORM“. Um ótimo ORM(object relational mapper) que facilita muito as tarefas de desenvolvimento.
Ainda tivemos apresentações sobre RIA por Anderson Straube, “Desenvolvimento Ágil com Zend Framework e Yahoo! UI” por Domingos Teruel e “Melhorando a performance de aplicações com o uso do MemCache” por Elton Minetto.
Durante o sábado o pessoal ainda pode fazer mini cursos que aconteceram simultaneamente as palestras nos laboratórios da Univali.
Para concluir: grande evento, grandes personalidades, ótimos contatos profissionais.
OBS: Sobre as festas que rolaram no submundo do PHP SC Conf, prefiro nem comentar.(ahahhahahaah).
Vou comentar sim: Estavam muito boas! #phpscconf#phpinga#jesusmechicoteia
Ontem, dia 29 foi a primeira apresentação do projeto theWebMind em um evento público.
A palestra foi muito produtiva, conseguimos atingir um público bem legal, agora esperamos que a comunidade contribua com o Mind.
Disponibilizamos a apresentação neste endereço: www.thewebmind.org/presentation.
Javascript is a very powerful programming language . Do not say this only because i love the language, but for daily work with Javascript and see its power.
Frameworks help of course, but do not forget that everythingh is all the more pure and beautiful Javascript.
In the list that I participate, I see some people mistakenly confuse it a little, but it’s coming the next Post.
What I will address in this Post is a very good plugin developed by Brandon Aaron.
For those who do not know, this guy lives down in Texas and is a leading member of jQuery developers team.
The basic idea of the plugin is creating the effect of Gradient (going from one color to another) in an HTML element. That’s right! No more Photoshop. O /
What we need: obviously the Jquery, and the Gradient plugin.
But this time go a little further…
The plugin allows us to specify the initial RGB code, RGB code final and even the direction of the gradient (vertical or horizontal).
Let’s see the code could understand better:
$('#my_element').gradient({
from: 'ffffff',
to: '000000',
direction: 'vertical';
});
In this example the gradient effect will be applied to the element with ID my_element, starting with white and black going to the vertical direction.
Simple!
Good, but as I said above, go a little further. If we pass RGB values for the plugin, so maybe we can use another plugin well known and very good too, the Color Picker.
I prepared a script where I use the features of the 2 plugins. See below as it was. And again see the power of JavaScript:
Porque?
Bom, hoje no trabalho eu precisei testar uma rotina que basicamente identificava se o usuário estava em um PC ou em um iPhone.
No meu caso específico era com .NET que eu ia fazer essa verificação, mas com PHP ou Javascript também conseguimos identificar o User Agent.
Blza. Verificação feita. Mas e iPhone pra testar? Pois é, não tinha nenhum.
Pesquisando acabei achando esse site: http://www.yes-no-cancel.co.uk/2008/01/03/imitating-the-iphone-user-agent-in-firefox/
“Imitating the iPhone User Agent in Firefox”.
Isso mesmo!!!
Um Add-on muito útil para o Firefox que troca o User Agent.
Ai foi barbada.
Para baixar o Add-on -> User Agent Switcher add-on for Firefox
A string do User Agent iPhone:
Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3
É só adicionar e ta pronto.
Só não esqueçam de voltar para User Agent default depois do teste.