Hlavní stránka | English main


Computers / Počítače

Last change: May 15, 2005 AD

[CZ] české popisky jsou je bílé
[EN] English texts are green

Index

On this page


Assembly & C++Builder 5

How to program in assembly using Borland C++ Builder.
I only know how to do it if the assembly code implements a function that is called by the C or C++ main function.

1. Create a new project

File->New, on the "New" tab select "Console Wizard", when a dialog appears, press OK

Above main() method, insert (in the .cpp unit):

extern "C" float MySubroutine(float Arg1,float Arg2);

Write in the main() something like this (to call the assembly part):

float result = MySubroutine(10,15);

2. Add the assembly source

Assume you have an assembly source myfile.asm, that is as follows:

586p
model flat
locals
.DATA
.CODE
PUBLIC C MySubroutine
MySubroutine PROC C Arg1:DWORD, Arg2:DWORD

... YOUR CODE HERE ...

fld Arg1
fmul Arg2
ret
ENDP
END

Project->Add to project , find myfile.asm (change the mask from .c/.cpp to .asm), add it.

3. Voilá, you can compile it!

Perl in a Script ( here-document )

Print title of a page (notice that we need two escape slashes):

#!/bin/sh
FILE="myfile.html"
TITLE=`
perl - <<EOF
use HTML::TokeParser;
\\$p = HTML::TokeParser->new("$FILE") || die "Can't open: \\$!";
if (\\$p->get_tag("title")) {
my \\$title = \\$p->get_trimmed_text;
print "\\$title";

EOF
`
echo "Title is: $TITLE"

Print a table of content:

#!/bin/sh
# NOTE: we need to escape '$' for Perl variables
echo 'Usage: generate_toc <filename>'; 
FILE="$1"

# Generate + redirect output into the file itself (rewrite it)
perl - > "$FILE" <<EOF
use HTML::Toc; use HTML::TocInsertor;

my \$toc = HTML::Toc->new();

#Set what elements to use and their level starting with 1
\$toc->setOptions({
 'tokenToToc' => [{
    'level' => 1,
    'tokenBegin' => '<h2>'
   }, {
    'level' => 2,
    'tokenBegin' => '<h3>'
   }]
});

my \$tocInsertor = HTML::TocInsertor->new();
\$tocInsertor->insertIntoFile(\$toc, "$FILE");
EOF

***

Perl notes

Lisp

C :

if (myvar == 2 && 1) { printf("true"); } else { printf("is"); printf("false"); }

Lisp :

(if (and (= myvar 2)
         t)                               ; 't' == true == '1' in C
    (print "true")                        ; then-caluse
    (progn  (print "is") (print "false")) ; else-clause
) ; ('progn' creates 1 form (block in C) from a set of forms)

JavaScript mini-notes


HTML::Toc note - how to use

Generate table of content from H2 and H3 elements.

#!/bin/usr/perl
$file = 'disman.html';
use HTML::Toc;
use HTML::TocInsertor;

my $toc = HTML::Toc->new();

#Set what elements to use and their level starting with 1
$toc->setOptions({
'tokenToToc' => [{
'level' => 1,
'tokenBegin' => '<h2>'
}, {
'level' => 2,
'tokenBegin' => '<h3>'
}]
});

my $tocInsertor = HTML::TocInsertor->new();
$tocInsertor->insertIntoFile($toc, $file);


PHP notes

PEAR: Manual install example

Let's install HTML parser XML_HTMLSax if we cannot use the pear install utility.

Assume our php script will be in C:\my\example\path.
Unpack the parser's files [and PEAR.php from the package PEAR] and save them as follows: 

<?php
ini_set("include_path", 'C:\my\example\path' . PATH_SEPARATOR .ini_get("include_path"));
//OR replace 'C:\my\example\path' by getcwd() (returns the script's directory)

require_once "XML/XML_HTMLSax.php";
?>

 Various PHP notes

No errors are shown on the page, only an empty html page
Solution - in php.ini add/rewrite:
display_errors = on


TeX

Czech in TeX

Declare either \usepackage[czech]{babel} if you use the package babel or \usepackage{czech} and process by [pdf]cslatex otherwise. It's better not to use babel and [pdf]cslatex together.

TeX Links

References for TeX and Friends


Links / Odkazy

Index of links


Web development

PHP:
ASP

Programming languages

en francais Sources & tutoriaux pour C/C++/Java/JavaScript/PHP/ASP/VB/Flash/Assembleur/...: vois  "Autres languages" a droit).

Software+Resources

See also Wokna (Another page] and UNIX/Linux Applications (Another page].

See Freshmeat (e.g. the category Scientific/Engineering)

Various tools, applications etc. Linux tools, application etc. (some available also under Windows) Find & Download Software COMMERCIAL ----------------------------------------------------------------------

Linux and UNIX

Windows

Various

 

On-line manualy, ucebnice aj. (On-line tutorials etc.)

Hardware

Theory


Jakub Holý 2002AD