Follow me on Twitter RSS FEED

Fix to Windows 7 icon issue

Posted in
My friend had an issue with win7. He dont have any idea how it happen but all the icons changed to windows default icon.














When he told me, i googled and found some fix to this problem.

so here is the solution
  • Try to Restore as all people use to do.
  • Else try to clear the icon cache database.
1. Close all folder windows that are currently open.

2. Launch Task Manager using the CTRL+SHIFT+ESC key sequence, or by running taskmgr.exe.

3. In the Process tab, right-click on the Explorer.exe process and select End Process.

4. Click the End process button when asked for confirmation.

5. From the File menu of Task Manager, select New Task (Run…)

6. Type CMD.EXE, and click OK

7. In the Command Prompt window, type the commands one by one and press ENTER after each command:

CD /d %userprofile%\AppData\Local
DEL IconCache.db /a
EXIT
8. In Task Manager, click File, select New Task (Run…)

9. Type EXPLORER.EXE, and click OK.

Thanks to winhelponline

Creating Transparant(Glassy) Layer For Web Page

Posted in
Lets start creating Glassy Layer.

Step1:
  • Fire Photoshop CS2 and above
  • Double click on the layer to unlock it
  • Erase the white using Eraser tool
  • You ll see black and white checks (transparent area)
  • now add any image or graphics
  • By selecting the item you added previously change the opacity to 45% range
  • after that File->Save for Web & Device...
  • Select the type as png-24 which is found below presets and save it
Now the image file is created.
Step 2:
  • Now in the HTML page use the image created above any other images.
Now this is called UI Experience.

Static background image for web page

Posted in
Many websites have there background image as static even when scroll, So how they do that?
Its just a one piece of CSS code..

background-attachment:fixed;

Even when you scroll this blog the background image is still. Well many times this is very cool but not all times.

Reverse String using XOR and without using Temporary Variable

Posted in
My friend faced this question for TCS technical interview. The code the much simple but the logic is bit complex

char* rev(char* str)
{
int end= strlen(str)-1;
int start = 0;

while( start<end )
{
str[start] ^= str[end];
str[end] ^= str[start];
str[start]^= str[end];

++start;
--end;
}

return str;
}
The the above version is with while loop even one can use for loop instead of it.

XOR (Exclusive OR) table
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
So how does it works.

First operation:x1 = x1 XOR x2
x1:100
x2:111
New x1:011
Second operationx2 = x2 XOR x1
x1:011
x2:111
New x2:100
Third operation:x1 = x1 XOR x2
x1:011
x2:100
New x1:111


So finally we have done X1 and X2 are swapped. This method is for both without using Temporary variable and also using Xor operator...

Pretty Cool huh...

Adding Parameter values to Database Query String

There were always problem with Adding Values to query string...

Consistent way:
const string query = "insert into TABLENAME (Id, Name) Values(?,?)";
object[] ParameterValues = {
IntId,
StrName
};
SqlConnection connection = new SqlConnection(connection_string);
SqlCommand command = new SqlCommand(query, connection);
foreach (object parameterValue in ParameterValues)
{
command.Parameters.AddWithValue("", parameterValue);
}
connection.Open();
command.ExecuteNonQuery();

So with this way we can add all the special characters like without using \(Back slash) to a sql Database.

Hope its usefull..