Sunday, June 29, 2008

Monday, June 23, 2008

Мда...


Германия не хочет войны. Война - это "безграничное безумие". Она "приведет к крушению социального и политического порядка". Нацистская Германия не испытывает желания "онемечивать" другие народы. "Нам чужд образ мыслей, характерный для людей прошлого столетия, которые полагали, что из поляка или француза можно сделать немца... Французы, поляки и другие народы - наши соседи, и мы осознаем, что никакие исторически мыслимые обстоятельства не могут изменить эту реальность...

Адольф Гитлер, 17 мая 1933 г.

Tuesday, June 17, 2008

Makhachkala changed its coat of arms



I’ve casually found out today looking trough the Wikipedia that my hometown changed its coat of arms in 2006. Left side shows old emblem and the right side shows current one, which is much prettier I think.
Хренова… домой хочется :)

DirectoryCopy method (.NET, C#)

There is no such method in FCL, so here is my implementation :)


        public static void DirectoryCopy(string from, string to)
{
if (String.IsNullOrEmpty(from) || String.IsNullOrEmpty(to))
return;
if (!Directory.Exists(from))
return;
if (!Directory.Exists(to))
{
try
{
Directory.CreateDirectory(to);
}
catch (Exception e)
{
//Log.LogException(Errors.CANNOT_COPY_FILE, e);
}
}
DirectoryInfo dir = new DirectoryInfo(from);
FileInfo[] files = dir.GetFiles();
if (files != null && files.Length > 0)
{
foreach (FileInfo file in files)
{
try
{
file.CopyTo(Path.Combine(to, file.Name));
}
catch (Exception e)
{
//Log.LogException(Errors.CANNOT_COPY_FILE, e);
}
}
}
foreach (DirectoryInfo subDir in dir.GetDirectories())
{
DirectoryCopy(subDir.FullName, Path.Combine(to, subDir.Name));
}
}

Thursday, June 12, 2008

Awful book

Last Sunday I started to read the “A Tester’s Guide to .NET Programming” Apress, 2006 book. I’ve just finished it today. What can I say… This is really worst IT book I’ve read for a long time. Firstly it is very raw and stylistically badly written. Then, it says almost nothing about testing by itself, authors don’t even provide any basics definitions, and difference between tests. Book teaches to write simple windows/console/web applications use some primitive FCL classes, shortly describes OOP. Code in book is ridiculous. Who do write like this? :
strMemoryInfo += (intTPhysicalMem / MEGABYTES).ToString() + " MB , ";
strMemoryInfo += (intTVirtualMem / MEGABYTES).ToString() + "MB , ";
strMemoryInfo += (intAPhysicalMem / MEGABYTES).ToString() + " MB , ";
strMemoryInfo += (intAVirtualMem / MEGABYTES).ToString() + "MB ";
strMemoryInfo += "\r\n";
return strMemoryInfo;
Book supposed to provide code examples on VB.NET and C#, but sometimes C# section disappears. Screenshots were taken from VB.NET screens only.
Only last chapter named “An Introduction to Visual Studio Team Test” contains some useful information. I’ve spent about 4 hours in total, mostly because after second chapter I didn’t read it deeply, but just scanned. The conclusion is simple and scary: if testers act according this book it is terrible. If you are tester or going to became one, do not read this book! :)