Visual Studo 2010 Useful Shortcuts

  • **CTR + ALT + L **- move to Solution Explorer
  • Type (for example “try” or “for”) and hit Tab twice for code snippet auto-completion.
  • Ctrl + – and the opposite Ctrl + Shift + – Move cursor back (or forwards) to the last place it was. No more scrolling back or PgUp/Dwn to find out where you were.
  • Ctrl + I – Incremental Search
  • Shift+Alt+Enter window in focus in full screen mode. Hit it again, and you have all the panels back. ****
  • Ctrl + Alt + I – jump to Immediate Window
  • Tools -> Options -> Environment -> Keyboard. Type “Navigation” to get the shortcut to combo-box on top of the window.
  • Ctrl + Shift + , or Ctrl + Shift + . to zoom-in or zoom-out
  • Ctrl + M + M – collapse/expand current region
  • Ctrl + M + O – collapse  all regions
  • Ctrl + M + L – expand  all regions
  • CTRL+K + X – code snippet
  • CTRL+K + S – Surround With code snippet More shortcuts are here:

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13189 Or here: http://www.itscodingtime.com/post/Visual-Studio-2010-Keyboard-Mouse-Shortcuts.aspx

Visual Studo Shortcuts as in Eclipse

Using both Eclipse and Visual Studio can be a pain, when it comes to shortcuts.
In VS you can change shortcuts here: Tools -> Options -> Environment -> Keyboard

Change the following:
Delete line: Edit.lineDelete -> Ctrl + D
Comment line: Edit.CommentSelection -> Ctrl + /
Uncomment line: Edit.UnCommentSelection -> Ctrl + Shift + /
Goto Definition: Edit.GoToDefinition -> F3
Goto Navigation Bar: Window.MovetoNavigationBar -> Ctrl + #

To be able to move lines up and down like in Eclipse (alt + up; alt + down) you’ll need to create 2 macros:

    Sub MoveLineUp()
        DTE.ActiveDocument.Selection.Collapse()
        DTE.ActiveDocument.Selection.Cut()
        DTE.ActiveDocument.Selection.LineUp()
        DTE.ActiveDocument.Selection.Paste()
        DTE.ActiveDocument.Selection.LineUp()
    End Sub

    Sub MoveLineDown()
        DTE.ActiveDocument.Selection.Collapse()
        DTE.ActiveDocument.Selection.Cut()
        DTE.ActiveDocument.Selection.LineDown()
        DTE.ActiveDocument.Selection.Paste()
        DTE.ActiveDocument.Selection.LineUp()
    End Sub

then the same way you change shortcuts in VS, find “moveLineUp” and “moveLineDown” and assign Alt + UP and Alt + Down.
Alternatively install Productivity Power Tools that provide Edit.MoveLineUp and Edit.MoveLineDown

I’ll keep updating as it comes along.

SQL Server connection validation

I run into a problem where I tried to connect to a fresh installation of SQL Server 2008 and could not do it for no apparent reason. But it turns out that SQL Server 2008 is shipped with TSP/IP disabled and nobody can connect to it via network, even from localhost.
Here is the solution:
http://support.microsoft.com/kb/823938

You can check in registry this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\\MSSQLServer\SuperSocketNetLib\Tcp\Enabled
It must be set to 1 for SQL Server to be listening for network connection.

Run this on master database to see error log on the server:
exec Go Xp_readerrorlog
You should look for
SQL server listening on X.X.X.X: Y
This will be an indicator if network connections are allowed in the Server

Поиск вируса

Если в системе не удаётся что-либо запустить, то:
1) грузимся с любого лайв-сд/двд/юсб, не обязательно мегасборки на BartPE, вполне хватит обычного установочника на WinPE 2.x, т.е. от Vista/7/2008
2) запускаем консоль (в установщиках на WinPE – Shift+F10) и делаем магические пассы:
cd c:\
c:
dir *.exe /od /s > c:\execs.txt
dir *.dll /od /s > c:\dlls.txt
notepad c:\execs.txt
notepad c:\dlls.exe
В открывшихся блокнотах ищём по дате заражения, т.е. если сегодня – то ищем строку “16.06.2011”
при необходимости модифицируем до dir *.* /od /s > c:\all.txt или до dir … | findstr “16.06.2011”

По мотивам http://ru-sysadmins.livejournal.com/1739747.html
Спасибо товарищу pan_2

Shortcuts in Eclipse

Ctrl + Shift + R Open any file quickly
Ctrl + Shift + T Open a type
Ctrl + T go to super type of the class
Ctrl + O Go directly to a member (method, variable) of a class file
Ctrl + Shift + ↓ or Ctrl + Shift + ↑ navigate between methods in class
ALT + Up/Down Arrow move selected string up or down
Ctrl + L jump to line number
CTRL + D Delete row.
Ctrl + Q go to last edit place
Ctrl + E or CTRL+F6 go to open editors
Ctrl + . and Ctrl + , Move between issues in editor
F3 go to type declaration
CTRL+SHIFT+O Organize imports
CTRL+1 It activates the quick fix
CTRL+F7 Move between views
CTRL+F8 Move between perspectives.
CTRL + F11 Runs the application.
CTRL + M Maximize or umaximize current tab.
CTRL + I Corrects indentation.
CTRL + SHIFT + F Formats code.
CTRL + J Incremental search.
CTRL + SHIFT + L Shows you a list of your currently defined shortcut keys.

from here: http://rayfd.wordpress.com/2007/05/20/10-eclipse-navigation-shortcuts-every-java-programmer-should-know/
and here: http://eclipse.dzone.com/news/effective-eclipse-shortcut-key

How to replace system files in WinXp

Sometimes you need to replace damaged system files with correct ones. I’m talking about files in C:\windows\system32\…

There are 2 ways of doing this:

Use sfc command: insert distribution disk with correct version of Windows, execute sfc /purgecache to clean out the cache of drivers/files. Then execute sfc /scannow. This will check all the system files and replace damaged.

Another way is to replace files one by one. Again, insert your distribution disk, then run command:

expand D:\i386\ndis.sy_ C:\windows\system32\drivers\ndis.sys

This unpacks compressed files from the CD archive.