quinta-feira, 19 de novembro de 2009
HTML 5
Esta evolução da linguagem padrão para web pode eliminar a necessidade de plug-ins para aplicações multimídia em navegadores. Diversos críticos consideram a tecnologia como um forte concorrente ao Flash do Adobe, Silverlight, da Microsoft, e o recente JavaFX, da Sun. Recentemente, Shantanu Narayen, diretor executivo do Adobe, disse que o Flash não irá perder mercado, porem a versão 5 do HTML já está sendo chamado de “Flash-killer”. Estas tecnologias precisarão se adaptar rapidamente para conseguir manter-se no mercado, tão popular quanto hoje. Na avaliação do co-diretor de ferramentas da Mozilla, Ben Galbraith, as tecnologias viabilizadas pelo HTML 5 como o Canvas para desenhos 2D e o armazenamento de conteúdos no desktop, permitirão que “usemos mais o browser do que nunca”.
Após dez anos sem atualizações, a forma como se escreve páginas na Internet passa por uma boa transformação. O HTML 5 oferece uma experiência web totalmente diferente para usuários e embora exista um longo caminho para ser finalizado, os navegadores mais importantes, como o Opera, Google Chrome, Safari 4, o novo Firefox 3.5 e o Internet Explorer 8 já implementaram partes da linguagem, incluindo tags de vídeo e suporte à tecnologia Canvas.
Com a evolução da linguagem, os navegadores passam da categoria “mostradores de páginas”.
quarta-feira, 18 de novembro de 2009
SPDY: An experimental protocol for a faster web
original post here
Executive summary
Background: web protocols and web latency
- Single request per connection. Because HTTP can only fetch one resource at a time (HTTP pipelining helps, but still enforces only a FIFO queue), a server delay of 500 ms prevents reuse of the TCP channel for additional requests. Browsers work around this problem by using multiple connections. Since 2008, most browsers have finally moved from 2 connections per domain to 6.
- Exclusively client-initiated requests. In HTTP, only the client can initiate a request. Even if the server knows the client needs a resource, it has no mechanism to inform the client and must instead wait to receive a request for the resource from the client.
- Uncompressed request and response headers. Request headers today vary in size from ~200 bytes to over 2KB. As applications use more cookies and user agents expand features, typical header sizes of 700-800 bytes is common. For modems or ADSL connections, in which the uplink bandwidth is fairly low, this latency can be significant. Reducing the data in headers could directly improve the serialization latency to send requests.
- Redundant headers. In addition, several headers are repeatedly sent across requests on the same channel. However, headers such as the User-Agent, Host, and Accept* are generally static and do not need to be resent.
- Optional data compression. HTTP uses optional compression encodings for data. Content should always be sent in a compressed format.
Previous approaches
- Stream Control Transmission Protocol (SCTP) -- a transport-layer protocol to replace TCP, which provides multiplexed streams and stream-aware congestion control.
- HTTP over SCTP -- a proposal for running HTTP over SCTP. Comparison of HTTP Over SCTP and TCP in High Delay Networks describes a research study comparing the performance over both transport protocols.
- Structured Stream Transport (SST) -- a protocol which invents "structured streams": lightweight, independent streams to be carried over a common transport. It replaces TCP or runs on top of UDP.
- MUX and SMUX -- intermediate-layer protocols (in between the transport and application layers) that provide multiplexing of streams. They were proposed years ago at the same time as HTTP/1.1.
Goals for SPDY
- To target a 50% reduction in page load time. Our preliminary results have come close to this target (see below).
- To minimize deployment complexity. SPDY uses TCP as the underlying transport layer, so requires no changes to existing networking infrastructure.
- To avoid the need for any changes to content by website authors. The only changes required to support SPDY are in the client user agent and web server applications.
- To bring together like-minded parties interested in exploring protocols as a way of solving the latency problem. We hope to develop this new protocol in partnership with the open-source community and industry specialists.
-
To allow many concurrent HTTP requests to run across a single TCP session.
-
To reduce the bandwidth currently used by HTTP by compressing headers and eliminating unnecessary headers
-
To define a protocol that is easy to implement and server-efficient. We hope to reduce the complexity of HTTP by cutting down on edge cases and defining easily parsed message formats.
- To make SSL the underlying transport protocol, for better security and compatibility with existing network infrastructure. Although SSL does introduce a latency penalty, we believe that the long-term future of the web depends on a secure network connection. In addition, the use of SSL is necessary to ensure that communication across existing proxies is not broken.
- To enable the server to initiate communications with the client and push data to the client whenever possible.
Basic features
- Multiplexed streams
SPDY allows for unlimited concurrent streams over a single TCP connection. Because requests are interleaved on a single channel, the efficiency of TCP is much higher: fewer network connections need to be made, and fewer, but more densely packed, packets are issued.
-
Request prioritization
Although unlimited parallel streams solve the serialization problem, they introduce another one: if bandwidth on the channel is constrained, the client may block requests for fear of clogging the channel. To overcome this problem, SPDY implements request priorities: the client can request as many items as it wants from the server, and assign a priority to each request. This prevents the network channel from being congested with non-critical resources when a high priority request is pending.
- HTTP header compression
SPDY compresses request and response HTTP headers, resulting in fewer packets and fewer bytes transmitted.
Advanced features
- Server push.
SPDY experiments with an option for servers to push data to clients via the X-Associated-Content header. This header informs the client that the server is pushing a resource to the client before the client has asked for it. For initial-page downloads (e.g. the first time a user visits a site), this can vastly enhance the user experience.
- Server hint.
Rather than automatically pushing resources to the client, the server uses the X-Subresources header to suggest to the client that it should ask for specific resources, in cases where the server knows in advance of the client that those resources will be needed. However, the server will still wait for the client request before sending the content. Over slow links, this option can reduce the time it takes for a client to discover it needs a resource by hundreds of milliseconds, and may be better for non-initial page loads.
SPDY implementation: what we've built
-
A high-speed, in-memory server which can serve both HTTP and SPDY responses efficiently, over TCP and SSL. We will be releasing this code as open source in the near future.
-
A modified Google Chrome client which can use HTTP or SPDY, over TCP and SSL. The source code is at http://src.chromium.org/viewvc/chrome/trunk/src/net/flip/. (Note that code currently uses the internal code name of "flip"; this will change in the near future.)
-
A testing and benchmarking infrastructure that verifies pages are replicated with high fidelity. In particular, we ensure that SPDY preserves origin server headers, content encodings, URLs, etc. We will be releasing our testing tools, and instructions for reproducing our results, in the near future.
Preliminary results
We downloaded 25 of the "top 100" websites over simulated home network connections, with 1% packet loss. We ran the downloads 10 times for each site, and calculated the average page load time for each site, and across all sites. The results show a speedup over HTTP of 27% - 60% in page load time over plain TCP (without SSL), and 39% - 55% over SSL.
| DSL 2 Mbps downlink, 375 kbps uplink | Cable 4 Mbps downlink, 1 Mbps uplink | |||
| Average ms | Speedup | Average ms | Speedup | |
| HTTP | 3111.916 | 2348.188 | ||
| SPDY basic multi-domain* connection / TCP | 2242.756 | 27.93% | 1325.46 | 43.55% |
| SPDY basic single-domain* connection / TCP | 1695.72 | 45.51% | 933.836 | 60.23% |
| SPDY single-domain + server push / TCP | 1671.28 | 46.29% | 950.764 | 59.51% |
| SPDY single-domain + server hint / TCP | 1608.928 | 48.30% | 856.356 | 63.53% |
| SPDY basic single-domain / SSL | 1899.744 | 38.95% | 1099.444 | 53.18 |
| SPDY single-domain + client prefetch / SSL | 1781.864 | 42.74% | 1047.308 | 55.40% |
* In many cases, SPDY can stream all requests over a single connection, regardless of the number of different domains from which requested resources originate. This allows for full parallelization of all downloads. However, in some cases, it is not possible to collapse all domains into a single domain. In this case, SPDY must still open a connection for each domain, incurring some initial RTT overhead for each new connection setup. We ran the tests in both modes: collapsing all domains into a single domain (i.e. one TCP connection); and respecting the actual partitioning of the resources according to the original multiple domains (= one TCP connection per domain). We include the results for both the strict "single-domain" and "multi-domain" tests; we expect real-world results to lie somewhere in the middle.
The role of header compression
The role of packet loss and round-trip time (RTT)
- SPDY sends ~40% fewer packets than HTTP, which means fewer packets affected by loss.
- SPDY uses fewer TCP connections, which means few changes to lose the SYN packet. In many TCP implementations, this delay is disproportionately expensive (up to 3 s).
- SPDY's more efficient use of TCP usually triggers TCP's fast retransmit instead of using retransmit timers.
Table 2: Average page load times for top 25 websites by packet loss rate
| Average ms | Speedup | ||
| Packet loss rate | HTTP | SPDY basic (TCP) | |
| 0% | 1152 | 1016 | 11.81% |
| 0.5% | 1638 | 1105 | 32.54% |
| 1% | 2060 | 1200 | 41.75% |
| 1.5% | 2372 | 1394 | 41.23% |
| 2% | 2904 | 1537 | 47.7% |
| 2.5% | 3028 | 1707 | 43.63% |
| Average ms | Speedup | ||
| RTT in ms | HTTP | SPDY basic (TCP) | |
| 20 | 1240 | 1087 | 12.34% |
| 40 | 1571 | 1279 | 18.59% |
| 60 | 1909 | 1526 | 20.06% |
| 80 | 2268 | 1727 | 23.85% |
| 120 | 2927 | 2240 | 23.47% |
| 160 | 3650 | 2772 | 24.05% |
| 200 | 4498 | 3293 | 26.79% |
SPDY next steps: how you can help
- Bandwidth efficiency is still low. Although dialup bandwidth efficiency rate is close to 90%, for high-speed connections efficiency is only about ~32%.
- SSL poses other latency and deployment challenges. Among these are: the additional RTTs for the SSL handshake; encryption; difficulty of caching for some proxies. We need to do more SSL tuning.
- Our packet loss results are not conclusive. Although much research on packet-loss has been done, we don't have enough data to build a realistic model model for packet loss on the Web. We need to gather this data to be able to provide more accurate packet loss simulations.
- SPDY single connection loss recovery sometimes underperforms multiple connections. That is, opening multiple connections is still faster than losing a single connection when the RTT is very high. We need to figure out when it is appropriate for the SPDY client to make a new connection or close an old connection and what effect this may have on servers.
- The server can implement more intelligence than we have built in so far. We need more research in the areas of server-initiated streams, obtaining client network information for prefetching suggestions, and so on.
To help with these challenges, we encourage you to get involved:
- Send feedback, comments, suggestions, ideas to the chromium-discuss discussion group.
- Download, build, run, and test the Google Chrome client code.
- Contribute improvements to the code base.
SPDY frequently asked questions
quarta-feira, 11 de novembro de 2009
Google's Go: A New Programming Language That's Python Meets C++
Go attempts to combine the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++. In our experiments with Go to date, typical builds feel instantaneous; even large binaries compile in just a few seconds. And the compiled code runs close to the speed of C. Go is designed to let you move fast.We're hoping Go turns out to be a great language for systems programming with support for multi-processing and a fresh and lightweight take on object-oriented design, with some cool features like true closures and reflection.
For more details check out Golang.org.
To get things started the right way, here's Go's rendition of Hello World!
package main
import "fmt"
func main() {
fmt.Printf("Hello, World\n")}
segunda-feira, 19 de outubro de 2009
Anti-IF campaign

What Is the Anti-IF Campaign?
The objective of the Anti-IF Campaign is to raise awareness of effective use of the Object-Oriented paradigm.
The primary purpose of our campaign is to become aware of the design consequences of using IFs and of control structures in general, applied by following the path of the procedural paradigm in Object Oriented contexts. This greater awareness will enable you to understand how to achieve more effective results in terms of flexibility, comprehensibility, testability, and ability to evolve.
Why Was It Started?
The campaign was Francesco Cirillo’s idea: “Lots of teams want to be agile, but they don’t know the basics for cutting down on code complexity.” Knowing how to use objects lets developers eliminate IFs based on type, those that most often compromise software's flexibility and ability to evolve. Let’s start with these!”
Who Is It For?
- Developers (Junior and Senior)
- Business Analysts
- Project Leaders
- Software Quality Assurance Team Members
sexta-feira, 16 de outubro de 2009
Sugestão no Washington Post: Use Linux para evitar fraude bancária
terça-feira, 13 de outubro de 2009
Browsers: uma breve história - Parte III
Como as especificações de design para páginas web, tornou-se mais preciso e as expectativas dos usuários cresceram, uma outra batalha na guerra dos navegadores web começou. Quanto mais detalhada era uma página web e mais rica a sua funcionalidade, maior era o fosso entre os navegadores. Como se isso não bastasse, existia também diferenças entre as plataformas. Como o Netscape trabalhava no Macintosh, era significativamente diferente de como ele funcionava no Windows. Houve diferenças entre si nos navegadores, mas também nos sistemas. Por exemplo, fontes tendiam a exibir menores em Macs, e maior no Windows (mesmo usando o mesmo browser). Cor tendiam a mostrar mais escura em um PC do que em um Mac. Determinados recursos disponíveis no IE 4.0 no PC talvez não estivesse disponível para usuários de Mac (Ainda que sempre o caminho).
Como podemos enfrentar essa guerra?
A guerra dos navegadores tem sido intensa e frustrante. Todo desenvolvedor web tem histórias de horror sobre a tentativa de tornar nos seus locais de trabalho, os principais navegadores. Nos primeiros dias as linhas de batalha foram divididas e bastante equilibradas. Isso tornou as coisas muito difíceis. O resultado foi que muitas vezes tivemos que desenvolver a um nível inferior, para manter os problemas do navegador para um mínimo. Hoje somos capazes de fazer mais.
O primeiro passo para lidar com questões de compatibilidade de navegadores, é definir claramente qual o navegador que um determinado site irá apoiar. Para nós, quando a utilização de um navegador cair abaixo de 3% já não se deve apoiá-lo ativamente. Isso não significa que um site não funciona em um navegador mais antigo. Significa apenas que não mais será feito testes com esse navegador e, se surgem problemas de exibição, não serão prontamente corrigidos.
Quando formamos nossos padrões baseados nos navegadores mais utilizados, e em 95-97% dos casos os nossos sites ficarão muito bem, isso não ajuda muito quando o nosso cliente ainda está usando um navegador obsoleto. Enquanto nós sempre incluiremos os nossos padrões de compatibilidade do navegador nas nossas propostas, também é uma idéia muito boa fazer uma prospecção de navegadores que eles usam (e talvez mais importante, que navegador usa seu chefe) antes de iniciar um projeto. Caso contrário, você estará enfrentando um problema real para o fim de um projeto quando o cliente chama dizendo que o site parece terrível em seu computador (não o tempo para começar a educá-los sobre questões de compatibilidade do navegador).
Apoio a navegadores mais antigos
Apoiar os navegadores mais utilizados e utilizando os meios mais eficientes de codificação faz sentido para projetos web. No entanto, a decisão de limitar o apoio ao navegador pode não fazer sentido para aquelas pessoas que ainda usam navegadores mais antigos (isto é particularmente problemático se o presidente possa ser uma dessas pessoas). É por isso que é extremamente importante comunicar e discutir as normas de compatibilidade do navegador com o seu cliente antes de iniciar um projeto. Também é uma boa idéia incluir normas de compatibilidade do navegador em qualquer proposta ou no contrato do projeto. E por favor, sempre fazer a pergunta "qual o browser que o presidente da empresa usa?", e talvez qual o navegador que a mãe dele usa também; vai que ele queira mostrar o que os "meninos" da empresa fizeram.
Manuseio com navegadores do futuro
Uma nota a respeito de navegadores do futuro. Podemos incluir o seguinte texto em nossos padrões técnicos "A Xpto não garante a compatibilidade com versões futuras dos vários navegadores. Se novos navegadores não exibem informações com precisão, correções podem ser feitas e, será cobrado homem-hora." Enquanto isto pode parecer óbvio (como você não pode apoiar um navegador que ainda não existe), é uma boa idéia deixar o cliente saber que as futuras versões do navegador pode agir de maneira diferente e teoricamente "quebrar" o site existente.
O que nos reserva o futuro?
Embora as questões de compatibilidade do navegador são de longe a parte mais frustrante no desenvolvimento web, as coisas melhoraram. A boa notícia é que a cada mês que passa, há menos navegadores mais antigos sendo usados. Para nosso grande alívio, a atual tendência dos navegadores é para a compatibilidade cross-browser e aderência aos padrões web já existentes. Esperemos que com menos pressão por novas versões de navegadores para oferecerem recursos novos e originais, os navegadores mais recentes se mantenham em conformidade com as normas existentes. Podemos sonhar, não podemos?
sexta-feira, 2 de outubro de 2009
Celestia 3D Space Simulation Software For Linux / Windows / OS X

Celestia is a real-time visual space simulation astronomy program. It is a cross platform, open source software and released under the GNU General Public License. NASA and ESA have used Celestia in their educational and for interfacing to trajectory analysis software. It allows users to travel through an extensive universe, modeled after reality, at any speed, in any direction and at any time in history. Celestia displays and interacts with objects ranging in scale from artificial satellites to entire galaxies in three dimensions using OpenGL. It is a perfect software for astronomer, educator, student, and teacher for astronomy purpose.
Features
- Celestia displays the Hipparcos Catalogue (HIP) of almost 120,000 stars.
- Solar and lunar eclipse finder.
- Display the orbital paths of planets (including extrasolar planets), dwarf planets, moons, asteroids, comets, artificial satellites, and spacecraft.
- Celestia users can travel/fly through the Celestia universe using simple keyboard controls, at any speed from 0.001m/s to millions of light years/s
Controls allow users to orbit stars, planets, moons and other space objects, track space objects such as spacecraft, asteroids and comets as they fly by, or travel to and/or fly through nebula and irregular, elliptical and spiral galaxies (over 10,000 galaxies included). - Celestia displays such features as detailed atmospheres on planets and moons, planet shine on orbiting satellites, sunsets and sunrises, moving clouds, planetary rings, eclipse and ring shadows etc.
- Graphic screen-shots and movies can be captured in classic or HD resolutions (up to 1920x1080) on Windows and Linux platforms.
Packages
You need to install the following packages:
- celestia - A real-time visual space simulation
- celestia-common - Datafiles for Celestia, a real-time visual space simulation
- celestia-glut - A real-time visual space simulation (GLUT frontend)
- celestia-gnome - A real-time visual space simulation (GNOME frontend)
- celestia-kde - A real-time visual space simulation (KDE frontend)
Install Celestia Under Debian / Ubuntu Linux
Type the following commands:sudo apt-get update
sudo apt-get install celestia-gnome celestia
How do I start Celestia?
Type the following command at a console (terminal):$ celestia-gnome &
Alternatively, you can start Celestia in the following ways:
- Applications menu
- Choose Education > Celestia
Celestia Mouse, Keyboard and Joystick Controls
Celestia allows you to zoom in / out and rotate various objects from star to spacecraft using a mouse. It has "point and goto" interface which allows you to navigate through our universe.
| Mouse Controls | Description |
|---|---|
| Left Drag | Camera orientation--Up/Down/Left/Right (also Up & Down arrow key) |
| Shift+Left Dbl Click on an object | Deselect and Center selected object |
| Left Click on no object | Deselect currently selected object |
| Right Click on an object | Display object context menu if it has one |
| Scroll Wheel or Ctrl+Left Drag or Ctrl+Left Drag Left+Right Drag up/down | Distance to selection adjust. (Home/End) |
To see complet list press CTRL+H.
How do I view demo?
To view the demo click on Help menu > Demo.
Further readings:
- Official project website
- Celestia motherlode collection of add-ons made by various people
- Celestia from Wikipedia, the free encyclopedia.
(Image credit: Wikipedia)


