MS Word: put syntax highlighed code into the document

Here is the simple method to put the code with highlighting into the Word document:

    1. Download and install Notepad++. This is easy-to-use and yet very powerful text editor with a lot of features, support of the plugins etc.
    2. Put your code into the Notepad++ edit window
    1. Configure the language, if Notepad++ did not do this automatically:
      Language->your language
      npp language select
      If necessary the additional configuration could be done in the Style Configurator: Settings->Style Configurator…
    1. Export the highlighted text with help of NppExport plugin: Plugins->NppExport
      It has the following options:
      npp export options
    1. Select “Copy RTF to clipboard”
    2. Paste the content of the clipboard into the Word document
    3. Make any changes in the Word document if necessary

Oracle: how to clone profiles

Here is the simple script for cloning the Oracle profiles.
[cc lang=”oracle8″]
set serveroutput on

declare
cursor c_profiles is
select PROFILE, RESOURCE_NAME, LIMIT
from dba_profiles
order by profile, resource_name;

s_PROFILE dba_profiles.PROFILE%type ;
s_prev_PROFILE dba_profiles.PROFILE%type ;
s_RESOURCE_NAME dba_profiles.RESOURCE_NAME%type ;
s_LIMIT dba_profiles.LIMIT%type ;
begin

s_prev_PROFILE := ‘no_such_profile’ ;

dbms_output.enable(1000000);
open c_profiles;
loop
fetch c_profiles into s_PROFILE,s_RESOURCE_NAME,s_LIMIT ;
if ( s_prev_profile <> s_profile ) then
begin
dbms_output.put_line ( ‘–‘);
dbms_output.put_line ( ‘create profile “‘||s_profile||'” limit ‘ ||s_RESOURCE_NAME|| ‘ ‘ || s_LIMIT||’;’ ) ;
s_prev_profile := s_profile ;
end;
else
dbms_output.put_line ( ‘alter profile “‘||s_profile|| ‘” limit ‘ ||s_RESOURCE_NAME|| ‘ ‘ || s_LIMIT || ‘;’ ) ;
end if;
exit when c_profiles%NOTFOUND ;
end loop ;

close c_profiles ;

end;
/
[/cc]

Continue reading

Windows: local printer option is greyed out

Some time ago I need to add the local printer to the system, however, this option was greyed out in the “Add printer” wizard.
The problem was caused by local policy, preventing the adding of the new devices to the system.

The following should be done to enable “Add local printer” option

  1. Start the policy editor (Control Panel -> Administrative tools -> Local security policy)
  2. Select “Local policy” item
  3. Find the item “Devices: Prevent Users from Installing Printer Drivers” in the section Security Settings -> Security Options and change it to Enabled
  4. Go to “Security Settings -> User Rights Assignment” section and check, that “Load & Unalod Drivers” option contains the active user group. It important, that even if it has “All Staff” already, it still could miss “Administrators” group, so it’s necessary to add it manually.