Friday, October 12, 2007

חידות לראיון עבודה

חידות בראיון עבודה הן משהו שקשה להתחמק ממנו אבל די קל לעבור אותן בעיקר כשערן רום מביא לכם את התשובות, אז קבלו את חלק א' של החידות והפתרונות העיוור והכדים
חידה - מול עיוור מונחים שני כדים, ברשותך 50 כדורים שחורים ו-50 כדורים אדומים.
עליך לחלק את הכדורים בצורה כזו שלעיוור יהיה הסיכוי הגבוה ביותר להוציא כדור אדום.
איך תעשה זאת?
פתרון - יש לשים כדור אדום אחד בכד מסוים ובכד השני את כל שאר הכדורים, כך נגיע לסיכוי של בערך 75%.
הסבר: בכד עם הכדור הבודד הסיכוי הוא מאה אחוז ובכד השני קצת פחות מחמישים אחוז.
שלוש קערות
חידה - יש לנו 3 קערות שבהן ישנן גולות שחורות, גולות לבנות או מעורב, גולות שחורות וגולות לבנות.
על כל קערה רשום פתק:
שחור, לבן או מעורב (שחור ולבן)
ידוע ששלושת הפתקים שקריים.
תוך כמה הוצאות של כדורים תדעו מה הפתק המתאים לכל קערה?
פתרון - הוצאה אחת תספיק.
הסבר: מאחר ונתון שכל הפתקים לא נמצאים על הקערה הנכונה די להוציא כדור אחד מהקערה המעורבת, בהתאם לצבע של הכדור שייצא נדביק מבדקה שחור או לבן ואת הפתקים האחרים פשוט נחליף. זה הסידור הנכון.
החבית הכבדה
חידה - יש 9 חביות ואחת כבדה יותר מהשאר. כיצד תאתרו את החבית הכבדה ביותר בעזרת שתי שקילות בלבד?
פתרון - שוקלים שתי קבוצות של 3 חביות, אם קבוצה אחת יותר כבדה אז שוקלים שם חבית אחת מול חבית אחת.
במצב של שיוויון בשקילה הראשונה ממשיכים עם שלושת החביות שלא שקלנו.
אם יש שיוויון בשקילה השנייה אזי החבית שנותרה בחוץ בשקילה זו היא החבית המבוקשת (הכבדה).
זמן ופתילים
חידה - אנו רוצים למדוד זמן בעזרת פתילים. לרשותנו שני פתילים אשר זמן הבעירה של כל אחד מהם הוא שעה. קצב הבעירה אינו קבוע (כלומר חצי מאורך הפתיל לא יבער חצי מזמן בערת הפתיל). כיצד תמדדו שלושת רבעי שעה?
פתרון - מדליקים פתיל אחד משני הצדדים ופתיל אחד רק מצד אחד, כשהפתיל הראשון מסיים מדליקים את הצד השני של הפתיל השני.
הסבר: אחרי שהדלקנו את הפתיל הראשון משני צדדיו תעבור חצי שעה. אז אם נדליק את הצד השני של הפתיל השני נקבל רבע שעה, סך הכל שלושת רבעי שעה.
כובעים בקופסה
חידה - בקופסה יש חמישה כובעים: שלושה שחורים ושניים לבנים. בוחרים שלושה באקראי ומעמידים בטור שלושה אנשים כאשר האחרון בטור רואה את הכובעים של אלה לפניו, אך לא את שלו. האמצעי רואה את של הראשון והראשון לא רואה אף כובע.
האחרון אומר:אני לא יודע איזה כובע יש לי.
האמצעי אומר:אני לא יודע איזה כובע יש לי.
הראשון אומר: אני יודע איזה כובע יש לי. איזה כובע יש לראשון?
פתרון - לראשון יש בהכרח כובע שחור.
הסבר: אם האחרון לא יודע איזה כובע יש לו מכאן שלשני הראשונים יש או שני כובעים שחורים או כובע שחור אחד וכובע לבן אחד.
מאחר וגם האמצעי לא יודע איזה כובע יש לו (ואם לראשון היה לבן הוא הרי היה יודע שיש לו שחור), נקבל שלראשון יש כובע שחור

Saturday, October 6, 2007

43 Exceptionally Useful AJAX Applications

Link

What is ctfmon.exe And Why Is It Running?

You are no doubt reading this article because you are frustrated with the ctfmon.exe process that just won't stop opening no matter what you do. You remove it from the startup items and it just magically reappears. So what is it?

Ctfmon is the Microsoft process that controls Alternative User Input and the Office Language bar. It's how you can control the computer via speech or a pen tablet, or using the onscreen keyboard inputs for asian languages.

If you are using any of the above, you should leave it enabled. For everybody else, we'll get to the job of disabling this annoying service.

image

Depending on your system configuration, there are a number of different steps to disable it. I've tried to list all the methods below.

Step 1: Disabling in Microsoft Office 2003

We can remove the alternative text input from Microsoft Office 2003 by just removing that feature in the setup.

Note: I haven't figured out where the equivalent setting is for Office 2007 (if there is one), but we can also disable it a different way below.

Go to Add/Remove programs, choose to Change your installation of Microsoft Office and make sure you check the box for "Choose advanced customization of applications" before you hit next.

image

Find "Alternative User Input" in the list and change the dropdown to "Not available" so it looks like this:

image

Step 2a: Disabling in Windows XP

There's an additional step we can take to make sure it gets turned off in Windows XP, which really seems to be the best answer for XP users.

Open up Control Panel and choose Regional and Language Options.

image

Choose the Languages tab and then click on Details in the top section.

image

Now on the Advanced tab you can choose to "Turn off advanced text services", which should immediately close ctfmon.

image

You'll also want to take a look at the first Settings tab, and make sure that your "Installed Services" box looks similar to this one:

image

If you have more than one Installed service then ctfmon might come back… For instance on my system there was an input for my drawing tablet so I could use it as a text input… which I don't care about, so I clicked Remove on it.

Step 2b: Disabling in Windows Vista

The setting above for completely disabling text services doesn't seem to exist in Windows Vista as far as I can tell, but we can remove the additional input services using a similar method.

Open Control Panel, choose Regional and Language Options and then find "Change keyboards or other input methods".

image

On the Keyboards and Languages tab, you can select Change keyboards.

image

Now you'll finally be at the same screen as in Windows XP. You'll again want to remove the extra installed services in the list other than your default keyboard language.

image

Step 3: Remove From Startup

You won't want to perform this step before doing the others, because it will just be overwritten again. Open up msconfig.exe through the start menu run or search box, and then find the Startup tab.

image

Find ctfmon in the list and disable it by unchecking the box. Just remember that if you haven't disabled ctfmon through one of the other settings this won't help you a lot.

Step 4: If all else fails

You can just completely unregister the dlls that run the alternative input services by running these two commands from the run box (one at a time)

Regsvr32.exe /u msimtf.dll

Regsvr32.exe /u msctf.dll

If you perform this step, you should also use Step 3 to get rid of the startup entries.

Step 5: Reboot

Reboot your computer and then open a Microsoft Office application if you do have that installed. Verify that ctfmon.exe is not running.

For more information you can read the Microsoft article on the subject.

Source

Saturday, September 29, 2007

Default Form Button

Form properties ->Misc->AcceptButton

Firefox - new profile

Step 1: Start Firefox and export your bookmarks as a file on your hard-drive (we'll need them later).

fast firefox browser

Step 2: Type firefox.exe - P in the Run box of Windows. (see screenshot)

Step 3: Click the Create Profile button without making any modifications to your existing profile (which is normally called "default")

Firefox Very Slow

Now when you Start Firefox in the new profile, you are very likely to be impressed with the speed. You can import the bookmarks that you saved in Step 1. If you have made any changes to the Firefox Dictionary, copy the persdict.dat word list file from the old profile folder to the new one.

Yes, there won't be any old Firefox add-ons in the new profile but the browser will be extremely quick and won't hog the CPU - just the way you want Firefox to run on your computer.

And if you ever need to revert to the old profile, just type Firefox -P again and click the old profile. Nothing is lost.

 

Source

Tuesday, September 25, 2007

Impersonation - C#

http://netcode.ru/dotnet/?lang=&katID=30&skatID=261&artID=6875

SetACL - windows permissions management (GPL)

 

http://setacl.sourceforge.net/index.html

DOS command to delete directory with all sub directories without confirmations

Windows XP DOS command deletes the C:\TEST directory and all subdirectories WITHOUT ANY WARNING:

RD C:\TEST/S /Q

/S = Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree.
/Q = Quiet mode, do not ask if OK to remove a directory tree with /S.

Friday, September 7, 2007

Clean Up Ubuntu Grub Boot Menu After Upgrades

To remove GRUB entries, we'll need to edit the file /boot/grub/menu.lst. You can do this by using Alt+F2 and then typing in the following command:

gksu gedit /boot/grub/menu.lst

image

Now that we've got the file open, scroll down to the bottom of the file where it says "End Default Options", and you'll find all the menu entries for the various kernels in here. You can just select and delete the ones you want.

image

Save the file, and then the next time you boot up you'll see a much nicer set of options.

Comments:

No need to delete those lines to simplify the GRUB menu. The easier way to keep only newest lines is to open the menu.lst (gksu gedit /boot/grub/menu.lst), find "#howmany=all" and change it to "#howmany=1″. Then run "sudo update-grub" to update changes. Next time, only newest kernel lines will be shown.

Source

Tracking Down Svchost Process

In CMD window write:

tasklist /svc