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?
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.
Notice:
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
End Select
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);
adap.Fill(ds);
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;
GridView1.DataBind();
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)
{
base.OnInit(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.
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:
Ninja 2A 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.
PaperCreated 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.
Second RealityThe 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.
PukerPuker was a demo by the Dutch group SuccesS, of whom we knew Harlequin, one of its members. View it here.
HaringFeestNo 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
get
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.
if (_backgroundBrush == null)
_backgroundBrush = GetBackgroundBrushDefault();
return _backgroundBrush;
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:
#nav
width: 1092px;
#main {
width: 834px;
#content
#masthead
background-image: url(/Themes/Blogs/paperclip/images/customer-pen.jpg);
width: 1104px;
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:
Well, if you notice anything out of the ordinary, don't hesitate to contact me.
Monday, august 14 2006, 12:30 CETLet's upgrade to Community Server 2.1.
More info on new features can be found here.
Monday, augsut 14 2006, 14:07 CETWell, 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.