TECH GUIDE BLOG

Tech Guide Programming Tutorial Tips Tricks

Archive for June, 2009

Prevent Access to Your Drive with File Sharing XP

Posted by Admin On June - 27 - 2009

We use computers. We use it together, with your parents, families and your friends. We thought it would be safe if we let them use your PC, but oopppss, they do delete your files and say sorry to you. Sorry didn’t make your files back to you. If you don’t want this disaster happen to you again, here’s a way to make it not happen again. Open folder options in control panel section and with View tab, you will see many options ahead. Find use simple file sharing option (XP), uncheck this and click OK.

simple file sharing XP

simple file sharing XP

After you did like above on XP, you can see the different now. Everytime you see the properties of every files or folders or drives (right-click and click Properties), see the tab, there will be a new tab called Security. Now we can start playing, choose a file, folder or drive that you want to be blocked so other users can’t access it. Click edit and you will see a new window to set permission. XP is the same either, I know these picture below are on Vista, I’m running Vista, so there is no picture for XP, but it’s should be easy since it’s not so different (so long XP =)). In this new window, you can edit permissions of each users in your computer. You can add a new user if their username isn’t there yet. Just remember do not restrict yourself, you must be idiotic silly, but since you’re admin, you can set the permissions again and again, God Bless You.

security-tab

Security tab

So, let’s set the permission then. Check under ‘Deny’ if you those users can’t access your files etc and check under ‘Allow’ if you want users can do in that file. You can check Deny ‘Full Control’ if you want users can do nothing with your selected file or you may choose what actions a user can do and can’t do with that file. Click OK and now the other users that try to access or delete your priceless files again will find another way instead of Shift+DEL Enter and double-click.

set-permission

Set permission window

Final words, may this post can help you and works fine. It works fine with my PC and my friend. So, it must be fine on your PC with Windows XP or above.

Popularity: 31% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter

Boyer Moore String Searching Algorithm

Posted by Admin On June - 23 - 2009

This time, we will talk about Boyer Moore string searching. It’s not like brute-force, it will search a substring from the back and go forward till the first char of string. For example, we search a substring EXAMPLE within HERE IS A SIMPLE EXAMPLE string. I can’t explain it well, so this below maybe rather confusing.

EXAMPLE
HERE IS A SIMPLE EXAMPLE
's' is not in EXAMPLE substring, jump for EXAMPLE length = 7
       EXAMPLE
HERE IS A SIMPLE EXAMPLE
'e' is not same as 'p', so jump for the last char of EXAMPLE to 'p' EXAMPLE = 2
         EXAMPLE
HERE IS A SIMPLE EXAMPLE
'a' != 'i', jump for distance from 'e' SIMPLE to the front 'e' EXAMPLE sub string = 6
               EXAMPLE
HERE IS A SIMPLE EXAMPLE
'e' is not same as 'p', so jump for the last char of EXAMPLE to 'p' EXAMPLE = 2
                 EXAMPLE
HERE IS A SIMPLE EXAMPLE
compare till end, found.

For the code, it’s a little weird, made by myself with many helps. It just find the index of string if it found the sub string within the string. You can use a table to save all chars shift value.

#include <stdio.h>
#include <string.h>
#include <conio.h>
#include <windows.h>

void main()
{
	char string[1000], substring[1000];
	int strvalue[256], i, j, diff = 0, count = 0;

	printf("Input string: ");
	gets(string);
	printf("Input substring: ");
	gets(substring);
	for (i = 0; i < 256; i++)
	{
		strvalue[i] = -1;
	}
	for (i = strlen(substring) - 1; i >= 0 ; i--)
	{
		if (strvalue[substring[i]] == -1)
			strvalue[substring[i]] = i;
	}
	for (i = 0; i < 256; i++)
	{
		if (strvalue[substring[i]] == -1)
			strvalue[substring[i]] = strlen(substring);
	}
	i = strlen(substring) - 1;
	while (true)
	{
		for (j = strlen(substring) - 1; j >= 0 ; j--)
		{
			if (substring[j] == string[i - diff])
			{
				count++;
				diff++;
			}
			else
				break;
			if (count == strlen(substring))
			{
				printf("%d", i - diff + 2);
				getch();
				exit(0);
			}
		}
		diff = strlen(substring) - strvalue[string[i - diff]] - 1 - count;
		if (diff > 0)
		{
			i = i + diff;
			diff = 0;
			count = 0;
		}
		else
			i++;
		if (i > strlen(string) + strlen(substring) + 2)
			exit(0);
	}
}

Popularity: 49% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter

Boost Windows Shutdown with Auto End Task

Posted by Admin On June - 17 - 2009

While using Windows, like XP, of course we’ve seen some programs that’s not responding anymore, because your finger specification is much more faster than your rig specification. You open the program and after 3 seconds you want to close it, even the program needs 4 seconds to start up. This state of course, can decrease the system performance itself. When we want to shut down after you do that, the system will wait longer than usually, because Windows will wait these programs to be closed.

not responding

End Now State

It’s much better if the programs that are not responding could be closed without wait the Windows to end it, in other words, we just click close button and the program will close itself without click End Now button and of course Windows doesn’t have to wait anymore to shut down.

To do like the above, you have to open regedit (Registry Editor). Go to HKEY_USERS\.DEFAULT\Control Panel\Desktop. Then, find AutoEndTask registry with REG_DWORD type. If there is no AutoEndTask key, you can create it, click Edit -> New -> DWORD Value and name it with AutoEndTask. Double click and change the value to 1 and click OK. Restart the computer for take change effect.

auto end task

Auto End Task

Popularity: 79% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter