Workouts for Garmin Fenix 3

Running interval sessions is a necessity for me. I do Fartleks at times, but for the more complicated interval workouts, I make use of my Garmin Fenix 3 sports watch. It has a Workout feature where all the logic steps of running, recovering and resting in various distances and time can be easily setup. I still have to do all the hard work, but the Fenix does help me get it executed.

On the Garmin Connect site it’s quite easy to build the workout, but then I found a few hiccups in transmitting to the watch itself. As it turns out, I had added Fortsätt läsa ”Workouts for Garmin Fenix 3”

Runkeepertips för Race

När man ska skapa ett ”Race”-event till ett lopp i Runkeeper är det så dumt att man inte kan lägga till en GPX-fil med bansträckningen. Det enda sättet är att rita upp hela sträckan manuellt i browsern!

Det är sådär kul och väldigt tidsödande på längre sträckor.

Googlade runt och fann en lösning på detta; RKrace-bookmarklet: http://jacqueminv.github.io/rkrace-bookmarklet/

Med den kan man lätt lägga till en GPX-fil och på så sätt slippa rita själv. Funkar tydligen även på att uppdatera andra aktiviteter i Runkeeper, men det har jag inte testat.

Det är så gött med folk som gör något åt praktiska problem, och delar med sig av det!

Toolchain till Tiviar Alpha+

I am in no way wiz enough to know what I’m doing, but I’m going to attempt to build a native toolchain for the Tiviar Alpha Plus STB. I prefer native since it appears to be more simple to setup, configure and maintain. I’m probably wrong, but that’s what I prefer.

I think I’ve found a couple of cornerstones to do this:

Here’s a source tar, which apparently has been published on tiviar.com earlier, but the link does not work anymore when I try to follow:
http://www.generalfiles.org/download/gs64b0e7a3h32i0/stbgcc-4.5.3-1.3.tar.bz2.html

It seems to contain necessary mipsel toolchain stuff, such as gcc with friends, includes and headers. But I have yet to verify that.
From what I can tell, someone has used a Red Hat buildserver for this.

And here’s a How-To buil Directfb using a buildserver:
”Building Qt for the Broadcom BCM97420C”
Webkit for Qt/DirectFB broadcom 97420c0

And on a mailinglist (http://comments.gmane.org/gmane.comp.lib.qt.user/6025) I found this configure line, but they are for Qt so I suspect a lot can be omitted for c source only assemblies:
./configure -opensource -confirm-license -embedded mips -xplatform
devices/linux-mipsel-broadcom-97425-g++ -opengl es2 -device mipsel-broadcom-
97425 -device-option CROSS_COMPILE=/opt/tool
chains/stbgcc-4.5.3-2.4/bin/mips-linux- -device-option BRCM_PLATFORM=97425 -
device-option BRCM_BHCP_VER=b2 -device-option
BRCM_BASE_DIR=/opt/vendor/broadcom/7425/Refsw12.4 -device-option B_REFSW
_DEBUG=y -prefix /usr/local/Qt/ -sysroot /opt/toolchains/stbgcc-4.5.3-
2.4/mipsel-linux-uclibc/sys-root -no-mips_dsp -no-mips_dspr2 -no-xcb -qpa
eglsfs -system-zlib -system-libpng -system-libjpeg
-eglfs -no-avx -no-sse3 -no-sse4.1 -no-sse4.2 -no-ssse3 -no-sse2 -fontconfig
-icu -system-sqlite -glib -v -gstreamer -force-pkg-config
1981

./configure -opensource -confirm-license -xplatform devices/linux-
mipsel-broadcom-97425-g++ -opengl es2 -device mipsel-broadcom-97425 -device-
option CROSS_COMPILE=/opt/toolchains/stbgcc-4.5.3-2.4/bin/mips-linux-
-device-option BRCM_PLATFORM=97425 -device-option
BRCM_BHCP_VER=b2 -device-option BRCM_BASE_DIR=/opt/vendor/broadcom/7425/Refsw12.4
-device-option B_REFSW_DEBUG=y -prefix /usr/local/Qt/
-sysroot /opt/toolchains/stbgcc-4.5.3-2.4/mipsel-linux-uclibc/sys-root
-no-mips_dsp -no-mips_dspr2 -no-xcb -qpa eglsfs -system-zlib
-system-libpng -system-libjpeg -eglfs -no-avx
-no-sse3 -no-sse4.1 -no-sse4.2 -no-ssse3 -no-sse2 -fontconfig -icu -system-sqlite
-glib -v -gstreamer -force-pkg-config

And perhaps adding to that:
-Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -pipe --sysroot=/home/kushal/bcm/stbgcc-4.5.3-2.4/mipsel-linux-uclibc/sys-root -ICU -ffunction-sections -fdata-sections -O2 -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -fno-exceptions -D_REENTRANT -MD -DQT_NO_XCB -DBUILDING_QT__=1 -DNDEBUG -DENABLE_3D_RENDERING=1 -DENABLE_BLOB=1 -DENABLE_CHANNEL_MESSAGING=1 -DENABLE_CSS_BOX_DECORATION_BREAK=1 -DENABLE_CSS_COMPOSITING=1 -DENABLE_CSS_EXCLUSIONS=1 -DENABLE_CSS_FILTERS=1 -DENABLE_CSS_IMAGE_SET=1 -DENABLE_CSS_REGIONS=1 -DENABLE_CSS_STICKY_POSITION=1 -DENABLE_DATALIST_ELEMENT=1 -DENABLE_DETAILS_ELEMENT=1 -DENABLE_FAST_MOBILE_SCROLLING=1 -DENABLE_FILTERS=1 -DENABLE_FTPDIR=1 -DENABLE_FULLSCREEN_API=1 -DENABLE_GESTURE_EVENTS=1 -DENABLE_ICONDATABASE=1 -DENABLE_IFRAME_SEAMLESS=1 -DENABLE_INPUT_TYPE_COLOR=1 -DENABLE_INSPECTOR=1 -DENABLE_INSPECTOR_SERVER=1 -DENABLE_JAVASCRIPT_DEBUGGER=1 -DENABLE_LEGACY_NOTIFICATIONS=1 -DENABLE_LEGACY_VIEWPORT_ADAPTION=1 -DENABLE_LEGACY_VENDOR_PREFIXES=1 -DENABLE_METER_ELEMENT=1 -DENABLE_MHTML=1 -DENABLE_MUTATION_OBSERVERS=1 -DENABLE_NOTIFICATIONS=1 -DENABLE_PAGE_VISIBILITY_API=1 -DENABLE_PROGRESS_ELEMENT=1 -DENABLE_RESOLUTION_MEDIA_QUERY=1 -DENABLE_REQUEST_ANIMATION_FRAME=1 -DENABLE_SHARED_WORKERS=1 -DENABLE_SMOOTH_SCROLLING=1 -DENABLE_SQL_DATABASE=1 -DENABLE_SVG=1 -DENABLE_SVG_FONTS=1 -DENABLE_TOUCH_ADJUSTMENT=1 -DENABLE_TOUCH_EVENTS=1 -DENABLE_WEB_SOCKETS=1 -DENABLE_WEB_TIMING=1 -DENABLE_WORKERS=1 -DENABLE_XHR_TIMEOUT=1 -DWTF_USE_TILED_BACKING_STORE=1 -DHAVE_QTQUICK=1 -DHAVE_QTPRINTSUPPORT=1 -DHAVE_QSTYLE=1 -DHAVE_QTTESTLIB=1 -DWTF_USE_ZLIB=1 -DWTF_USE_LIBJPEG=1 -DWTF_USE_LIBPNG=1 -DPLUGIN_ARCHITECTURE_UNSUPPORTED=1 -DWTF_USE_3D_GRAPHICS=1 -DENABLE_WEBGL=1 -DENABLE_CSS_SHADERS=1 -DENABLE_TOUCH_SLIDER=1 -DENABLE_ACCELERATED_2D_CANVAS=0 -DENABLE_ANIMATION_API=0 -DENABLE_BATTERY_STATUS=0 -DENABLE_CSP_NEXT=0 -DENABLE_CSS_GRID_LAYOUT=0 -DENABLE_CSS_HIERARCHIES=0 -DENABLE_CSS_IMAGE_ORIENTATION=0 -DENABLE_CSS_IMAGE_RESOLUTION=0 -DENABLE_CSS_VARIABLES=0 -DENABLE_CSS3_BACKGROUND=0 -DENABLE_CSS3_CONDITIONAL_RULES=0 -DENABLE_CSS3_TEXT=0 -DENABLE_DASHBOARD_SUPPORT=0 -DENABLE_DATAGRID=0 -DENABLE_DATA_TRANSFER_ITEMS=0 -DENABLE_DEVICE_ORIENTATION=0 -DENABLE_DIRECTORY_UPLOAD=0 -DENABLE_DOWNLOAD_ATTRIBUTE=0 -DENABLE_FILE_SYSTEM=0 -DENABLE_GAMEPAD=0 -DENABLE_GEOLOCATION=0 -DENABLE_HIGH_DPI_CANVAS=0 -DENABLE_INDEXED_DATABASE=0 -DENABLE_INPUT_SPEECH=0 -DENABLE_INPUT_TYPE_DATE=0 -DENABLE_INPUT_TYPE_DATETIME=0 -DENABLE_INPUT_TYPE_DATETIMELOCAL=0 -DENABLE_INPUT_TYPE_MONTH=0 -DENABLE_INPUT_TYPE_TIME=0 -DENABLE_INPUT_TYPE_WEEK=0 -DENABLE_LEGACY_CSS_VENDOR_PREFIXES=0 -DENABLE_LINK_PREFETCH=0 -DENABLE_LINK_PRERENDER=0 -DENABLE_MATHML=0 -DENABLE_MEDIA_SOURCE=0 -DENABLE_MEDIA_STATISTICS=0 -DENABLE_MEDIA_STREAM=0 -DENABLE_MICRODATA=0 -DENABLE_NAVIGATOR_CONTENT_UTILS=0 -DENABLE_NETSCAPE_PLUGIN_API=0 -DENABLE_NETWORK_INFO=0 -DENABLE_ORIENTATION_EVENTS=0 -DENABLE_PROXIMITY_EVENTS=0 -DENABLE_QUOTA=0 -DENABLE_SCRIPTED_SPEECH=0 -DENABLE_SHADOW_DOM=0 -DENABLE_STYLE_SCOPED=0 -DENABLE_SVG_DOM_OBJC_BINDINGS=0 -DENABLE_TEXT_AUTOSIZING=0 -DENABLE_TEXT_NOTIFICATIONS_ONLY=0 -DENABLE_TOUCH_ICON_LOADING=0 -DENABLE_VIBRATION=0 -DENABLE_VIDEO=0 -DENABLE_VIDEO_TRACK=0 -DENABLE_WEB_AUDIO=0 -DENABLE_XSLT=0 -DBUILDING_WebKit1 -DBUILDING_WEBKIT -DQT_ASCII_CAST_WARNINGS -DSQLITE_CORE -DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_COMPLETE -DSTATICALLY_LINKED_WITH_WebCore -DSTATICALLY_LINKED_WITH_ANGLE -DSTATICALLY_LINKED_WITH_JavaScriptCore -DSTATICALLY_LINKED_WITH_WTF -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB

One day (night) with some more time on my hands, I just might be able to cook this. Until that day…

WordPress Metainformation

Jag valde WordPress (just nu v3.3) till en sajt jag skapade för ett kreativt projekt; svenskajakttorn.se. Inte det säkraste, inte det snyggaste, men väldigt enkelt att komma igång med.

Wordpress meta-informationPå dess sidopanel kan man lägga till menyalternativ, det finns ett par förvalda till standardtemat, i mitt fall ”Twenty Eleven”. De klassiska Widgetarna på sidopanelen är förstås etikettmoln, länkar till arkiv över äldre inlägg etc. Och så finns där en default Widget som kort och gott heter ”Meta”. Den visar inloggningslänken till själva sajten, men även ett par andra länkar till RSS-flöden och så en till WordPress.org. Även om jag gärna slår ett slag för WordPress så vill jag inte att dessa estetiskt onödiga länkar ska synas på just denna sajt.

Jag letade runt genom administrationspanelens GUI-redigerare, men koden ligger djupare inbäddat än i de olika php-sidorna till temat Twenty Eleven (som jag råkar använda). Efter att ha konsulterat Señor Google visar det sig att just Meta-widgeten inte går att anpassa.

Lösningen är att ta bort default Meta-Widget från sidopanelen – eller var man nu har valt att lägga den – och lägga till ett Tillägg/Plugin som erbjuder frihet att visa vilka länkar man vill. I mitt fall endast inloggningslänken. När jag sökte på plugins fanns där flera olika. Jag nöjde mig med en enkel: Custom Meta Widget.

Reflections on Celtx after my first 100 days

So in truth I’ve been using it closer to 200 days, but it sounded cooler with the hundred. If not daily, I’ve at least been tampering with writing projects on a weekly basis since I first installed it. I’ve written a full feature (Day Before The Dead) started a book project and have a handful of other feature projects in early stages. Overall I’m quite happy, else I would have looked for alternatives at a much earlier stage. That said, I’d like to share what I believe are weak points on important features and missing or deficient functionality. This applies to Celtx version 2.9.1, Celtx Script and Celtx Studio as per November 2011.

Export Data – the ’Master Catalog’
I’m an amateur writer. Admittedly I have not paid much attention to the pre- and post-production functions in Celtx. One major thing I did notice was the poor export function for marked up content, schedules, reports etc. It does exports a .csv file which is easily imported to a spreadsheet (i.e. Microsoft Excel), but it’s only a short summary. It doesn’t contain all the details, far from it: notes, details of character info, scene info etc. is not exported. This should be left to the user/production assistant to filter and clean up, not for Celtx to censor. Export it all, it’s there! And the information contained is not massive enough to choke any normal spreadsheet!

Obviously all things cannot be reported or scheduled in detail in Celtx. While this is true, don’t put limitations in where they are not called for. I’m thinking Celtx should consider abandoning the RDF ”database” structure in favor of e.g. sqlite if they want to be able to create more elaborate and robustly generated reports and schedules, but that’s another story.

Aggressive Master Catalog auto updater
The Master Catalog captures characters quite aggressively. I’m willing to bet that most Celtx users have it filled with a number of characters called long strings of text like ”JASON HELLO MY NAME IS JASON. WHAT IS”. In fact, those are supposed to be a parenthetical or piece of a dialogue. Perhaps Celtx could introduce a second pass that occurs minutes later, to wash out those obvious non-characters? Or let us users enable the scan manually, when they think it’s OK to do so?

Limited reports
I think there should be better possibilities to make custom reports containing all or any of the Breakdown items. Oh, there is not even an export function for the default reports, like there is with the Master Catalog. One report type I’m missing in particular is ”Notes”, showing only the notes as: in the order they appear in the script, by each user, and by (reversed) chronological order.

Scheduling
Is best done in MS Project, MS Excel or similar alternative product. Celtx simply misses out on too many things when it comes to WBS and time schedule – try scheduling over night sessions, for instance. Hence the importance to add ALL details to the Master Catalog export file. But I do think this part has a lot of potential and I would rather not use e.g. MS Project.

Export Script – FDX
Let’s face it, FD is still the big colossal leader in the industry (citation needed). The Final Draft XML format is there to grab. Some producers or studios may require or wish for an FDX formatted copy, so why not provide it? Unlike the dinosaurs, having the ability to change and adapt is far more important to survive in the long run than being the number one for a limited time.

Import Script – SPMD
I’ve fallen in love with the Screenplay Markdown language. It’s so easy, it’s so portable. Now all I need from Celtx is a way to import SPMD according to it’s spec, rather than guessing (about 60% right, unscientifically guesstimated) via existing .txt import function.

Index Cards
The Index Cards-function in Celtx is limited to one scene heading per card. No more, no less. That’s all fine when writing a short outline or so, but not very useful once you are well into a full feature with hundreds of scene headers. Take a look at how MM does it. Or Fade In. I’m looking for ’meta cards’; Index cards that that span over an entire scene sequence; containing several scene headers. Then I want to shuffle. Oh, and I don’t want my cards to die when I happen to delete a scene header. Let it become grey instead. I think I recall reading that the present limit to 8 types of cards will be abandoned, which is good I one wishes to tag up an entire beatsheet, like the BS2 (Blake Snyder’s take on it) with e.g. 15 default beats.

And what about changing the view: from hierarchical, to timeline stream, to mindmap connections and so on?

Collaboration – Celtx Studio
Collaboration is a pain. A team of writers have to work sequentially, making sure only one writer at the time is ’checked in’ to the script, otherwise changes and updates may be lost. This severely hinders creativity and productivity. Google Docs currently provide the ultimate in real time writing collaboration, but I could settle with a concurrent version system like Git, Subversion et al. To that – a simple GUI that allows the user to accept or reject each change. I like the simplicity of MediaWiki history comparison, but it’s too crude. I need more granularity.

I’ve seen comments on the Celtx board saying that they are working on a major update of the Celtx Studio, hopefully released ’soon’ (November turned into December, still waiting). I sure hope this means a major improvement for the collaboration part. Me and my writing partner have spent a number of unnecessary hours to ensure all our contributions have synced and ended up in the latest version of the draft. If we were more people, I would probably not go for Celtx Studio as-is, but rather start out with Google Docs first.

Synchronizing with other devices – Celtx Script
Only some script types are supported, and only on some devices; the iDevices, that is. Non-Apple smartphones, pads etc. are not welcome, at least not yet. I regard this part as work in progress and have no reason to doubt that there eventually will be an Android and Windows Mobile versions too. I do miss the ability to read the in-line comments and I think it’s strange that the title page is not committed when printing/sending PDF via email while on the iDevice. On the Celtx forum I’ve seen a user posting a reader app for Android, so it can’t be far away.

No vivid development community
Browsing the development section of the Celtx.com forum it appears deserted. I’ve been reading their wiki and I’ve been seriously searching the Internet for more Celtx hacking/development sources. I’m not in awe. There is too little engagement from the Celtx team devs, they could put a little more effort into the dev section if they considered it important. On the other hand, there is not enough people from the community who share their findings. With just 20 minutes a day, commenting 1 or 2 posts, the Celtx crew could get far more attention from skilled developers – and less skilled developers who still may be useful and loyal to the community. Using open source is so much more productive and creative when there is an active community, I hope the Celtx team gets it.

Limited language support when Typesetting a PDF
I’m lucky to write in English and Swedish. It happens to be supported by the Celtx PDF typesetting webservice. I think they would save some bandwidth if they posted the source code and config/setup for this LaTeX-driven service, so that the community could help out in making Celtx a far more international success. I don’t understand the agenda to keep the webservice code closed, while it’s still free of charge? Well, conspiracy 1: perhaps they’d like to make it a premium service in the future, taking a small fee each time a users wishes to generate a PDF? That brings us to —

Pagination
It only seems to be 98% reliable, even when TypSet as PDF. The inline script pagination in the edit view is an estimation only, or rather, a guesstimation at best. Depending upon how the script is generated and developed, the deviation has been reported on the forum to exceed 50 percent! Wow. Perhaps yet another reason to bring the LaTeX service client side and/or open source, to make a quicker pagination update. Writers want to know how much they’ve done and what remains. The closer the deadline, the more important this feature becomes.

Unsupported tags and characters breaks Celtx
It’s too easy to introduce ’hidden’ tags (html/xml) and unsupported characters. Someone just has to write a story in MS Word or other common editor, then cut’n paste directly into Celtx. Problem occurs; file get’s corrupted, or will not sync to iDevice or some other strange symptom appears. The forum has too many of these symptoms appearing in user’s posts for several months, they should already have detected a root cause and start to address it. I don’t think it’s an easy task, but it’s definitely something the Celtx crew should address in an upcoming major release.

There, I’ve said it. And I’ve just used up some more valuable time I could have spent writing on a commercial success that could make me and my family economically independent for generations. I will very likely spend more time on tinkering with Celtx addons to resolve some of the annoyances above rather than writing scripts.

Perhaps I should just go for SPMD, once I’ve found a way to get it outputted as a proper PDF. Damn you Celtx! :-)

Bashing the scraper

Av anledningar som vi inte behöver gå in på satt jag och pillade på ett bashscript på jobb idag, och lärde mig lite om curl

result=$(curl -s -d "iporfqdn=$line" http://some.place.com/toogle/ | sed -e 's/<[^>]*>//g' | awk '/NTP/ { getline; print $3 }')

-d gör att curl postar ett formulärs fält, i fallet ovan som har id=iporfqdn. Jag är övertygad om att man kan skippa sed-pipen och rensa bort html-taggarna med enkom awk, men det bidde inte så i det här skriptet.

Just awk '/NTP/ { getline; print $3 }') är en smart konstruktion för scraping, som bearbetar raden efter strängen ”NTP” stöts på. I mitt fall innehöll den viktiga raden jag vill åt bara variabler som inte gick smidigt att göra en regexp på.

En annan sak som jag blev påmind om var att en klassisk ”läs en rad i taget från en textfil”-loop kan bli onödigt krånglig. En vanlig metod är att använda sig av:

while read line; do
# gör något, typ echo $line
done

Men då läses inte textfilens sista rad in, om sista variabeln är på samma rad som sista \n

Lösningen? Man kan lägga till en annan delimiter än newline och testa, och se till att read inte tolkar slashen i newline; \n som en escape character:

while IFS='' read -r line || [ -n "$line" ]; do
result=$(someFunction $line)
echo $result
let count++
done < "$1"

Här skickar vi input från varje rad i en textfil (från $1). Det kan vara en lista med IP-addresser, lösenord, namn, filmer, artikel- eller ordernummer, telefonnummer, orter, fotbollslag -- eller vad man nu kan tänkas behöva ge som input till något annat.
read -r är tricket för att undvika newline-escape!
[ -n "$variabel" ] kollar om strängen är NULL, men då krävs att den är inom citationstecken. När vi når efter sista raden återstår ...inget. Färdigt!

SPMD – ScreenPlay MarkDown

Stu at Prolost.com posted a proposal for SPMD, a lightweight markup language for the classic screenplay format, inspired by Markdown.

The purpose of SPMD is to enable writers to focus on the writing, rather than fiddling with buttons and extra keyboard shortcuts to format the sluglines, characters, dialogue, transitions etc. I know it’s easy to just do e.g. Ctrl/Cmd-1 to format a line into a Slugline in Celtx, but that’s still an extra effort and definitely something that takes focus from the writing, even though it might seem trivial.

Instead, SPMD relies on a few basic rules, for instance:

A Scene Heading, or “slugline,” is any line that has a blank line following it, and either begins with INT or EXT, or has two empty lines preceding it. A Scene Heading always has at least one blank line preceding it.

A typical  slugline like this would become correctly formatted:
EXT. HOSPITAL - DAY
But it could also be written without caps, as stated:

1. Scene Heading Prefixes

Case insensitive.

  • INT.{space}
  • EXT.{space}
  • INT./EXT.{space}
  • INT/EXT.{space}
  • INT{space}
  • EXT{space}
  • INT/EXT{space}
  • I/E{space}

The rests of the SPMD format, it’s RfC if you will, is outlined here: http://prolost.com/storage/downloads/spmd/SPMD_proposal.html. It’s highly effective for those who decide to master it, and has great potential to become an efficient writing tool!

Once done writing – and that includes a wide margin of procrastination regardless of writing-application – an SPMD-supported application can pick up the text file and convert it straight to a properly formatted screenplay, to a PDF document for instance. Screenplain is one of those. This is an open source python application written by Marting Vilcans. He has also posted a basic (and free!) cloud version of Screenplain, e.g. and online SPMD file formatter, using Google’s App Engine, here: https://screenplain.appspot.com/.

The advantage is clear; any text file editor will do, on any device. Very portable. Very easy. Envision using a combination of your iPad/iDevice, PC, Mac, Windows, Linux, Android, GoogleDocs, MS Word*, *nix, emacs, Apple Pages*, LibreOffice*, nano, vi — whatever and wherever! Put your file in an online share, like Dropbox, or check it in on Github, a Subversion repo, use a private Pastebin or a Wiki or whatever you like!

So everybody doesn’t have all those options, apart from us geeks, but anyone who partners up with another writer (or writers), or have that idea when they don’t have anything to scribble on…

Yup, you got it. Enter SPMD!

As of right now the only commercial screenplay application I’ve found supporting SPMD is Fade In (FI), but I hope the other ones including Celtx will catch up soon. It should be trivial to add SPMD as an import option, but the ultimate goal would be to have SPDM as the on-the-fly WYSIWYG editor view. Note that both Celtx and Final Draft already does a decent job of tidying up an SPMD-formatted text file, but it still requires manual clean-up.

 

* NB: Provided you save the file as a plain text file, not as .doc, .rtf etc.

 

Understanding Celtx RDF/XML structure

I wanted to attempt improving the open source screenplay/pre-production software Celtx. It’s based on other open source components such as Firefox and built using XUL, e.g. a lot of XML, Javascript, HTML and CSS. Quite a simple and brilliant idea, making it interoperable and customizable for the handy hacker. But before I start making hacks I need to examine how Celtx works.

In a previous post I took a look at the translation of Celtx to other languages (in Swedish), but here are my findings on how Celtx v2.9.1 is working with the content rather than displayed language. I’m focusing on the screenplay perspective, which is most interesting to me.

I’m making the tedious effort to study output files instead of looking at the source code, but when you save a script in Celtx it ends up in a project file with the extension .celtx, e.g. MyMovie.celtx. It’s just a zipped file which contains all the data for a project in clear text, so it’s easy to examine. A project library can contain several types of media and data, at the moment Celtx defaults to seven kinds of templates:

  1. Film (Screenplay)
  2. Audio-Visual (Directors schedule?)
  3. Theatre (Stageplay)
  4.  Audio Play (BBC standard for radioplays/podcasts)
  5. Storyboard (based on index cards and images)
  6. Comic Book (comic stageplay)
  7. Novel (basic book writing).

The most important things, like the text of the script, are stored html text files, while the intelligence and meta data is stored in rdf/xml files.

Unzip/extracting a virgin MyMovie.celtx file gives:

  • local.rdf
    This file contains the ”master” resource definitions for the whole project.
  • project.rdf
    This file contains the meta data, the order of scenes, character info etc.
  • scratch-xeb.html
    This file contains a ”scratchpad” placeholder for ideas and information, which is related to the script but put in a separate structure as to not interfere with the original script.
  • script-xeb.html
    This file contains the actual/original screenplay script content, tagged with html.

If we add images/photos to the project they will appear next to the files above, as seen further down on this post.

Let’s have a look inside each file!

The local.rdf file
This file declares a Project Master ID (my wording), which all it’s containing rdf/xml files connect to, as well as telling what view was last open when we open Celtx. A project can contain a Novel, a Screenplay etc. This it’s all kept together logically in the local.rdf file.

It may look like this:

<?xml version="1.0"?>
<RDF:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
         xmlns:cx="http://celtx.com/NS/v1/"
         xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
         xmlns:NC="http://home.netscape.com/NC-rdf#"
         xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <RDF:Seq RDF:about="rdf:#$3DD1u">
    <RDF:li RDF:resource="http://celtx.com/res/1kEqvojZWTHA"/>
    <RDF:li RDF:resource="http://celtx.com/res/vbHM8my1Pyk0"/>
  </RDF:Seq>
  <RDF:Description RDF:about="http://celtx.com/project/fly1RztQ01di">
    <cx:opentabs RDF:resource="rdf:#$3DD1u"/>
  </RDF:Description>
</RDF:RDF>

First we have the rdf/xml declaration, the usuals. The interesting parts are:
The ID’s of the contained content types/templates, in this case a Screenplay and it’s Master Catalog:

  <RDF:Seq RDF:about="rdf:#$3DD1u">
    <RDF:li RDF:resource="http://celtx.com/res/1kEqvojZWTHA"/>
    <RDF:li RDF:resource="http://celtx.com/res/vbHM8my1Pyk0"/>
  </RDF:Seq>

Where:
A Master Catalog is a view on tagged elements of a script, e.g. characters, sound effects, animals etc. and some meta data notes for each element (where applicable).
I’m guessing the Celtx Installation ID (my wording) is ”#$3DD1u”
The Screenplay ID is ”1kEqvojZWTHA”
The Master Catalog ID is ”vbHM8my1Pyk0”

The 12 character long strings are generated by Celtx and appears to be unique for each project file, while the Celtx Installation ID seems to stay fixed.

Then we have the declaration of what elements are open in the project, in this case the Master Catalog script:

  <RDF:Description RDF:about="http://celtx.com/project/fly1RztQ01di">
    <cx:opentabs RDF:resource="rdf:#$3DD1u"/>
  </RDF:Description>

Where the Master Project ID, again in lack of appropriate wording, is ”fly1RztQ01di”.

project.rdf
This file contains the brains and structure of e.g. a Screenplay script; the characters, the order of scenes, the meta data about characters etc. It does not contain the actual script contents, as they are stored in a separate html file.

The file is always initiated with an xml statement:
<?xml version="1.0"?>

This is followed by the master RDF declaration:
<RDF:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cx="http://celtx.com/NS/v1/"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

At the bottom of the file we find this closing section:
<cx:Project RDF:about="http://celtx.com/project/fly1RztQ01di"
cx:fileVersion="1.4"
dc:title="testing"
dc:modified="2011-07-23T14:31:35Z">
<cx:components RDF:resource="http://celtx.com/res/U0xHoW9oCmfD"/>
</cx:Project>

Again we see a reference to the ”Master Project ID”: ”fly1RztQ01di”
EXPLORE: What is the cx:components ”U0xHoW9oCmfD”?

Between the initial and closing sections we find stuff more randomly ordered, or in reverse order? I guess it doesn’t really matter. Since most personal computers these days have a fair amount or RAM and CPU horsepower, and a screenplay script is just a couple of hundred pages (around 90-120 in case of Hollywood standard specs), it shouldn’t really matter from a performance perspective.

OK, moving on.

Scenes are stated like this:
<RDF:Description RDF:about="http://celtx.com/res/5r38m100"
cx:sceneid="7k38m100"
cx:location=" "
dc:title="INT. SCENE 2 - NIGHT"
cx:intext="INT"
cx:setting="SCENE 2"
cx:daynight="NIGHT"
cx:ordinal="2"
cx:sortord="0002">
<cx:members RDF:resource="rdf:#$E+uWw1"/>
<cx:markup RDF:resource="rdf:#$F+uWw1"/>
</RDF:Description>

Where the non-obvious are:

sceneid		A key linked to the content in the script-xeb.html file.
sortord		Tells us the scene number.
cx:members	(We'll figure this out later.)
cx:markup	(We'll figure this out later.)

Cast is marked up like this, here with a character called ”Daniel”:
<cx:Cast RDF:about="http://celtx.com/res/dF4dFMsdbEdt"
dc:title="DANIEL" />

The cast characters are detailed in the Master Catalog view. Opening this in Celtx and adding info, this section can look like this:
<cx:Cast RDF:about="http://celtx.com/res/dF4dFMsdbEdt"
dc:title="DANIEL"
cx:tags="DANIELTAG"
NS1:character-full-name="Daniel The Barbarian"
dc:description="This is Daniels description: He's a mean bastard."
NS1:character-age="36"
NS1:character-hair="Brown hair"
NS1:character-eyes="Green/brown"
NS1:character-height="184"
NS1:character-princ_func="protagonist"
NS1:character-goal="Daniel wants to understand Celtx and improve it. He'd like to see a screenplay of his turn into a full feature film some day, but enjoys hacking Celtx for the fun of it."
NS1:character-ach_goal="The character's way to achieve his goal is to study the source code, understand rdf/xml better and then attempt to write and publish some extended features."
NS1:character-fam_back="Daniel is the only son in an intercontinental family."
NS1:character-habits="Dives into stuff 110% for a period of time. Then dives into something else. Zooms in and out of stuff quickly."
NS1:character-education="While a BSc in Mechanical Engineering, he's mostly self made when it comes to IT."
NS1:character-person="A nice guy."
NS1:character-likes="Watching good flicks, hunting and learning how stuff works."
NS1:character-dislikes="He dislikes the limited number of hours per day."
NS1:character-traits="My character traits are treating me well."
NS1:character-dist_feat="I'm so normal and have no distinguished features!"
NS1:character-weight="about 90 kg's, in a showroom mirror.">
<cx:media RDF:resource="http://celtx.com/res/WDOkyiQ3kwhM"/>
</cx:Cast>

In the Master Catalog we can add images/photos of the character.
The cx:media resource is thus ”WDOkyiQ3kwhM”

Further down in the project.rdf we find:

  <cx:Image RDF:about="http://celtx.com/res/gZc7yg59RFIg"
                   cx:localFile="protagonist.gif"
                   dc:title="protagonist.gif" />

Other files
The image file protagonist.gif is stored in the root of the zipped .celtx file, next to the rdf files.

How does Celtx know that the image is contained related to the character, e.g. how does Celtx know what scenes this character is in? (as shown in Master Catalog)?

Ah! It adds a separate tag for this in the project.rdf file:
<RDF:Seq RDF:about="http://celtx.com/res/WDOkyiQ3kwhM">
<RDF:li RDF:resource="http://celtx.com/res/gZc7yg59RFIg"/>
</RDF:Seq>

See! WDOkyiQ3kwhM is the resource ID in the cx:Cast for the character ”Daniel”, and it contains a reference to an element gZc7yg59RFIg, which in turn states it’s an image with the file name protagonist.gif!

Now we are getting at it. The project.rdf file is a sort of database, containing connections between different resources; be it scenes, characters and their meta data. We can start to work out a structured schema of how things are put together based upon these connecting ID’s.

Once we have a complete view of the schema, it’s easy to build things that need the meta data and structure, for instance export a custom report to Excel/LibreOffice/OpenOffice/Google Docs Sheets. If we know the XML structure of Final Draft, we can build an ”Export/Import Final Draft screenplay”. While this may be useful, my intention is to build something basic first. And I don’t have Final Draft to explore it’s structure. I’ll give this some more thought and try to come up with a useful ”Hello World” case eventually.

Under huven på Celtx

Jag har en förmåga att börja med att lyfta på huven istället för att använda ett program, ett operativsystem eller egentligen vilken produkt som helst. En hälsosam men riskfylld nyfikenhet. Det dröjde inte många minuter efter att jag installerat skribentprogrammet Celtx förrän jag bläddrade runt bland filer och läste på forumet hur det funkar: enkelt uttryckt är det uppbyggt kring en modifierad Firefox.

Celtx screenshot

Normalt brukar jag hålla mig till engelskt originalspråk i program, men nu var jag intresserad av vad olika filmtermer heter på svenska, exempelvis ”SHOT”, ”INTERCUT” med mera. Det finns ju översatt i Celtx. Trodde jag.

Den svenska översättningen i nuvarande v2.9.1 var tydligen inte uppdaterad sedan v2.7.0. Drygt 4-500 rader med strängar har tillkommit. Översättningsfilerna finns i installationsmappen/chrome/celtx.jar. Zippa upp celtx.jar och extrahera mapparna locale och content. I locale finns undermapparna sv-SE/ följt av celtx/ som i sin tur innehåller följande filer:

  • audio_tmpl.html
  • celtx.dtd
  • celtx.properties
  • comic.css
  • findreplace.dtd
  • spellcheck.dtd
  • tabbrowser.dtd
  • tabbrowser.properties
  • theatre_tmpl.html

Med hjälp av en riktig texteditor, exempelvis Notepad++ om man kör Windows, är det bara att och rocka loss på strängarna. Mer info om översättning i Celtx, dock något utdaterat, finns på Celtx wiki.

Det tog någon timme att gå igenom alla strängarna, sen skickade jag in mitt bidrag till Celtx och hoppas det håller klass nog att komma med i nästa version. Jag må vara en amatöröversättare, men de flesta strängarna är inte så komplicerade, exempelvis ”Spara till…” och andra vedertagna begrepp behöver man inte vara proffs för att fixa, bara man ser till att stava rätt och översätta i rätt kontext. Ett proffs behövs för att göra det snabbt, rätt OCH riktigt – det vill säga i rätt kontext.

Men nog om översättning. Det verkar som att man kan skriva tillägg (add-ons/extensions) till Celtx på samma sätt som till Firefox. Dags att ta reda på vad XUL egentligen innebär! Kanske går det att hacka in en öppen Jabberklient, eller integration mot Google Docs eller bara ett enkelt ftp-skript för offline backup – kanske rent av en enklare, öppen version av Celtx betaltjänst ”Studio”?

Eller så kanske jag ska vänta lite med det och skriva färdigt mitt första manuskript först, jag har bara cirka 60 sidor kvar…

What’s this?

Surfing around the interwebs, I keep stumbling upon a set of characters and numbers. I’ve seen mentioning of PS3, Geohot, jailbreak, but I don’t have the slightest clue of what this means. Really. Could anyone explain what this is?

erk: C0 CE FE 84 C2 27 F7 5B D0 7A 7E B8 46 50 9F 93 B2 38 E7 70 DA CB 9F F4 A3 88 F8 12 48 2B E2 1B
riv: 47 EE 74 54 E4 77 4C C9 B8 96 0C 7B 59 F4 C1 4D
pub: C2 D4 AA F3 19 35 50 19 AF 99 D4 4E 2B 58 CA 29 25 2C 89 12 3D 11 D6 21 8F 40 B1 38 CA B2 9B 71 01 F3 AE B7 2A 97 50 19
R: 80 6E 07 8F A1 52 97 90 CE 1A AE 02 BA DD 6F AA A6 AF 74 17
n: E1 3A 7E BC 3A CC EB 1C B5 6C C8 60 FC AB DB 6A 04 8C 55 E1
K: BA 90 55 91 68 61 B9 77 ED CB ED 92 00 50 92 F6 6C 7A 3D 8D
Da: C5 B2 BF A1 A4 13 DD 16 F2 6D 31 C0 F2 ED 47 20 DC FB 06 70

Nah, don’t bother ;-)