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
<?php | |
/* From https://www.usps.com/send/official-abbreviations.htm */ | |
$us_state_abbrevs_names = array( | |
'AL'=>'ALABAMA', | |
'AK'=>'ALASKA', | |
'AS'=>'AMERICAN SAMOA', | |
'AZ'=>'ARIZONA', | |
'AR'=>'ARKANSAS', |
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 os | |
import pickle | |
import warnings | |
import numpy as np | |
import pandas as pd | |
from sklearn.model_selection import train_test_split | |
from tensorflow.keras.callbacks import EarlyStopping | |
from tensorflow.keras.layers import Dense | |
from tensorflow.keras.layers import Dropout |
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
/* | |
* Copyright 2014 Julian Shen | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
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
Row | Season | No. in series | Company | Deal | Industry | Entrepreneur Gender | Amount | Equity | Valuation | Corcoran | Cuban | Greiner | Herjavec | John | O'Leary | Harrington | Guest | # Sharks | $ per shark | Details / Notes | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | 1 | 1 | Ava the Elephant | Yes | Healthcare | Female | $50,000 | 55% | $90,909 | 1 | 1 | $50,000 | |||||||||
3 | 1 | 1 | Mr. Tod's Pie Factory | Yes | Food and Beverage | Male | $460,000 | 50% | $920,000 | 1 | 1 | 2 | $230,000 | ||||||||
4 | 1 | 1 | Wispots | No | Business Services | Male | 0 | ||||||||||||||
5 | 1 | 1 | College Foxes Packing Boxes | No | Lifestyle / Home | Male | 0 | ||||||||||||||
6 | 1 | 1 | Ionic Ear | No | Uncertain / Other | Male | 0 | ||||||||||||||
7 | 1 | 2 | A Perfect Pear | Yes | Food and Beverage | Female | $500,000 | 50% | $1,000,000 | 1 | 1 | 2 | $250,000 | ||||||||
8 | 1 | 2 | Classroom Jams | Yes | Children / Education | Male | $250,000 | 10% | $2,500,000 | 1 | 1 | 1 | 1 | 1 | 5 | $50,000 | |||||
9 | 1 | 2 | Lifebelt | No | Consumer Products | Male | 0 |
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
/** | |
* Creates a 'ghost' bitmap version of the given source drawable (ideally a BitmapDrawable). | |
* In the ghost bitmap, the RGB values take on the values from the 'color' argument, while | |
* the alpha values are derived from the source's grayscaled RGB values. The effect is that | |
* you can see through darker parts of the source bitmap, while lighter parts show up as | |
* the given color. The 'invert' argument inverts the computation of alpha values, and looks | |
* best when the given color is a dark. | |
*/ | |
private Bitmap createGhostIcon(Drawable src, int color, boolean invert) { | |
int width = src.getIntrinsicWidth(); |
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
<?php | |
// http://developers.whatwg.org/sections.html | |
$def->addElement('section', 'Block', 'Flow', 'Common'); | |
$def->addElement('nav', 'Block', 'Flow', 'Common'); | |
$def->addElement('article', 'Block', 'Flow', 'Common'); | |
$def->addElement('aside', 'Block', 'Flow', 'Common'); | |
$def->addElement('header', 'Block', 'Flow', 'Common'); | |
$def->addElement('footer', 'Block', 'Flow', 'Common'); |
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
package com.example.d_rom.supportdesigndemo.widget; | |
import android.content.Context; | |
import android.content.res.ColorStateList; | |
import android.content.res.TypedArray; | |
import android.support.design.widget.TextInputLayout; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v4.view.ViewPropertyAnimatorListenerAdapter; | |
import android.support.v4.view.animation.FastOutSlowInInterpolator; | |
import android.text.TextUtils; |