Sunday 22 April 2012

Some notes on elegant code

Some thoughts concerning questions that were put (and answered) in Steve McConnells's "Code Complete":
Coding habits 

Thursday 19 April 2012

Useful E-Texteditor commands and options

--clearstate    : Don't reload files from last session.
--clearlayout   : Resets window layout and positions.
--clearundo     : Clear undo history for all un-milestoned files.
--noupdate      : Do not perform new version check at startup.
More commands 

Wednesday 11 April 2012

Oracle: Case insensitive regexp search through all sources

select *
from all_source
where regexp_like( text, regexp_search_string, 'i' )

Sunday 8 April 2012

ASCII-gramm for using wget to clone website

wget -k -N -p -np -r LINK
      |  |  |   |  | 
convert  |  |   |  recursive
  links  |  |   |
     to  |  |   don't go to
  local  |  |   the parent level
         |  |
    do not  get all
  retrieve  images, etc.
     files  to show the page
until they   
 are newer    
then local

How to boot MHDD from USB Device

To boot famous disk diagnostic tool MHDD from USB thumb drive you'll need: 
1. Not supprisingly thumb drive you are willing to use as bootable (and are ready to format it).
2. A copy of Virtual Floppy Drive application.

a. So. First obtain a copy of Virtual Floppy Drive 
(We are making our bootable USB because we don't have real floppy drive, don't we? If you have physical floppy drive and spare diskette than you can skip this section and go straight to the b )
Unpack it in some folder and then run vhdwin.exe from it, go to driver tab and Start virtual floppy drive service.


Next go to 'Drive 0' tab and hit 'Open/Create'. Set media type to 3.5" 1.44MB and again hit create.


Now you have a virtual floppy in your virtual floppy drive to put bootable image of MHDD there. Btw mine floppy drive got "A:" disk letter, remember the one you got you will need it.

b. So let's put on our floppy a bootable image of MHDD somehow. To do this obtain "Last version of MHDD, self-extracting floppy image.". I got it following the google link returned for the query of "MHDD". Run downloaded file (mine was named "mhdd32ver4.6floppy.exe"). The summoned application has no options and looks like this:


So just hit 'Create Floppy' confirming overwriting of content of the floppy residing currently in a drive. Wow. Now we have a bootable image of MHDD but it's on our floppy, not on USB. 
c. Now we are to move it to the USB Thumb drive. To make this happen we need another app from HP called 'HP USB Disk Storage Format Tool'. It can be downloaded from Softpedia. After downloading run it and it will  present itself with single dialog. Select your USB Thumb drive as a device, FAT as file system, check 'Quick Format' and 'Create a DOS startup disk...' selecting floppy drive as a destination.


That will make our thumb drive bootable. But we still do not have MHDD on it. So the next step is just to copy entire contents of floppy drive to our new bootable USB drive (overwriting or not overwriting files). That's all. Now we can boot from our USB drive. 

d. So it's time to reboot and to command your bios to boot from USB media. 

Sadly but you have to make a few more moves to actually  run MHDD.

After boot you will be faced with Windows 98 (!) logo and then the following selection:


I select "With " (cause with is better than without, isn't it =)
Than there's beep and report of some failures. Don't mention and just press 'f' until you are faced with >D:\MHDD and a message that mhdd was successfully unpacked to D:\MHDD. You know what I'd say: "It's a shameless lie". To ensure run DIR command =)
So MHDD is not actually unpacked and we are to do it manually. So execute the following commands:

c:
cd mhdd
c:\pkunzip -e mhdd

Now we have really unpacked MHDD to c:\MHDD.
So it's time to type MHDD and hit enter. Voila!


Wednesday 4 April 2012

Remarks bout bcb6 compiler

1. The destructors may not be called in stack unwinding if function inlining is enabled
2. BCB doesn't call _all_ destructors of local objects in case the temporary is initialized _within the parenthesis_ of hte if statement.