2009-11-03

Spam and malware, with screenshots

Got this fake antivirus message yesterday and thought it might be worth sharing:
This one was rather well crafted, but they obviously didn't take the time to check operating system, even though they found my ip address. (See bottom left.) Here's another one. This one I got in mail a few weeks ago, from a friend who obviously got her email account stolen:

It's in norwegian, and it's readable, but it is quite obvious that she didn't write it. I guess they fed it through google translate. Translated back to english it would become something like (errors intended): "I need you help NÅ How is you? ..." Wonder what this is going to look like in a couple of years when automated translation gets getter : )

2009-10-29

Windows 7 fail

I downloaded the Release Candidate of Windows 7 earlier this year, and today I decided to give it a try. After booting from the dvd and asking a couple of questions it asks for a cd rom driver(!).

What did you say, Microsoft? You are booting from that CD rom drive. You also have a whole DVD to store whatever drivers you need. Every major linux distro I've tried manages include drivers for my cd rom on a CD!

Of course, like every Windows installation I have done since 3.1 it stops more than one time. And of course it doesn't boot into live cd mode before start asking questions, but that is hardly anything new for anybody who has installed Windows more than a couple of times.

2009-10-21

Improving DZone

Recently I've been thinking about how to improve the quality of DZone, and here are some notes that I've made.

Disclaimer:I do not work for DZone.

Continue to post relevant stuff!

For everyone who is already contributing: You are the reason why I visit DZone. (The article you wrote two moths ago was great, you really managed to pinpoint the problem! That link you posted last week was interesting, I would never have found it if it didn't float to the top of DZone! Thank you for for taking time to moderate incoming links! ) If you find good articles or blog posts related to software or hardware development, please continue to post it.

Post good articles!

How can we define good articles? According to Dave Winer it is:

People talking about things they know about, not just expressing opinions about things they are not experts in (nothing wrong with that, of course).
Don't post links to links!

There's a saying that goes like this "copy one source and it is plagiarism, copy two or three sources and it is research."

If you want to post a link to DZone, make sure you either link directly to the source, or that you add significant value.

Don't post non-developer stuff

Remember, DZone is D(eveloper)Zone, not Digg, not Slashdot or any other general social networking/bookmarking site.

That means, if you find great stuff but it's not related to software or hardware development, please post it, but post it somewhere else. If somebody is interested in those articles too, they can visit digg, lifehacker and slashdot. I'm sure many DZone readers do already.

If you post a top n list, make sure it is a good one

Jurgen Appelo has described his preparations here: http://www.noop.nl/how-to-make-a-top-blog-list.html. Basically, if you think this is too much work, don't post the link.

Vote down

To quote the stackowerflow faq:

Be honest.

Above all, be honest. If you see misinformation, vote it down. Insert comments indicating what, specifically, is wrong.

Read before you respond

Sometimes articles are voted down because of what we, the readers, think the author is writing. As an example, the article When Windows beats Linux: a cautionary tale was downvoted eagerly and judging by the comments, the downvoters was most likely zealous Linux fans, who obviously had not read the article (It was pro Linux.)

Downvote this article

Now, this article is not related to software development, so you may just go ahead, follow my advice and downvote it, I don't care. Or, -if you think more people should be reading this, post it to dZone and vote it up.

Also, if you have any ideas about how to make a better DZone, please write it down in blog post, or if you are lazy, just make a comment.

2009-10-18

Creating Drupal themes from scratch

If you want to create Drupal themes from scratch, i.e. you do not want to modify an existing theme but rather paste your own html and insert placeholders, MODx style, then this post is for you.

MODx has long been my favourite framework because of it's simple and powerful templating system (copy and paste your html, insert placeholders, go), but recently the lack of visible activity has convinced me to look for other alternatives. I bought "Using Drupal" and "Joomla! A User's Guide: Building a Successful Joomla! Powered Website". One of the reasons I never started to use Joomla! was that it always seemed like it would force me to organize content into two levels. After reading a few pages of the book I found out that it was in fact true. So I put the Joomla! book down and started reading "Using Drupal".

Drupal seems a lot more flexible. The thing that has always scared me away from Drupal and back to MODx is templating. Here is an example: http://drupal.org/node/11774 The templating system is very flexible, -and may seem very complicated.

In addition to this, the ultimate beginners theme, Zen, actually complicates things further if you, for instance, would like to move an existing site to Drupal, or if you want to unpack the html from the designer, insert your placeholders and test it. At least that's my conclusion so far.

Here's a simplified version of my current workflow: 
  • Use a standard theme for your admin pages:
    • Adjust settings under http://<yourservername>/admin/settings/admin
  • Download an empty theme. The best I've found so far is foundation
  • Unzip and paste into themes folder.
  • Rename page.tpl.php in the empty theme to something else.
  • Paste your html to a new file called page.tpl.php.
  • Using the old page.tpl.php as reference, insert similar placeholders into the new one.
  • Enable and test.

2009-10-15

I'm new with drupal, and I wish sobody told me this yesterday: To make an absolute link to an image in a theme, without worrying about where the theme is going to be installed, you can do the following:

<img alt="logo" src="<?php echo(base_path().drupal_get_path('theme','your_theme_name'))?>/img/some_image.png" />

If you are using phptemplate, the drupal_get_path-call might be substituted by just $directory, making it even simpler:

<img alt="logo" src="<?php echo(base_path() . $directory )?>/img/some_image.png" />

The second one was found here:  http://drupal.org/node/52520

Netbeans got a nice css preview

Was doing some spare time drupal work in Netbeans 6.8 when I suddenly found out it had working css preview. See screenshot below for details:
Logging into my other (work ) account I found it in Netbeans 6.7 too, which explains why it wasn't mentioned in NetBeans 6.8 -- New and Noteworthy

2009-05-10

The "bug"

A couple of days ago I troubleshooted some code that was supposed to take a ResultSet as input and return a String as output. For some reason it would just skip the entire resultset, regardless of what I did. In hindsight, it's funny. That last() gave me a lot of debugging, including looking for possible concurrency issues. Don't know why I put it there in the first place either :)