Skip to content

Instantly share code, notes, and snippets.

View MichaelPaulukonis's full-sized avatar

Michael Paulukonis MichaelPaulukonis

View GitHub Profile
@MichaelPaulukonis
MichaelPaulukonis / How Sir Dinadan rescued a lady from Sir downlink direction 0000000.txt
Last active December 29, 2015 12:29
first results of noun-replacement. WEIRD WEIRD FLAWS. "Le Morte D'Arthur" with the nouns replaced by nouns from "Underground -- Hacking, madness and obsession on the electronic frontier." The nlp library (https://github.com/fortnightlabs/pos-js/) insists on interpreting every instance of "king" or "King" as a VBG (verb, gerund). AAAARGH. BEACUSE…

NLP transformation of text sample. source code

"King" and more nouns and proper nouns (singular and plural) are replaced. Replacement is better. The opening line shows that it is not perfect.

#NaNoGenMo

Third "major" variation -- if original noun started with a capital letter, replacement will start with a capital letter.

More punctuation removal - not perfected however. I've added some unit-tests, but even that's stubby.

Some of the punctuation removal to the detriment of the title -- "D'ARTHUR" is now un-replaced

Third "major" variation -- if original noun started with a capital letter, replacement will start with a capital letter.

More punctuation removal - not perfected however. I've added some unit-tests, but even that's stubby.

Some of the punctuation removal to the detriment of the title -- "D'ARTHUR" is now un-replaced

This contains 158797 words.

In the "chapter highlights", the standalone two-word lines correspond to "BOOK I" "BOOK II" etc. in the original.

@MichaelPaulukonis
MichaelPaulukonis / js2-indent-set.el
Last active January 2, 2016 11:59
Setting Emacs' js2-mode indent level on the fly. See refs @ http://www.xradiograph.com/JavaScript/Emacs
;;; do I even need to say how preliminary all of this is?
;;; in-progress variant to use universal-argument or param
(defun js2-cust-idnt (&optional indt)
"set indentation in this buffer"
(interactive)
;; TODO if no prefix-arg and no idnt, prompt for indent?
(let ((indent-level (if indt indt
current-prefix-arg)))
(setq js2-basic-offset indent-level)))
@MichaelPaulukonis
MichaelPaulukonis / gist:8301218
Created January 7, 2014 15:42
various bookmarklets
javascript:var%20loc='site:https://developer.mozilla.org/en-US/docs/Web/JavaScript';if('%s'){loc='https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fdeveloper.mozilla.org%2Fen-US%2Fdocs/+%s';}location.href=loc;
javascript:if('%s')%20location.href='https://duckduckgo.com/?q=%s+site%3Aemacswiki.org';else%20location.href='http://emacswiki.org/';
javascript:if(escape("%s"))%20location.href='http://stackoverflow.com/search?q='+escape("%s");else%20location.href='http://stackoverflow.com/';
// search netflic -- but now prompts for profile; possible to set?
javascript:{var%20loc="http://movies.netflix.com/";if(escape("%s")){var%20srch="%s".replace("%20","+");loc="http://movies.netflix.com/WiSearch?raw_query=SRCHTERM&ac_category_type=none&ac_rel_posn=-1&ac_abs_posn=-1&v1=SRCHTERM&search_submit=".replace(/SRCHTERM/g,srch)}location.href=loc}
javascript:if('%s')%20location.href='http://www.xradiograph.com/?q=%s&focus=on&action=search';else%20location.href='http://www.xradiograph.com/';
@MichaelPaulukonis
MichaelPaulukonis / r0t.pde
Last active August 29, 2015 13:56
Processing MOOC week 2
// https://class.coursera.org/compartsprocessing-001/human_grading/view/courses/972068/assessments/3/submissions
//
// In this assignment, you must produce an original sketch containing at least 20 distinct objects of at least 2 kinds of shapes.
// Each object must be unique, in shape (ellipse, rect, etc), or in color, or in size.
// Although shapes must be visible on your canvas, you may include objects which are partially out of view.
// Additionally, you must include a 2 sentence (minimum) description of your artistic intent/goal for your assignment.
// This sketch contains two areas painted with rectangles of technically
// identical colors and transparency, but diminishing size, such that
// subsequent applications build from a dark tint of the background, to a
@MichaelPaulukonis
MichaelPaulukonis / vasarely.dime.pde
Created February 19, 2014 04:32
dime-story vasarely (processing sketch)
// Inspired by Victor Vasarely*, I created a mechanistic color grid with inset squares or rectangles.
// The color palette was primarily built using a Complementary set of reds and greens,
// with a hand-picked blue and yellow for added vibrancy.
// The algorithm prohibits the horizontal repetition of a background color,
// and will not alow an inset-shape to be the same color as the background.
// * particularly by http://4.bp.blogspot.com/-JvA1kOVrVoQ/TbtLGxQ7fxI/AAAAAAAAAZU/n8wyXMlmDus/s1600/colour_vasarely5.jpg
// found, charmingly enough, at http://mrswagnersartideas.blogspot.com/2011/04/victor-vasarely.html
// two early palettes.
@MichaelPaulukonis
MichaelPaulukonis / restore.from.bak.sql
Last active August 29, 2015 13:56
semi-automated script to restore a SQL Server (2008/2012) database from a .bak file
-- Michael Paulukonis 2014
-- notes @ http://www.xradiograph.com/Programming/SQL
-- adapted from http://sqlanywhere.blogspot.com/2011/06/installing-sql-server-database-from-bak.html
-- ASSUMES the BAK file and dest db have the same names
-- step2 needs to pull the logical names out of the .bak file
-- original version scripted a DROP of existing table
-- I've removed it from here, in order to force a manual backup-vs-delete decision
@MichaelPaulukonis
MichaelPaulukonis / polychromatic.text.pde
Last active August 29, 2015 13:56
painting with text
/* Traditionally, text and image are segregated in Western Art.
This sketch plays with those boundaries, providing an polychromatic
text painting environment.
Mouse click and drag to paint (previous paints will fade slightly).
Color and size are based on mouse position.
Space to paint without fading previous actions.
RIGHT/LEFT to increase/decrease rotation of letters.
R to reset rotation to 0.
UP/DOWN to change paint mode.