Behind the Screen

How to repair a corrupted Blackfish SQL database

We use Blackfish SQL as the database for our discussion forums. Although the java version (formerly known as JDataStore) supports mirroring and fail-over, the .NET version has never been certified for that functionality. Sometimes when we have hardware failures in our data center, our database ends up being corrupted. Fortunately, I’ve found an easy way to repair this corruption that, so far, has worked all 3 times I’ve had to use it.

There is a very nice, free (with an option to upgrade) hex editor available called "Hex Editor Neo" that I used for the repair job, after discussing the issue with Adrian Andrei. After analyzing the raw file in Neo, it looked like I could copy the first block, from hex 0 to hex 2040, of a good version of the database over the corrupted version and repair the live database. So this is what I did:

1. Select the range 0×0 to 0×2040 from the good backup of the database using Neo, or some other hex file editor of your choice.

bsqlfixrange

2. Edit|Copy it. You should see something like this in Neo:

bsqlfix1

3. Select the tab with the corrupted version of the database.

4. Edit|Paste at 0×00 in the corrupted file. You should see the block turn red where it was pasted.

5. Then click Save.

6. Close Neo, and start using your database again.

Caveat Emptor

I’m documenting this because it works for me and it’s a quick way to fix the corrupted database. This is a completely unsupported tip. Your mileage may vary. I strongly recommend regularly backing up whatever database you use, and ensuring your network infrastructure has good redundancy so you never encounter this situation (we’re still working on improving ours).

Posted by John Kaster on September 9th, 2009 under CodeGear products | 10 Comments »


New "home page" header links on EDN

We’ve introduced a new logo for EDN as part of our standard header. With that minor redesign, I had a "duh!" moment and realized we could also create a "home page" link for the specific EDN application you’re currently using, such as Blogs, Chat, Discussion Forums, CodeCentral, Member Services, QualityCentral, and so on.

The EDN "knowledge base" is the ‘home page" of EDN, and every EDN web site has a link back to the EDN home page. Every EDN application label now has a link to the application "home page" as well. The following graphic shows this for member services:

new_header

Note: the discussion forums is missing its application label and link right now. We’ll introduce that application label and link for discussion forums soon.

Posted by John Kaster on May 15th, 2009 under Uncategorized | 4 Comments »


Meet me at Delphi Live!

As I mentioned in this blog post, I’ll be attending Delphi Live this week. If you want to catch up with me, probably the best place to find me is in Embarcadero area of the exhibit hall on Thursday from approximately 1:15pm-2:30pm and 6:45-7:30pm (at the "Beer Bash" before the "Meet the Team").

See you there!

Posted by John Kaster on May 12th, 2009 under CDN, Delphi, Uncategorized | Comment now »


Rehashing CodeCentral hash values

Shortly after my blog post about finally displaying MD5 hash values for CodeCentral downloads, Jorge Almeida asked about SHA1 hash values instead because of the known collision problems with MD5. So, we now are displaying not only MD5 hash values but also SHA1 hash values for each CodeCentral download that has an attachment, as illustrated (once again) in the MD5/SHA1 Hash Generator upload.

When you go to that item, you will now see in the details section:

Updated on Tue, 25 Sep 2007 13:26:55 GMT
Originally uploaded on Tue, 25 Sep 2007 07:51:10 GMT
SHA1 Hash: 4A6F1A4808A1E295D309F5F15E20336FAB08D6BC
MD5 Hash: 7ACEF4E7E2A223B59F92070039FD1947

Hopefully, we won’t have to rehash the hash values in CodeCentral again.

Posted by John Kaster on May 10th, 2009 under CDN, Delphi | 2 Comments »


See you at Delphi Live!

I’ll be attending Delphi Live! in San Jose, California May 13 – 16, 2009. Thomas Pfister is staying nearby in Capitola, California and has graciously offered to chauffeur me to and from the conference in the handy-dandy convertible he’ll have while visiting. Since I’m completely buried in EDN work until then, I’m luckily not speaking at the conference this year, so I can attend sessions, and gather informal feedback from everyone there on what they’d like to see on EDN, instead of scrambling from session to session, preparing for my next talk.

It’s not often I get to go to a conference only as an attendee, and I’m really looking forward to this one! There are lots of great sessions lined up.

I hope to see you there!

Posted by John Kaster on May 5th, 2009 under CodeGear products, Delphi | 3 Comments »


MD5 hash on CodeCentral downloads

All internal stored downloads in CodeCentral now have an MD5 hash value, so you can use that value to validate your download.

In the Details section of the download, you’ll see something like this:

Updated on Tue, 25 Sep 2007 13:26:55 GMT
Originally uploaded on Tue, 25 Sep 2007 07:51:10 GMT
MD5 Hash: 7ACEF4E7E2A223B59F92070039FD1947

If you don’t already have an MD5 utility, you should be able to use this CodeCentral Delphi download to compare the hash value against.

This request was made long ago on our newsgroups. I’m glad to finally mark this one "Done".

Posted by John Kaster on May 4th, 2009 under CDN, Delphi | 5 Comments »


What’s in a named list?

We’re working on "named lists" for QualityCentral. This will allow any logged-in user to create a list of QualityCentral (QC) reports, name the list, and share it with varying visibility rules, such as private, public, invitation only, etc.

I want to get your feedback on some of the options for named lists. This is not an exhaustive design spec, and each of these options have implications for how the lists are managed internally. What I’d really like to get is what you expect for the user experience, without worrying about the internal implementation of the list.

Consider the following "named list" scenario:

  • You make a list named "DBArtisan for Joe"
  • You make another list named "Delphi for David"
  • You make a another list named "JBuilder for Dan"
  • You then make another list, called "My QC reports", which references the other three lists "DBArtisan for Joe", "Delphi for David", and "JBuilder for Dan"

Here’s what I’d like your feedback on:

Displaying the list

1) When you look at "My QC items", what do you see?
1a) The combined QC reports from the referenced lists
1b) A list containing links to each of the referenced lists
1c) Something else entirely

Removing items from the list

2) When you remove a report reference from the list "My QC Items", should:
2a) the report reference be removed from the list originally containing it?
2b) you be prompted to remove it from the original list?
2c) it only be removed from "My QC Items" because "My QC Items" should be a snapshot of the other lists at the time you create the list "My QC Items"

(Status updates and other modifications to a specific item are not an issue, because all lists link to their original QC items.)

Adding items to the list

3) When you add items to "My QC Items", should:
3a) it be added as a new QC report link only for "My QC items"
3b) you be required to choose the referenced list that should contain the reference
3c) you only be allowed to add another list to a list of lists

Please let me know what you think. Thanks!

Posted by John Kaster on April 13th, 2009 under CDN | 6 Comments »


Powerful but easy paging with ASP.NET MVC

Since I started following the public beta in mid-2008, I’ve been eagerly awaiting the release of ASP.NET MVC. Now that ASP.NET MVC 1.0 is released, I’ve been diving into it more, and fiddling with some DataSnap tooling to quickly generate the strongly typed models MVC works likes best. The EDN team is working on upgrades (replacements, really) to existing web applications, and also some new web applications based on ASP.NET MVC.

If you’re not familiar with ASP.NET MVC, my top recommendation is to read Scott Guthrie’s free 185 page tutorial. (This tutorial is one of the best tutorials I’ve ever read on the process of writing any application. There are many gems in there that go beyond just ASP.NET MVC.)

I have some friends using Developer Express XPO to develop both a WinForms GUI and an MVC interface. One of the things they were trying to figure out was how to page an XPCollection, which supports IEnumerable, and is similar to a strongly typed dataset. Paging a collection is something we definitely need for our EDN MVC applications as well, so I decided to investigate this. I used code from the MVCContrib project to implement collection paging for XPCollection (and other IEnumerable collections) in a generic but highly customizable and reusable way.

MVCContrib includes a PaginationHelper class for converting an enumerable collection to an interface called IPagination.For further information, please read Jeremy Skinner’s discussion of his excellent work on GridModels and Html.Pager().

Here’s a pattern to use to quickly make your IEnumerable collection pageable.

First, implement support for a nullable int page number in your controller action:

using MvcContrib.Pagination;
public ActionResult Index(int? page)
{
  var pageNo = page?? 1; // default to page 1
  var Customers = GetCustomers(); // returns your Enumerable collection
  var CustPage = PaginationHelper.AsPagination<Customer>(Customers, pageNo);
  return View(“Index”, CustPage);
}

Then, use MvcContrib.UI.Pager’s html helper for generating the paging control:

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IPagination<Customer>>" %>
<%@ Import Namespace="MvcContrib.UI.Pager" %>
…
(your standard MVC code for iterating the collection, now a subset)
…
<%= Html.Pager(Model) %>

PaginationHelper.AsPagination casts Customers to an IPagination interface. One important change I had to make to this ascx code was to replace System.Web.Mvc.ViewUserControl<IEnumerable<Customer>> with System.Web.Mvc.ViewUserControl<IPagination<Customer>>. Once you do that, the call to Html.Pager() will automatically generate the paging UI for you, which defaults to using a URL parameter called "page" for indicating which page to select out of the collection.

The total number of items in the collection, the range of selected items, going to the first, previous, next, and last page of the collection are all automatically supported by Html.Pager().

Update: it was so late last night, I forgot to mention this post about XPO and LINQ support.

Posted by John Kaster on April 2nd, 2009 under CDN, Delphi | 10 Comments »


The Top 25 Most Dangerous Programming Errors

I was just having a Skype chat with Jonathan Benedicto, one of the developers on the Developer Network team, and he pointed out a very valuable and relevant link to me regarding the "Top 25 most dangerous programming errors" all software developers should address in their code.

This isn’t a funny David Letterman Top 10 list. This is a list put together by more than 30 organizations, including the US National Security Agency, the Department of Homeland Security, Microsoft, and Symantec.You can see the news article Jon mentioned to me on the BBS web site. (It’s nice to see the industry work together on broad issues like this.)

For the "meat" of the errors and ways to address them, see the official list, including fixes.

And start plugging any holes you find in your own code!

Posted by John Kaster on January 13th, 2009 under CDN, IT Industry, ednfront | Comment now »


Blog server maintenance scheduled for December 22, 2008

Update: Blog server maintenance is now completed. Thank you for your patience.

After 11am Pacific Time, our blog server will be temporarily down as it gets moved to our new network infrastructure. We expect the down time to be 5 to 30 minutes. We apologize for the inconvenient timing, but we’re in the middle of migrating all our servers to our new infrastructure, and not all of it can be done in the middle of the night! (Or the weekend.)

We appreciate your patience as we migrate all our servers to our greatly improved infrastructure. I hope you’ve been noticing the improved performance in the last couple weeks, as we’ve been migrating portions of it over.

We’ll be all done by January 1, 2009. What a great way to usher in the new year!

Posted by John Kaster on December 20th, 2008 under CDN | 7 Comments »




Server Response from: blog2.codegear.com