August 2006 - Posts
At this community with some beautiful members who like to blog here, we had a serious problem. Spam comments. I've blogged about it before and others as well. So when reading the article about the CS Spam Blocker by Jayson Knight, I read that comments marked as spam would be deleted automatically. So I tried to figure out how this was working. But still, for every comment-spam I received, I also got an email. Resulting in a flooded mailbox from time to time.
So when I saw J-O Eriksson talk about the spam comments being deleted by an automated job, I asked myself what Jasyon Knight actually ment. So I asked, and as you can see in the replies in the J-O Eriksson post, it's solved! :-)
One last time, what can you as a blogger do?
- Go to your weblog's dashboard.
- Go to default post settings at http://bloggingabout.net/ControlPanel/Blogs/DefaultPostSettings.aspx
Remember these settings are post settings, and can be changed on each individual post. These are just the default.
- Set "Allow Comments on my blog" to "yes"
- Set "Comment Moderation" to "Only anonymous comments require approval"
In the future, if you no longer receive comments, you can set this to "Comments are published immediatly"
- Set "Send me email notifications" to "All Feedback"
You'll receive email when someone posts a comment, or a trackback is created.
- Go to Advanced Post Settings at http://bloggingabout.net/ControlPanel/Blogs/PostOptions.aspx
Remember these settings are global, and overrule the settings on individual posts.
- Set "Allow Anonymous Users to Comment" to "Yes"
- Set "Comment Moderation" to "Ignore"
- Set "Allow comments on my blog" to "Yes"
- Set "Comment Day Limits" to "Always"
- Now the beautiful part!
Go to My Email Settings at http://bloggingabout.net/ControlPanel/Blogs/GeneralOptions.aspx
- Check the option "Do not send email notifications for comments rated as spam"
Now everyone will still be able to post spam, but it'll be marked as spam, you won't get any email about it, and it'll be deleted after a certain number of days. In other words, you won't notice it even if you get a million spam comments per day.
- If you still get spam-comments that get through the spam-blocker, notify me and forward the email you receive about the comment. Only then can I take actions like adding the words to the bad-word filter, if they aren't already in.
- There are two levels of spam. Spam that the system is 99% sure of that it is spam, and spam that is marked as "possible-spam". You'll still get e-mails of those, as Community Server can't be too carefull about marked comments as spam.
Again, good luck fighting spam.
In the not so distant past I was bold enough to call Jan and Patrick whiners. But currently I have to extend an application with some functionality and I've been debugging it for a few hours now. Overall it's not that bad, but the things you can come across really make you wonder.
Dim Active As Integer
Active = 10
Select Case Active
Case TriState.UseDefault ' -2
' Do Something
Case TriState.True ' -1
' Do Something else
Case TriState.False ' 0
' Do Something else
As you can see in the code above, someone decided to use Active as a variable to store some number. After passing it through some methods, they match it against this weird enumeration from the Microsoft.VisualBasic namespace. Even though it's an enumeration, it's still totally unclear what it stands for.
My problem was, that this little (cut-down) piece of code was in a method that was adding SqlParamaters into an array. But as you can see in my example, when you insert the number 10 into Active, it won't get processed, and thus the array will have a SqlParameter that's null. When some more methods later this is added into the Microsoft Data Access Application Block (yes, the old one), it throws some weird error.
Part of the problem was the setup of the solution. I first tried to figure out what was happening with Reflector, but didn't get it. So I rearranged the solutions (yes, multiple), added the Data Access Block and debugged my way through. Only to find out that in my array, SqlParameter number 7 was empty. So after too much time, I could not resist but make the following comment in the code. Although the original developer probably will never read it, it still feels good to get it out of my system this way! ;)
' Comment : Any idea why this doesn't always work?!
' Any idea how long it took me to figure out the fault was in here?
' So I added a Case Else here, only hoping the UseDefault really
' is some sort of weird default, and that it now always works. >-(
I'm currently debugging an application and it says:
De objectverwijzing is niet op een exemplaar van een object ingesteld.
Anyone any idea what it means?! ;-)
For a while now I'm trying to figure out why my method, triggered by the GridView.RowUpdating event, doesn't work as all samples say it should do. All samples of course assume you're doing everything in your .aspx page, but I have to do everything in my code-behind, because on forehand I don't know what I'll be binding to my GridView. Check out what I'm trying to do, maybe you can help?
First, I load up some data:
DataSet ds = new DataSet();
SqlConnection con = new SqlConnection("somestring");
SqlCommand cmd = new SqlCommand("select * from sometable", con);
SqlDataAdapter adap = new SqlDataAdapter(cmd);
After that, I'm doing some work to make my GridView look beautifull, adding all columns by hand. But for this demo, I'll show you the simple version, that also doesn't work :-)
Let's bind the data to our GridView and have it autogenerate our columns, as well as an edit button.
GridView1.AutoGenerateColumns = true;
GridView1.AutoGenerateEditButton = true;
GridView1.DataSource = ds;
Now I've tried a lot of places to setup subscription to the events. Currently I'm in the OnInit method, but it doesn't matter where you place this code.
protected override void OnInit(EventArgs e)
GridView1.RowUpdating += new GridViewUpdateEventHandler(GridView1_RowUpdating);
GridView1.RowUpdated += new GridViewUpdatedEventHandler(GridView1_RowUpdated);
GridView1.RowEditing += new GridViewEditEventHandler(GridView1_RowEditing);
So now everything's setup, let's create a method for the RowEditing event.
void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
GridView1.EditIndex = e.NewEditIndex;
Been there, done that... Okay, now the part that doesn't work!
void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
// This method is never even touched!
void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
// e.Keys.Count == 0
// e.NewValues.Count == 0
// e.OldValues.Count == 0
When we edit a row in our GridView and press the "Update" button, at some time it's received in the RowUpdating method. But as I noted in the comments in that method, some collections that should contain the columns (names, old values and new values) are always empty. Always. And the RowUpdated method is never even touched!!!
Okay, so I've read on the ASP.NET Forums that I need to use a DataSource control. For example a SqlDataSource, which is automatically added to your WebForm if you drag-n-drop your way around Visual Studio 2005. The problem is, I'd very much like to do so, if ASP.NET 2.0 requires this. But I can't set a DataSource property or anything on the SqlDataSource!!!
So if you have any solution to my problem... I probably have to read the cells on the GridView of the selected row, find the controls, get the values from those and insert those into my DataSet. Which means I won't make my 70% code reduction Microsoft has always promised me. Bah!
We're getting some serious comment spam at the moment. Just today I've already received a couple of hundred comments that Community Server marked as spam. Although none of them pass the great spam filter(s), it's still very irritating. Here are some tips that can help people that use Community Server, and of course our own bloggers.
- The first thing you have to do, if it's not already setup, is make every (anonymous) comment a moderated comment. This way you as the weblog owner, have to moderate these posts.
You can set this up at your weblog dashboard (found here), in the left menu choose "Global Settings" and "Default Post Settings". Mark "Allow Comments on my blog" (or no one would be able to comment), and set comment moderation on "Only anonymous comments require approval". You can of course also set it to "All comments require approval". With the email notification setting you can setup wether you want to be emailed if a comment is placed.
When reviewing comments, you can filter comments on "no spam", "possible spam" and "spam" (or "ignore" to view all comments). That way it's pretty easy to moderate (and publish) all good comments and ignore the spam.
- One of the most easy suggestions is to turn of comments for old blogposts. It's also a shame you have to do this, as normal people also can't comment on these. But for me personally, I've got blogposts of almost three years old and those are getting spammed like there's no tomorrow. Especially this one : First Post!
This option can be found under your weblog dashboard, in the left menu choose "Global Settings" and "Advanced Post Settings". You can configure the "Comment day limits", where I've set it up for 90 days.
- Another thing you can do is check the default spam blocking configuration and override it for your personal weblog. Check your dashboard again, choose "Global Settings" and "Spam, ping and Cross-Posting". Mark the checkbox to override custom spam scores. I believe it's currently set to the default, 5 points for moderation, and 10 for spam. I'm not going to tell you exactly how Spam Blocking works in Community Server, because you can read more about it here. But it counts url's in the comment, bad words and how many times someone posts a comment in the last x seconds. These negative penalty points are 'awarded' and punished based on thresholds in our configuration. When you reach 10 points, your comment is marked as spam. After checking the "Use custom spam scores" you can lower these numbers, if too much spam comes through the spam blocker and are marked as 'normal' comments.
- The last thing you can do is to not allow anonymous users to comment your posts. Under "Advanced Post Settings" again, you can set "Allow anonymous users to comment" to no. Everyone will have to register to place a comment. But people who might have really good comments, might choose to not bother anymore because of the required registration.
- You don't have to delete comments that are marked as being spam. They are automatically deleted after a certain configured number of days.
Well, good luck in fighting spam.
While writing his upcoming book The Art of Agile Development, James Shore is posting a lot of chapters on his website to be reviewed by visitors. He just posted a great chapter on how he thinks Continuous Integration should take place. He mentions the Integration Token; a physical object like a rubber chicken or a stuffed toy. Whenever you're busy on updating the CI server, you should take this token from the server so everyone knows you're busy with the application/project.
He describes this in three steps:
Check that the integration token is available. If it isn't, somebody is checking in unproven code and you need to wait until they're done.
Get the latest changes from the repository. Others can get changes at the same time, but don't let anybody take the integration token until you're done.
Run a full build and make sure everything builds and passes tests.
In the distant past I was working on a project with a few people where we all had our own database and local webserver. This isn't a problem, until people start to continuously check-in code that uses something that's in their database or configuration file. When you get the latest files from your source repository and get their new sourcecode, you miss their new database objects and/or configuration updates. We didn't even have tests to check this, but the application just kept crashing multiple times a day because of this. When asking the person who checked in the code, you'd get some vague answer about what to do with it, and were left in the dark. Believe me, they weren't loved by me for this. Heck, at that project, there wasn't much love at all, so perhaps that was the root of all the problems. ;-)
Anyway, the way James Shore describes it in his book is a great way to handle suchs problems. And when there's no love and people still break the build, there's probably enoug interest from other team members to beat up the responsible member with the Integration Token!
The demoscene seems to have found YouTube.com for getting demos on the net. The winner of Assembly 2006 was by The Black Lotus, and they seem to rule the Amiga scene. I was looking for a video and found it at YouTube. It's pretty impressive, but probably won because it's an Amiga demo, not overall the best demo. But hey, I wasn't there to vote, so I cannot complain! ;-)
But I started searching for more videos. Some that jumped out are:
A demo I hadn't seen in a long, long time... I first saw it during X, my first party ever. No idea what year it was, probably '94 or '95. It was organized by SuccesS somewhere near Utrecht. The demo is very cartoonish like, go see it here.
Created solely by Statix, for a good part on my computer. It was released during Wired 96 in southern Belgium. Before the party, Statix asked on #nlcoders (an irc channel) if he could finish the intro on someone's computer, as he could not bring one from England. I offered my computer.
Something I regretted afterwards, because he totally crashed my pc while I was asleep at night. He used some tool to compress the executable which crashed and destroyed my harddrive. The bad thing was, my entire BBS was on that pc. Luckely Nix from TBL helped out by attaching my harddrive to his computer. We copied everything that could be safed on his, I reformatted mine, installes MS-DOS, went back to Nix and copied everything back. That was a crazy night. As a thank you for all these troubles, we got mentioned in the greetings of Paper! Our group name was Subliminal.
Go watch it here. And be sure to do so! More info here on Pouet.
The most well-known demo ever is probably Second Reality by the Future Crew. I wasn't around in the demoscene by the time it got released, but it was pretty groundbreaking because it redefined what demos were and could do. As wikipedia says: "the demo exceeded what were widely believed to be the limits of PC hardware in 1993".
Anyway, you can view the demo here, download it (201MB) with eDonkey or order the DVD MindCandy or watch it with an emulator.
Puker was a demo by the Dutch group SuccesS, of whom we knew Harlequin, one of its members. View it here.
No idea why this is called 'HaringFeest', because it's at The Party held in Denmark. But I mention this video because it has SuccesS in it, with Harlequin at 1:16, who's a friend of Subliminal. We went to Bizarre together once (can't remember which year) and played a lot of Quake there. Harlequin (his realname was Arjen, can't remember his last name) created the Quake clan "One Minute Survivors", also known as 1ms. Too bad the only reference I can find is from Q4O (Quake For Oldies, who only had players older then 30 years! ;) and can be found here, with a screenshot of an endscore here.
Anyway, the video can be found here. It gives you an idea of how nerd-like demoscene parties were (and probably still are).
P.J. van de Sande from the (Dutch) weblog Born 2 Code .NET has two posts about the in .NET 2.0 new ?? operator. In the first post he explains what it does and why he likes it. After some comments, he decided to write another post about it, trying to explain even further why he likes it so much. But now he pulls some code from his sleeve I really had to take a good look at.
public Brush BackgroundBrush
return _backgroundBrush ??
_backgroundBrush = GetBackgroundBrushDefault()
You have to know how this is evaluated to understand it. Before it returns anything, it first evaluates the ?? operator, which is probably understood much better by the following code block.
public Brush BackgroundBrush
if (_backgroundBrush == null)
_backgroundBrush = GetBackgroundBrushDefault();
But still, it's some lovely code. You decide for yourself if you want to see code like that in your project. Perhaps Jan Schreuder would be more happy to see code like this instead of the code in his latest post! ;-)
Because I sometimes want to paste source code into my posts, I want my skins to be a little wide. Source code is often much wider than normal text. I really like the new Community Server 2.0 paperclip skin, but it wasn't wide enough. So I changed it a bit. These are the steps I took:
- First, choose the appropriate skin. I chose "Paperclip Cactus"
- View your weblog, right click it in Internet Explorer (or any browser) and choose "View Source" to view the html source. Now you want to find the .css file that belongs to your current skin and skin-style. For Paperclip Cactus this is in the HTML as "/Themes/Blogs/paperclip/style/style.css" and "/Themes/Blogs/paperclip/style/cactus.css", of which the first would be right here on this community. The first stylesheet if for Paperclip overall, the second one are overrides for the Cactus style specific.
- Now comes the hard part, as you'll have to figure out which elements in the style-sheet must be changed according to your wishes. To make the Paperclip wider, you need the following parts:
- Now I chose to make everything a few hundred pixels wider. I believe it was 300 pixels. I also included an extra large header image I created myself. The code should be like this:
I probably made a mistake on the "customer" part in the name, it should've been "custom" ;-)
- Now create your own header. I could nowhere find a Photoshop file or anything else, so I have torn apart the original and create my own .psd, download it here.
- Go to your Control Panel in Community Server, select "Global Settings" and "Change how my blog looks" again. Select the tab "CSS Overrides" and insert the code above.
And you're done... Have fun!
Community Server just keeps getting better and better, providing more features then I could even imagine to incorporate into a product like this. Some features that our bloggers will probably notice most:
The editor that was installed since version CS 2.0 with the advanced feature to upload images and files into your own personal folder. New is the ability to insert a code-snipper via a popup window, although I still like CopySourceAsHTML best, especially with the tip coming from Jan Schreuder.
CS 2.1 introduces tags, kind of removing the categories. Tags that are used a lot of the time, appear in bold and larger on the /blogs/ page, as well as on your own weblog. It's introduced with del.icio.us and technorati and very popular to group posts. Perhaps we should think about standarizing tags or something, because a lot of strange tags appear on the /blogs/ page! :)
- New Skins
As you can see on my weblog, I've chosen a new skin. Because I tested this new version locally first, I had the change to already work with/on this skin, so I changed it a bit, making it much wider than the original skin.
The latest blogposts are gone from the homepage. This is default in CS 2.1 and I can get them back, but I'm not completely sure on what I want to do with the free space.
I also tried to change the frontpage a bit. A new logo I just picked up from somewhere. I've created a favicon.ico but it doesn't seem to appear in the address bar of my IE :)
- Review comments
I was just checking out the new reporting feature of CS 2.1 and saw that some weblogs have some serious comment spam going on. Or at least the owner of the weblog doesn't remove the comment spam. CS 2.1 has a new feature with which you can filter comments by "possible spam" which is really nice.
By the way, in case you didn't know, in your weblog settings, you can setup to be notified of everything feedback. Not just the approved comments, which is the default. Yes, you'll also get notified about spam. But hey, it's a nice notice so you'll know when to clean up ;-)
More spam stuff, you can now setup your own spam moderation a bit. BloggingAbout.NET uses multiple rules to figure out when something is spam or not. If you think you need to tighten this a bit, you can also set it up in your control panel.
- About my blog
Not many people have set this up. But for your friends and visitors to know who you really are, or to recruiters who might want to offer you the best job in the world and don't know how to contact you, fill in this missing piece of your weblog.
Well, if you notice anything out of the ordinary, don't hesitate to contact me.
Monday, august 14 2006, 12:30 CET
Let's upgrade to Community Server 2.1.
More info on new features can be found here.
Monday, augsut 14 2006, 14:07 CET
Well, finally all files are uploaded. The SQL update wasn't hard and took only a few minutes. Uploading so many files took much longer, but we're back.
I'm testing the entire website currently and just hope everything keeps working out.
A while ago I had some problems uninstalling .NET 3.0 so I deleted everything, both files and everything related to WinFX in my registry. Not a smart thing to do. When installing the latest july CTP I had even more problems. I'm brave (read : crazy) enough to install everything on my own machine instead of some virtual pc session, so I really had to get things working again. Luckely more people had the same problem(s) and after some extensive searching and trial-and-error I got it working again.
But now another problem, I can't load anything that's related to WPF, as Orcas isn't compatible with the july CTP. But my colleague Mike Glaser found that when you first install the june ctp, then Orcas, uninstall the june ctp and at last install the july CTP, you can at least load the WPF projects. You can't edit them in Visual Studio however. But after installing Expression, the new design suite by Microsoft, you're able to edit everything. You can load, build and run Sudoku from both the Expression Interactive Designer and Visual Studio 2005.
So now you know how to load WPF projects in Visual Studio 2005.