Skip to content

Instantly share code, notes, and snippets.

@bbotelho3
bbotelho3 / Convert a PDF file to black and white (not grayscale)
Last active March 11, 2021 12:37
Convert a PDF file to black and white (not grayscale)
# The first approach that I found was to convert using a virtual device using Ghostscript.
# The virtual device, pdfwrite, supports parameters to convert the original PDF file to another PDF file in grayscale.
# In my case, I wanted only black and white, so this was not enough.
#!/bin/bash
gs \
-sOutputFile=output.pdf \
-sDEVICE=pdfwrite \
-sColorConversionStrategy=Gray \
http://problemotd.com/problem/2-equals-1/
In the fifth step, both sides are divided by (a - b).
Since a = b, (a - b) is equal to 0, resulting in a 0/0 division.
0/0 is indetermined, therefore the fifth step is not valid.
# http://www.problemotd.com/problem/bit-counter/
(1..100).each {|n| puts n[1] == 1}
<html>
<body>
<script>
function alert_b() {
top.location="http://google.com.br";
}
window.fbAsyncInit = function() {
FB.init({