Search This Blog

Tuesday, February 24, 2009

Cloning objects in VB6

Add method to object:

Public Function Clone() As Home
Dim m As New MemoryStream()
Dim b As New BinaryFormatter()
b.Serialize(m, Me)
m.Position = 0
Return b.Deserialize(m)
End Function

Showing code
Dim obj As New MyObject()
Dim objNew As MyObject= obj .Clone





Saturday, February 7, 2009

Accessing SVN directly from C#

I am working on a project where I need to automatically initiate a Commit to SVN repository.

Researching existing projects using C# 2.0+ .net to access subversion.

Inactive project to recreate SVN DotSVN in .NET. Has file browser working.
Blog for DotSVN


http://sharpsvn.open.collab.net/ - Not 100% stable yet.
http://www.pumacode.org/projects/svndotnet/ - Still In Development as of 1/2009.

http://ankhsvn.open.collab.net/ - Ankh .NET IDE addin.

Sample Code from http://svn.haxx.se/users/archive-2005-05/0065.shtml
Suggestion: When new SVN releases come out, all it takes is a simple
ikvmc svnjavahl.jar -reference IKVM.GNU.Classpath.dll
and make sure that your program can access ikvm-native.dll, classpath
dll, and the libsvnjavahl-1.dll.

Sample code (abbreviated):

using org.tigris.subversion.javahl;

public void ListRepoDirs()
{
SVNClient client = new SVNClient();
DirEntry[] dirs = client.list("svn://testsrvr/testrepo1/",
Revision.HEAD, true);

foreach(DirEntry dir in dirs)
{
Console.WriteLine(dir.getPath() + ", last mod: " + dir.getLastAuthor());
}
}

Wednesday, February 4, 2009

Creating HTML tables in Blogger


Blogger puts in extra space some how in a blog post containing HTML tables.
I found a fix: http://www.mt-soft.com.ar/2008/12/06/how-to-create-tables-in-blogger/
Wrap a Div around entire HTML containing formatted tables.


From http://www.blogger-book.com

Testing method of avoiding large white space created by standard way of coding table

I have a post detailing how to write the HTML for a table in this post How to avoid large space above table when writing the HTML for a table in Blogger. There were two methods, the one I used is cumbersome. MLA commented in that post and asked for my opinion of his way of avoiding large white space above tables when writing HTML for tables in the standard format. I said I will test it, so I am testing it first in a New Blogger blog. If it works here, I believe it should also work in the old (classic) Blogger. So here goes. If you don't see any large white space between this paragraph, and the table, that means MLA's method works:















ProductCodePrice
Apple0123$1.25
Orange0247$1.55
Pear1928$1.45



Well, there are no large space between the paragraph above and the table as you can see, so MLA's method works.

This is how MLA did it. He created a class "nobr" using CSS, like this:

Then below the CSS, he created a division
specifying the class. He will then type the HTML for the table in the standard format within that division. For example, this is the script I used to create the above table: