Wednesday, July 14, 2010
Something is wrong !
You know something is wrong when even applications like Acrobat Reader require a restart to update themself!
Saturday, May 1, 2010
A simple class to read and write application settings
I'll come straight to the point. All I want to do is save a few setting for my little .NET application like
MaxSizeOfText=256.
Ok, that not all. I want each user to have his own settings. I can do this by storing such settings to a file in the user's appData folder.
Programming in the .NET world is usually pretty easy though a bit frustrating because at times it is painfully easy. There are also times when exisitng classes can get the work done but finding out how exaclty to use these classes is so darned unintuitive that its easier to write the functionality all by yourself.
I consider all classes present in the base-class-library revolving around reading / writing application configuration a big fiasco. There aren't many areas which are as confusing as this. With each version of .NET new ways to access appSettings keep cropping up. Come on, how difficult is to define an easy to understand programmatic access to some XML data? and if you can't do that why not just hide those classes from end developers, we are capable of writing our own.
Here is a class I quickly wrote which allows you to store application settings in a 'name'-'value' form in XML. The file can be located anywhere on your computer. It has just 3 menthods for interacting with it so it's very simple to use. Settings can be added without any special methods, setting can be read and setting can be removed. Minimum requirement, a target file should be present with atleast following xml:
Rest is taken care of by the class. I am sure there must be lots of improvement that can be made and I would appreciate any comments.
The class diagrams is presented below:

Here is the complete code for the XmlSettings class:
// ++
// (C) Copyright Siddharth Barman, 2010.
// Copyright notice: You are free to use this material with or without the copyright notice.
// Author is not reponsible for any damage/problems arising out of the use of this material.
// --
using System.Xml;
namespace Sid.Utilities
{
/// <summary>
/// Allows reading and writing settings to XML files. The XML files should have
/// the following structure <settings><setting name="ABC" value="XYZ" /></settings>
/// </summary>
public class XmlSettings
{
#region Public interface
/// <summary>
/// Path to the settings file. The file must exist.
/// </summary>
/// <param name="file"></param>
public XmlSettings(string file)
{
this.file = file;
doc = new XmlDocument();
doc.Load(file);
}
/// <summary>
/// Returns the settings file being used.
/// </summary>
public string SettingsFile
{
get { return file; }
}
/// <summary>
/// Allows a setting to be read or written. Each setting is referred by it's name.
/// Null is returned if a setting does not exist while reading.
/// A new setting is created if it does not exist while writing.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public string this[string name]
{
get
{
return ReadSetting(name);
}
set
{
SetSetting(name, value);
}
}
public void Remove(string name)
{
XmlNode node = GetSettingNode(name);
if (node != null)
{
RootNode.RemoveChild(node);
}
}
public void Save()
{
doc.Save(file);
}
#endregion
#region Protected and Private members
protected XmlNode RootNode
{
get
{
return doc.SelectSingleNode("/settings");
}
}
protected string ReadSetting(string name)
{
XmlNode node = GetSettingNode(name);
if (node == null || node.Attributes.Count == 0 || node.Attributes["value"] == null)
{
return null;
}
return node.Attributes["value"].Value;
}
protected void SetSetting(string name, string value)
{
XmlNode node = GetSettingNode(name);
if (node == null)
{
node = CreateSettingNode(name);
}
node.Attributes["value"].Value = value;
}
protected XmlNode GetSettingNode(string name)
{
return doc.SelectSingleNode(string.Format("/settings/setting[@name='{0}']", name));
}
protected XmlNode CreateSettingNode(string name)
{
XmlNode node = doc.CreateNode(XmlNodeType.Element, "setting", string.Empty);
RootNode.AppendChild(node);
XmlAttribute nameAtt = doc.CreateAttribute("name");
node.Attributes.Append(nameAtt);
nameAtt.Value = name;
XmlAttribute valueAtt = doc.CreateAttribute("value");
node.Attributes.Append(valueAtt);
return node;
}
protected string file;
protected XmlDocument doc;
#endregion
}
}
MaxSizeOfText=256.
Ok, that not all. I want each user to have his own settings. I can do this by storing such settings to a file in the user's appData folder.
Programming in the .NET world is usually pretty easy though a bit frustrating because at times it is painfully easy. There are also times when exisitng classes can get the work done but finding out how exaclty to use these classes is so darned unintuitive that its easier to write the functionality all by yourself.
I consider all classes present in the base-class-library revolving around reading / writing application configuration a big fiasco. There aren't many areas which are as confusing as this. With each version of .NET new ways to access appSettings keep cropping up. Come on, how difficult is to define an easy to understand programmatic access to some XML data? and if you can't do that why not just hide those classes from end developers, we are capable of writing our own.
Here is a class I quickly wrote which allows you to store application settings in a 'name'-'value' form in XML. The file can be located anywhere on your computer. It has just 3 menthods for interacting with it so it's very simple to use. Settings can be added without any special methods, setting can be read and setting can be removed. Minimum requirement, a target file should be present with atleast following xml:
Rest is taken care of by the class. I am sure there must be lots of improvement that can be made and I would appreciate any comments.
The class diagrams is presented below:

Here is the complete code for the XmlSettings class:
// ++
// (C) Copyright Siddharth Barman, 2010.
// Copyright notice: You are free to use this material with or without the copyright notice.
// Author is not reponsible for any damage/problems arising out of the use of this material.
// --
using System.Xml;
namespace Sid.Utilities
{
/// <summary>
/// Allows reading and writing settings to XML files. The XML files should have
/// the following structure <settings><setting name="ABC" value="XYZ" /></settings>
/// </summary>
public class XmlSettings
{
#region Public interface
/// <summary>
/// Path to the settings file. The file must exist.
/// </summary>
/// <param name="file"></param>
public XmlSettings(string file)
{
this.file = file;
doc = new XmlDocument();
doc.Load(file);
}
/// <summary>
/// Returns the settings file being used.
/// </summary>
public string SettingsFile
{
get { return file; }
}
/// <summary>
/// Allows a setting to be read or written. Each setting is referred by it's name.
/// Null is returned if a setting does not exist while reading.
/// A new setting is created if it does not exist while writing.
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public string this[string name]
{
get
{
return ReadSetting(name);
}
set
{
SetSetting(name, value);
}
}
public void Remove(string name)
{
XmlNode node = GetSettingNode(name);
if (node != null)
{
RootNode.RemoveChild(node);
}
}
public void Save()
{
doc.Save(file);
}
#endregion
#region Protected and Private members
protected XmlNode RootNode
{
get
{
return doc.SelectSingleNode("/settings");
}
}
protected string ReadSetting(string name)
{
XmlNode node = GetSettingNode(name);
if (node == null || node.Attributes.Count == 0 || node.Attributes["value"] == null)
{
return null;
}
return node.Attributes["value"].Value;
}
protected void SetSetting(string name, string value)
{
XmlNode node = GetSettingNode(name);
if (node == null)
{
node = CreateSettingNode(name);
}
node.Attributes["value"].Value = value;
}
protected XmlNode GetSettingNode(string name)
{
return doc.SelectSingleNode(string.Format("/settings/setting[@name='{0}']", name));
}
protected XmlNode CreateSettingNode(string name)
{
XmlNode node = doc.CreateNode(XmlNodeType.Element, "setting", string.Empty);
RootNode.AppendChild(node);
XmlAttribute nameAtt = doc.CreateAttribute("name");
node.Attributes.Append(nameAtt);
nameAtt.Value = name;
XmlAttribute valueAtt = doc.CreateAttribute("value");
node.Attributes.Append(valueAtt);
return node;
}
protected string file;
protected XmlDocument doc;
#endregion
}
}
Labels:
Application,
appSettings,
C#,
Configuration,
ConfigurationManager,
DotNet,
Microsoft,
settings,
sucks
Monday, February 22, 2010
Survival of the cheapest
Working as a software engineer, I have seen a few lay offs, mostly in the United States and the UK. Anyway, I'm working in India so I should be safe, right? Right?
No, a resounding No!
I used to work for a British company. I was sent to the UK to do knowledge-transfers so that the work could be done from India (Bangalore). Oh yes, 'you have been Bangalored'.
I met a lot of developers and project managers in the UK who were all really nice people and I was helping the company to get them (the developers and PMs in the UK) laid off and move the work to India.
I never did feel the need to ask if it was the right thing for a company to do.
But now, four years later, every time I hear a speech made by any CEO, I can't believe the amount of hypocrisy. Each CEO tries to brain-wash the employees into believing their tag-line. Things like, 'customer first', 'we do this better than anyone'. You also hear words like 'costs', 'competitive advantages' a lot. Beware, the moment such words start getting tossed around, its very likely that things are about to change ... and perhaps for you.
With China offering cheaper labor, Indian I.T. professionals should no longer think their jobs secure.
It isn't 'survival of the fittest', it's survival of the cheapest'.
No, a resounding No!
I used to work for a British company. I was sent to the UK to do knowledge-transfers so that the work could be done from India (Bangalore). Oh yes, 'you have been Bangalored'.
I met a lot of developers and project managers in the UK who were all really nice people and I was helping the company to get them (the developers and PMs in the UK) laid off and move the work to India.
I never did feel the need to ask if it was the right thing for a company to do.
But now, four years later, every time I hear a speech made by any CEO, I can't believe the amount of hypocrisy. Each CEO tries to brain-wash the employees into believing their tag-line. Things like, 'customer first', 'we do this better than anyone'. You also hear words like 'costs', 'competitive advantages' a lot. Beware, the moment such words start getting tossed around, its very likely that things are about to change ... and perhaps for you.
With China offering cheaper labor, Indian I.T. professionals should no longer think their jobs secure.
It isn't 'survival of the fittest', it's survival of the cheapest'.
Tuesday, December 22, 2009
Remove Nissan.exe trojan / NewsPaedia
If your browser keeps opening on its own with websites like thenewpaedia.com, it is quite likely that you have a trojan/backdoor program nissan.exe.
This exe resides in your recycle-bin. It makes entries in the system registry so it gets loaded everytime someone logs in. The exe remains in memory all the time and detects any registry modification on a key and writes back its own values.
First let's see where the exe resides. It probably resides in a path like "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
Open a command-prompt,
C:\>
C:\>cd \
C:\>cd "Recycler"
C:\>dir /a hsr *.*
You should now see an entry for nissan.exe. This exe has to be removed. Right now, it will not be possible as this exe is already loaded in memory.
Now lets see where in the registry the entry exists for loading the exe:
Open regedit.exe
Navigate to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon"
Here you should see an entry named 'Taskman' having a value like "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
We need to somehow get this entry deleted.
We cannot delete it right now as the nissan.exe will detect the 'delete' and will immediately write back the value.
How to get rid of this:
1. Create a user on the system who is not an Administrator
2. Log off from any account which may have Admin rights.
3. Log in as a regular (non-admin user).
4. Navigate to Windows\System32 folder and do a RunAs->Administrator on
- Regedt32.exe
- Cmd.exe
- TaskMgr.exe
5. Switch to TaskMgr instance which you started in Step 4. Kill all instances of
Explorer.exe
6. Now switch to Regedit instance and search for Nissan.exe and remove all values where it shows up. Do a find for 'nissan.exe' a few times just to make sure.
7. Switch to command prompt instance and del all entries of nissan.exe by running
C:\>
C:\>cd \
C:\>cd "Recycler"
C:\>dir /a hsr *.*
This will display exactly where nissan.exe is for e.g.
"C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
Now to delete the entries:
C:\>attrib -hsr "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe"
C:\>del "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe"
Do a dir nissan.exe and check if you missed out any entry.
By now all entries which launch the exe should have been removed.
I have a suspicion that USB drives get affected and when such 'affected' drives auto-run, the system gets infected. I would therefore recommend that you disable AUTORUN on all drives. Follow the instructions in the link:
Disable autorun
This exe resides in your recycle-bin. It makes entries in the system registry so it gets loaded everytime someone logs in. The exe remains in memory all the time and detects any registry modification on a key and writes back its own values.
First let's see where the exe resides. It probably resides in a path like "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
Open a command-prompt,
C:\>
C:\>cd \
C:\>cd "Recycler"
C:\>dir /a hsr *.*
You should now see an entry for nissan.exe. This exe has to be removed. Right now, it will not be possible as this exe is already loaded in memory.
Now lets see where in the registry the entry exists for loading the exe:
Open regedit.exe
Navigate to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon"
Here you should see an entry named 'Taskman' having a value like "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
We need to somehow get this entry deleted.
We cannot delete it right now as the nissan.exe will detect the 'delete' and will immediately write back the value.
How to get rid of this:
1. Create a user on the system who is not an Administrator
2. Log off from any account which may have Admin rights.
3. Log in as a regular (non-admin user).
4. Navigate to Windows\System32 folder and do a RunAs->Administrator on
- Regedt32.exe
- Cmd.exe
- TaskMgr.exe
5. Switch to TaskMgr instance which you started in Step 4. Kill all instances of
Explorer.exe
6. Now switch to Regedit instance and search for Nissan.exe and remove all values where it shows up. Do a find for 'nissan.exe' a few times just to make sure.
7. Switch to command prompt instance and del all entries of nissan.exe by running
C:\>
C:\>cd \
C:\>cd "Recycler"
C:\>dir /a hsr *.*
This will display exactly where nissan.exe is for e.g.
"C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe".
Now to delete the entries:
C:\>attrib -hsr "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe"
C:\>del "C:\RECYCLER\S-1-5-21-3028898713-0813311981-684376638-1852\nissan.exe"
Do a dir nissan.exe and check if you missed out any entry.
By now all entries which launch the exe should have been removed.
I have a suspicion that USB drives get affected and when such 'affected' drives auto-run, the system gets infected. I would therefore recommend that you disable AUTORUN on all drives. Follow the instructions in the link:
Disable autorun
Labels:
Nissan.exe,
remove,
thenewspaedia.com,
trojan,
virus,
Windows
Thursday, September 17, 2009
Download FULL SQL Express 2008
Here are the links where the full installer for SQL Express may be found:
http://www.microsoft.com/downloads/details.aspx?familyid=58CE885D-508B-45C8-9FD3-118EDD8E6FFF&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=08E52AC2-1D62-45F6-9A4A-4B76A8564A2B&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=58CE885D-508B-45C8-9FD3-118EDD8E6FFF&displaylang=en
http://www.microsoft.com/downloads/details.aspx?familyid=08E52AC2-1D62-45F6-9A4A-4B76A8564A2B&displaylang=en
Tuesday, August 25, 2009
Installing Microsoft products really sucks
Installing Microsoft applications is a fu**ed-up experience.
Why can't they ever get them right?
Ever since the highly touted .NET framework made its appearance, installing anything coming out of Microsoft has become a royal pain.
Thought I'd install SQL Server 2008 developer edition and see the new features. What I am greeted with? A long long long download process from the Internet to get .NET 3.5 SP1. Man! why couldn't they package the offline version on the DVD?
Anyway, after the download is complete, the installation of .NET 3.5 SP1 itself took almost an hour. Why? It takes that much time to install Windows OS in the first place?
Ok, now at least I can select all the cool 'features' of SQL I want to install, I select almost everything and click the dreaded 'Next' button. Whay do I see? I am now told to install SP1 of Visual Studio first before installing SQL 2008 Man, that's the final straw. Is this the way to make software?
That's not all, go to the download page for .NET SP1 on Microsoft's site:
http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en
This is taken right from the page:
"IMPORTANT: After installing the .NET Framework 3.5 SP1 package (either the bootstrapper or the full package) you should immediately install the update KB959209 to address a set of known application compatibility issues.
In addition, on Windows Vista x64 and Windows Server 2008 x64, install the update KB967190 to address a file association issue for XPS documents."
HAHAHA! Installing SP1 itself requires installing another fix on it immediately! hehehe.. Don't ask if installing the fix requires you to install another something, I am too scared to go check.
Where have all the 'real' developers gone from Microsoft?
Why can't they ever get them right?
Ever since the highly touted .NET framework made its appearance, installing anything coming out of Microsoft has become a royal pain.
Thought I'd install SQL Server 2008 developer edition and see the new features. What I am greeted with? A long long long download process from the Internet to get .NET 3.5 SP1. Man! why couldn't they package the offline version on the DVD?
Anyway, after the download is complete, the installation of .NET 3.5 SP1 itself took almost an hour. Why? It takes that much time to install Windows OS in the first place?
Ok, now at least I can select all the cool 'features' of SQL I want to install, I select almost everything and click the dreaded 'Next' button. Whay do I see? I am now told to install SP1 of Visual Studio first before installing SQL 2008 Man, that's the final straw. Is this the way to make software?
That's not all, go to the download page for .NET SP1 on Microsoft's site:
http://www.microsoft.com/downloads/details.aspx?FamilyID=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en
This is taken right from the page:
"IMPORTANT: After installing the .NET Framework 3.5 SP1 package (either the bootstrapper or the full package) you should immediately install the update KB959209 to address a set of known application compatibility issues.
In addition, on Windows Vista x64 and Windows Server 2008 x64, install the update KB967190 to address a file association issue for XPS documents."
HAHAHA! Installing SP1 itself requires installing another fix on it immediately! hehehe.. Don't ask if installing the fix requires you to install another something, I am too scared to go check.
Where have all the 'real' developers gone from Microsoft?
Monday, May 25, 2009
Friday, May 22, 2009
Big shops, big names or the small local ones
What is the difference between a big shop (e.g. Excite/Croma/Vijay Sales etc) and the local across the street computer dealer?
- Big shops have more products on display
- Big shops have better ambiance
- Big shops are more customer friendly
- Big shops offer better product support
- Big shops are hassle free one stop shop for your needs
Really?
I think its the exact opposite. I don't just 'think' that, but I have experienced that many times in many different 'big' shops.
Big shops have more products:
Few days back, the customer likes an LG LCD TV on display, wants to buy it so ordered it from Excite. 'Big' shop says we don't have it in stock but we 'can' get it for you.
Now, how is it that a 'big' shop have such a paltry stock of items? If they are having products in display then why not in stock?
Moving on, 'big' shop says they will get it ... 'if customer pays 75% of the price in advance'! wow!
The customer has to pay the price of bad stock keeping!.. OK..
Customer pays the advance, big shops says 'the piece will come in 1-2 days'. Customer waits for 2 weeks! Customer eventually wants his money back. 'Big' shop says, if will take 1 month to reverse the Credit Card payment! Amazing! ... Customer cannot even get back the money for something he did not purchase!
So, products on display, big shops win,
but
they do not win at delivering the final product.
Better ambiance & customer friendliness:
You enter you local dealer, he says 'Hi Sid, how's your kid .. etc'.
You enter 'big shop', 2 ladies come rushing at you with 'welcome to ... Sir!'. You cover your face and say 'thanks, I'm just taking a look at stuff, please don't kill me!'. After that you have one person rushing at you with a leaflet saying 'you must fill up this form to become a member to avail 'great' discounts, 'free' gift' and whatnot.
As you browse through the neatly arranged products, a security person keeps moving behind and to make sure you're not a thief.
As all this is happening, you being to sweat. You wonder why... the 'big' shop attendants have probably been ordered NOT to turn on the A/C when number of customers are low by the owner.
Finally when your trying to make the payment, you ask how much points will you get for the 'big purchase' you are about to make. He says 'No points for this Sir!, you are buying it at a sale'!
Why do they even take the trouble to make us members?
So as you see, everything that is happening is against the customer. Customer satisfaction is LEAST important.
So, a small shop with just a 'hi sir, how are you?' is MUCH more friendly than big shops who have so many things which are useless for the customer.
Big shops offer better product support:
Most people will have different experience around this. For me, I somehow feel so intimidated by 'big' shops, I usually don't phone them. I personally take the item (if it is small) and try to get it replaced. On the other hand, the local shops are more than happy to send 'Ramu' with a replacement piece.
So, I'd say, smaller shops still have better customer support which is a result of better customer relation.
Big shops are hassle free one stop shop for your needs:
They are hassle free for finding out which product you want to buy.
But to actually buy the product it looks like the smaller shop is better for all the above reasons.
What could be the reason for the failure of these big retailers?
- I think the problem is that they (owners) have too much money already so they could not care less about their customers.
- The owners are no longer personally involved with the shops and customers.
- Human beings are basically greedy and ungrateful.
- The employees of the big shops in turn don't care about customers since they anyway are getting their salaries customers or not. Even if they get chucked out, working in a shop is anyway not such a big deal, they can get equivalent jobs elsewhere.
Does all this seem familiar?
- Big shops have more products on display
- Big shops have better ambiance
- Big shops are more customer friendly
- Big shops offer better product support
- Big shops are hassle free one stop shop for your needs
Really?
I think its the exact opposite. I don't just 'think' that, but I have experienced that many times in many different 'big' shops.
Big shops have more products:
Few days back, the customer likes an LG LCD TV on display, wants to buy it so ordered it from Excite. 'Big' shop says we don't have it in stock but we 'can' get it for you.
Now, how is it that a 'big' shop have such a paltry stock of items? If they are having products in display then why not in stock?
Moving on, 'big' shop says they will get it ... 'if customer pays 75% of the price in advance'! wow!
The customer has to pay the price of bad stock keeping!.. OK..
Customer pays the advance, big shops says 'the piece will come in 1-2 days'. Customer waits for 2 weeks! Customer eventually wants his money back. 'Big' shop says, if will take 1 month to reverse the Credit Card payment! Amazing! ... Customer cannot even get back the money for something he did not purchase!
So, products on display, big shops win,
but
they do not win at delivering the final product.
Better ambiance & customer friendliness:
You enter you local dealer, he says 'Hi Sid, how's your kid .. etc'.
You enter 'big shop', 2 ladies come rushing at you with 'welcome to ... Sir!'. You cover your face and say 'thanks, I'm just taking a look at stuff, please don't kill me!'. After that you have one person rushing at you with a leaflet saying 'you must fill up this form to become a member to avail 'great' discounts, 'free' gift' and whatnot.
As you browse through the neatly arranged products, a security person keeps moving behind and to make sure you're not a thief.
As all this is happening, you being to sweat. You wonder why... the 'big' shop attendants have probably been ordered NOT to turn on the A/C when number of customers are low by the owner.
Finally when your trying to make the payment, you ask how much points will you get for the 'big purchase' you are about to make. He says 'No points for this Sir!, you are buying it at a sale'!
Why do they even take the trouble to make us members?
So as you see, everything that is happening is against the customer. Customer satisfaction is LEAST important.
So, a small shop with just a 'hi sir, how are you?' is MUCH more friendly than big shops who have so many things which are useless for the customer.
Big shops offer better product support:
Most people will have different experience around this. For me, I somehow feel so intimidated by 'big' shops, I usually don't phone them. I personally take the item (if it is small) and try to get it replaced. On the other hand, the local shops are more than happy to send 'Ramu' with a replacement piece.
So, I'd say, smaller shops still have better customer support which is a result of better customer relation.
Big shops are hassle free one stop shop for your needs:
They are hassle free for finding out which product you want to buy.
But to actually buy the product it looks like the smaller shop is better for all the above reasons.
What could be the reason for the failure of these big retailers?
- I think the problem is that they (owners) have too much money already so they could not care less about their customers.
- The owners are no longer personally involved with the shops and customers.
- Human beings are basically greedy and ungrateful.
- The employees of the big shops in turn don't care about customers since they anyway are getting their salaries customers or not. Even if they get chucked out, working in a shop is anyway not such a big deal, they can get equivalent jobs elsewhere.
Does all this seem familiar?
Wednesday, May 20, 2009
Which SQL Jobs are currently executing
Following script lists currently executing SQL jobs.
select
j.job_id, j.name
from
msdb..sysjobactivity a (NOLOCK)
inner join
msdb..sysjobs j (NOLOCK)
on
j.job_id=a.job_id
where
a.start_execution_date is not null
and
a.job_history_id is null
select
j.job_id, j.name
from
msdb..sysjobactivity a (NOLOCK)
inner join
msdb..sysjobs j (NOLOCK)
on
j.job_id=a.job_id
where
a.start_execution_date is not null
and
a.job_history_id is null
Wednesday, May 13, 2009
Horror of installing XP on ASUS M3N78-EM
After trying to get comfortable with Vista x64 on my new machine (ASUS M3N78-EM, Phenom Triple Core, 4 GB RAM), I decided that it's just not gonna happen. I couldn't connect my Sony HandyCam as drivers were not present, my plain old HP Deskjet 64bit drivers weren't working..basically the whole experience was pretty miserable.
Anyway, decided that XP 32bit is still the way to go. Installed slipstreamed version of XP SP3. Everthing worked except ... THE SOUND! Searched google and found lots of forums where people had similar problems with the RealTek Hi definition audio drivers. I tried ALL solutions I came across including installing XP UAA drivers (available with HP), installing latest drivers from ASUS for my MOBO, drivers from RealTek, nothing worked. Finally there was a post which suggested installing only SP2 of XP and then installing the Realtek Drivers and guess what? THIS WORKED!
Hope this helps anyone else having similar problems.
Anyway, decided that XP 32bit is still the way to go. Installed slipstreamed version of XP SP3. Everthing worked except ... THE SOUND! Searched google and found lots of forums where people had similar problems with the RealTek Hi definition audio drivers. I tried ALL solutions I came across including installing XP UAA drivers (available with HP), installing latest drivers from ASUS for my MOBO, drivers from RealTek, nothing worked. Finally there was a post which suggested installing only SP2 of XP and then installing the Realtek Drivers and guess what? THIS WORKED!
Hope this helps anyone else having similar problems.
Thursday, December 25, 2008
Guns n' Roses still rock
Went to Landmarks, MG Road, Pune on Christmas day and say big posters of Chinese Democracy but could not locate the CDs. After asking the staff turns out that they are all sold out. Sure I was sad I could not get my copy but I was also quite happy, after all these years Gn'R (my favorite band since school days) still kicks ass and manages to sell out 100%.
Saturday, December 13, 2008
Setting up a wireless network with DLink DER 300 and Airtel broadband
Setting up home networks can be either a total pleasure or a total pain; there are no in-betweens.
Here is an east step by step instruction so you have a ‘total pleasure’able experience.
I am assuming:
The Airtel DSL router has it’s IP set to 192.168.1.1
The DLINK router’s IP is set to 192.168.0.1
Step1:
While still connected to the airtel DSL directly, log into the Airtel DSL router’s administration website using your favorite browser: http://192.168.1.1
- Enter the user-id and password. The default one is ‘admin’ for login and ‘password’ for password.
- Now click the ‘LAN’ link on the left side of the web-page.
- Select the ‘Disable DHCP Server’ as shown below:

Click Save.
Step 2:
Remove the network cable which connects the Airtel DSL router to your PC from your PC and connect it to the socket marked ‘Internet’ on the DLink router.
Step 3:
Connect your PC to one of the LAN ports of the DLink router using the supplied LAN cable (supplied with the DLink router).
Bring up the Command Prompt in Windows by typing cmd in the Programs…Run menu. Now type: ping 192.168.0.1
Your screen should look something like this:
C:\Documents and Settings\Siddharth.PIXIE.000>ping 192.168.0.1
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.0.1: bytes=32 time=20ms TTL=64
Reply from 192.168.0.1: bytes=32 time=20ms TTL=64
Reply from 192.168.0.1: bytes=32 time=20ms TTL=64
This means that your DLink router is connect properly to the PC.
Step 4:
Now to setup the PC’s network properties:

You can specify an IP address starting from 192.168.1.3 to 192.168.1.255.
Just make sure you don’t give 192.168.1.1 or 192.168.1.2 as these will be used by the routers.
Step 5:
Configure the DLink router Open the following URL in your favorite browser: http://192.168.0.1
Enter the user name as admin. The default password is blank so just leave it empty.
Disable DHCP:
In the next screen, click the “LAN Setup” from the left side of the website. I usually disable DHCP so that is what I am going to suggest here. In the “Enable DHCP Server” checkbox is checked, uncheck it.

Here is an east step by step instruction so you have a ‘total pleasure’able experience.
I am assuming:
The Airtel DSL router has it’s IP set to 192.168.1.1
The DLINK router’s IP is set to 192.168.0.1
Step1:
While still connected to the airtel DSL directly, log into the Airtel DSL router’s administration website using your favorite browser: http://192.168.1.1
- Enter the user-id and password. The default one is ‘admin’ for login and ‘password’ for password.
- Now click the ‘LAN’ link on the left side of the web-page.
- Select the ‘Disable DHCP Server’ as shown below:
Click Save.
Step 2:
Remove the network cable which connects the Airtel DSL router to your PC from your PC and connect it to the socket marked ‘Internet’ on the DLink router.
Step 3:
Connect your PC to one of the LAN ports of the DLink router using the supplied LAN cable (supplied with the DLink router).
Bring up the Command Prompt in Windows by typing cmd in the Programs…Run menu. Now type:
Your screen should look something like this:
C:\Documents and Settings\Siddharth.PIXIE.000>ping 192.168.0.1
Reply from 192.168.0.1: bytes=32 time=20ms TTL=64
Reply from 192.168.0.1: bytes=32 time=20ms TTL=64
This means that your DLink router is connect properly to the PC.
Step 4:
Now to setup the PC’s network properties:
You can specify an IP address starting from 192.168.1.3 to 192.168.1.255.
Just make sure you don’t give 192.168.1.1 or 192.168.1.2 as these will be used by the routers.
Step 5:
Configure the DLink router Open the following URL in your favorite browser: http://192.168.0.1
Enter the user name as admin. The default password is blank so just leave it empty.
Disable DHCP:
In the next screen, click the “LAN Setup” from the left side of the website. I usually disable DHCP so that is what I am going to suggest here. In the “Enable DHCP Server” checkbox is checked, uncheck it.
In the Router settings section specify the following details:
Click ‘Save Settings’.
Internet connection:
Click the “Internet Setup” link from the left side of the web-page.
Click the “Manual Internet Connection Setup” button.
In the next screen, set the ‘My Internet Connection is’ as ‘Static IP’. The properties should look like this:
Click ‘Save Settings’.
Wednesday, August 6, 2008
Set of useful command line utilities
Fresh from the factory, a set of useful command line utilities from your's truly:
whereis
This program allows you to locate a file on the machine using standard windows module locating logic.
For example if you are looking for a file notepad.exe and it is present in a particular known folder or in the PATH, the program will display where notepad.exe will be located by Windows.
paths
Prints paths which are set in your system.
winver
Prints the Windows version.
Download
whereisThis program allows you to locate a file on the machine using standard windows module locating logic.
For example if you are looking for a file notepad.exe and it is present in a particular known folder or in the PATH, the program will display where notepad.exe will be located by Windows.
paths
Prints paths which are set in your system.
winver
Prints the Windows version.
Download
Sunday, June 1, 2008
Friday, May 23, 2008
The Walk of Life
It's not WHAT you get, it's HOW you get it - with principles, honour and dignity OR with dishonesty, lack of character and of ethics.
It's not WHERE you reach, it's the ROAD you select - sunshine and butterflies or thorns and shadows. If trying hard does not work, try soft. When you don't know what to do, do nothing. Just wait and watch. Sometimes you get the bear, sometimes the bear gets you. Destiny must be embraced with courage and spirit. The means are more important than the ends, the Journey is more important than the Destination.
.... Prof. Rao
It's not WHERE you reach, it's the ROAD you select - sunshine and butterflies or thorns and shadows. If trying hard does not work, try soft. When you don't know what to do, do nothing. Just wait and watch. Sometimes you get the bear, sometimes the bear gets you. Destiny must be embraced with courage and spirit. The means are more important than the ends, the Journey is more important than the Destination.
.... Prof. Rao
Saturday, January 26, 2008
Borland C++ is back, slicker than ever
It's been sometime since I touched C++ programming. Everything seems to be .NET.
.NET is cool, a decent concept, a good base class library and a good enough IDE (Visual Studio 2005), yeah, but there still something missing; raw power. I first saw "Raw Power" delivered yet in a simple to use way in Delphi when VB was still in its infancy and VC++ programmers were considered cool. However coming from the C++ side of things, I was most delighted when Borland released Borland C++ Builder 1.0 - this was a very easy to use, TRULY RAD and powerful developer environment. The last release I used without any problems was Borland C++ Builder 6.0. After 6.0, ... nothing ... there was a C++ Builder Personal edition but the IDE was quite buggy, installation was a pain, .NET integration sucked (though I didn't care much for that)...all in all a pretty 'not happening' period of programming for me. The only thing available was .NET and its various version. Seriously, I hear people vehemently saying .NET programs are always optimized for the target platform since the runtime on the target machine is optimized for the target architecture etc etc etc...hogwash! A managed application still can't come even close to a C++ application as far raw speed is concerned. If I have to develop something for myself, nothing lesser than C++ will do! Sure VC++/MFC is there, but its a royal pain to do even slighlty complicated UI application using it; so I need Borland C++!. Good news: Borland is back, back with a spanking new IDE called CodeGear. I cannot recommend another IDE as highly as Borland's C++ Builder 2007. You can download the trial version at http://www.codegear.com/products/cppbuilder
Happy days are back!
.NET is cool, a decent concept, a good base class library and a good enough IDE (Visual Studio 2005), yeah, but there still something missing; raw power. I first saw "Raw Power" delivered yet in a simple to use way in Delphi when VB was still in its infancy and VC++ programmers were considered cool. However coming from the C++ side of things, I was most delighted when Borland released Borland C++ Builder 1.0 - this was a very easy to use, TRULY RAD and powerful developer environment. The last release I used without any problems was Borland C++ Builder 6.0. After 6.0, ... nothing ... there was a C++ Builder Personal edition but the IDE was quite buggy, installation was a pain, .NET integration sucked (though I didn't care much for that)...all in all a pretty 'not happening' period of programming for me. The only thing available was .NET and its various version. Seriously, I hear people vehemently saying .NET programs are always optimized for the target platform since the runtime on the target machine is optimized for the target architecture etc etc etc...hogwash! A managed application still can't come even close to a C++ application as far raw speed is concerned. If I have to develop something for myself, nothing lesser than C++ will do! Sure VC++/MFC is there, but its a royal pain to do even slighlty complicated UI application using it; so I need Borland C++!. Good news: Borland is back, back with a spanking new IDE called CodeGear. I cannot recommend another IDE as highly as Borland's C++ Builder 2007. You can download the trial version at http://www.codegear.com/products/cppbuilder
Happy days are back!
Sunday, January 20, 2008
iTunes or WMP11
I have been using WMP 11 for watching a lot of movies, never really faced any issues.
Today, I tried burning an audio cd for myself, WMP would not do it, c'mon, every CD I put in the burner, Windows Media Player kept saying insert a blank CD. The only way out was to save the song-list as a .m3u play-list file, open this file in iTunes and burn it without any hitches.
So, which media player do you use?
Today, I tried burning an audio cd for myself, WMP would not do it, c'mon, every CD I put in the burner, Windows Media Player kept saying insert a blank CD. The only way out was to save the song-list as a .m3u play-list file, open this file in iTunes and burn it without any hitches.
So, which media player do you use?
Programming language names getting ridiculous
Okay, we had 'C'. Then we had 'C++', quite catchy.
C#? ok, we can tolerate this. F#? wait a minute, what's going on here?
D? damn...I can't stand this anymore!
C#? ok, we can tolerate this. F#? wait a minute, what's going on here?
D? damn...I can't stand this anymore!
Tuesday, January 8, 2008
XP Customization
Seemed like I had seen every possible wallpaper and customization for XP, till I chanced upon http://www.crystalxp.net/. Highly recommended, specially the BricoPacks customization software which make Windows XP look exactly like Vista. They also have an amazing collection of wallpapers! The WWW is fun again!
Labels:
customization,
http://www.crystalxp.net/,
Vista,
wallpapers,
XP
Sunday, December 16, 2007
Odyssey Bookstore Pune
Finally a book-store which had almost all the stuff I've been looking for, for the last 2-3 months. Though the store looks small compared to others like Landmarks or Crosswords, they have a sophisticated collection of books and CDs. I went there looking for the 'Tao of Jeet Kune Do', though they didn't have it, I got 2 other amazing books on the same subject which were also on my list. I must say the customer care is pretty good, they took down the request the 'Tao...', lets see how soon they can get it!
They also must have a pretty neat collection of CDs. I say 'must have' since I didn't have much time to browse through their collection, I just asked for "Deep Purple - Knocking at your back door" and "Best of Shania Twain", they handed me both without much searching, amazing!
Crosswords, you could learn a few things from these guys.
They also must have a pretty neat collection of CDs. I say 'must have' since I didn't have much time to browse through their collection, I just asked for "Deep Purple - Knocking at your back door" and "Best of Shania Twain", they handed me both without much searching, amazing!
Crosswords, you could learn a few things from these guys.
Subscribe to:
Posts (Atom)