RJ's blog - stuff that interests, frustrates and fasinates me RSS 2.0
 Wednesday, November 14, 2007

As I mentioned a few days ago, I just updated to dasBlog 2.0. The docs for the upgrade to dasBlog 2.0 don't appear to be up to date, so to help out any one who might be having issues with it (*cough*dan*cough*), here's a rundown of the steps I did to upgrade.  I use Webhost4life as a hosting service and had a previous working install of dasBlog 1.9, so the steps are targeted towards that.

  1. Download the latest version of dasBlog 2.0
  2. Install it on your local pc.
  3. Using something like SmartFTP, copy the xml files in your remote dasblog\content folder to the local directory.
  4. Time for a backup of your contents folder, if you don't have one.. just in case!
  5. Run the content upgrade app : dasblog\upgradedasblog\DasBlogUpgrader.exe
  6. Copy the dasblog\SiteConfig files to a temp local folder and using something like BeyondCompare merge in the few changes that you had made in your old install into the new siteSecurity.config and site.config files.
  7. Copy all of the files in your local dasBlog install up to your host server.   This is everything in the root and subdirectories, there are changes required in the bin, datepicker\themes, etc.  There may be folders you can safely ignore, I just did them all.
  8. Now is a good time to clean up all of the old logs in your remote \logs folder (see my comments dasBlog20Upgrade.aspx">here).
  9. Since I copied everything from the local install to the server, and SmartFTP keeps the modification date the same, I deleted everything in the root and sub folders (excluding content !) that had a date prior to 8/14/2007.  Necessary?  Not sure.. but if they aren't needed why not get rid of them?
  10. Log into your WebHost4Life account.  Select "Site Admin" from the top menu, then "Set .NET App" from the left pane.   Change the root version to .net 2.0.

If you had a previously working install of dasBlog 2.0, this is all it should take to do the upgrade.  If I missed something, leave a comment and let me know.

Wednesday, November 14, 2007 1:07:13 PM (Central Standard Time, UTC-06:00)  #    Comments [1] -
Random | utilities
 Monday, November 12, 2007

I'm using virtual PC on our build machine to keep archives of old development enviroments, every time we upgrade to new versions of Delphi or 3rd party controls I create a VPC archive with source code for that build version of our application.  As I was trying to put together an image for D2006 so I could finalize the update to D2007, I ran into a block because our base XP image was created some time ago and had a max size of 8gb.  Even though we use dynamic instead of fixed HD sizes, you define during the Virtual HD creation wizard what the max size of the drive can be.  I found a tool that lets you resize the VHD called VHD Resizer, but that doesn't do the full job - after you resize it you need to use something like Partition Magic to allocate the partition.  However we don't have a current version of it, the newest I can find is v 4.0 which doesn't support NTFS. 

So I've spent some time trying different things.  #1) Converting the dynamic to fixed size and then back again gives you no opportunity to change the VHD size, though it does take a hell of a long time to convert from dynamic to fixed.  #2) Tried using the freeware tool PartionLogic but couldn't get the iso to run under the virtual PC instance. #3) Dug through the cabnit and found a copy of Norton Systemworks 2001 to see if I could ghost or repartition the drive that way or to Ghost it to another VHD, gave up after 30min of frustration on getting a ghost image to be able to boot under VPC.  #4) Gave up with all the screwing around and wasted hours trying to get my damn VHD resized and dropped the $70 to buy a copy of Partion Magic 8.0.  It took me longer to do the download than to install and resize the partition - total time spent was maybe 15min.

For reference, yes I know I could have just mapped a 2nd drive to my VPC instance but this was a potential problem that I was going to face again in the future so I wanted to resize our base XP image and be done with it.  Also it was going to take some messing around to get all of the build utilities and such working on the 2nd HD, so resizing the main drive really was the best solution to the problem.  I should have just saved myself the time and frustration and purchased Partion Magic up front.  I've used it before, I knew it would work, so I should have known better.

IMO the stupid part about this is that you would think that Microsoft would have this functionality built into VirtualPC.  It can't be that uncommon of a tast to want to do, I found many posts & blogs on the topic during my search.  For the life of me I can't understand why they don't incorporate resizing VHD's.  Oh wait, I know.. because its Microsoft.  No company has made more money using other peoples ideas and doing it worse than they did, often driving the other company out of business in the process (or just buying them up).

Monday, November 12, 2007 2:11:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
utilities
 Sunday, November 11, 2007

I needed to take a TDataset and save the data out to a CSV file the other day. It wasn't until I actually tried to do it that I realized that Delphi didn't have an option for ClientDataset.SaveToFile that supported CSV - only binary and xml format.  Ended up grabbing some code off of an old post by Bill Todd to handle it.  I added in the ability to toggle on/off writing the fieldnames as a header row.

Ironicially, I just noticed that Steve Trefethen recently did something similar in C#, interesting to see the differences in code.  I might have to play around and make a LoadFromCsv reader now to populate a TClientDataset, just cause.  :)

// example: SaveToCsv(ClientDataset1,'c:\temp\testfile.csv','"',',');
procedure SaveToCsv(DataSet: TDataSet; AsciiFilePath: String;
  Delimiter, Separator: Char; WriteHeader: boolean = true);
var
  AsciiFile:   System.Text;
  I:           Integer;
  LastField:   Integer;
begin
  Assign(AsciiFile, AsciiFilePath);
  Rewrite(AsciiFile);
  LastField := DataSet.FieldCount - 1;
  if WriteHeader then
  begin
    for I := 0 to LastField do
    begin
      Write(AsciiFile, Delimiter + DataSet.Fields[I].FieldName + Delimiter);
      if I < LastField then
        Write(AsciiFile, Separator);
    end;
    Writeln(AsciiFile, '');  // Write CRLF at the end of row
  end;
  while not DataSet.EOF do
  begin
    for I := 0 to LastField do
    begin
      if not (DataSet.Fields[I].DataType in
        [ftBCD, ftCurrency, ftFloat, ftInteger, ftSmallInt, ftWord]) then
      begin
        Write(AsciiFile, Delimiter);
        Write(AsciiFile, DataSet.Fields[I].AsString);
        Write(AsciiFile, Delimiter);
      end
      else
        Write(AsciiFile, DataSet.Fields[I].AsString);
      if I < LastField then
        Write(AsciiFile, Separator);
    end;
    Writeln(AsciiFile, '');  // Write CRLF at the end of row
    DataSet.Next;
  end;
  System.Close(AsciiFile);
end;
Sunday, November 11, 2007 1:20:55 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Delphi

I grabbed most of the archived posts I had that were in old html files and brought them into dasBlog.&amp;nbsp; I'm going to *try* and start updating again (no really I am.. not like in ; 2004, 2005, or 2006).  I could really stand to have a repositor of things I resolve as I working on coding stuff. This is one of my shortcomings, I learn a lot on a regular basis as part of my work, I'm just terrible about documenting it so I have it for reference in the future so often end up having to figure it out again some day down the road.

Any bets on me keeping up with my goal? If past performance is any indication of future results, it'd be easy money.. lol

Sunday, November 11, 2007 1:20:02 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Random
 Saturday, November 10, 2007

Spent some time today upgrading the blog to dasblog 2.0.  The upgrade was pretty simple but ended up stuck because I couldn't log in after the upgrade was completed.  After a whole bunch of messing around poking at things and reviewing the config files I ended up downloading SmartFTP to try and recopy all the files which I had done manually the first time.  Ya, I know I should have done that to start with ... as it was I just used windows explorer and copied over the files that had changed.  Obviously that was a bad idea because it didn't work. 

Spent about 15 min downloading, installing, configuring SmartFTP and recopying all of the dasBlog 2.0 files to the website - bingo, it worked just fine.  So because I was too lazy to download it to start with I spent 1+ hrs messing around copying the files manually and trying get it working once I was done because it failed.  Windows Explorer = stupid FTP, and anyone chosing to use it isn't much better, myself included.

As part of the upgrade I realized I hadn't been cleaning out the old logs that dasBlog keeps.  Ended up writing a simple dos batch file to call an ftp script that will download all of the logs and then delete them from the server - here's the code for it.

CleanupDasblog.bat:
ftp -n -v -i -s:c:\scripts\CleanupDasblog.txt [ftp.yourwebsite.com] 

CleanupDasblog.txt:

USER [username]
[password]
cd [remotepath/log]
lcd [localpath\log]
mget *.*
mdel *.*
close
quit

Saturday, November 10, 2007 5:14:42 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Scripting | utilities

On the 10th of November in 1775 at Tun Tavern, the Continental Congress passed a resolution which said in part:

"...Resolved, that two battalions of Marines be raised, consisting of one colonel, two lieutenant colonels, two majors, and other officers as usual in other regiments; and that they consist of an equal number of privates with other battalions; that particular care be taken, that no persons be appointed to office, or enlisted into said battalions, but such as are good seamen, or so acquainted with maritime affairs as to be able to serve to advantage by sea when required; that they be enlisted and commissioned to serve for and during the present war between Great Britain and the Colonies, unless dismissed by order of Congress; that they be distinguished by the names of the first and second battalions of American Marines..."

And thus the United States Marine Corps was born.  Semper Fi my brothers, Semper Fi.   And to all members of our military, both past and present - Happy Veteran's day.

Saturday, November 10, 2007 4:58:27 PM (Central Standard Time, UTC-06:00)  #    Comments [0] -
Military | Random
Fundraising for LLS
TeamInTraining - Contribute Now
Archive
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910


About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Rich Werning
Sign In
All Content © 2010, Rich Werning
My DasBlog theme is modified from 'Business' created by Christoph De Baene (delarou)