Photos From Pan American BJJ Championship

Last weekend I was invited to take pictures professionally of the Brazilion Jiu Jitsu Pan American Championship. It was my first time I got to do photography for pay and doing sports photography.

There was several challenges.  First, I had no idea who anyone was.  Having to constantly ask “who should I shoot?” amongst the 8 simultaneous matches started getting old.  Then there was having to go through almost 1,000 photos – forget even trying to photoshop them.  But it was a fun learning weekend, and they came out pretty good.

Several photos are being used for the Pan Am DVD, and about 10 will be used in a japanese publication.  Here are a pseudo-random few from the event:

 

Delete Files Older Than Date Using Batch Files

This problem has nagged at me for years.  Here is a batch command to delete files on a Windows 2003 machine.

Forfiles -pC:\backup -s -m*.* -d-5 -c "cmd /c del /q @path"

This will delete all files in my backup directory older than 5 days. To test it first, use this:

Forfiles -pC:\backup -s -m*.* -d-5 -c "cmd /C Echo 0x22@Path\@File0x22"

This will print out each file that you will be deleting.

Now playing: Lamb Of GodTerror And Hubris In The House Of Frank Pollard

Donate To Charity Using MSN Messenger 8.1

Microsoft will donate money to the charity of your choosing with every instant message you write.  Just append the appropriate code next to your display name.

From http://messengersays.spaces.live.com/blog/cns!5B410F7FD930829E!25315.entry:

To download Messenger 8.1 or view the offical “I’m” website, go: http://im.live.com/Messenger/IM/Home/

Now playing: Silversun PickupsMelatonin

How to Downgrade a Database from SQL Server 2005 to SQL Server 2000

I found this deep in a forum and don’t want it lost (source):

As you may all know, SQL Server 2005 request a minimum of 8GB RAM to work… let’s say satisfactorily. I first didn’t know that and after a while from the upgrade I did from SQL Server 2000 to 2005 my SQL Services were starting to crash three or four times per DAY!!!

At first I thought I was being attacked, but soon I realized it was nothing like that. I then decided to downgrade to a SQL Server 2000 edition. Though I looked around the internet to find some information on how to do that, I got very disappointed when I realized that no actual documentation of any kind could be found for that. So I am posting this thread to inform you on the procedures I had to follow for this action.

Before beginning I must assume, firstly that the user, who will attempt such thing, has a basic knowledge of SQL Environment, secondly that he has the two versions already installed (both 2000 and 2005), that a basic backup of the databases has been created and finally that all the 2005 SQL Server Users have been created at the SQL Server 2000 environment as well.

Step 1: Generating Scripts for the Database Elements and Structures

  1. Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).
  2. At the pop-up Dialog Box click at the Script All Objects in the selected Databases check box, to activate it and then Click the Next Button.
  3. Set the following Elements to the following Values
    1. Script Collation , set to TRUE
    2. Script Database Create, set to TRUE
    3. Script of SQL Version, set to SQL SERVER 2000
    4. Script foreign keys, set to FALSE
    5. Script Triggers, set to FALSE Then Hit the Next button
  4. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
  5. Click Finish

After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Structure of the Database will be created.

Be careful, the SQL Server 2005 Edition inserts the Views in a random place through the script. Therefore, all the scripts that are referred to the Views MUST be moved to the end of the script. If the Query Analyzer shows some errors do not be bothered. Delete all the elements created from the script and after you fix the code run it again.

Step 2: Moving the data from 2005 to 2000

  1. After completing the previous step successfully, moving the data follows. Right-click at the 2005 database you used to run the previous step and select Tasks and then choose the Export Data (option).
  2. From the pop-up Dialog Box, select the Source Db and Click at the Next Button.
  3. At the next step you will have to choose the destination server and the destination Database for the Data to be exported. Then Click Next.
  4. A List of all the Source Database’s Elements will appear in the screen. Select one by one all the Elements you wish to move and for each one click at the button Edit Mappings (Located at the bottom right corner of the Dialog Box just under the Elements list). A new Dialog box will pop-up. Select the Delete rows in Destination Tables option and activate the Enable Identity Insert Option. (Remember to repeat this action for each of the selected Element from the list that will be moved.

CAUTION!!! A malfunction of the SQL Server 2005 has been found. Not sure why, after multiple tries I have observed that when I tried to move more than twelve Elements at once, the Export Data Wizard of SQL Server 2005 seemed to disable the Enable Identity Insert Option that was activated over the Edit Mappings Dialog Box. But if the number of the selected Elements is smaller than 12 no problem seemed to appear.

Step 3: Generating Scripts for the Database Foreign Keys and Triggers

Finally, to successfully finish the downgrade of the Database, the Triggers and the Foreign Keys of the DB must be produced. The procedure that should be followed is the one stated next:

  1. Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.
  2. Using the pop-up Dialog Box make sure that the check box Script All Objects in the selected Databases is not enabled and hit the Next Button.
  3. Set all the Elements on the List to a False Value except the ones that follow:
    1. Include IF NOT EXISTS , set to TRUE
    2. Script Owner, set to TRUE
    3. Script of SQL Version, set to SQL SERVER 2000
    4. Script foreign keys, set to TRUE
    5. Script Triggers, set to TRUE
    6. Then Hit the Next button
  4. After finishing reading the Elements of the Database, a new list will appear at the Dialog Box. Make sure that you select ONLY THE TABLES of the Database and hit the Next Button.
  5. At the screen that follows hit the Select All button and the Next.
  6. Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.
  7. Click Finish Button.

After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Foreign Keys and the Triggers of the Database will be created.

After these steps the database should be fully functional under the SQL Server 2000 edition.

www.hellasinternet.com
Panos Tzirakis & George Dounavis

Finally, The Truth on OEM Software

I just read a great article on OEM software, called Buying OEM versions of Windows Vista: the facts.  I am sure the data here could be extrapolated to any OEM software.

The basics with OEM versions of Vista are:

  1. You absolutely can buy OEM versions lawfully.
  2. There is no difference between OEM and non-OEM versions (EXCEPT):
  3. It is tied to your motherboard: You cannot move it to a new computer 3 years from now or upgrade your motherboard.
  4. Once you open the OEM package, you can no longer return it.

Render RadioButtonList as an Unordered List UL

In my latest project, I found the need to use the RadioButtonList which spits out the absolute nastiest HTML to render it unusable (for me anyway). The control gives you to HTML options using the RepeatLayout attribute.

Flow spits out a series of span’s and label’s with BR’s if you don’t specify RepeatDirection of Horizontal. And choosing Table gives you a nicely unaccessible table you can’t format easily. Because of these limitation’s, I have always stayed away from CheckBoxList and RadioButtonList controls.

My solution is to write my own RadioButtonList, but to spit it out as an Unordered List which I can style very easily horizontally or vertically, little or lots of padding, all with CSS.

I unfortunately have been forced to regress back to ASP.NET 1.1 and VB.NET for a little while until the company upgrades to 2.0. Hence why I wrote the following instead of writing a CSS Control Adapter.

Imports System
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace MyControls

 <DefaultProperty("Text"), _
ToolboxData("<{0}:ULRadioButtonList runat=server />") _
, Description("Creates a RadioButtonList using an Unordered List.")> _
Public Class ULRadioButtonList
Inherits RadioButtonList

 Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

//"SBE 01/28/2007:  just in case...not sure if this is needed or not
Controls.Clear()

//"SBE 01/28/2007:  not sure why I am leaving quotes as a param...I was just undecided if I would ever need to use " instead of "
Dim inputFormatString As String = "<input id={0}{1}{0} name={0}{2}{0} type={0}radio{0} value={0}{3}{0} {4} />"
Dim labelFormatString As String = "<label for={0}{1}{0}>{2}</label>"

//"SBE 01/28/2007:  if user sets the cssclass, add it to the <ul> tag
If (Not MyBase.CssClass Is Nothing AndAlso MyBase.CssClass <> "") Then
     writer.WriteLine("<ul class="" & MyBase.CssClass & "">")
Else
     writer.WriteLine("<ul>")
End If

//"SBE 01/28/2007:  loop through the dataitems
For index As Integer = 0 To Items.Count - 1
     writer.Indent += 1
     writer.WriteLine("<li>")
     writer.Indent += 1

     Dim inputBuilder As New StringBuilder
     Dim labelBuilder As New StringBuilder
     Dim checked As String = ""

     If (Items(index).Selected) Then
          checked = "checked"
     End If

     inputBuilder.AppendFormat(inputFormatString, """", MyBase.ClientID & "_" & index.ToString(), MyBase.UniqueID, Items(index).Value, checked)
     labelBuilder.AppendFormat(labelFormatString, """", MyBase.ClientID & "_" & index.ToString(), Items(index).Text)

     writer.WriteLine(inputBuilder.ToString())
     writer.WriteLine(labelBuilder.ToString())

     writer.Indent -= 1

     writer.WriteLine("</li>")
     writer.WriteLine()
     writer.Indent -= 1

 Next

 writer.WriteLine("</ul>")

 End Sub

 End Class

End Namespace

Before I started writing this, I found a beautiful website SimplyGold who had already wrote something similar for the CheckBoxList. Thanks for saving me some time!

Now playing: MenomenaMuscle n’ Flo