Mittwoch, 19. Januar 2011
Google Chrome already uses SPDY
SSL connections from Google Chrome to a Google server have a 90 % chance of using SPDY. SPDY is an HTTP replacement that encrypts all data and greatly reduces latency (it's way better than persistent or keep-alive HTTP connections). Read more about SPDY at Wikipedia. Although already deloyed by Google, support for SPDY in any free HTTP server software is currently non-existent.
Montag, 10. Januar 2011
Saving Revisions of Articles in a Database
Reverse diffs
Assumption: You have the most recent revision available anyways in your "articles" table. Then use reverse-diffs (that convert revision k into revision k-1) instead of normal forward-diffs (that would convert revision k into revision k+1). This saves disk space.
Let's assume you have n revisions. With reverse-diffs your "revisions" table only needs to save one reverse-diff for each of the (n-1) old revisions. In contrast to that for forward-diffs you would have to store the initial revision completely (1) plus one forward-diff for each following revision (n-1) which sums up to n.
Diff format
Instead of using diffutils think about whether it might be more easy and maybe even efficient to serialize and gzip the data of all revisions. Mediawiki does this especially because this is a very efficient way to deal with edit-wars (source for this is a presentation by a Mediawiki developer, but I have lost the link, sorry).
Assumption: You have the most recent revision available anyways in your "articles" table. Then use reverse-diffs (that convert revision k into revision k-1) instead of normal forward-diffs (that would convert revision k into revision k+1). This saves disk space.
Let's assume you have n revisions. With reverse-diffs your "revisions" table only needs to save one reverse-diff for each of the (n-1) old revisions. In contrast to that for forward-diffs you would have to store the initial revision completely (1) plus one forward-diff for each following revision (n-1) which sums up to n.
Diff format
Instead of using diffutils think about whether it might be more easy and maybe even efficient to serialize and gzip the data of all revisions. Mediawiki does this especially because this is a very efficient way to deal with edit-wars (source for this is a presentation by a Mediawiki developer, but I have lost the link, sorry).
Samstag, 8. Januar 2011
As expected: No Response to Opera Bug Reports
Why should I bother reporting bugs to Opera if they never ever send a response? Three weeks ago I told them that in Opera 11.00 input fields with type="search" cannot be submitted (DSK-322619). They did not respond to any of my bug reports in the past but I wanted to let them know nevertheless. But as expected they did not react at all.
In the future I won't waste my time reporting Opera bugs.
In the future I won't waste my time reporting Opera bugs.
Mittwoch, 5. Januar 2011
nginx: Blocking Mozilla Prefetch Requests
if ( $http_x_moz = "prefetch" ) {
return 444;
}On ComputerBase they accounted for 15 % of all HTTP requests for HTML pages. And our HTML pages cannot even be cached so this behaviour of Mozilla browsers is a waste of resources (server load + traffic).Mozilla should fix Firefox such that it only prefetches resources marked as rel="prefetch". Those marked as rel="next" should not be prefetched.
Edit: Switched from "return 403" to "return 444" (i.e. just close connection) because some users reported problems with proxy servers.
Donnerstag, 14. Januar 2010
Removing a password from a PDF file
One of my tutors protects PDF files with a password although they are only accessible after you've authenticated yourself as a student. Since it is annoying to enter a password each and every time you open one of those PDFs, you can use QPDF to get rid of the password:
qpdf --password=<PASSWORD> --decrypt input.pdf output.pdf
Donnerstag, 1. Oktober 2009
Running Hunspell via PHP's exec function
Reminder to self: Ensure that the environment variable
$HOME is set. Otherwise hunspell refuses to report any misspelled words.
Abonnieren
Posts (Atom)