How to break Safari4 with CSS 
Today I found a nasty Safari 4.0 bug. By accident, I ended up with a css line as follows:

.orange {color: !important;}

The result is... Safari skips the complete rest of the css file after this statement. Took me ages to figure this out. But if this is persistant in some Safari versions, it might come in handy to make a Safari-Hack, like:

.dummy {color: !important;} /* rest of file is ignored by Safari */

So every disadvantage has it advantages.

[ add comment ]   |  permalink  |  related link  |   ( 3 / 323 )
linux centos/redhat/fedora man pages show strange characters - howto 
If you get strange ã characters in your man pages, the problem is probably that your ssh client does not understand UTF-8.

The solution is easy: add

export LANG=en_US

at the end of your /etc/bashrc



[ add comment ]   |  permalink  |  related link  |   ( 2.9 / 593 )
Long Time Google Docs Bugs Which Are So Far Never Fixed By Google 
The number of bugs in google docs seem to be so long that they have problems fixing them. At least the following issues are not resolved for months now. Unfortunately they are adding features more quickly than that they are fixing bugs, which was microsofts favorite thing to do and made me switch to google docs. Alas...

These bugs irritate me the most:
1. table ghost cells. Saving and reloading solves it, but thats a pain.
2. Font always switches back to "wide". Even if all default and font settings are right, some "ghost" font keeps popping up
3. jumping to beginning when more people start editing. irritating
4. bullet and indent trouble. Just like MSW, google is having trouble with idents and bullets.
5. table cell width's - I want to size a table using the mouse, not with a dialog.

more to be added...


[ add comment ]   |  permalink  |  related link  |   ( 3 / 745 )
what's the best pictureviewer for xp/vista? 
First, a bit of history:

before XP, I used acdsee on win98/win2000/nt but the person who developed this thought it was a good idea to put tons of useless features into it without thinking about the fact that an application needs a intuative userinterface, and then decided that it also needed nagscreens, banners and other irritations. So goodbye acdsee. This frankenstein is killed some time ago by it's creator and now lives on as a zombie.

On XP i've been using the standard windows picture viewer, which is simple and good. It shows all my snapshots and allows me to browse and print them. In combination with explorer, you hardly need anything else.

But what about the other popular formats, most importantly png and psd (photoshop) files. Because microsoft does not seem to like them they are not supported by the standard XP viewer. And then you might want to do some simple editing, like rescale or contrast correction on a few pictures. At that moment, you realize thet you need an alternative.

Well, vista finally arrived. And with it came the brand new photo gallery and solved all my problems...not. Although png file support is ok, psd files (from microsofts big enemy adobe) is still not supported, and the edit possibilities are still minimal.

Then i tried picasa, but that is not a picture viewer, it is a digital photo album.

so my wishlist was as follows:
- at least jpg, gif, png and psd format support.
- some simple editing options,
like scale, crop, contrast/hue/brightness, rotation, flip
- a real picture viewer with explorer-like file management.

In comes irfanview. This seems like a decent picturemanager, but it has a lot of drawbacks. First, the brain of the developer and my brain seem to be so different, that nearly all defaults are wrong. If you click on something, it always does NOT do what you want.
Example: the save-floppy icon is save-as, not save as you expect. Also, try to get the picture scaled to the window automatically, but keep its ratio. This should be the default setting, but in irfanview you need 20 minutes to figure out how to do this.
Then, try to edit a picture. You need to wade through hundreds of options, none are relevant until you find out it can not do what you want.
Finaly, irfanview is incredibly slow. The XP standard viewer shows pictures on avarage 50x faster than irfanview.
Conclusion: irfanview is bloatware that needs a serious rewrite. Its an application only a mother could love.

Googling for alternatives i came across firegraphic, paperstore, thumbsplus, compupic..

Then I found xnview. XnView is a better viewer in all aspects than irfanview or acdsee. It has a better userinterface, has a lot of options and features, and they are placed in the way you would expect them, its very fast and supports a lot of fileformats. A big advantage is it's browser screen which has a good explorer-like feel. And it's free.
The main disadvantage is that it also tries to implent too many features and options, but it does not become completly unusable, and the defaults are well chosen. Furthermore it does not have a modern userinterface like picasa.

What is it that picture viewer developers seem to think that the number of features is more important than the usability? Do we need to wait for windows7 before we get a decent picture viewer/editor in windows? Or is there a viewer that can do simple editing and is fast and passes some simple usability criteria?



[ add comment ]   |  permalink  |  related link  |   ( 2.9 / 733 )
Generating microsoft office documents (word, excel) on your webserver using php 
Actually, this is much easier than you might think. The trick is to use the capability of excel and word to read html files. So just generate normal html, but use a content-type header line to force the browser to see this as a word or excel file: (using php)

header ("Content-type: application/msword"); or
header ("Content-type: application/vnd.ms-word");
for word and
header ("Content-type: application/msexcel"); or
header ("Content-type: application/vnd.ms-excel");

I have never seen any difference between msword and vnd.ms-word, so if anybody knows the difference, please respond.

Then you might want to define the local filename. This can be done using the content-disposition header:

header("Content-Disposition: filename=\"invoice_$invoicenr.xls\"");

For excel, just start generating a html table. The full table is used as excel sheet with its rows and columns.
For word, just start generating html code. It is interpreted by word. Make sure to use a FULL url path if you want to include images.

Here is an example to generate a word document:
<?
$inr=10056; // invoice number
$item="usbst"; // article number
$itemdesc="Usb stick 512Mb"; // article descr
$price=6.49; // price

header("Content-type: application/vnd.ms-word");
header("Content-Disposition: filename=\"invoice_$inr.doc\"");
Header("Expires: Wed, 14 Oct 1997 06:41:40 GMT");
Header("Cache-control: no-cache");
?>
<html>
<HEAD>
<style type="text/css">
body { font-family: "Microsoft Sans Serif";
font-size:10pt;
margin:0px;}
img { padding:0px;margin:0px;border: solid 0px white;}
</style>
</HEAD><BODY>
<img src="http://www.cosninix.com/blog49/themes/default/images/header750x100.jpg" width="100">
<div style="margin-left:12px;">
<p>Invoice #<?=$inr?></p>
<table width="100%">
<tr>
<td width="20%"><b><?=$item?></b></td>
<td width="40%"><?=$itemdesc?></td>
<td width="40%"><?=$price?></td>
</tr>
</table>
</body>
</html>


Click here to test it.

[ 2 comments ] ( 43 views )   |  permalink  |  related link  |   ( 3 / 686 )

Next