- Disconnect the hard drive from the machine and connect it to another machine as a secondary drive.
- Copy the file "mfehidk.sys" from a non-currupted Windows XP system to Windows/System32/Drivers
- Reconnect the drive back and start the OS...
Please, oh Google-gods, rank this blog prominently, and let's save some poor, misguided souls who might be searching for some code on formating a query string in C# or merely grazing for urdu shayaris.... If just one person sees the light, then I've done my job! .... Yes, I am not above shamelessly begging the search engines for relevance .... it's called SEO, right?)
Friday, April 23, 2010
Fixing the McAfee Windows XP crash
Tuesday, April 20, 2010
Dynamically add LinkButton to placeholder
LinkButton filterButton = new LinkButton();
filterButton.ID = "SomeUniqueID";
filterButton.Text = "WhateverNeedsDisplayedInHyperlink";
filterButton.Click += (showFile);
filterButton.DataBind();
ShowFileLinks.Controls.Add(filterButton);
ShowFileLinks.Controls.Add(new LiteralControl("
"));
private void showFile(object sender, EventArgs e1)
{
//this is your unique buttonID...do whatever you want with it..Prob query the Database
int btnIndex = Convert.ToInt32(((LinkButton)sender).ID);
}
Generate unique strings and numbers in C#
It is not possible to shorten it without loosing some of the uniqueness of the GUID, but we can come a long way if we can accept a 16 character string instead.
We can change the standard GUID string representation:
21726045-e8f7-4b09-abd8-4bcc926e9e28
Into a shorter string:
3c4ebc5f5f2c4edc
The following method creates the shorter string and it is actually very unique. An iteration of 10 million didn.t create a duplicate. It uses the uniqueness of a GUID to create the string.
private string GenerateId()
{
long i = 1;
foreach (byte b in Guid.NewGuid().ToByteArray())
{
i *= ((int)b + 1);
}
return string.Format("{0:x}", i - DateTime.Now.Ticks);
}
If you instead want numbers instead of a string, you can do that to but then you need to go up to 19 characters. The following method converts a GUID to an Int64.
private long GenerateId()
{
byte[] buffer = Guid.NewGuid().ToByteArray();
return BitConverter.ToInt64(buffer, 0);
}
The standard GUID is still the best way to ensure the uniqueness even though it isn't 100% unique.
Wednesday, April 7, 2010
Firefox issues
Description
How do I restore the Firefox Menu Bar?
This happened
Every time Firefox opened,I selected the close option on some toolbar and eventually had no menu toolbars left in firefox. Could not right click and restore the menu and felt really stupid being stuck with a bare naked firefox window.
Solution
Hit the Alt key to show the Menu bar, then open View > Toolbars and check-mark the Menu bar.
And now ALL IZ WELL !!!!