This afternoon I was working on a Markov chain project that would build n-grams from movie and tv show synopses and then generate “crossover” texts that combine the movies/tv shows. Most of the summary texts came from IMDb and I would simply have to remove the names of actors from within the texts. For example…

Nick Fury issues a state of emergency, telling his top agents Phil Coulson (Clark Gregg), Natasha Romanoff (Scarlett Johansson), and Maria Hill (Cobie Smulders), that they are completely out of options.

Removing these actor name is the first bit of regex: /\(.*?\)/

Include the white space before the first parenthesis like this: /\s\(.*?\)/

To build the Markov chain, I followed this Coding Train tutorial video. Here is an example of some output using summary texts of Star Wars, MCU films, Harry Potter, Frozen, Shrek, and Batman.

Luke returns to Queens to await another visions, and he is saved from Vader’s gunfire and doesn’t like hats because Snape killed him” (referring to a kiss she gave him in return Strange studies under the influence the next movie. Luke and the Tesseract, an energy source of a Jedi. Later, Obi-Wan explains that Gotham with her own life at stake, Anna rushes in front of them, grieving as Ginny comforts him with his best friends and Asgard’s forces. Spending time with Yoda. They fight guards on the night in the Darkhold also comes to Elsa’s curse. Anna, however, is captured for the Yellowjacket suit and unlock some advanced technology by using Vibranium comes from 1940. Escaping its collapse. Dried lava and brimstone are everywhere. In a stunning everyone into the minds of every person in the library guarded by a dozen inmates focus their parents and they concoct a plan to eliminate the agency’s enemies broken out of Arkham. He even gives Batman throws the bomb was molded from. Fox explains to Han that R2 is carrying the throne of Asgard, Odin, and with the halves of a broken, sharp pool stick and no choice but to run away, so he tracks down through a window. Donkey tells Shrek that Fiona doesn’t realise what’s been happening in his name. Tony is doing a display of his weapons manufacturing company, Stark Industries.

The text is fun and rambling, but it might be easier to read if it were separated into paragraphs. To do this, simply split the text into an array with the separator “. “ and then form paragraphs of 2-4 sentences. Right? There is an immediate problem. The code thinks that “Dr. “ is a complete sentence. Anagrams such as S.H.I.E.L.D. sometimes have similar issues.

Google searches turn up long lines of regex that seem to always fail when I test them at regex101.com. After a bit of trial and error, I end up using the following regex:

var myarray = result.match(/(((Mr|Ms|Mrs|Dr|Capt|Col)\.\s+[A-Z])|["’“A-Z]).*?((Mr|Ms|Mrs|Dr|Capt|Col)\.\s+[A-Z].*?)?[.?!]+["’”]?(\s(?=[A-Z"])|$)/g);

A sentence starts with either a title (Mr, Ms, Mrs, Dr, Capt, Col), a quotation mark, or a capital letter. A sentence might contain a title. A sentence ends with punctuation (period, question mark, or exclamation mark), possibly followed by a quotation mark, followed by a space, and then either a capital letter, quotation mark, or the end of the string. I didn’t bother including sentences that begin/end with numbers. Here is the final result using that regex…

Luke returns to Queens to await another visions, and he is saved from Vader's gunfire and doesn't like hats because Snape killed him" (referring to a kiss she gave him in return Strange studies under the influence the next movie. Luke and the Tesseract, an energy source of a Jedi. Later, Obi-Wan explains that Gotham with her own life at stake, Anna rushes in front of them, grieving as Ginny comforts him with his best friends and Asgard's forces.

Spending time with Yoda. They fight guards on the night in the Darkhold also comes to Elsa's curse. Anna, however, is captured for the Yellowjacket suit and unlock some advanced technology by using Vibranium comes from 1940. Escaping its collapse.

Dried lava and brimstone are everywhere. In a stunning everyone into the minds of every person in the library guarded by a dozen inmates focus their parents and they concoct a plan to eliminate the agency's enemies broken out of Arkham. He even gives Batman throws the bomb was molded from. Fox explains to Han that R2 is carrying the throne of Asgard, Odin, and with the halves of a broken, sharp pool stick and no choice but to run away, so he tracks down through a window.

Donkey tells Shrek that Fiona doesn't realise what's been happening in his name. Tony is doing a display of his weapons manufacturing company, Stark Industries.


This post is a 2016 presentation that I gave for a graduate class.

game-based learning title slide

Is there a difference between educational game-playing and gamification in education?

What experiences do you have with gaming in the classroom?

Educational Quiz Games

educational quiz games

Math

math games

Science

science games

Fitness

fitness games

Games4Change

games for change

  • PeaceMaker - Challenges players to establish peace in the Middle East.
  • Parable of the Polygons - shows how small individual biases can become large institutional biases
  • Papers, Please - Examine documents as an immigration officer to keep your dystopian country, Arstotzka, safe.
  • Darfur is Dying - Provides a window into the experience of refugees in Darfur.

Board / Card Games

board games and card games

  • Werewolf - (aka Mafia) to open discussion of the Salem witch trials, McCarthyism, and other witch hunts
  • Pandemic - (or the mobile game Plague, Inc) to illustrate how diseases travel interconnected networks of the world
  • Meltdown - save the polar bears before the ice melts
  • Heads Up - use Ellen’s party game to review a subject
  • Telestrations - Split a text into 1-2 sentence strips. Give a different strip to each student. You have 1 minute to sketch your sentence. Pass sketch to right. Write down or share your interpretation of their sketch.

Student-Created Games

student created games

Badging

quest badge Resources for creating badges…


Hello Jekyll

May 31, 2019

A “Hello, World!” program generally is a computer program that outputs or displays the message “Hello, World!”. Such a program is very simple in most programming languages, and is often used to illustrate the basic syntax of a programming language. It is often the first program written by people learning to code. B “Hello, World!” program is traditionally used to introduce novice programmers to a programming language. “Hello, world!” is also traditionally used in a sanity test to make sure that a computer language is correctly installed, and that the operator understands how to use it.

“Hello, world” program by Brian Kernighan (1978) While small test programs have existed since the development of programmable computers, the tradition of using the phrase “Hello, world!” as a test message was influenced by an example program in the seminal 1978 book The C Programming Language. Howdy there world welp, here we go one two three and a one two three. The example program in that book prints “hello, world”, and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial:[4]

main( ) {
        printf("hello, world\n");
}

The C language version was preceded by Kernighan’s own 1972 A Tutorial Introduction to the Language B,[5] where the first known version of the program is found in an example used to illustrate external variables:




RECENT POSTS