SlideShare une entreprise Scribd logo
1  sur  38
Télécharger pour lire hors ligne
Meme Script
●   Type System
●   If, while etc
●   Dates, times, strings
Meme Script Example
var x = 10;
var y = 20;
var z : Integer;
z = x + y;
notify(z);
Meme IDE Function Editor
Primitive Types
●   Integer 10, -234
●   Decimal 1.23
●   String “ABC”
●   Boolean true, false
Declaring Integer Variables
●   Local variables within functions


var x : Integer;
var x2 = 1;
Declaring Decimal Variables

var d : Decimal(2);
var d2 = 1.23;
Declaring Boolean Variables

var b : Boolean;
var b2 = true;
Declaring Strings

var s : String;
var s = “abc”;
Default Initializations
●   String - empty string “”
●   Integer and Decimal – 0
●   Boolean – false
Pre-defined Complex Types
●   Date – day, month, year
●   Time – hour, minute, second
●   Duration – hour, minute, second
●   Timestamp
IF

var a = 15;
if (a > 10)
{
    notify(“A is big”);
}
IF / ELSE
var a = 15;
if (a > 10)
{
    notify(“A is big”);
}
else
{
    notify(“A is small”);
}
IF / ELSIF / ELSE
    notify(“A is small”);
}
    notify(“A is big”);
}
elsif (a > 5)
{
    notify(“A is medium sized”);
}
else
{
    notify(“A is small”);
}
WHILE

var x = 0;
while (x < 10)
{
    x++;
    // do other things
}
FOR

var names : String[];
append(names, "Jack");
append(names, "Jill");
append(names, "Jane");
for (name in names)
{
    notify(name);
}
Arithmetic

var c = 20;
f = c * (9.0 / 5.0) + 32;
notify(f);
Logical Operators

var x = 10;
if ((x > 10) and not (x > 20))
{
    notify(“x is middle sized”);
}
Dataspace
Defining a 'Person' Record
Adding Attributes to the 'Person'
            Record
Naming Conventions
Record Type Names
●   bumpy case with initial uppercase,
●   - E.g. Person or EmployeeDetails
Attribute names in records
●   - bumpy case with initial lowercase
●   - E.g. name or firstName
Defining an Address Record
Adding List of Addresses to Person
Creating a Person Record
var p : Person;
var a : Address;
a.line1 = "12 Hight St";
a.zip = "PA 12345";
p.name = "Simon";
p.tel = "1234567";
append(p.addresses, a);
'Dot' Notation
notify(p.addresses[0].line1);


p.addresses[0].line1 = "13 High St"
String Concatenation
var s1 = "The Start"
var s2 = "The Middle"
var s3 = "The End"
var result = s1 + ", " + s2 + ", " +
s3 + ". " + 3 + " parts.";


The Start, The Middle, The End. 3 parts.
String Comparison
var s1 = "String 1";
var s2 = "String ONE";
if (s1 == s2)
{
    notify("Yes");
}
String Utilities

●   Boolean startsWith(sourceString, matchString)
●   Boolean endsWith(sourceString, matchString)
●   String subString(sourceString, startPos, length)
●   Integer size(sourceString)
●   String toLower(sourceString)
●   String toUpper(sourceString)
●   String trim(sourceString)
●   String replaceAll(sourceString, matchString, replacementString)
●   String replaceFirst(sourceString, matchString, replacementString)
●   String replaceLast(sourceString, matchString, replacementString)
Collections
var people : Person[];
var names : String[];
append(names, "Fred");
append(names, "Jane");
INSERT
var people : Person[];
var names : String[];
append(names, "Fred");
append(names, "Jane");
insert(names, "Joe", 0);
Collections and []
var people : Person[];
var fred : Person[];
fred.name = "Fred";
fred.tel = "12345";
people.append(fred);
var jane : Person[];
jane.name = "Fred";
jane.tel = "12345";
people.append(jane);
Removing from a Collection
var people : Person[];
var fred : Person[];
fred.name = "Fred";
fred.tel = "12345";
people.append(fred);
remove(people, fred);
notify(people[1].name);
Date and Time Types
●   Date - day, month, year
●   Time - hour, minute, second
●   Duration - hour, minute, second
●   Timestamp
Date and Time Arithmetic
var t : Time;
t = timeNow();


var dt : Duration;
dt.hour = 1;
t = addTime(t, dt);
Date and Time Utilities
●   dateNow()
●   timeNow()
●   setDate(Date, year, month, day)
●   setTime(Time, hour, min, sec)
●   addDays(Date, days)
●   dayOfWeek(Date)
●   monthOfYear(Date)
●   formatDate(Date, formatString)
●   formatTime(Time, formatString)
●   formatTimestamp(Timestamp, String)
Date Formatting
Code                  Description                                         Example
                                                                          Result
d                     Day of the month without leading zero               “1”
dd                    Day of the month with leading zero                  “01”
ddd                   The localised name for the day of the week          “Sunday”
m                     Month of the year without leading zero              “1”
mm                    Month of the year with leading zero                 “01”
mmm                   The localised short (3 letter) name for the month   “Jan”
mmmm                  The localised full name for the month               “January”
yy                    The year as two digits                              “10”
yyyy                  The year as four digits                             “2010”


       var today : Date;
       today = dateNow();
       formatDate(today, “mmm d, yyyy”);

       “January 1, 2011”
Time Formatting
Code            Description                                    Example result
HHH             Hour in 24 hour format with leading zero       19
HH              Hour in 24 hour format with leading zero       08
H               Hour in 12 hour format without leading zeros   8
MM              Minute with leading zero                       05
M               Minute without leading zero                    5
SS              Seconds with leading zero                      09
S               Seconds without leading zero                   9
PP              am / pm indicator                              am


       var t : Time;
       t = timeNow();
       formatTime(t, “HH:MM:SS PP”);


       “12:34:10 am”
Questions?

Contenu connexe

En vedette (8)

Tugaas basis data
Tugaas basis dataTugaas basis data
Tugaas basis data
 
Leren onderzoeken op het HLO
Leren onderzoeken op het HLOLeren onderzoeken op het HLO
Leren onderzoeken op het HLO
 
01 intro
01 intro01 intro
01 intro
 
Tute seven preparation
Tute seven preparationTute seven preparation
Tute seven preparation
 
6. how to linked in
6. how to linked in6. how to linked in
6. how to linked in
 
03 cross platform design
03 cross platform design03 cross platform design
03 cross platform design
 
02 meme ide
02 meme ide02 meme ide
02 meme ide
 
Teknik inferensi
Teknik inferensiTeknik inferensi
Teknik inferensi
 

Dernier

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 

Dernier (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

04 meme script

  • 1. Meme Script ● Type System ● If, while etc ● Dates, times, strings
  • 2. Meme Script Example var x = 10; var y = 20; var z : Integer; z = x + y; notify(z);
  • 4. Primitive Types ● Integer 10, -234 ● Decimal 1.23 ● String “ABC” ● Boolean true, false
  • 5. Declaring Integer Variables ● Local variables within functions var x : Integer; var x2 = 1;
  • 6. Declaring Decimal Variables var d : Decimal(2); var d2 = 1.23;
  • 7. Declaring Boolean Variables var b : Boolean; var b2 = true;
  • 8. Declaring Strings var s : String; var s = “abc”;
  • 9. Default Initializations ● String - empty string “” ● Integer and Decimal – 0 ● Boolean – false
  • 10. Pre-defined Complex Types ● Date – day, month, year ● Time – hour, minute, second ● Duration – hour, minute, second ● Timestamp
  • 11. IF var a = 15; if (a > 10) { notify(“A is big”); }
  • 12. IF / ELSE var a = 15; if (a > 10) { notify(“A is big”); } else { notify(“A is small”); }
  • 13. IF / ELSIF / ELSE notify(“A is small”); } notify(“A is big”); } elsif (a > 5) { notify(“A is medium sized”); } else { notify(“A is small”); }
  • 14. WHILE var x = 0; while (x < 10) { x++; // do other things }
  • 15. FOR var names : String[]; append(names, "Jack"); append(names, "Jill"); append(names, "Jane"); for (name in names) { notify(name); }
  • 16. Arithmetic var c = 20; f = c * (9.0 / 5.0) + 32; notify(f);
  • 17. Logical Operators var x = 10; if ((x > 10) and not (x > 20)) { notify(“x is middle sized”); }
  • 20. Adding Attributes to the 'Person' Record
  • 21. Naming Conventions Record Type Names ● bumpy case with initial uppercase, ● - E.g. Person or EmployeeDetails Attribute names in records ● - bumpy case with initial lowercase ● - E.g. name or firstName
  • 23. Adding List of Addresses to Person
  • 24. Creating a Person Record var p : Person; var a : Address; a.line1 = "12 Hight St"; a.zip = "PA 12345"; p.name = "Simon"; p.tel = "1234567"; append(p.addresses, a);
  • 26. String Concatenation var s1 = "The Start" var s2 = "The Middle" var s3 = "The End" var result = s1 + ", " + s2 + ", " + s3 + ". " + 3 + " parts."; The Start, The Middle, The End. 3 parts.
  • 27. String Comparison var s1 = "String 1"; var s2 = "String ONE"; if (s1 == s2) { notify("Yes"); }
  • 28. String Utilities ● Boolean startsWith(sourceString, matchString) ● Boolean endsWith(sourceString, matchString) ● String subString(sourceString, startPos, length) ● Integer size(sourceString) ● String toLower(sourceString) ● String toUpper(sourceString) ● String trim(sourceString) ● String replaceAll(sourceString, matchString, replacementString) ● String replaceFirst(sourceString, matchString, replacementString) ● String replaceLast(sourceString, matchString, replacementString)
  • 29. Collections var people : Person[]; var names : String[]; append(names, "Fred"); append(names, "Jane");
  • 30. INSERT var people : Person[]; var names : String[]; append(names, "Fred"); append(names, "Jane"); insert(names, "Joe", 0);
  • 31. Collections and [] var people : Person[]; var fred : Person[]; fred.name = "Fred"; fred.tel = "12345"; people.append(fred); var jane : Person[]; jane.name = "Fred"; jane.tel = "12345"; people.append(jane);
  • 32. Removing from a Collection var people : Person[]; var fred : Person[]; fred.name = "Fred"; fred.tel = "12345"; people.append(fred); remove(people, fred); notify(people[1].name);
  • 33. Date and Time Types ● Date - day, month, year ● Time - hour, minute, second ● Duration - hour, minute, second ● Timestamp
  • 34. Date and Time Arithmetic var t : Time; t = timeNow(); var dt : Duration; dt.hour = 1; t = addTime(t, dt);
  • 35. Date and Time Utilities ● dateNow() ● timeNow() ● setDate(Date, year, month, day) ● setTime(Time, hour, min, sec) ● addDays(Date, days) ● dayOfWeek(Date) ● monthOfYear(Date) ● formatDate(Date, formatString) ● formatTime(Time, formatString) ● formatTimestamp(Timestamp, String)
  • 36. Date Formatting Code Description Example Result d Day of the month without leading zero “1” dd Day of the month with leading zero “01” ddd The localised name for the day of the week “Sunday” m Month of the year without leading zero “1” mm Month of the year with leading zero “01” mmm The localised short (3 letter) name for the month “Jan” mmmm The localised full name for the month “January” yy The year as two digits “10” yyyy The year as four digits “2010” var today : Date; today = dateNow(); formatDate(today, “mmm d, yyyy”); “January 1, 2011”
  • 37. Time Formatting Code Description Example result HHH Hour in 24 hour format with leading zero 19 HH Hour in 24 hour format with leading zero 08 H Hour in 12 hour format without leading zeros 8 MM Minute with leading zero 05 M Minute without leading zero 5 SS Seconds with leading zero 09 S Seconds without leading zero 9 PP am / pm indicator am var t : Time; t = timeNow(); formatTime(t, “HH:MM:SS PP”); “12:34:10 am”