SlideShare a Scribd company logo
1 of 10
Download to read offline
CHAPTER
FORTYTWO
POSTGRESQL FUNCTIONS
In this chapter we will learn about using the PostgreSQL database in the Ring programming language.
42.1 Loading the library
Before using the next function load the postgresqllib.ring library
load "postgresqllib.ring"
# Use PostgreSQL functions
42.2 Examples
Example (1):
load "postgresqllib.ring"
conninfo = "user=postgres password=sa dbname = postgres"
exit_nicely = func conn {
PQfinish(conn)
shutdown(1)
}
conn = PQconnectdb(conninfo)
if (PQstatus(conn) != CONNECTION_OK)
fputs(stderr, "Connection to database failed: "+PQerrorMessage(conn))
call exit_nicely(conn)
ok
res = PQexec(conn, "select * from pg_database")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Select failed: " + PQerrorMessage(conn))
PQclear(res)
exit_nicely(conn)
ok
nFields = PQnfields(res)
for i = 1 to nFields
? PQfname(res, i-1)
next
329
Ring Documentation, Release 1.9
? copy("*",60)
for i = 1 to PQntuples(res)
for j=1 to nFields
see PQgetvalue(res, i-1, j-1) + " "
next
see nl
next
PQclear(res)
PQfinish(conn)
Output:
datname
datdba
encoding
datcollate
datctype
datistemplate
datallowconn
datconnlimit
datlastsysoid
datfrozenxid
datminmxid
dattablespace
datacl
************************************************************
postgres 10 6 English_United States.1252
English_United States.1252 f t -1 12937 549 1 1663
template1 10 6 English_United States.1252 English_United States.1252
t t -1 12937 549 1 1663 {=c/postgres,postgres=CTc/postgres}
template0 10 6 English_United States.1252 English_United States.1252
t f -1 12937 549 1 1663 {=c/postgres,postgres=CTc/postgres}
mahdb 10 6 English_United States.1252 English_United States.1252
f t -1 12937 549 1 1663
Example(2):
load "postgresqllib.ring"
conninfo = "user=postgres password=sa dbname = mahdb"
exit_nicely = func conn {
PQfinish(conn)
shutdown(1)
}
conn = PQconnectdb(conninfo)
if (PQstatus(conn) != CONNECTION_OK)
fputs(stderr, "Connection to database failed: "+PQerrorMessage(conn))
call exit_nicely(conn)
ok
res = PQexec(conn, "
DROP DATABASE mahdb;
42.2. Examples 330
Ring Documentation, Release 1.9
")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Remove failed: " + PQerrorMessage(conn))
PQclear(res)
ok
PQclear(res)
res = PQexec(conn, "CREATE DATABASE mahdb;")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Create database failed: " + PQerrorMessage(conn))
PQclear(res)
ok
res = PQexec(conn, "
CREATE TABLE COMPANY (
ID INT PRIMARY KEY NOT NULL,
NAME TEXT NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR(50),
SALARY REAL );
")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Create Table failed: " + PQerrorMessage(conn))
PQclear(res)
ok
PQclear(res)
res = PQexec(conn, "
INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY)
VALUES (1, 'Mahmoud' , 31, 'Jeddah', 10.00 ),
(2, 'Ahmed' , 27, 'Jeddah', 20.00 ),
(3, 'Mohammed', 33, 'Egypt' , 30.00 ),
(4, 'Ibrahim' , 24, 'Egypt ', 40.00 );
")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Insert Table failed: " + PQerrorMessage(conn))
PQclear(res)
ok
PQclear(res)
res = PQexec(conn, "
select * from COMPANY
")
if PQresultStatus(res) != PGRES_TUPLES_OK
fputs(stderr, "Select failed: " + PQerrorMessage(conn))
PQclear(res)
call exit_nicely(conn)
ok
nFields = PQnfields(res)
for i = 1 to nFields
? PQfname(res, i-1)
next
? copy("*",60)
42.2. Examples 331
Ring Documentation, Release 1.9
for i = 1 to PQntuples(res)
for j=1 to nFields
see PQgetvalue(res, i-1, j-1) + " "
next
see nl
next
PQclear(res)
PQfinish(conn)
Output:
id
name
age
address
salary
************************************************************
1 Mahmoud 31 Jeddah 10
2 Ahmed 27 Jeddah 20
3 Mohammed 31 Egypt 30
4 Ibrahim 24 Egypt 40
42.3 RingPostgreSQL Constants
The next constants are define by the RingPostgreSQL Library
CONNECTION_STARTED
CONNECTION_MADE
CONNECTION_AWAITING_RESPONSE
CONNECTION_AUTH_OK
CONNECTION_SSL_STARTUP
CONNECTION_SETENV
CONNECTION_OK
PQPING_OK
PQPING_REJECT
PQPING_NO_RESPONSE
PQPING_NO_ATTEMPT
PGRES_EMPTY_QUERY
PGRES_COMMAND_OK
PGRES_TUPLES_OK
PGRES_COPY_OUT
PGRES_COPY_IN
PGRES_BAD_RESPONSE
PGRES_NONFATAL_ERROR
PGRES_FATAL_ERROR
PGRES_COPY_BOTH
PGRES_SINGLE_TUPLE
PG_DIAG_SEVERITY
PG_DIAG_SQLSTATE
PG_DIAG_MESSAGE_PRIMARY
PG_DIAG_MESSAGE_DETAIL
42.3. RingPostgreSQL Constants 332
Ring Documentation, Release 1.9
PG_DIAG_MESSAGE_HINT
PG_DIAG_STATEMENT_POSITION
PG_DIAG_INTERNAL_POSITION
PG_DIAG_INTERNAL_QUERY
PG_DIAG_CONTEXT
PG_DIAG_SCHEMA_NAME
PG_DIAG_TABLE_NAME
PG_DIAG_COLUMN_NAME
PG_DIAG_DATATYPE_NAME
PG_DIAG_CONSTRAINT_NAME
PG_DIAG_SOURCE_FILE
PG_DIAG_SOURCE_LINE
PG_DIAG_SOURCE_FUNCTION
42.4 RingPostgreSQL Functions
The next functions are define by the RingPostgreSQL Library
Reference : https://www.postgresql.org/docs/9.1/static/libpq.html
PGconn *PQconnectdbParams(const char **keywords,
const char **values,int expand_dbname);
PGconn *PQconnectdb(const char *conninfo)
PGconn *PQsetdbLogin(const char *pghost,const char *pgport,
const char *pgoptions,const char *pgtty,
const char *dbName,const char *login,const char *pwd)
PGconn *PQsetdb(char *pghost,char *pgport,char *pgoptions,
char *pgtty,char *dbName)
PGconn *PQconnectStartParams(const char **keywords,
const char **values,int expand_dbname)
PGconn *PQconnectStart(const char *conninfo)
PostgresPollingStatusType PQconnectPoll(PGconn *conn)
PQconninfoOption *PQconndefaults(void)
PQconninfoOption *PQconninfo(PGconn *conn)
PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg)
void PQfinish(PGconn *conn)
void PQreset(PGconn *conn)
int PQresetStart(PGconn *conn)
PostgresPollingStatusType PQresetPoll(PGconn *conn)
PGPing PQpingParams(const char **keywords,const char **values,
int expand_dbname)
PGPing PQping(const char *conninfo)
char *PQdb(const PGconn *conn)
char *PQuser(const PGconn *conn)
char *PQpass(const PGconn *conn)
char *PQhost(const PGconn *conn)
char *PQport(const PGconn *conn)
char *PQtty(const PGconn *conn)
char *PQoptions(const PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
PGTransactionStatusType PQtransactionStatus(const PGconn *conn)
const char *PQparameterStatus(const PGconn *conn, const char *paramName)
int PQprotocolVersion(const PGconn *conn)
int PQserverVersion(const PGconn *conn)
char *PQerrorMessage(const PGconn *conn)
int PQsocket(const PGconn *conn)
42.4. RingPostgreSQL Functions 333
Ring Documentation, Release 1.9
int PQbackendPID(const PGconn *conn)
int PQconnectionNeedsPassword(const PGconn *conn)
int PQconnectionUsedPassword(const PGconn *conn)
int PQsslInUse(const PGconn *conn)
const char *PQsslAttribute(const PGconn *conn, const char *attribute_name)
const char **PQsslAttributeNames(const PGconn *conn)
void *PQsslStruct(const PGconn *conn, const char *struct_name)
void *PQgetssl(const PGconn *conn)
PGresult *PQexec(PGconn *conn, const char *command);
PGresult *PQexecParams(PGconn *conn,const char *command,int nParams,
const Oid *paramTypes,const char **paramValues,
const int *paramLengths,const int *paramFormats,int resultFormat)
PGresult *PQprepare(PGconn *conn,const char *stmtName,
const char *query,int nParams,const Oid *paramTypes)
PGresult *PQexecPrepared(PGconn *conn,const char *stmtName,
int nParams,const char **paramValues,
const int *paramLengths,const int *paramFormats,int resultFormat)
PGresult *PQdescribePrepared(PGconn *conn, const char *stmtName)
PGresult *PQdescribePortal(PGconn *conn, const char *portalName)
ExecStatusType PQresultStatus(const PGresult *res)
char *PQresStatus(ExecStatusType status)
char *PQresultErrorMessage(const PGresult *res)
char *PQresultErrorField(const PGresult *res, int fieldcode)
void PQclear(PGresult *res)
int PQntuples(const PGresult *res)
int PQnfields(const PGresult *res)
char *PQfname(const PGresult *res,int column_number)
int PQfnumber(const PGresult *res,const char *column_name)
Oid PQftable(const PGresult *res,int column_number)
int PQftablecol(const PGresult *res,int column_number)
int PQfformat(const PGresult *res,int column_number)
Oid PQftype(const PGresult *res,int column_number)
int PQfmod(const PGresult *res,int column_number)
int PQfsize(const PGresult *res,int column_number)
int PQbinaryTuples(const PGresult *res)
char *PQgetvalue(const PGresult *res,int row_number,int column_number)
int PQgetisnull(const PGresult *res,int row_number,int column_number)
int PQgetlength(const PGresult *res,int row_number,int column_number)
int PQnparams(const PGresult *res)
Oid PQparamtype(const PGresult *res, int param_number)
void PQprint(FILE *fout,const PGresult *res,const PQprintOpt *po)
char *PQcmdStatus(PGresult *res)
char *PQcmdTuples(PGresult *res)
Oid PQoidValue(const PGresult *res)
char *PQoidStatus(const PGresult *res)
char *PQescapeLiteral(PGconn *conn, const char *str, size_t length)
char *PQescapeIdentifier(PGconn *conn, const char *str, size_t length)
size_t PQescapeStringConn(PGconn *conn,char *to,
const char *from, size_t length,int *error)
size_t PQescapeString(char *to, const char *from, size_t length)
unsigned char *PQescapeByteaConn(PGconn *conn,
const unsigned char *from,size_t from_length,size_t *to_length)
unsigned char *PQescapeBytea(const unsigned char *from,
size_t from_length,size_t *to_length)
unsigned char *PQunescapeBytea(const unsigned char *from, size_t *to_length)
int PQsendQuery(PGconn *conn, const char *command)
int PQsendQueryParams(PGconn *conn,const char *command,
int nParams,const Oid *paramTypes,const char **paramValues,
42.4. RingPostgreSQL Functions 334
Ring Documentation, Release 1.9
const int *paramLengths,const int *paramFormats,int resultFormat)
int PQsendPrepare(PGconn *conn,const char *stmtName,
const char *query,int nParams,const Oid *paramTypes)
int PQsendQueryPrepared(PGconn *conn,const char *stmtName,
int nParams,const char **paramValues,
const int *paramLengths,const int *paramFormats,int resultFormat)
int PQsendDescribePrepared(PGconn *conn, const char *stmtName)
int PQsendDescribePortal(PGconn *conn, const char *portalName)
PGresult *PQgetResult(PGconn *conn)
int PQconsumeInput(PGconn *conn)
int PQisBusy(PGconn *conn)
int PQsetnonblocking(PGconn *conn, int arg)
int PQisnonblocking(const PGconn *conn)
int PQflush(PGconn *conn)
int PQsetSingleRowMode(PGconn *conn)
PGcancel *PQgetCancel(PGconn *conn)
void PQfreeCancel(PGcancel *cancel)
int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize)
int PQrequestCancel(PGconn *conn)
PGresult *PQfn(PGconn *conn,int fnid,int *result_buf,
int *result_len,int result_is_int,const PQArgBlock *args,int nargs)
PGnotify *PQnotifies(PGconn *conn)
int PQputCopyData(PGconn *conn,const char *buffer,int nbytes)
int PQputCopyEnd(PGconn *conn,const char *errormsg)
int PQgetCopyData(PGconn *conn,char **buffer,int async)
int PQgetline(PGconn *conn,char *buffer,int length)
int PQgetlineAsync(PGconn *conn,char *buffer,int bufsize)
int PQputline(PGconn *conn,const char *string)
int PQputnbytes(PGconn *conn,const char *buffer,int nbytes)
int PQendcopy(PGconn *conn)
int PQclientEncoding(const PGconn *conn)
char *pg_encoding_to_char(int encoding_id)
int PQsetClientEncoding(PGconn *conn, const char *encoding)
void PQtrace(PGconn *conn, FILE *stream)
void PQuntrace(PGconn *conn)
void PQfreemem(void *ptr)
void PQconninfoFree(PQconninfoOption *connOptions)
char *PQencryptPasswordConn(PGconn *conn, const char *passwd,
const char *user, const char *algorithm)
char *PQencryptPassword(const char *passwd, const char *user)
PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status)
int PQfireResultCreateEvents(PGconn *conn, PGresult *res)
PGresult *PQcopyResult(const PGresult *src, int flags)
int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs)
int PQsetvalue(PGresult *res, int tup_num, int field_num,
char *value, int len)
void *PQresultAlloc(PGresult *res, size_t nBytes)
int PQlibVersion(void)
PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn,
PQnoticeReceiver proc,void *arg)
PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn,
PQnoticeProcessor proc,void *arg)
void PQinitOpenSSL(int do_ssl, int do_crypto)
void PQinitSSL(int do_ssl)
int PQisthreadsafe(void)
42.4. RingPostgreSQL Functions 335
CHAPTER
FORTYTHREE
SECURITY AND INTERNET FUNCTIONS
This chapter contains the security and internet functions provided by the Ring programming language for Hashing,
Encryption & Decryption.
Before using the next function load the openssllib.ring library
load "openssllib.ring"
# Use OpenSSL functions
• MD5()
• SHA1()
• SHA256()
• SHA512()
• SHA384()
• SHA224()
• Encrypt()
• Decrypt()
• Randbytes()
Before using the next function load the internetlib.ring library
load "internetlib.ring"
# Use the Internet functions
• Download()
• SendEmail()
43.1 MD5() Function
We can calculate the MD5 hash using the MD5() Function
Syntax:
MD5(cString) ---> String contains the MD5 hash of the string cString
Example:
see "md5('happy') = " + md5("happy") + nl +
"md5('Hello') = " + md5("Hello") + nl
336
Ring Documentation, Release 1.9
Output:
md5('happy') = 56ab24c15b72a457069c5ea42fcfc640
md5('Hello') = 8b1a9953c4611296a827abf8c47804d7
43.2 SHA1() Function
We can calculate the SHA1 hash using the SHA1() Function
Syntax:
SHA1(cString) ---> String contains the SHA1 hash of the string cString
Example:
see "sha1('hello') : " + sha1("hello") + nl +
"sha1('apple') : " + sha1("apple") + nl
Output:
sha1('hello') : aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
sha1('apple') : d0be2dc421be4fcd0172e5afceea3970e2f3d940
43.3 SHA256() Function
We can calculate the SHA256 hash using the SHA256() Function
Syntax:
SHA256(cString) ---> String contains the SHA256 hash of the string cString
Example:
see "sha256('hello') : " + sha256("hello") + nl +
"sha256('apple') : " + sha256("apple") + nl
Output:
sha256('hello') : 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
sha256('apple') : 3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b
43.4 SHA512() Function
We can calculate the SHA512 hash using the SHA512() Function
Syntax:
SHA512(cString) ---> String contains the SHA512 hash of the string cString
Example:
see "sha512('hello') : " + sha512("hello") + nl +
"sha512('apple') : " + sha512("apple") + nl +
"sha512('hello world') : " + sha512("hello world") + nl
43.2. SHA1() Function 337
Ring Documentation, Release 1.9
Output:
sha512('hello') : 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673c
a72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043
sha512('apple') : 844d8779103b94c18f4aa4cc0c3b4474058580a991fba85d3ca698a0bc9e52
c5940feb7a65a3a290e17e6b23ee943ecc4f73e7490327245b4fe5d5efb590feb2
sha512('hello world') : 309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca8
6d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f
43.5 SHA384() Function
We can calculate the SHA384 hash using the SHA384() Function
Syntax:
SHA384(cString) ---> String contains the SHA384 hash of the string cString
Example:
see "sha384('hello') : " + sha384("hello") + nl +
"sha384('apple') : " + sha384("apple") + nl +
"sha384('hello world') : " + sha384("hello world") + nl
Output:
sha384('hello') : 59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa
90125a3c79f90397bdf5f6a13de828684f
sha384('apple') : 3d8786fcb588c93348756c6429717dc6c374a14f7029362281a3b21dc10250
ddf0d0578052749822eb08bc0dc1e68b0f
sha384('hello world') : fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcb
b83578b3e417cb71ce646efd0819dd8c088de1bd
43.6 SHA224() Function
We can calculate the SHA224 hash using the SHA224() Function
Syntax:
SHA224(cString) ---> String contains the SHA224 hash of the string cString
Example:
see "sha224('hello') : " + sha224("hello") + nl +
"sha224('apple') : " + sha224("apple") + nl +
"sha224('hello world') : " + sha224("hello world") + nl
Output:
sha224('hello') : ea09ae9cc6768c50fcee903ed054556e5bfc8347907f12598aa24193
sha224('apple') : b7bbfdf1a1012999b3c466fdeb906a629caa5e3e022428d1eb702281
sha224('hello world') : 2f05477fc24bb4faefd86517156dafdecec45b8ad3cf2522a563582b
43.7 Encrypt() Function
We can use the Encrypt() function to encrypts the data using the Blowfish algorithm.
43.5. SHA384() Function 338

More Related Content

What's hot

Ugly code
Ugly codeUgly code
Ugly codeOdd-e
 
Closures for Java
Closures for JavaClosures for Java
Closures for Javanextlib
 
The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 31 of 202
The Ring programming language version 1.8 book - Part 31 of 202The Ring programming language version 1.8 book - Part 31 of 202
The Ring programming language version 1.8 book - Part 31 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 25 of 181
The Ring programming language version 1.5.2 book - Part 25 of 181The Ring programming language version 1.5.2 book - Part 25 of 181
The Ring programming language version 1.5.2 book - Part 25 of 181Mahmoud Samir Fayed
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good codeGiordano Scalzo
 
Tackling Asynchrony with Kotlin Coroutines
Tackling Asynchrony with Kotlin CoroutinesTackling Asynchrony with Kotlin Coroutines
Tackling Asynchrony with Kotlin CoroutinesTech Triveni
 
Jdd 2016 DROP DATABASE
Jdd 2016 DROP DATABASEJdd 2016 DROP DATABASE
Jdd 2016 DROP DATABASEJarek Ratajski
 
PyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutinePyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutineDaehee Kim
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftGiordano Scalzo
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4Jan Berdajs
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88Mahmoud Samir Fayed
 
tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会RyoyaKatafuchi
 
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185Mahmoud Samir Fayed
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30Mahmoud Samir Fayed
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークTsuyoshi Yamamoto
 
The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196Mahmoud Samir Fayed
 

What's hot (20)

Ugly code
Ugly codeUgly code
Ugly code
 
Closures for Java
Closures for JavaClosures for Java
Closures for Java
 
The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88
 
The Ring programming language version 1.8 book - Part 31 of 202
The Ring programming language version 1.8 book - Part 31 of 202The Ring programming language version 1.8 book - Part 31 of 202
The Ring programming language version 1.8 book - Part 31 of 202
 
Lập trình Python cơ bản
Lập trình Python cơ bảnLập trình Python cơ bản
Lập trình Python cơ bản
 
The Ring programming language version 1.5.2 book - Part 25 of 181
The Ring programming language version 1.5.2 book - Part 25 of 181The Ring programming language version 1.5.2 book - Part 25 of 181
The Ring programming language version 1.5.2 book - Part 25 of 181
 
Better Software: introduction to good code
Better Software: introduction to good codeBetter Software: introduction to good code
Better Software: introduction to good code
 
Tackling Asynchrony with Kotlin Coroutines
Tackling Asynchrony with Kotlin CoroutinesTackling Asynchrony with Kotlin Coroutines
Tackling Asynchrony with Kotlin Coroutines
 
Jdd 2016 DROP DATABASE
Jdd 2016 DROP DATABASEJdd 2016 DROP DATABASE
Jdd 2016 DROP DATABASE
 
PyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into CoroutinePyconKR 2018 Deep dive into Coroutine
PyconKR 2018 Deep dive into Coroutine
 
DROPDB Galactic story
DROPDB Galactic storyDROPDB Galactic story
DROPDB Galactic story
 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in Swift
 
はじめてのGroovy
はじめてのGroovyはじめてのGroovy
はじめてのGroovy
 
D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4D-Talk: What's awesome about Ruby 2.x and Rails 4
D-Talk: What's awesome about Ruby 2.x and Rails 4
 
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.3 book - Part 50 of 88
 
tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会tensorflow/keras model coding tutorial 勉強会
tensorflow/keras model coding tutorial 勉強会
 
The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185The Ring programming language version 1.5.4 book - Part 26 of 185
The Ring programming language version 1.5.4 book - Part 26 of 185
 
The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30The Ring programming language version 1.4 book - Part 18 of 30
The Ring programming language version 1.4 book - Part 18 of 30
 
Groovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトークGroovy ネタ NGK 忘年会2009 ライトニングトーク
Groovy ネタ NGK 忘年会2009 ライトニングトーク
 
The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196The Ring programming language version 1.7 book - Part 7 of 196
The Ring programming language version 1.7 book - Part 7 of 196
 

Similar to The Ring programming language version 1.9 book - Part 37 of 210

Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my dayTor Ivry
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overviewAveic
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?Adam Dudczak
 
groovy databases
groovy databasesgroovy databases
groovy databasesPaul King
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.Mike Fogus
 
Tests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapTests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapRodolphe Quiédeville
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful weddingStéphane Wirtel
 
The Ring programming language version 1.5.3 book - Part 35 of 184
The Ring programming language version 1.5.3 book - Part 35 of 184The Ring programming language version 1.5.3 book - Part 35 of 184
The Ring programming language version 1.5.3 book - Part 35 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 86 of 189
The Ring programming language version 1.6 book - Part 86 of 189The Ring programming language version 1.6 book - Part 86 of 189
The Ring programming language version 1.6 book - Part 86 of 189Mahmoud Samir Fayed
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and CEleanor McHugh
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1Ke Wei Louis
 
The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180Mahmoud Samir Fayed
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For GoogleEleanor McHugh
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」Ken'ichi Matsui
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docxAdamq0DJonese
 

Similar to The Ring programming language version 1.9 book - Part 37 of 210 (20)

Go ahead, make my day
Go ahead, make my dayGo ahead, make my day
Go ahead, make my day
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overview
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
groovy databases
groovy databasesgroovy databases
groovy databases
 
Code as data as code.
Code as data as code.Code as data as code.
Code as data as code.
 
Tests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTapTests unitaires pour PostgreSQL avec pgTap
Tests unitaires pour PostgreSQL avec pgTap
 
Python postgre sql a wonderful wedding
Python postgre sql   a wonderful weddingPython postgre sql   a wonderful wedding
Python postgre sql a wonderful wedding
 
Swift Study #7
Swift Study #7Swift Study #7
Swift Study #7
 
Doubly Linked List
Doubly Linked ListDoubly Linked List
Doubly Linked List
 
The Ring programming language version 1.5.3 book - Part 35 of 184
The Ring programming language version 1.5.3 book - Part 35 of 184The Ring programming language version 1.5.3 book - Part 35 of 184
The Ring programming language version 1.5.3 book - Part 35 of 184
 
The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212The Ring programming language version 1.10 book - Part 81 of 212
The Ring programming language version 1.10 book - Part 81 of 212
 
Golang dot-testing
Golang dot-testingGolang dot-testing
Golang dot-testing
 
The Ring programming language version 1.6 book - Part 86 of 189
The Ring programming language version 1.6 book - Part 86 of 189The Ring programming language version 1.6 book - Part 86 of 189
The Ring programming language version 1.6 book - Part 86 of 189
 
Introduction to Go for Java Programmers
Introduction to Go for Java ProgrammersIntroduction to Go for Java Programmers
Introduction to Go for Java Programmers
 
Implementing Software Machines in Go and C
Implementing Software Machines in Go and CImplementing Software Machines in Go and C
Implementing Software Machines in Go and C
 
Super Advanced Python –act1
Super Advanced Python –act1Super Advanced Python –act1
Super Advanced Python –act1
 
The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180The Ring programming language version 1.5.1 book - Part 79 of 180
The Ring programming language version 1.5.1 book - Part 79 of 180
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For Google
 
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
数学カフェ 確率・統計・機械学習回 「速習 確率・統計」
 
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
-- Task 2- Debugging a program with stacks- queues- and doubly-linked.docx
 

More from Mahmoud Samir Fayed

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212Mahmoud Samir Fayed
 

More from Mahmoud Samir Fayed (20)

The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 212 of 212
 
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 211 of 212
 
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 210 of 212
 
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 208 of 212
 
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 207 of 212
 
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 205 of 212
 
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 206 of 212
 
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 204 of 212
 
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 203 of 212
 
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 202 of 212
 
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 201 of 212
 
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 200 of 212
 
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 199 of 212
 
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 198 of 212
 
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 197 of 212
 
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 196 of 212
 
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 195 of 212
 
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 194 of 212
 
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 193 of 212
 
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 192 of 212
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?Watsoo Telematics
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?What are the features of Vehicle Tracking System?
What are the features of Vehicle Tracking System?
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

The Ring programming language version 1.9 book - Part 37 of 210

  • 1. CHAPTER FORTYTWO POSTGRESQL FUNCTIONS In this chapter we will learn about using the PostgreSQL database in the Ring programming language. 42.1 Loading the library Before using the next function load the postgresqllib.ring library load "postgresqllib.ring" # Use PostgreSQL functions 42.2 Examples Example (1): load "postgresqllib.ring" conninfo = "user=postgres password=sa dbname = postgres" exit_nicely = func conn { PQfinish(conn) shutdown(1) } conn = PQconnectdb(conninfo) if (PQstatus(conn) != CONNECTION_OK) fputs(stderr, "Connection to database failed: "+PQerrorMessage(conn)) call exit_nicely(conn) ok res = PQexec(conn, "select * from pg_database") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Select failed: " + PQerrorMessage(conn)) PQclear(res) exit_nicely(conn) ok nFields = PQnfields(res) for i = 1 to nFields ? PQfname(res, i-1) next 329
  • 2. Ring Documentation, Release 1.9 ? copy("*",60) for i = 1 to PQntuples(res) for j=1 to nFields see PQgetvalue(res, i-1, j-1) + " " next see nl next PQclear(res) PQfinish(conn) Output: datname datdba encoding datcollate datctype datistemplate datallowconn datconnlimit datlastsysoid datfrozenxid datminmxid dattablespace datacl ************************************************************ postgres 10 6 English_United States.1252 English_United States.1252 f t -1 12937 549 1 1663 template1 10 6 English_United States.1252 English_United States.1252 t t -1 12937 549 1 1663 {=c/postgres,postgres=CTc/postgres} template0 10 6 English_United States.1252 English_United States.1252 t f -1 12937 549 1 1663 {=c/postgres,postgres=CTc/postgres} mahdb 10 6 English_United States.1252 English_United States.1252 f t -1 12937 549 1 1663 Example(2): load "postgresqllib.ring" conninfo = "user=postgres password=sa dbname = mahdb" exit_nicely = func conn { PQfinish(conn) shutdown(1) } conn = PQconnectdb(conninfo) if (PQstatus(conn) != CONNECTION_OK) fputs(stderr, "Connection to database failed: "+PQerrorMessage(conn)) call exit_nicely(conn) ok res = PQexec(conn, " DROP DATABASE mahdb; 42.2. Examples 330
  • 3. Ring Documentation, Release 1.9 ") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Remove failed: " + PQerrorMessage(conn)) PQclear(res) ok PQclear(res) res = PQexec(conn, "CREATE DATABASE mahdb;") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Create database failed: " + PQerrorMessage(conn)) PQclear(res) ok res = PQexec(conn, " CREATE TABLE COMPANY ( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE INT NOT NULL, ADDRESS CHAR(50), SALARY REAL ); ") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Create Table failed: " + PQerrorMessage(conn)) PQclear(res) ok PQclear(res) res = PQexec(conn, " INSERT INTO COMPANY (ID,NAME,AGE,ADDRESS,SALARY) VALUES (1, 'Mahmoud' , 31, 'Jeddah', 10.00 ), (2, 'Ahmed' , 27, 'Jeddah', 20.00 ), (3, 'Mohammed', 33, 'Egypt' , 30.00 ), (4, 'Ibrahim' , 24, 'Egypt ', 40.00 ); ") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Insert Table failed: " + PQerrorMessage(conn)) PQclear(res) ok PQclear(res) res = PQexec(conn, " select * from COMPANY ") if PQresultStatus(res) != PGRES_TUPLES_OK fputs(stderr, "Select failed: " + PQerrorMessage(conn)) PQclear(res) call exit_nicely(conn) ok nFields = PQnfields(res) for i = 1 to nFields ? PQfname(res, i-1) next ? copy("*",60) 42.2. Examples 331
  • 4. Ring Documentation, Release 1.9 for i = 1 to PQntuples(res) for j=1 to nFields see PQgetvalue(res, i-1, j-1) + " " next see nl next PQclear(res) PQfinish(conn) Output: id name age address salary ************************************************************ 1 Mahmoud 31 Jeddah 10 2 Ahmed 27 Jeddah 20 3 Mohammed 31 Egypt 30 4 Ibrahim 24 Egypt 40 42.3 RingPostgreSQL Constants The next constants are define by the RingPostgreSQL Library CONNECTION_STARTED CONNECTION_MADE CONNECTION_AWAITING_RESPONSE CONNECTION_AUTH_OK CONNECTION_SSL_STARTUP CONNECTION_SETENV CONNECTION_OK PQPING_OK PQPING_REJECT PQPING_NO_RESPONSE PQPING_NO_ATTEMPT PGRES_EMPTY_QUERY PGRES_COMMAND_OK PGRES_TUPLES_OK PGRES_COPY_OUT PGRES_COPY_IN PGRES_BAD_RESPONSE PGRES_NONFATAL_ERROR PGRES_FATAL_ERROR PGRES_COPY_BOTH PGRES_SINGLE_TUPLE PG_DIAG_SEVERITY PG_DIAG_SQLSTATE PG_DIAG_MESSAGE_PRIMARY PG_DIAG_MESSAGE_DETAIL 42.3. RingPostgreSQL Constants 332
  • 5. Ring Documentation, Release 1.9 PG_DIAG_MESSAGE_HINT PG_DIAG_STATEMENT_POSITION PG_DIAG_INTERNAL_POSITION PG_DIAG_INTERNAL_QUERY PG_DIAG_CONTEXT PG_DIAG_SCHEMA_NAME PG_DIAG_TABLE_NAME PG_DIAG_COLUMN_NAME PG_DIAG_DATATYPE_NAME PG_DIAG_CONSTRAINT_NAME PG_DIAG_SOURCE_FILE PG_DIAG_SOURCE_LINE PG_DIAG_SOURCE_FUNCTION 42.4 RingPostgreSQL Functions The next functions are define by the RingPostgreSQL Library Reference : https://www.postgresql.org/docs/9.1/static/libpq.html PGconn *PQconnectdbParams(const char **keywords, const char **values,int expand_dbname); PGconn *PQconnectdb(const char *conninfo) PGconn *PQsetdbLogin(const char *pghost,const char *pgport, const char *pgoptions,const char *pgtty, const char *dbName,const char *login,const char *pwd) PGconn *PQsetdb(char *pghost,char *pgport,char *pgoptions, char *pgtty,char *dbName) PGconn *PQconnectStartParams(const char **keywords, const char **values,int expand_dbname) PGconn *PQconnectStart(const char *conninfo) PostgresPollingStatusType PQconnectPoll(PGconn *conn) PQconninfoOption *PQconndefaults(void) PQconninfoOption *PQconninfo(PGconn *conn) PQconninfoOption *PQconninfoParse(const char *conninfo, char **errmsg) void PQfinish(PGconn *conn) void PQreset(PGconn *conn) int PQresetStart(PGconn *conn) PostgresPollingStatusType PQresetPoll(PGconn *conn) PGPing PQpingParams(const char **keywords,const char **values, int expand_dbname) PGPing PQping(const char *conninfo) char *PQdb(const PGconn *conn) char *PQuser(const PGconn *conn) char *PQpass(const PGconn *conn) char *PQhost(const PGconn *conn) char *PQport(const PGconn *conn) char *PQtty(const PGconn *conn) char *PQoptions(const PGconn *conn) ConnStatusType PQstatus(const PGconn *conn) PGTransactionStatusType PQtransactionStatus(const PGconn *conn) const char *PQparameterStatus(const PGconn *conn, const char *paramName) int PQprotocolVersion(const PGconn *conn) int PQserverVersion(const PGconn *conn) char *PQerrorMessage(const PGconn *conn) int PQsocket(const PGconn *conn) 42.4. RingPostgreSQL Functions 333
  • 6. Ring Documentation, Release 1.9 int PQbackendPID(const PGconn *conn) int PQconnectionNeedsPassword(const PGconn *conn) int PQconnectionUsedPassword(const PGconn *conn) int PQsslInUse(const PGconn *conn) const char *PQsslAttribute(const PGconn *conn, const char *attribute_name) const char **PQsslAttributeNames(const PGconn *conn) void *PQsslStruct(const PGconn *conn, const char *struct_name) void *PQgetssl(const PGconn *conn) PGresult *PQexec(PGconn *conn, const char *command); PGresult *PQexecParams(PGconn *conn,const char *command,int nParams, const Oid *paramTypes,const char **paramValues, const int *paramLengths,const int *paramFormats,int resultFormat) PGresult *PQprepare(PGconn *conn,const char *stmtName, const char *query,int nParams,const Oid *paramTypes) PGresult *PQexecPrepared(PGconn *conn,const char *stmtName, int nParams,const char **paramValues, const int *paramLengths,const int *paramFormats,int resultFormat) PGresult *PQdescribePrepared(PGconn *conn, const char *stmtName) PGresult *PQdescribePortal(PGconn *conn, const char *portalName) ExecStatusType PQresultStatus(const PGresult *res) char *PQresStatus(ExecStatusType status) char *PQresultErrorMessage(const PGresult *res) char *PQresultErrorField(const PGresult *res, int fieldcode) void PQclear(PGresult *res) int PQntuples(const PGresult *res) int PQnfields(const PGresult *res) char *PQfname(const PGresult *res,int column_number) int PQfnumber(const PGresult *res,const char *column_name) Oid PQftable(const PGresult *res,int column_number) int PQftablecol(const PGresult *res,int column_number) int PQfformat(const PGresult *res,int column_number) Oid PQftype(const PGresult *res,int column_number) int PQfmod(const PGresult *res,int column_number) int PQfsize(const PGresult *res,int column_number) int PQbinaryTuples(const PGresult *res) char *PQgetvalue(const PGresult *res,int row_number,int column_number) int PQgetisnull(const PGresult *res,int row_number,int column_number) int PQgetlength(const PGresult *res,int row_number,int column_number) int PQnparams(const PGresult *res) Oid PQparamtype(const PGresult *res, int param_number) void PQprint(FILE *fout,const PGresult *res,const PQprintOpt *po) char *PQcmdStatus(PGresult *res) char *PQcmdTuples(PGresult *res) Oid PQoidValue(const PGresult *res) char *PQoidStatus(const PGresult *res) char *PQescapeLiteral(PGconn *conn, const char *str, size_t length) char *PQescapeIdentifier(PGconn *conn, const char *str, size_t length) size_t PQescapeStringConn(PGconn *conn,char *to, const char *from, size_t length,int *error) size_t PQescapeString(char *to, const char *from, size_t length) unsigned char *PQescapeByteaConn(PGconn *conn, const unsigned char *from,size_t from_length,size_t *to_length) unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length,size_t *to_length) unsigned char *PQunescapeBytea(const unsigned char *from, size_t *to_length) int PQsendQuery(PGconn *conn, const char *command) int PQsendQueryParams(PGconn *conn,const char *command, int nParams,const Oid *paramTypes,const char **paramValues, 42.4. RingPostgreSQL Functions 334
  • 7. Ring Documentation, Release 1.9 const int *paramLengths,const int *paramFormats,int resultFormat) int PQsendPrepare(PGconn *conn,const char *stmtName, const char *query,int nParams,const Oid *paramTypes) int PQsendQueryPrepared(PGconn *conn,const char *stmtName, int nParams,const char **paramValues, const int *paramLengths,const int *paramFormats,int resultFormat) int PQsendDescribePrepared(PGconn *conn, const char *stmtName) int PQsendDescribePortal(PGconn *conn, const char *portalName) PGresult *PQgetResult(PGconn *conn) int PQconsumeInput(PGconn *conn) int PQisBusy(PGconn *conn) int PQsetnonblocking(PGconn *conn, int arg) int PQisnonblocking(const PGconn *conn) int PQflush(PGconn *conn) int PQsetSingleRowMode(PGconn *conn) PGcancel *PQgetCancel(PGconn *conn) void PQfreeCancel(PGcancel *cancel) int PQcancel(PGcancel *cancel, char *errbuf, int errbufsize) int PQrequestCancel(PGconn *conn) PGresult *PQfn(PGconn *conn,int fnid,int *result_buf, int *result_len,int result_is_int,const PQArgBlock *args,int nargs) PGnotify *PQnotifies(PGconn *conn) int PQputCopyData(PGconn *conn,const char *buffer,int nbytes) int PQputCopyEnd(PGconn *conn,const char *errormsg) int PQgetCopyData(PGconn *conn,char **buffer,int async) int PQgetline(PGconn *conn,char *buffer,int length) int PQgetlineAsync(PGconn *conn,char *buffer,int bufsize) int PQputline(PGconn *conn,const char *string) int PQputnbytes(PGconn *conn,const char *buffer,int nbytes) int PQendcopy(PGconn *conn) int PQclientEncoding(const PGconn *conn) char *pg_encoding_to_char(int encoding_id) int PQsetClientEncoding(PGconn *conn, const char *encoding) void PQtrace(PGconn *conn, FILE *stream) void PQuntrace(PGconn *conn) void PQfreemem(void *ptr) void PQconninfoFree(PQconninfoOption *connOptions) char *PQencryptPasswordConn(PGconn *conn, const char *passwd, const char *user, const char *algorithm) char *PQencryptPassword(const char *passwd, const char *user) PGresult *PQmakeEmptyPGresult(PGconn *conn, ExecStatusType status) int PQfireResultCreateEvents(PGconn *conn, PGresult *res) PGresult *PQcopyResult(const PGresult *src, int flags) int PQsetResultAttrs(PGresult *res, int numAttributes, PGresAttDesc *attDescs) int PQsetvalue(PGresult *res, int tup_num, int field_num, char *value, int len) void *PQresultAlloc(PGresult *res, size_t nBytes) int PQlibVersion(void) PQnoticeReceiver PQsetNoticeReceiver(PGconn *conn, PQnoticeReceiver proc,void *arg) PQnoticeProcessor PQsetNoticeProcessor(PGconn *conn, PQnoticeProcessor proc,void *arg) void PQinitOpenSSL(int do_ssl, int do_crypto) void PQinitSSL(int do_ssl) int PQisthreadsafe(void) 42.4. RingPostgreSQL Functions 335
  • 8. CHAPTER FORTYTHREE SECURITY AND INTERNET FUNCTIONS This chapter contains the security and internet functions provided by the Ring programming language for Hashing, Encryption & Decryption. Before using the next function load the openssllib.ring library load "openssllib.ring" # Use OpenSSL functions • MD5() • SHA1() • SHA256() • SHA512() • SHA384() • SHA224() • Encrypt() • Decrypt() • Randbytes() Before using the next function load the internetlib.ring library load "internetlib.ring" # Use the Internet functions • Download() • SendEmail() 43.1 MD5() Function We can calculate the MD5 hash using the MD5() Function Syntax: MD5(cString) ---> String contains the MD5 hash of the string cString Example: see "md5('happy') = " + md5("happy") + nl + "md5('Hello') = " + md5("Hello") + nl 336
  • 9. Ring Documentation, Release 1.9 Output: md5('happy') = 56ab24c15b72a457069c5ea42fcfc640 md5('Hello') = 8b1a9953c4611296a827abf8c47804d7 43.2 SHA1() Function We can calculate the SHA1 hash using the SHA1() Function Syntax: SHA1(cString) ---> String contains the SHA1 hash of the string cString Example: see "sha1('hello') : " + sha1("hello") + nl + "sha1('apple') : " + sha1("apple") + nl Output: sha1('hello') : aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d sha1('apple') : d0be2dc421be4fcd0172e5afceea3970e2f3d940 43.3 SHA256() Function We can calculate the SHA256 hash using the SHA256() Function Syntax: SHA256(cString) ---> String contains the SHA256 hash of the string cString Example: see "sha256('hello') : " + sha256("hello") + nl + "sha256('apple') : " + sha256("apple") + nl Output: sha256('hello') : 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 sha256('apple') : 3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b 43.4 SHA512() Function We can calculate the SHA512 hash using the SHA512() Function Syntax: SHA512(cString) ---> String contains the SHA512 hash of the string cString Example: see "sha512('hello') : " + sha512("hello") + nl + "sha512('apple') : " + sha512("apple") + nl + "sha512('hello world') : " + sha512("hello world") + nl 43.2. SHA1() Function 337
  • 10. Ring Documentation, Release 1.9 Output: sha512('hello') : 9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673c a72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043 sha512('apple') : 844d8779103b94c18f4aa4cc0c3b4474058580a991fba85d3ca698a0bc9e52 c5940feb7a65a3a290e17e6b23ee943ecc4f73e7490327245b4fe5d5efb590feb2 sha512('hello world') : 309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca8 6d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f 43.5 SHA384() Function We can calculate the SHA384 hash using the SHA384() Function Syntax: SHA384(cString) ---> String contains the SHA384 hash of the string cString Example: see "sha384('hello') : " + sha384("hello") + nl + "sha384('apple') : " + sha384("apple") + nl + "sha384('hello world') : " + sha384("hello world") + nl Output: sha384('hello') : 59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa 90125a3c79f90397bdf5f6a13de828684f sha384('apple') : 3d8786fcb588c93348756c6429717dc6c374a14f7029362281a3b21dc10250 ddf0d0578052749822eb08bc0dc1e68b0f sha384('hello world') : fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcb b83578b3e417cb71ce646efd0819dd8c088de1bd 43.6 SHA224() Function We can calculate the SHA224 hash using the SHA224() Function Syntax: SHA224(cString) ---> String contains the SHA224 hash of the string cString Example: see "sha224('hello') : " + sha224("hello") + nl + "sha224('apple') : " + sha224("apple") + nl + "sha224('hello world') : " + sha224("hello world") + nl Output: sha224('hello') : ea09ae9cc6768c50fcee903ed054556e5bfc8347907f12598aa24193 sha224('apple') : b7bbfdf1a1012999b3c466fdeb906a629caa5e3e022428d1eb702281 sha224('hello world') : 2f05477fc24bb4faefd86517156dafdecec45b8ad3cf2522a563582b 43.7 Encrypt() Function We can use the Encrypt() function to encrypts the data using the Blowfish algorithm. 43.5. SHA384() Function 338