Archive for the ‘Programming Languages’ Category

This is one of the my professional applications which sending email by local SMTP server and gmail and yahoo mail service.

There a email address pool which will be selected randomly to send email. The ads text and image is ready in a web based application.

Email Marketing Program

The database engine is mySQL and a web based application feeds recipients email address, smtp sender emails and  ads.

Email Marketing Program Smtp Sender

There is no doubt that Java is my favorite programming language. On the client side, I coded a lot of Java Applet program. Nowadays, nobody use Java applets maybe they are slow and are not easy to code.

Java applet was first graphics and powerful client side program which you can embed inside your HTML page. Of course running java byte codes takes a little time but they had some advantages though.

I created some java applet which are developed by Visual Café or Visual Café for Java.

It was an integrated development environment for the Java programming language. It included a GUI builder and was marketed as a series of editions: ”Standard Edition,” “Enterprise Suite,” “Expert Edition,” “Professional Edition,” and “Development Edition.” Visual Café was spun off by Symantec as the flagship of a new company, WebGain.

 

Anyway, here are some my java applets:

 

I am sure that you have seen some animal pictures on programming book like oriely publisher.

Here are a list of symbols:

Perl Language

JavaScript

Phyton Language

UML

Java

The perl script language stands for Practical Extraction and Report Language, this is my first server side script language I used to create dynamic HTML page (I think it was 1997).

As you know Perl like PHP is an essential script language which is included in all web servers especially in linux or unix based web servers.

Perl has become popular for programming and developers  for web forms and generally creating dynamic web pages and gateway between systems, databases, and users.

Perl is typically implemented as an interpreted (not compiled) language.

Programs written in Perl are often called Perl scripts, especially in the context of CGI programming, whereas the term the Perl program refers to the system program named perl for executing Perl scripts.

Learning Perl is not difficult for who knows C and Pascal language. In fact, Perl syntax is a combination of  C and Pascal language.

Perl is an excelent language for text/string processing.  I created an Database engine with this amazing language. It works great with array and files.

 

Some of my perl programs (1997-1998):

1) Page counter:

#!/usr/bin/perl

#=======> Counter Program 
#=======>  By
#=======>     Homayoon Najafi

$number_of_digits = "";
$end = ".gif";

$pathtocounter = "counter.txt";
$pathtoimages = "http://www.XXCoveredXX.com/counter/";

open (COUNTER, $pathtocounter) || die "Cannot Open(Homayoon 1):$!";

flock(COUNTER,2);
$count = <COUNTER>;
flock(COUNTER,8);
# chop ($count) if $count =~ /\n$/; ==> HN
close (COUNTER);

$count++ ;
if($count==1){$count=29918;}

open (COUNTER, ">$pathtocounter") || die "Cannot Open(Can't open file....by Homayoon ):$!";
flock(COUNTER,2);
print COUNTER "$count";
flock(COUNTER,8);
close (COUNTER);

@digits = split(//, $count);

@digitimages = split(//, $count);

print ("Content-type: text/html\n\n");

foreach $digitimage (@digitimages)
 {
 $image = "<img src=$pathtoimages" . "$digitimage" . "$end "."ALT=$digitimage>\n";
 print ("$image");
 }
exit;

2) Form input: Getting user email address

#!/usr/local/bin/perl

#====> Getting E-mail Program by Homayoon Najafi (8 April 1998)

$buffer=$ENV{'QUERY_STRING'};

@pairs=split(/&/,$buffer);
foreach $pair (@pairs) 
 {
($name,$value)=split(/=/,$pair);
$value=~tr/+/ /;
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
$FORM{$name} = $value;
}

print "Content-type: text/html\n\n";
print "<html><head><title>Thanks for Adding Your Email</title></head><body>\n";
print "<center><p>Thanks for Adding Your Email: $FORM{'email'} </p></center>\n";
print "<HR>\n";
print "<center><p><a href=http://www.XXCoveredXX.com>Back to Iran Export Home Page</a></p></center>\n";
print "</body></html>\n";

open (My,"| /usr/lib/sendmail payam\@www.XXCoveredXX.com") || die "Can't open (sendmail)!!\n" ;
print My "Subject: A New E-mail Address from Home Page\n\n";
print My "=========================================\n";
print My "Remote Host(IP Address): $ENV{'REMOTE_HOST'}\n";
print My "E-mail Address: $FORM{'email'}\n\n";
close My;

3) HS code listing

#!/usr/bin/perl

 #====> Record Manager Program <========#

#====>          HS-Code Program for Home Page
#====>   Program file : hs-show.pl
#====> Created by Homayoon Najafi (Start 20 Aug 1998 )

#=====> Form Variable:
#=====> Code: %28rt23%2434%29 ===> (rt23$34) 

#===> Set Variables 

$CompaniesFileName='a_com.txt';   #====> Main Group of Companies
$Other_ComFileName='b_com.txt';   #====> Other Group of Companies
$HSGroupFileName='hs-group.txt';  #====> HS-Group Table

$BaseAdd='http://www.XXCoveredXX.com/exporter/company/';
$TotalRecords;
$TotalOtherRecords;
$TotalFound;

$HSID;

@Companies;
@Other_Com;
@HSGroup;
@HSFields;

@ListGroupA; #===> Array of Result for Compnay's A Group
@ListGroupB; #===> Array of Result for Compnay's B Group 

$HSID=$ENV{'QUERY_STRING'};     #====> For get method...

#===> Reading Data Files

#=====> Reading Data from Company file

 open (DATA,$CompaniesFileName);
 @Companies=<DATA>; 
 $TotalRecords=@Companies; #=====> TotalRecords....
 close DATA;

 open (DATA,$Other_ComFileName);
 @Other_Com=<DATA>;
 $TotalOtherRecords=@Other_Com;
 close DATA;

#=====> Reading Data from HS-Group file

open (DATA,$HSGroupFileName);
@HSGroup=<DATA>;
close DATA;

#====================> End of Reading Files

#===> Getting List of A Companies from Hs-group File..
@HSFields=split(/#/,$HSGroup[$HSID-1]); 
if($HSFields[3] != '')
{
@ListGroupA=split(/,/,$HSFields[3]);
}

#===> Getting List of B Companies from Other_ComFileName File..

$i=0;
foreach $Record (@Other_Com) 
 {
 if($i>99) {last;}
 @Fields=split(/#/,$Record);
 @ListHS=split(/,/,$Fields[1]);
 foreach $key (@ListHS) 
 {
 if ($key eq $HSID)
 {
 $ListGroupB[$i]=$Fields[0];$i++;
 }
 }
 }

$TotalRecords=@ListGroupA;
$TotalOtherRecords=@ListGroupB;
$TotalFound=$TotalRecords+$TotalOtherRecords;
exit;
#==============> Showing Results of Search <============#

#~~~~~~~~~~~~~~~~~~~~~~> HTML Routines ~~~~~~~~~~~~~~~~~~~~~~~~#

#=============> Show Body of HTML File (Results of Search...)

 #=========> End of Query Program <============#

Lets start with sample code to learn how to start coding:

<?php

echo “Hello world!”;

?>

 

An web based application is like computer program but web server runs it and browser is an interface between user and program.

 

JavaScript is one of my favorite script (over 10 years).  Javascript is client-side language in web applications world.

Actually is not a version of Java, but the syntax is very similar to Java language. In fact, Java and JavaScript are two completely different languages in both concept and design!

JavaScript was invented by Brendan Eich at Netscape (Navigator 2.0), and has appeared in all browsers since 1996.

Note: Client Browsers run JavaScript code.

 

JavaScript, also known as ECMAScript, is a prototype-based, object-oriented scripting language that is dynamic, weakly typed and has first-class functions. (see http://en.wikipedia.org/wiki/JavaScript)

Good resource for learning JavaScript: w3schools

ASP or Active Server Pages is a server side script MS technology, We call it ASP classic. here are some briefly information:

 

  • ASP is a script or program that runs inside ms web server or IIS ( Internet Information Services )
  • ASP programs have .asp extension
  • In ASP, an interpreter like JavaScript  is used to execute the server-side code
  • ASP is different from ASP.NET
  • ASP is running under the inetinfo.exe (IIS) process space

GW-BASIC is the first computer language that I coded some programs and ran on PC (X86 CPU family). I have coded with Basic language when I was 16 but I ran it on commodore 64 not X86 family.

GW basic is an advanced version of basic language which has an IDE or simple editor.

To get more info click here

Well, I think everybody knows and heard about the C language,  The C is one of the most popular computer programming languages of all time.  It was developed by Dennis Ritchie (1969-1973) at Bell Telephone Laboratories in order to use in Unix operating system.

C Book:

http://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628

 

Read or Download :  C Book Dennis M. Ritchie

 

I coded a lot of programs in C, I love it.  I remember that the first compiler that I used was Turbo C/C++ and then I used Borland C++. both of them are MS dos-based applications.

 

Turbo C (v 1.01) has 2 floppy disket, If you would like to download it click here

 

 

Also, for version  4.5 click here

Borland C/C++: