SlideShare a Scribd company logo
1 of 10
Download to read offline
Ring Documentation, Release 1.9
52.28 StyleFunctions Class
This class contains methods for adding CSS to the generated web page.
Like ScriptFunctions Class, The StyleFunctions class methods are merged to the Page class, so we can use the next
methods with page objects directly.
Method Parameters Description
StyleFloatLeft None Return float: left ;
StyleFloatRight None Return float: right ;
StyleSizeFull None Return width: 100% ; height: 100% ;
Stylecolor x Return ” color: ” + x + ” ; “
Stylebackcolor x Return ” background-color: ” + x + ” ;”
StyleTextCenter None Return “text-align: center ;”
StyleTextRight None Return “text-align: right ;”
StyleTextLeft None Return “text-align: left ;”
StyleSize x,y Return ” width: ” + x + ” ; height: ” + y + ” ;”
StyleWidth x Return ” width: ” + x + ” ;”
StyleHeight x Return ” height: ” + x + ” ;”
StyleTop x Return ” top: ” + x + ” ;”
StyleLeft x Return ” Left: ” + x + ” ;”
StylePos x,y Return ” top: ” + x + ” ;” + ” Left: ” + y + ” ;”
StyleHorizontalCenter None Return ” margin-right:auto ; margin-left:auto; “
StyleMarginTop x Return ” margin-top: ” + x + ” ;”
StyleMarginRight x Return ” margin-right: ” + x + ” ;”
StyleMarginLeft x Return ” margin-left: ” + x + ” ;”
StyleDivCenter nWidth,nHeight Create Div in the center of the page
StyleAbsolute None Return ” position:absolute ;”
StyleFixed None Return ” position:fixed ;”
StyleZIndex x Return ” z-index: ” + x + ” ;”
StyleFontSize x Return ” font-size: ” + x + ” ;”
StyleGradient x Generate Gradient (x values from 1 to 60)
StyleTable None Set table properties
StyleTableRows id Set different color to even and odd rows in the table
StyleTableNoBorder None Return ” border-style: none;”
52.29 WebPage Class
We use braces to access the active WebPage object attributes
Each one of these attribute will return a new object to access again using braces.
52.28. StyleFunctions Class 499
Ring Documentation, Release 1.9
Attribute Description
H1 Wraps HTML H1.
H2 Wraps HTML H2.
H3 Wraps HTML H3.
H4 Wraps HTML H4.
H5 Wraps HTML H5.
H6 Wraps HTML H6.
P Wraps HTML P.
Link Wraps HTML link.
NewLine Wraps HTML NewLine.
Div Wraps HTML Div.
Form Wraps HTML Form.
Input Wraps HTML Input.
TextArea Wraps HTML TextArea.
Select Wraps HTML Select.
Option Wraps HTML Option.
Image Wraps HTML Image.
UL Wraps HTML UL.
LI Wraps HTML LI.
Table Wraps HTML Table.
TR Wraps HTML TR.
TD Wraps HTML TD.
TH Wraps HTML TH.
Audio Wraps HTML Audio.
Video Wraps HTML Video.
Nav Wraps HTML Nav.
Span Wraps HTML Span.
Button Wraps HTML Button.
52.30 HtmlPage Class
The same as the WebPage class with the next changes
1. No output to the stdout
2. Provide the Output Method to get the output
Syntax:
output() ---> The output as string
52.30. HtmlPage Class 500
CHAPTER
FIFTYTHREE
DEPLOYING WEB APPLICATIONS IN THE CLOUD
In this chapter we will learn about deploying Ring Web Applications in the Cloud using Heroku
53.1 Introduction
We created a new project and tutorial to explain how to deploy Ring web applications in the Cloud using Heroku
Demo : http://testring.herokuapp.com/
Project : https://github.com/ring-lang/RingWebAppOnHeroku
Heroku Website : https://www.heroku.com/
53.2 Usage
To use this project and deploy it on Heroku
501
Ring Documentation, Release 1.9
1. Create Heroku account
2. Open your Heroku account and create new application
Example : testring
Note (You have to select a unique name for your application)
3. Open the command prompt, Create new folder : MyApp
md MyApp
4. Open the application folder
cd MyApp
5. Clone this projet using Git (Don’t forget the dot in the end to clone in the current directory)
git clone https://github.com/ring-lang/RingWebAppOnHeroku .
6. Login to Heroku (Enter your Email and Password)
heroku login
7. Add heroku (remote) to your Git project
change testring to your application name
heroku git:remote -a testring
8. Set the buildpacks (So Heroku can know how to support your project)
heroku buildpacks:add --index 1 https://github.com/ring-lang/heroku-buildpack-apt
heroku buildpacks:add --index 2 https://github.com/ring-lang/heroku-buildpack-ring
9. Now build your project and deploy it
git push heroku master
10. Test your project (In the browser)
heroku open
53.3 Ring source code files and permissions
To be able to run your new Ring scripts, Set the permission of the file to be executable using Git
For example, if you created a file : myscript.ring
git update-index --chmod=+x myscript.ring
git commit -m "Update file permission"
If you are using TortoiseGit, From windows explorer, select the file
Right click —> Properties —> Git —> Executable (+x)
Then commit and deploy!
53.3. Ring source code files and permissions 502
Ring Documentation, Release 1.9
53.4 Hello World program
file : ringapp/helloworld.ring
To run it : http://testring.herokuapp.com/ringapp/helloworld.ring
#!/app/runring.sh -cgi
see "content-type: text/html" +nl+nl
see "Hello, World!" + nl
file : ringapp/helloworld2.ring
To run it : http://testring.herokuapp.com/ringapp/helloworld2.ring
#!/app/runring.sh -cgi
load "weblib.ring"
import System.Web
new page {
text("Hello, World!")
}
53.5 Application Database
When you depoly the application, Everything will works directly!
No change is required, but in practice, You will need to update the next files to use your database
There are two scripts to interact with the database (We are using PostgreSQL in the cloud)
You will need to update the connection string in these files if you will use another database
• file: ringapp/database/newdb.ring (We run it using the browser for one time to create the tables)
• file: ringapp/datalib.ring (Class: Database)
In your practical projects, You can write better code (To be able to change the database)
Also you can create configuration file (To write the connection string in one place)
Database service : https://www.heroku.com/postgres
53.6 Deploying after updates
Just use Git and commit then push to heroku
file: build.bat contains the next commands for quick tests
git add .
git commit -m "Update RingWebAppOnHeroku"
git push heroku master
heroku open
53.4. Hello World program 503
Ring Documentation, Release 1.9
53.7 Local Tests
Local tests using Ring Notepad on Windows (Using local Apache Web Server)
Replace the first line in the file : ringapp/index.ring with
#!ring -cgi
Then run it from Ring Notepad (Ctrl+F6)
53.7. Local Tests 504
CHAPTER
FIFTYFOUR
USING RINGLIBCURL
In this chapter we will learn about using RingLibCurl
54.1 Get Request
Example:
load "libcurl.ring"
curl = curl_easy_init()
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)
curl_easy_setopt(curl, CURLOPT_URL, "http://ring-lang.sf.net")
curl_easy_perform(curl)
curl_easy_cleanup(curl)
54.2 Post Request
Example:
load "libcurl.ring"
curl = curl_easy_init()
cPostThis = "page=4&Number1=4&Number2=5"
curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/ringapp/index.ring?page=3")
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, cPostThis)
curl_easy_perform(curl)
curl_easy_cleanup(curl)
54.3 Facebook Login
Example:
505
Ring Documentation, Release 1.9
load "libcurl.ring"
see "Enter Email : " give $login_email
See "Enter Password : " give $login_pass
curl = curl_easy_init()
curl_easy_setopt(curl, CURLOPT_URL, 'https://www.facebook.com/login.php')
curl_easy_setopt(curl, CURLOPT_POSTFIELDS,'charset_test=j u s t a t e s t'+
' &email='+urlencode($login_email)+'&pass='+
urlencode($login_pass)+'&login=Login')
curl_easy_setopt(curl, CURLOPT_POST, 1)
curl_easy_setopt(curl, CURLOPT_HEADER, 0)
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt")
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt")
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U;"+
" Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3")
curl_easy_setopt(curl, CURLOPT_REFERER, "http://www.facebook.com")
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2)
mylist = curl_slist_append(NULL,'Accept-Charset: utf-8')
curl_slist_append(mylist,'Accept-Language: en-us,en;q=0.7,bn-bd;q=0.3')
curl_slist_append(mylist,'Accept: text/xml,application/xml,'+
'application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5')
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, mylist)
curl_easy_setopt(curl, CURLOPT_COOKIESESSION, false)
curl_easy_perform(curl)
curl_easy_cleanup(curl)
Func URLEncode cStr
cOut = ""
for x in cStr
if isalnum(x)
cOut += x
but x = " "
cOut += "+"
else
cOut += "%"+str2hex(x)
ok
next
return cOut
54.4 Save Output to String
Example:
load "libcurl.ring"
curl = curl_easy_init()
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)
54.4. Save Output to String 506
Ring Documentation, Release 1.9
curl_easy_setopt(curl, CURLOPT_URL, "http://ring-lang.sf.net")
cOutput = curl_easy_perform_silent(curl)
See "Output:" + nl
see cOutput
curl_easy_cleanup(curl)
54.5 Get Stock Data From Yahoo
Example:
Load "libcurl.ring"
### Part 1 --- Get Crumb and Cookie -----------------------------------------
See "Start curl_easy_init(): "+ nl
curl = curl_easy_init() ### >>> HANDLE >>> 01006BD0 CURL 0
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1)
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt")
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt")
curl_easy_setopt(curl, CURLOPT_URL, "https://finance.yahoo.com/quote/AMZN/history")
### HTML Data >>> STDOUT Window, Use curl_easy_perform_silent >>> String
cOutput = curl_easy_perform_silent(curl) ### GO Get Data >>> String
### Extract Crumb from data
### "CrumbStore":{"crumb":"abcdefghijk"},
if cOutput != NULL
newStr1 = substr(cOutput, substr(cOutput, '"CrumbStore":{"crumb":"' ), 48 )
nPosS = substr(newStr1, ':"' ) ; ### Start of crumb -2
nPosE = substr(newStr1, '"}' ) ; ### End of crumb
nCount = nPosE - nPosS -2 ### size of crumb
myCrumb = substr(newStr1, nPosS +2, nCount)
See "myCrumb.: |"+ myCrumb +"|" +nl
### UniCode "u002F" replace it with "/"
if substr( myCrumb, "u002F")
myCrumb = substr( myCrumb, "u002F", "/")
See "myCrumb2: |"+ myCrumb +"|"+ nl
ok
else
See "No Connectivity to Yahoo. Looking for Cookie and Crumb." +nl +nl
ok
### Part 2 --- Send URL with Crumb, and Cookie -----------------------------------------
54.5. Get Stock Data From Yahoo 507
Ring Documentation, Release 1.9
### Send URL+Crumb to Yahoo to fetch 1st stock history data,
$url = "https://query1.finance.yahoo.com/v7/finance/download/AMZN"+
"?period1=1277856000&period2=1498777545&interval=1wk" +
"&events=history&crumb=" + myCrumb
curl_easy_setopt(curl, CURLOPT_URL, $url);
cStr = curl_easy_perform_silent(curl)
See cStr
curl_easy_cleanup(curl) ### REMEMBER to CLOSE CURL
Output:
myCrumb.: |sEEeW97mxvN|
Date,Open,High,Low,Close,Adj Close,Volume
2010-07-05,110.650002,117.480003,109.000000,117.260002,117.260002,21000400
2010-07-12,117.809998,124.879997,117.320000,118.489998,118.489998,29407300
2010-07-19,118.379997,121.250000,105.800003,118.870003,118.870003,74252100
54.5. Get Stock Data From Yahoo 508

More Related Content

What's hot

The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181Mahmoud Samir Fayed
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightDonny Wals
 
Appengine Java Night #2b
Appengine Java Night #2bAppengine Java Night #2b
Appengine Java Night #2bShinichi Ogawa
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applicationsSkills Matter
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185Mahmoud Samir Fayed
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Sven Efftinge
 
Modernizes your objective C - Oliviero
Modernizes your objective C - OlivieroModernizes your objective C - Oliviero
Modernizes your objective C - OlivieroCodemotion
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210Mahmoud Samir Fayed
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsGil Fink
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue AdventureAllegient
 
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185Mahmoud Samir Fayed
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy ValuesJuriy Zaytsev
 

What's hot (20)

The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181The Ring programming language version 1.5.2 book - Part 44 of 181
The Ring programming language version 1.5.2 book - Part 44 of 181
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
 
Appengine Java Night #2b
Appengine Java Night #2bAppengine Java Night #2b
Appengine Java Night #2b
 
Patterns for slick database applications
Patterns for slick database applicationsPatterns for slick database applications
Patterns for slick database applications
 
The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185The Ring programming language version 1.5.4 book - Part 44 of 185
The Ring programming language version 1.5.4 book - Part 44 of 185
 
Jquery-overview
Jquery-overviewJquery-overview
Jquery-overview
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]
 
Modernizes your objective C - Oliviero
Modernizes your objective C - OlivieroModernizes your objective C - Oliviero
Modernizes your objective C - Oliviero
 
The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88The Ring programming language version 1.3 book - Part 34 of 88
The Ring programming language version 1.3 book - Part 34 of 88
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210
 
JQuery introduction
JQuery introductionJQuery introduction
JQuery introduction
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
jQuery Rescue Adventure
jQuery Rescue AdventurejQuery Rescue Adventure
jQuery Rescue Adventure
 
The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196The Ring programming language version 1.7 book - Part 48 of 196
The Ring programming language version 1.7 book - Part 48 of 196
 
Python training for beginners
Python training for beginnersPython training for beginners
Python training for beginners
 
The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185The Ring programming language version 1.5.4 book - Part 42 of 185
The Ring programming language version 1.5.4 book - Part 42 of 185
 
jQuery
jQueryjQuery
jQuery
 
Fabric.js @ Falsy Values
Fabric.js @ Falsy ValuesFabric.js @ Falsy Values
Fabric.js @ Falsy Values
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 

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

The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88Mahmoud Samir Fayed
 
Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4DEVCON
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212Mahmoud Samir Fayed
 
The Ring programming language version 1.5.2 book - Part 39 of 181
The Ring programming language version 1.5.2 book - Part 39 of 181The Ring programming language version 1.5.2 book - Part 39 of 181
The Ring programming language version 1.5.2 book - Part 39 of 181Mahmoud Samir Fayed
 
The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184Mahmoud Samir Fayed
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineYared Ayalew
 
The Ring programming language version 1.5.4 book - Part 40 of 185
The Ring programming language version 1.5.4 book - Part 40 of 185The Ring programming language version 1.5.4 book - Part 40 of 185
The Ring programming language version 1.5.4 book - Part 40 of 185Mahmoud Samir Fayed
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to javaciklum_ods
 
The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212Mahmoud Samir Fayed
 

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

The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196The Ring programming language version 1.7 book - Part 49 of 196
The Ring programming language version 1.7 book - Part 49 of 196
 
Html5 Overview
Html5 OverviewHtml5 Overview
Html5 Overview
 
The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181The Ring programming language version 1.5.2 book - Part 7 of 181
The Ring programming language version 1.5.2 book - Part 7 of 181
 
Django crush course
Django crush course Django crush course
Django crush course
 
Jquery fundamentals
Jquery fundamentalsJquery fundamentals
Jquery fundamentals
 
The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88The Ring programming language version 1.3 book - Part 30 of 88
The Ring programming language version 1.3 book - Part 30 of 88
 
Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4Python Code Camp for Professionals 1/4
Python Code Camp for Professionals 1/4
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212The Ring programming language version 1.10 book - Part 22 of 212
The Ring programming language version 1.10 book - Part 22 of 212
 
The Ring programming language version 1.5.2 book - Part 39 of 181
The Ring programming language version 1.5.2 book - Part 39 of 181The Ring programming language version 1.5.2 book - Part 39 of 181
The Ring programming language version 1.5.2 book - Part 39 of 181
 
The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189The Ring programming language version 1.6 book - Part 42 of 189
The Ring programming language version 1.6 book - Part 42 of 189
 
The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184The Ring programming language version 1.5.3 book - Part 53 of 184
The Ring programming language version 1.5.3 book - Part 53 of 184
 
The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184The Ring programming language version 1.5.3 book - Part 43 of 184
The Ring programming language version 1.5.3 book - Part 43 of 184
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
The Ring programming language version 1.5.4 book - Part 40 of 185
The Ring programming language version 1.5.4 book - Part 40 of 185The Ring programming language version 1.5.4 book - Part 40 of 185
The Ring programming language version 1.5.4 book - Part 40 of 185
 
Bring the fun back to java
Bring the fun back to javaBring the fun back to java
Bring the fun back to java
 
The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212The Ring programming language version 1.10 book - Part 53 of 212
The Ring programming language version 1.10 book - Part 53 of 212
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 
Django at the Disco
Django at the DiscoDjango at the Disco
Django at the Disco
 

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

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
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
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
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
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
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
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.
 
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
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 

Recently uploaded (20)

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...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
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
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
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)
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
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
 
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
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 

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

  • 1. Ring Documentation, Release 1.9 52.28 StyleFunctions Class This class contains methods for adding CSS to the generated web page. Like ScriptFunctions Class, The StyleFunctions class methods are merged to the Page class, so we can use the next methods with page objects directly. Method Parameters Description StyleFloatLeft None Return float: left ; StyleFloatRight None Return float: right ; StyleSizeFull None Return width: 100% ; height: 100% ; Stylecolor x Return ” color: ” + x + ” ; “ Stylebackcolor x Return ” background-color: ” + x + ” ;” StyleTextCenter None Return “text-align: center ;” StyleTextRight None Return “text-align: right ;” StyleTextLeft None Return “text-align: left ;” StyleSize x,y Return ” width: ” + x + ” ; height: ” + y + ” ;” StyleWidth x Return ” width: ” + x + ” ;” StyleHeight x Return ” height: ” + x + ” ;” StyleTop x Return ” top: ” + x + ” ;” StyleLeft x Return ” Left: ” + x + ” ;” StylePos x,y Return ” top: ” + x + ” ;” + ” Left: ” + y + ” ;” StyleHorizontalCenter None Return ” margin-right:auto ; margin-left:auto; “ StyleMarginTop x Return ” margin-top: ” + x + ” ;” StyleMarginRight x Return ” margin-right: ” + x + ” ;” StyleMarginLeft x Return ” margin-left: ” + x + ” ;” StyleDivCenter nWidth,nHeight Create Div in the center of the page StyleAbsolute None Return ” position:absolute ;” StyleFixed None Return ” position:fixed ;” StyleZIndex x Return ” z-index: ” + x + ” ;” StyleFontSize x Return ” font-size: ” + x + ” ;” StyleGradient x Generate Gradient (x values from 1 to 60) StyleTable None Set table properties StyleTableRows id Set different color to even and odd rows in the table StyleTableNoBorder None Return ” border-style: none;” 52.29 WebPage Class We use braces to access the active WebPage object attributes Each one of these attribute will return a new object to access again using braces. 52.28. StyleFunctions Class 499
  • 2. Ring Documentation, Release 1.9 Attribute Description H1 Wraps HTML H1. H2 Wraps HTML H2. H3 Wraps HTML H3. H4 Wraps HTML H4. H5 Wraps HTML H5. H6 Wraps HTML H6. P Wraps HTML P. Link Wraps HTML link. NewLine Wraps HTML NewLine. Div Wraps HTML Div. Form Wraps HTML Form. Input Wraps HTML Input. TextArea Wraps HTML TextArea. Select Wraps HTML Select. Option Wraps HTML Option. Image Wraps HTML Image. UL Wraps HTML UL. LI Wraps HTML LI. Table Wraps HTML Table. TR Wraps HTML TR. TD Wraps HTML TD. TH Wraps HTML TH. Audio Wraps HTML Audio. Video Wraps HTML Video. Nav Wraps HTML Nav. Span Wraps HTML Span. Button Wraps HTML Button. 52.30 HtmlPage Class The same as the WebPage class with the next changes 1. No output to the stdout 2. Provide the Output Method to get the output Syntax: output() ---> The output as string 52.30. HtmlPage Class 500
  • 3. CHAPTER FIFTYTHREE DEPLOYING WEB APPLICATIONS IN THE CLOUD In this chapter we will learn about deploying Ring Web Applications in the Cloud using Heroku 53.1 Introduction We created a new project and tutorial to explain how to deploy Ring web applications in the Cloud using Heroku Demo : http://testring.herokuapp.com/ Project : https://github.com/ring-lang/RingWebAppOnHeroku Heroku Website : https://www.heroku.com/ 53.2 Usage To use this project and deploy it on Heroku 501
  • 4. Ring Documentation, Release 1.9 1. Create Heroku account 2. Open your Heroku account and create new application Example : testring Note (You have to select a unique name for your application) 3. Open the command prompt, Create new folder : MyApp md MyApp 4. Open the application folder cd MyApp 5. Clone this projet using Git (Don’t forget the dot in the end to clone in the current directory) git clone https://github.com/ring-lang/RingWebAppOnHeroku . 6. Login to Heroku (Enter your Email and Password) heroku login 7. Add heroku (remote) to your Git project change testring to your application name heroku git:remote -a testring 8. Set the buildpacks (So Heroku can know how to support your project) heroku buildpacks:add --index 1 https://github.com/ring-lang/heroku-buildpack-apt heroku buildpacks:add --index 2 https://github.com/ring-lang/heroku-buildpack-ring 9. Now build your project and deploy it git push heroku master 10. Test your project (In the browser) heroku open 53.3 Ring source code files and permissions To be able to run your new Ring scripts, Set the permission of the file to be executable using Git For example, if you created a file : myscript.ring git update-index --chmod=+x myscript.ring git commit -m "Update file permission" If you are using TortoiseGit, From windows explorer, select the file Right click —> Properties —> Git —> Executable (+x) Then commit and deploy! 53.3. Ring source code files and permissions 502
  • 5. Ring Documentation, Release 1.9 53.4 Hello World program file : ringapp/helloworld.ring To run it : http://testring.herokuapp.com/ringapp/helloworld.ring #!/app/runring.sh -cgi see "content-type: text/html" +nl+nl see "Hello, World!" + nl file : ringapp/helloworld2.ring To run it : http://testring.herokuapp.com/ringapp/helloworld2.ring #!/app/runring.sh -cgi load "weblib.ring" import System.Web new page { text("Hello, World!") } 53.5 Application Database When you depoly the application, Everything will works directly! No change is required, but in practice, You will need to update the next files to use your database There are two scripts to interact with the database (We are using PostgreSQL in the cloud) You will need to update the connection string in these files if you will use another database • file: ringapp/database/newdb.ring (We run it using the browser for one time to create the tables) • file: ringapp/datalib.ring (Class: Database) In your practical projects, You can write better code (To be able to change the database) Also you can create configuration file (To write the connection string in one place) Database service : https://www.heroku.com/postgres 53.6 Deploying after updates Just use Git and commit then push to heroku file: build.bat contains the next commands for quick tests git add . git commit -m "Update RingWebAppOnHeroku" git push heroku master heroku open 53.4. Hello World program 503
  • 6. Ring Documentation, Release 1.9 53.7 Local Tests Local tests using Ring Notepad on Windows (Using local Apache Web Server) Replace the first line in the file : ringapp/index.ring with #!ring -cgi Then run it from Ring Notepad (Ctrl+F6) 53.7. Local Tests 504
  • 7. CHAPTER FIFTYFOUR USING RINGLIBCURL In this chapter we will learn about using RingLibCurl 54.1 Get Request Example: load "libcurl.ring" curl = curl_easy_init() curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) curl_easy_setopt(curl, CURLOPT_URL, "http://ring-lang.sf.net") curl_easy_perform(curl) curl_easy_cleanup(curl) 54.2 Post Request Example: load "libcurl.ring" curl = curl_easy_init() cPostThis = "page=4&Number1=4&Number2=5" curl_easy_setopt(curl, CURLOPT_URL, "http://localhost/ringapp/index.ring?page=3") curl_easy_setopt(curl, CURLOPT_POSTFIELDS, cPostThis) curl_easy_perform(curl) curl_easy_cleanup(curl) 54.3 Facebook Login Example: 505
  • 8. Ring Documentation, Release 1.9 load "libcurl.ring" see "Enter Email : " give $login_email See "Enter Password : " give $login_pass curl = curl_easy_init() curl_easy_setopt(curl, CURLOPT_URL, 'https://www.facebook.com/login.php') curl_easy_setopt(curl, CURLOPT_POSTFIELDS,'charset_test=j u s t a t e s t'+ ' &email='+urlencode($login_email)+'&pass='+ urlencode($login_pass)+'&login=Login') curl_easy_setopt(curl, CURLOPT_POST, 1) curl_easy_setopt(curl, CURLOPT_HEADER, 0) curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt") curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt") curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U;"+ " Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3") curl_easy_setopt(curl, CURLOPT_REFERER, "http://www.facebook.com") curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, FALSE) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2) mylist = curl_slist_append(NULL,'Accept-Charset: utf-8') curl_slist_append(mylist,'Accept-Language: en-us,en;q=0.7,bn-bd;q=0.3') curl_slist_append(mylist,'Accept: text/xml,application/xml,'+ 'application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5') curl_easy_setopt(curl, CURLOPT_HTTPHEADER, mylist) curl_easy_setopt(curl, CURLOPT_COOKIESESSION, false) curl_easy_perform(curl) curl_easy_cleanup(curl) Func URLEncode cStr cOut = "" for x in cStr if isalnum(x) cOut += x but x = " " cOut += "+" else cOut += "%"+str2hex(x) ok next return cOut 54.4 Save Output to String Example: load "libcurl.ring" curl = curl_easy_init() curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) 54.4. Save Output to String 506
  • 9. Ring Documentation, Release 1.9 curl_easy_setopt(curl, CURLOPT_URL, "http://ring-lang.sf.net") cOutput = curl_easy_perform_silent(curl) See "Output:" + nl see cOutput curl_easy_cleanup(curl) 54.5 Get Stock Data From Yahoo Example: Load "libcurl.ring" ### Part 1 --- Get Crumb and Cookie ----------------------------------------- See "Start curl_easy_init(): "+ nl curl = curl_easy_init() ### >>> HANDLE >>> 01006BD0 CURL 0 curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1) curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "cookies.txt") curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "cookies.txt") curl_easy_setopt(curl, CURLOPT_URL, "https://finance.yahoo.com/quote/AMZN/history") ### HTML Data >>> STDOUT Window, Use curl_easy_perform_silent >>> String cOutput = curl_easy_perform_silent(curl) ### GO Get Data >>> String ### Extract Crumb from data ### "CrumbStore":{"crumb":"abcdefghijk"}, if cOutput != NULL newStr1 = substr(cOutput, substr(cOutput, '"CrumbStore":{"crumb":"' ), 48 ) nPosS = substr(newStr1, ':"' ) ; ### Start of crumb -2 nPosE = substr(newStr1, '"}' ) ; ### End of crumb nCount = nPosE - nPosS -2 ### size of crumb myCrumb = substr(newStr1, nPosS +2, nCount) See "myCrumb.: |"+ myCrumb +"|" +nl ### UniCode "u002F" replace it with "/" if substr( myCrumb, "u002F") myCrumb = substr( myCrumb, "u002F", "/") See "myCrumb2: |"+ myCrumb +"|"+ nl ok else See "No Connectivity to Yahoo. Looking for Cookie and Crumb." +nl +nl ok ### Part 2 --- Send URL with Crumb, and Cookie ----------------------------------------- 54.5. Get Stock Data From Yahoo 507
  • 10. Ring Documentation, Release 1.9 ### Send URL+Crumb to Yahoo to fetch 1st stock history data, $url = "https://query1.finance.yahoo.com/v7/finance/download/AMZN"+ "?period1=1277856000&period2=1498777545&interval=1wk" + "&events=history&crumb=" + myCrumb curl_easy_setopt(curl, CURLOPT_URL, $url); cStr = curl_easy_perform_silent(curl) See cStr curl_easy_cleanup(curl) ### REMEMBER to CLOSE CURL Output: myCrumb.: |sEEeW97mxvN| Date,Open,High,Low,Close,Adj Close,Volume 2010-07-05,110.650002,117.480003,109.000000,117.260002,117.260002,21000400 2010-07-12,117.809998,124.879997,117.320000,118.489998,118.489998,29407300 2010-07-19,118.379997,121.250000,105.800003,118.870003,118.870003,74252100 54.5. Get Stock Data From Yahoo 508