Fibonacci Sequence - E-Commerce - Lecture Slides, Slides of Fundamentals of E-Commerce

Students of Communication, study E-Commerce as an auxiliary subject. these are the key points discussed in these Lecture Slides of E-Commerce : Fibonacci Sequence, Samples, Templates, Access Control, Comments, Initialisation Control, Strings, Number, Immortal Rabbits, Combining Approaches

Typology: Slides

2012/2013

Uploaded on 07/29/2013

sharad_984
sharad_984 🇮🇳

4.5

(13)

129 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
WML, WMLS
More acronyms than you can shake a stick at!
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Fibonacci Sequence - E-Commerce - Lecture Slides and more Slides Fundamentals of E-Commerce in PDF only on Docsity!

WML, WMLS More acronyms than you can shake a stick at!

Overview

Fibonacci re-visited

WML

More samples

Templates, access control, and comments

WMLS

Initialisation control and strings

The Fibonacci Sequence

In the first two months, Fib collected rabits:

Fib(1) = 1Fib(2) = 1

During month three he introduced the two rabbits:

Fib(3) = 2 = 1 + 1

In month four, the two produced one more rabbit:

Fib(4) = 3 = 2 + 1

In month five, the three produced two more:

Fib(5) = 5 = 3 + 2

In month six, the five produced three more:

Fib(6) = 8 = 5 + 3

The Fibonacci Sequence

In general, each month,

Fib(month)

is equal to

Fib(the previous month)

plus

Fib(the month

before that)

Fib(1) = 1Fib(2) = 1Fib(n) = Fib(n-1) + Fib(n-2)

How would you translate this into code?

(Rhetorical question. Answer it in the homework, not now.)

WML

Today's

weather

:

WML

How did the user’s choice wind up being shown?

Each time the user clicked an tag’s variable.

The tag’s variable, $(name), was the file path weused for the tag.

So each time the user clicked, it changed the value of$(name) and refreshed the card; which changed the valueused in the src attribute of the tag; which changed thepicture that was being displayed.

An interesting note is that the tag picks its value fromthe first

WML - Access control

It’s always possible to type in a URL manually.

Wouldn’t it suck if your e-banking web site had a password-checkpage that forwarded the user to the “transfer your money” page, andthe user could just type in the URL for the money-transfer pagewithout checking their password?

and

The tag contains info

about

a document. The

tag belongs in a document’s tag.

The tag limits the domain and filepath that the usercan

come from

to get to this tag:

(from the documentation at

phone.com

:)

domain

The

URL

domain

of

other

decks

that

can

access

cards

in

this deck.

The

default

value

is

the

domain

of

the

current

deck.

path

The

URL

root

of

other

decks

that

can

access

cards

in

the

deck.

The

default value

is

(the

root

path

of

the

current

deck)

which

lets

any

deck

within

the

specified

domain

access

this deck.

WML - Access control

Access-control example:

This would define a document which could onlybe reached by clicking links in documentsdownloaded from Luton’s web server; youcouldn’t link to the document from anyplace else.

WML Script for initialisation

Last week we saw that you could initialise thevalue of a variable with the

onenterforward

event:

This can be problematic if you want to change the value of$(Foo) in another card and then the user clicks forward to thefirst card again (following a link forward, as opposed to hittingthe Prev button to go back.)

WML Script for initialisation

An example of things going wrong:

myVar

= $(myVar)

Click

for

second

card

myVar

= $(myVar)

Click

for

first

card

Here the value ofmyVar will bechanged every timethe phone loadscard1 or card2.That’s not a bug;it’s a feature. Butwhat if you wantedto preserve thechange you madein card2, but stillhave a valid valuecoming into card1?

WML Script for initialisation

Another solution to the same problem would beto call a WML Script function:

WML Script - Strings

A few words about strings in WML Script:

A “String” is a sequence of characters--letters and numbers--like “bob the string” or “number : 1234” or “!@#%!%”.

The WMLS String Library provides a host of functions tomanipulate Strings.

String.compare(S1, S2)

: Test for equality

compare(s1,s2) will actually test whether two strings are different

. So

if (compare(s1,s2)) ...

is testing whether s1 != s2.

To test whether s

equals

s2, use !compare(s1,s2).

Remember that comparison is case-sensitive!