If you, like me, resent every dollar spent on commercial PDF tools,
you might want to know how to change the text content of a PDF without
having to pay for Adobe Acrobat or another PDF tool. I didn't see an
obvious open-source tool that lets you dig into PDF internals, but I
did discover a few useful facts about how PDFs are structured that
I think may prove useful to others (or myself) in the future. They
are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.
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
album albums | |
application applications | |
area areas | |
car cars | |
college colleges | |
council councils | |
customer customers | |
day days | |
death deaths | |
department departments |
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
FROM senderle/pystgis:django-base | |
# Requirements are installed here to ensure they will be cached. | |
COPY ./requirements /requirements | |
RUN pip install -r /requirements/local.txt | |
COPY ./compose/production/django/entrypoint /entrypoint | |
RUN sed -i 's/\r$//g' /entrypoint | |
RUN chmod +x /entrypoint |
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
{"nodes":[{"name":"Python"}, | |
{"name":"JavaScript"}, | |
{"name":"PHP"}, | |
{"name":"Django"}, | |
{"name":"Omeka"}, | |
{"name":"Dev 1"}, | |
{"name":"Dev 2"}], | |
"links":[{"source":3,"target":0,"value":60}, | |
{"source":3,"target":1,"value":40}, | |
{"source":4,"target":2,"value":80}, |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
fig = plt.figure(figsize=(21, 18)) | |
ax = fig.add_subplot(111, projection='3d') | |
u_c = np.linspace(0, np.pi / 2, 100) | |
v_c = np.linspace(0, np.pi / 2, 100) | |
x_c = 1 * np.outer(np.cos(u_c), |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
fig = plt.figure(figsize=(21, 18)) | |
ax = fig.add_subplot(111, projection='3d') | |
u_c = np.linspace(0, np.pi / 2, 100) | |
v_c = np.linspace(0, np.pi / 2, 100) | |
x_c = 1 * np.outer(np.cos(u_c), |
Open-source text corpora from the Perseus Project.
English translations of Plato (from above).
Download page for AntConc.
Quickstart guide for the Topic Modeling Tool.
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
An Athenian Stranger Clinias of Crete Megillus of Lacedaemon | |
Athenian To whom do you ascribe the authorship of your legal arrangements, Strangers? To a god or to some man? Clinias To a god, Stranger, most rightfully to a god. We Cretans call Zeus our lawgiver; while in Lacedaemon , where our friend here has his home, I believe they claim Apollo as theirs. Is not that so, Megillus? Megillus Yes. Athenian Do you then, like Homer, Cp. Hom. Od. 19.178 . say that | |
Minos used to go every ninth year to hold converse with his father Zeus, and that he was guided by his divine oracles in laying down the laws for your cities? Clinias So our people say. And they say also that his brother Rhadamanthys,—no doubt you have heard the name,—was exceedingly just. And certainly we Cretans | |
would maintain that he won this title owing to his righteous administration of justice in those days. Athenian Yes, his renown is indeed glorious and well befitting a son of Zeus. And, since you and our friend Megillus were bo |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from collections import Sequence, Mapping | |
from sys import getsizeof | |
def traverse(obj): | |
if isinstance(obj, basestring): | |
yield obj | |
elif isinstance(obj, Sequence): | |
yield obj | |
for o in obj: | |
for inner_o in traverse(o): |
NewerOlder