Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

How's your APEX game?

Lessons learned while building a game using Oracle APEX 5.0
by

Scott Wesley

on 14 December 2015

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of How's your APEX game?

?
yes, that's word play
Scott Wesley
How's your APEX game?
Lessons learned while building a game using Oracle APEX 5.0
Back in 2013
sagecomputing.com.au
Consulting.
Education.
Passion.
grassroots-oracle.com
2015
Book proposal accepted
Accepted to speak at Kscope15
Game
Game
Prep
USA
Toddler
Pro jQuery in
Oracle Application
Express
Scott Wesley
apress
OTN
Day
Kscope
dec
nov
sept
APEX 5
Client Upgrade
aug
march
apr
APEX 5 GA
75% book
jun
Nov
2014
apex 5 mods
revisions
springer.com/us/book/9781484209615
jQuery essentials
applied within APEX
awesome dynamic actions
Ask about 2 day course
Statistics
http://dgielis.blogspot.com.au/2015/03/apex-50-pimping-login-page.html
apex_workspace_activity_logs
P1_WORD
#p1_board
#p1_board
table
thead
tr
SQL Feasibility
create table
boggex_letters
(
cube_string varchar2(6)
,constraint cube_string_pk PRIMARY KEY (cube_string )
,constraint cube_chk
check
(
length(cube_string) = 6
)
) organization index
/
insert into boggex_letters
(cube_string)
values
(
'ASPFFK'
);
insert into boggex_letters (cube_string)
select column_value
from
table
(boggex.
string_to_sql_table
(

'ASPFFK:NUIHMQ:OBJOAB:LNHNRZ:AHSPCO:RYVDEL:IOTMUC:LREIXD'
||
':TERWHV:TSTIYD:WNGEEH:ERTTYL:OWTOAT:AEANEG:EIUNES:TOESSI'
));
select cube_string

-- 'roll' the dice
,
substr
(cube_string,
round(
dbms_random.value(1,6)
)
,1) as letter
from boggex_letters
order by

dbms_random.value
select roll,
count(*)
, round(
ratio_to_report(count(*)) over ()
*100,1) as rr
from (
select round(dbms_random.value(1,6)) roll
from dual connect by level < 10000
)
-- lots of rolls
group by roll
order by roll
with letters as
(select letter from boggex_letters_vw)
select 'game attempt' game_info
,(select
listagg(letter,':')
within group (order by letter) from letters) dice_rolls
from dual

select

-- four columns
substr(str,1,1) c1
,substr(str,2,1) c2
,substr(str,3,1) c3
,substr(str,4,1) c4
from (
select
listagg(letter)
within group(order by null) str, tile
from (
select column_value letter

,NTILE(4) OVER (ORDER BY null)
tile
-- 4x4 board
from
table(
boggex.
string_to_sql_table
(
(select puzzle_string
from boggex_attempts
where id = to_number(:P1_ID)
))
order by dbms_random.value -- ensure letters presented randomly
)
group by tile
)
create or replace type
nt_vc_arr
as
table of varchar2(4000);

"array of strings"
function
string_to_sql_table
(p_string in varchar2
,p_delimiter in varchar2 default ':')

return nt_vc_arr

pipelined
is
-- Convert a given delimited string to a table of values
-- pipelined so it can be utilised more efficiently within SQL
--
select column_value from table(string_to_table('A:B:C'));
l_array apex_application_global.vc_arr2;
begin

-- convert string to associative array (pl/sql table)
l_array :=
apex_util.string_to_table
(p_string, p_delimiter);

-- stream the array elements as records
for i in l_array.first..l_array.last loop

pipe row
(trim(l_array(i)));
end loop;

return;
end string_to_sql_table;
column_value
------------
A
B
C

3 rows returned
no processes!
boggex.pkb
boggex.js
boggex.css
floor
(DBMS_RANDOM.value(0,6))+1
CSS
v('P1_WORD')
-- rarely, WITH sql
#p1_board
td.t-Report-
cell

{
background-color: #2578cf !important;
color: #fff;
font-size:300%;
padding: 22px 19px 24px 19px;
/* 4x4 board */
text-align: center;
}
// Do something just a little fancy on click button
$('.t-Login-container,.t-Body-alert').
slideUp
('medium')
P1_SUBMIT_METHOD
P1_GAVE_UP
Enter
Click
Click
insert guess
refresh region
Type letter
Tap
letter
Hide intro
Insert game record
Show board
Start timer

Timer expires
$('#game_timer')
-- <div id="game_timer"/>

.countdown
(
{until:
'&LIMIT_JQUERY.'
-- '+2m +00s'
,format: 'YOWDHMS'
,significant: 2
// ie: minutes seconds
,onExpiry:
$.event.trigger('EXPIRED_DA')
});
Hide Try button
Finish game record
Show results


var your_namespace
= new function() {


this.public_fn = function() {

};


var private_fn = function() {

};

};
create
package my_package
as

procedure public_proc;

end;


create package body my_package as


procedure private_proc is

procedure public_proc is

end;
Page Level
Template (4.2)
User Interface
Theme Style
Mostly table
API calls
Keep PL/SQL
out of APEX
word validation
-- then see if they've guessed this word already
,(select 'R' from boggex_words
where attempt_id = p_attempt_id
and
lower(word) = lower(p_word)
and rownum = 1)

-- check to see if letters used exist in puzzle
,(select 'S' from dual where not exists (
with r (word, s, n, puzzle_string) as (
select upper(p_word), regexp_replace(puzzle_string
,substr(upper(p_word), 1 , 1), null, 1, 1) as s
,2 as n
,puzzle_string
from boggex_attempts
where id = p_attempt_id
union all
select word, regexp_replace(s, substr(word , n, 1), null, 1, 1), n+1
,puzzle_string
from r
where
instr(s,substr(word, n, 1)) > 0
)
select 'S'
from r
where length(puzzle_string) - length(s) = length(word)
))

https://community.oracle.com/message/13273655

-- now check word exists in dictionary
,(select 'I' from dual
where not exists
(select null
from
boggex_dict
where word = lower(p_word)))


)
-- end coalesce
);
-- end insert into boggex_words

Why use PL/SQL when SQL will do
"Little Data"
Obvious reports
Data related graphs
Meta data
Monitor Activity

// record browser details for statistics
$s(
'P1_USER_AGENT'
, navigator.userAgent);

On page load:
Turn APEX instrumentation into graphical form
last_letter = $('#P1_WORD').val().substr(this.length-1).toUpperCase();
apex.debug('Last letter:'+last_letter);

// Add highlight to first unhighlighted button encountered
// with the same letter as that entered.
if (last_letter.length > 0)
$('#p1_board td.t-Report-cell:not(.hover):contains("'+last_letter+'"):first')
.addClass('hover')
;

event.which != 8
Key Release P1_WORD
// if the clicked cell has no hover class
if (!$(this.triggeringElement).hasClass('hover')) {


// concatenate letter in cell to p1_word
$s('P1_WORD', $v('P1_WORD') +
$(this.triggeringElement).text());


// sustain the hover style (see page attributes)
$(this.triggeringElement).addClass('hover');
}
click
#p1_board td.t-Report-cell
touchpunch.js
Board
Cell
No hover
Same letter
First instance
Value
Last letter
Upper()
Recovery
Momentum
Boggex
http://everything2.com/title/Boggle
Slack
Intro
Post
oct
:P1_WORD
-- almost always
&P1_WORD.
-- HTML, never SQL
competition.odtug.com
Oracle APEX Gaming Competition
Plugins
Themes
Integration?
APEX 4.0
Pre UT/t42
era of js framework
SQL
CSS
Idea formation
PL/SQL
APEX 5.0
Dynamic Actions
Peer into my brain
Productivity
Analytics
table()
Selectors intro
Declarative balance
Demo




.
.




<
input type="text"

id="P1_WORD"
name="p_t01" class="text_field" value="" size="30" maxlength="">
Live validation
Placeholder
Icons
No code
single page application
dynamic actions
Opposite false action
touchstart
300ms delay
Countdown timer
Touchpunch
SQL, PL/SQL, CSS, jQuery, Dynamic Actions
Q
L
jQuer
CSS
Dyn mic A tion
PL/S L
keith-wood.name/countdown.html
touchpunch.furf.com
JavaScript Namespaces
PL/SQL Packages
Encapsulate
Perform
boggex.pkb
Modularise
Maintain
-- Congrats, but we don't support long words
,case when
length
(p_word) > 9 then 'L' end
insert into
boggex_words
(id, attempt_id, word, submit_method, validity)

values
(boggex_seq.nextval, p_attempt_id, p_word, p_submit_method
,
coalesce
( l_validity

,
'V'

-- valid word

String chk
,Game table
,Recursive loop
,Big table
coalesce (
)
nvl (
)
,and this
check this
short
circuit
evaluation
regardless
of that
20c
10c
2c
5c
1c
String chk
Game table
Recursive loop
Big table
P1_GAVE_UP
N
Set Value
Item:
Value:
Time for demo?
How
is
your
APEX
game?
apex.oracle.com/pls/apex/f?p=
boggex
Thankyou, OTN Forums

-- jQuery Selector
#P1_WORD
-- CSS
<div class="
t-Region
t-Region--scrollBody"
id="R9669002387900724"
>

{display:none}
Inline CSS:
#P1_WORD

{text-transform: uppercase;}
#
id="p1_board"
>
-ception
#orclapex
Full transcript