Digital World

26 April, 2006

Access Private member ouside the class???

why dot net calls pointers unsafe ???
Try this c++ ,com code: The class has a private variable and has no assignment statement as past of it. But still the code manages to assign a value to the private member:
#include "comdef.h"
class ClassNameHolder
{
private:
BSTR bstrVal;
public:
BSTR* ReturnMe() {return &bstrVal;}
BSTR GiveMeOut() {return bstrVal;}
};

void AssignName(BSTR *val);

void main()
{
CoInitialize(0);
ClassNameHolder *obj = new ClassNameHolder();
AssignName(obj->ReturnMe());
_bstr_t bstrbb = obj->GiveMeOut();
CoUninitialize();
}

void AssignName(BSTR *val)
{
*val = ::SysAllocString(L"Arun");
}

24 April, 2006

Case statements in Oracle 8i

Was typing in a SP in oracle 9i. Being familiar with SQL Server 2000 i used the "case" statements in the pl/sql and i found it was working smooth. The functionality should also run in Oracle 8i, so considering the developments Oracle is making in ANSI - SQL, i reviewed the code for 8i compatibility, I also browsed few sites which gave me information that case satements are compatible from 8i onwards. But when the tester ran the script i was suprised to find the script giving out compilation errors. So I cross checked the case statments compatibility in 8i once again and i was surprised to find the case statements are not compatible with PL/SQL ? Different parsers for the same Oracle version should be a well known problem but this difference in SQL and PL/SQL parsers looks stupid to me.

20 April, 2006

Experience in London and Scotland

The plus:
1)Easily Scotland could be one of the best tourist destinations in the world map. Breathtaking landscapes. The castles, mountains cliffs ending on the ocean, the color of the water, the lochs, the rivers, waterfalls, the lakes directly emptying into the ocean thru waterfalls, geological imporatance of the landscape… it was an amazing experience.
2)The london eye, M’am Tussaud’s musuem, royal jewels, the big ben, cruise in the Thames were my favourite in the London.
3)It was great to go around shopping in Oxford circus, that to during the Easter sales made it great.
The Minus:
1) There were no q’s in any place unless it is enforced. Myself and my wife were surprised to find people pushing and getting ahead to board the flight in a place like the Heathrow airport.
2) London City was totally untidy and full of waste every where.
3)Drunk people everywhere with words of racism flowing out without any consideration. Once myself and my friend were called as “Muslim racist”, we being Hindus from India. Imagine the plight of those good souls in the Muslim community.
4)We couldn’t get to places on time because of frequent shutdowns of the underground trains, the primary means of transport in London.