Created
April 21, 2011 18:07
-
-
Save gf3/935138 to your computer and use it in GitHub Desktop.
Exam Study Progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require( 'fs' ) | |
, Levenshtein = require( 'levenshtein' ) // npm install levenshtein | |
, arg = process.argv.slice( 2, process.argv.length ).join( ' ' ) | |
String.prototype.contains = function contains( substr ) { | |
return this.indexOf( substr ) >= 0 | |
} | |
fs.readFile( 'Exam Study Terms.txt', function (err, data) { var terms, amount, match | |
if (err) | |
throw err | |
terms = data.toString( 'utf8' ).split( "\n" ) | |
terms.pop() | |
if ( arg ) { | |
if ( /^\d/.test( arg ) ) { | |
if ( arg.contains( '/' ) ) | |
amount = terms.length * ( ( arg.match( /^(\d)/ )[1] + '.0' ) / ( arg.match( /(\d)$/ )[1] + '.0' ) ) | |
else if ( arg.contains( '%' ) ) | |
amount = terms.length * ( '0.' + arg.replace( /[^\d]/, '' ) ) | |
else | |
amount = parseInt( arg, 10 ) | |
amount = Math.round( amount ) | |
console.log( amount + ' terms of ' + terms.length ) | |
console.log( terms.slice( 0, amount ) ) | |
} | |
else { | |
match = terms.reduce( function( prev, current, idx, ar ) { | |
var l = new Levenshtein( arg.toLowerCase(), current.toLowerCase() ) | |
return l < prev.distance | |
? { word: current, distance: l.distance } | |
: prev | |
}, { word: '', distance: Infinity }) | |
console.log( 'Term ' + ( terms.indexOf( match.word ) + 1 ) + ' of ' + terms.length ) | |
console.log( Math.round( terms.indexOf( match.word ) / terms.length * 100 ) + '% finished' ) | |
console.log( match.word ) | |
} | |
} | |
else { | |
console.log( terms.length + ' terms' ) | |
console.log( terms ) | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tenets of science: measurability, falsifiability, and repeatability | |
Advertising and lack/desire | |
Advertising as an imagined future | |
Analogue/Digital | |
Appadurai, Arjun | |
Baudrillard, Jean | |
Beaubourg | |
Benjamin, Walter | |
Bilal, Wafaa | |
Brand, Stewart | |
Broadcast | |
Commodity fetishism | |
Commodity self | |
Consumer culture | |
Copyright | |
Cosmopolitanism | |
Cultural imperialism | |
Culture industry | |
Cyborg | |
da Vinci, Leonardo | |
Debord, Guy | |
Deterritorialization | |
Diaspora | |
Dominguez, Ricardo/Transborder Immigrant Tool | |
Duchamp, Marcel (L.H.O.O.Q) | |
Empiricism | |
Ethnoscape | |
Felt evidence | |
Flaneur | |
Foucault | |
Frankfurt school | |
Habermas, Jurgen | |
Haraway, Donna | |
Hybridity | |
Hyperreality | |
Ideology | |
Ideoscape | |
Intertextuality | |
Koons, Jeff | |
Lee, Nicki S. | |
Linnaeus, Carl | |
Marked/Unmarked | |
Marx, Karl | |
Masses | |
McLuhan, Marshall | |
Media convergence | |
Mediascape | |
Medium | |
Metanarrative/Master narrative | |
Modernism | |
Modernity | |
Narrowcast | |
Noeme | |
Orientalism | |
Outsourcing | |
Phenomenology | |
Positivism | |
Postcolonial theory | |
Postmodern | |
Postmodernism | |
Postmodernity | |
Public | |
Public Sphere | |
Reflexivity | |
Reification | |
Reproduction | |
Said, Edward | |
Sherman, Cindy | |
Simulation | |
Spectacle | |
Technoscape | |
The Work of Art in the Age of Mechanical Reproduction | |
Therapeutic ethos | |
Trademark | |
Transnationalism | |
Ultrasound | |
Wall, Jeff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> node est.js frkfrt schl | |
Term 31 of 77 | |
39% finished | |
Frankfurt school | |
> node est.js 1% | |
8 terms of 77 | |
[ '3 tenets of science: measurability, falsifiability, and repeatability', | |
'Advertising and lack/desire', | |
'Advertising as an imagined future', | |
'Analogue/Digital', | |
'Appadurai, Arjun', | |
'Baudrillard, Jean', | |
'Beaubourg', | |
'Benjamin, Walter' ] | |
> node est.js 1/9 | |
9 terms of 77 | |
[ '3 tenets of science: measurability, falsifiability, and repeatability', | |
'Advertising and lack/desire', | |
'Advertising as an imagined future', | |
'Analogue/Digital', | |
'Appadurai, Arjun', | |
'Baudrillard, Jean', | |
'Beaubourg', | |
'Benjamin, Walter', | |
'Bilal, Wafaa' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment