Windows 64bit Delphi 2007/2009 Debugger Fix / Workaround with "Assertion failure" error

«SetThreadContext failed» Delphi 2007/2009 Windows x64
This error is typical not only for 7, but also for subsequent Windows 64-bit. Delphi 2007 and 2009 are susceptible to the "Assertion failure" error.
If one run Delphi 2007 or Delphi 2009 on Windows 64bit and met the Assertion failure when hit F2 or exit out of the program, this strange error dialog occurs: bds.exe - bordbk105N.dll Assertion failure: "(!"SetThreadContext failed")" in ..\win32src\thread32.cpp at line ... Continue execution? If Press No or ESC key will close the whole IDE. Pressing Yes may prompt for the same dialog.

There was an unofficial hotfix at CodeCentral - ID: 27521, RAD Studio 2007 Debugger Fix for Windows 7 that now is unavailable.

Further is a temporary solution for this problem.
Using any hex editor, for example, mh-nexus, an open source version.
1. Close Delphi
2. Make a backup of the library bordbk105N.dll (version should be 105.11.1.12533) for Delphi 2007, bordbk120N.dll (version should be 120.903.17.15115) for Delphi 2009
For Delphi 2007
the location is "%ProgramFiles(x86)%\CodeGear\RAD Studio\5.0\bin\bordbk105N.dll",
for Delphi 2009
the location is "%ProgramFiles(x86)%\CodeGear\RAD Studio\6.0\bin\bordbk120N.dll"
3. Open the library file in hex editor
4. Look for hex string in the file
01 00 48 74 47 80 3d
There is only one(!) HEX 01 00 48 74 47 80 3D
5. Change it to
01 00 48 EB 47 80 3d
74 is replaced with EB
6. Save
7. Restart Delphi and the error message should be gone. That’s all. Now the debugger runs on Windows 64bit.

Or try to find the in the internet the ready-to-use patcher Delphi_2007_2009_WOW64_Debugger_Fix.zip (Delphi_2007_2009_WOW64_Debugger_Fix.exe) who will do the same for you.

CodeGear Delphi 2007
My first note was «SetThreadContext failed» Delphi 2007/2009 Windows x64.
Here I made more detailed explanation.
An put a concise version of the article on Stackoverflow

Rainbow by Turtle

An example for programming lessons at school

Rainbow by Turtle
import turtle t = turtle.Turtle() # Setting the title turtle.title("Rainbow by Turtle") t.hideturtle() # Setting the rainbow width rainbow_width = 20 t.width(rainbow_width+1) t.left(90) # Setting the rainbow radius r=50 angle=180 # Colors for the rainbow colors=["violet", "indigo", "blue", "green", "yellow", "orange", "red"] for i in colors: t.color(i) r=r+rainbow_width t.circle(r, angle) t.up() t.right(90) t.forward(rainbow_width) t.down() t.left(90) angle=angle*(-1) turtle.exitonclick() t.done()

Amongus by Turtle on Python

An example for programming lessons at school

Amongus by Turtle on Python
import turtle # Primary colors for the character BODY_COLOR = 'red' GLASS_COLOR = 'skyblue' # Setting the title turtle.title("Amongus by Turtle") # Main object Turtle t = turtle.Turtle() t.hideturtle() # Method for drawing the body def body(): # Brush size t.pensize(20) # Setting the color t.fillcolor(BODY_COLOR) t.begin_fill() # Right side t.right(90) t.forward(50) t.right(180) t.circle(40, -180) t.right(180) t.forward(200) # Head t.right(180) t.circle(100, -180) # Left side t.backward(20) t.left(15) t.circle(500, -20) t.backward(20) t.circle(40, -180) t.left(7) t.backward(50) t.up() t.left(90) t.forward(10) t.right(90) t.down() t.right(240) t.circle(50, -70) t.end_fill() # Method for drawing glasses def glass(): # Moving the turtle t.up() t.right(230) t.forward(100) t.left(90) t.forward(20) t.right(90) t.down() # Setting the color t.fillcolor(GLASS_COLOR) t.begin_fill() t.right(150) t.circle(90, -55) t.right(180) t.forward(1) t.right(180) t.circle(10, -65) t.right(180) t.forward(110) t.right(180) t.circle(50, -190) t.right(170) t.forward(80) t.right(180) t.circle(45, -30) t.end_fill() # Method for drawing a backpack def backpack(): # Moving the turtle t.up() t.right(60) t.forward(100) t.right(90) t.forward(75) # Setting the color t.fillcolor(BODY_COLOR) t.begin_fill() t.down() t.forward(30) t.right(255) t.circle(300, -30) t.right(260) t.forward(30) t.end_fill() # Call all necessary methods body() glass() backpack() turtle.exitonclick() turtle.done()

Oracle SQL. The first difficulties that users overcome

How to find out the Oracle version

The Oracle version can be found by requesting select version from v$instance; in SQL Plus

ORACLE_HOME

ORACLE_HOME environment variable is set to the path one level above the bin directory where SQL Plus executable file is located.

"No TNS entries found" Error message

In order to remove this message set TNS_ADMIN environment variable to the path where the file tnsnames.ora is located.
TNS stands for Transparent Network Substrate is a proprietary Oracle computer-networking technology, supports homogeneous peer-to-peer connectivity on top of other networking technologies such as TCP/IP, SDP and named pipes © Wikipedia.

"No valid Oracle clients found"

This error occurs when one try to connect an Oracle database, through a Client like Toad for Oracle. To solve add the folder where Oracle client is located to the Path variable.

Starting with Oracle 10g, along with the exp, imp utilities, appeared two new Data Pump utilities: expdp and impdp respectively.
They are also located in the bin directory of the Oracle home folder.
The old export and import utilities are client-side oriented, while the new ones are server-side oriented. Although the old and new utilities are similar in usage, the results are completely different. This means that a dump exported with exp cannot be imported with impdp.

Default directory for the dmp file

If the directory is not specified, Oracle tries to seek the dmp file in the default directory, which is something like that
«drive letter»:\app\«user name»\admin\oratest\dpdump or
«drive letter»:\app\«user name»\product\21c\admin\xe\dpdump in newer versions of Oracle

How to view already available directories for Data Pump

This request select directory_name, directory_path from dba_directories; in SQL Plus shows available directories.

TBytesStream class for Delphi 2007

CodeGear Delphi 2007
TBytesStream class was added in Delphi 2009, so I define it manually for CodeGear Delphi 2007. type TBytesStream = class(TMemoryStream) private FBytes: TBytes; FCapacity: Longint; FSize: Longint; protected function Realloc(var NewCapacity: Longint): Pointer; override; public constructor Create(const ABytes: TBytes); overload; property Bytes: TBytes read FBytes; end; Full unit published on Github