Friday, July 03, 2009

Zamena GPS Navigatora 4

Nastavak price Zamena GPS Navigatora 3

Juce mi je stigao novi GPS Navigator. Na svu srecu ovaj radi (za sada) lepo. Nazalost ova prica jos nije gotova zato sto mi uz novi uredjaj nisu poslali i novu garanciju. Poslao sam servisu mail u vezi garancije. Jos cekam odgovor...

Kad sve bude gotovo napisacu izvestaj o ovom procesu.

Task in progress.....

Submit this story to DotNetKicks

Monday, June 29, 2009

Zamena GPS Navigatora 3

Nastavak price iz Zamena GPS Navigatora 2

Danas sam bio pozitivno iznenadjen. Evo mail-a iz servisa:


Javljam se po prijemu Vaseg uredjaja na servis, uredjaj je pregledan I ustanovljena ne ispravnost. Porucio sam iz magacina novi, cim stigne bice Vam poslat.
Hvala na strpljenu

Submit this story to DotNetKicks

Friday, June 26, 2009

Bat file and current path

You can use this in your bat files to get current path

set currentpath=%~dp0

Submit this story to DotNetKicks

Zamena GPS Navigatora 2

Nastavak price Zamena GPS Naviagatora

Danas u 15:30 moj GPS navigator je isporucen servisu. Nesta pre toga sam dobio obavestenje iz servisa u kome pise:


Navigacia koju ste slali jos nije dostavljena servisu, cim dodje do nas bice pregledana I bice Vam javljeno.

Submit this story to DotNetKicks

Thursday, June 25, 2009

Zamena GPS Navigatora

Kupio sam GPS navigator Prestigio GeoVision 150 u Gigatron prodavnici (www.gigatronshop.com). Ispostvavilo se da je neispravn. Ovde cu da vam opisem kako je tekao tok reklamacije pa ce gore navedena firma dobiti od mene ili pohvale ili kritike.

- Dakle, danas u 13:00 doso je covek iz city expressa i uzeo neipsravan uredjaj. Kaze da ce biti u servisu gigatrona sutra do 13:00

...

Submit this story to DotNetKicks

Tuesday, June 09, 2009

Remove quotes from parameter in bat file


SET prop=%1
SET prop=###%prop%###
SET prop=%prop:"###=%
SET prop=%prop:###"=%
SET prop=%prop:###=%

Submit this story to DotNetKicks

Sunday, April 26, 2009

Second monitor preview

If you want to see what is on your second monitor (for example on your TV that is connected on your comp) you can use this application:

http://sites.google.com/site/mijalko/Home/second-monitor-preview

Submit this story to DotNetKicks

MSTest and TeamCity trouble

When I run test from Visual Studio all tests pass but when I setup test environment from Teamcity half of my test fails.

Problem was because some of assemblies was missing in mstest environment. Actually, I have used Enterprise library and I had custom trace listener. Test project had that trace listener in references. But when Teamcity runs mstest my assembly was missing in build agent working folder.

All assemblies that are not used directly in test (for example class from my assembly was dynamically loaded by enterprise library application logging block) will not be copied to test folder. Therefor, those test methods should be decorated with attribute like:


[DeploymentItem("MyTraceListener.dll")]


Somehow, this was not necessary when you run tests from Visuals Studio IDE.

I hope that I save you some time.

Submit this story to DotNetKicks

Wednesday, March 11, 2009

Hibernate (NHibernate) and Polymorphism

If you use lazy loading on base class, NHibernate will create proxy class of base class so you will not be able to use is operator to check type of object. For example:


abstract class Base
{
};

class A : Base
{
}

class B: Base
{
}

class C
{
public virtual Base BaseClass {get; set;}
}


If you now list all C objects from database and try to check of what type is C.BaseClass with

if (c.BaseClass is A)
{
}
else if (c.BaseClass is B)
{
}
else
{
//ERROR
}


you will get an error.

Simplest way to solve this problem is to add method in base class that will returns instance to itself:


abstract class Base
{
public virtual Base This()
{
return this;
}
};


Now, you can check:

if (c.BaseClass.This() is A)
{
}
else if (c.BaseClass.This() is B)
{
}

Submit this story to DotNetKicks