Learn C The Hard Way [PDF] 06-28-2015, 09:21 PM
#1
Recently, with the help of @phyrrus9, I managed to finally give some old hardware some life by installing Arch. Since I can't really be asked finding and installing the right GPU driver from the AUR, I've kept it as-is: without a GUI. Now, I wanted to use it to learn C and brush up on some other shit, and as CLI browsers aren't the best, I took some time to compile this amazing book into a printable PDF file. I'll append code snippets etc at the end.
Download Link: http://bit.ly/learncthehardway
(I used bitly simply for analytical purposes.)
And then I compiled the resulting files into one using Adobe Acrobat.
Download Link: http://bit.ly/learncthehardway
(I used bitly simply for analytical purposes.)
Spoiler: How It Was Done
Code:
links = []
import pprint
for x in range(53):
link = 'http://c.learncodethehardway.org/book/ex' + str(x) + '.html'
links.append(link.strip())
pprint.pprint(links)Code:
import pdfcrowd
pages = ['http://c.learncodethehardway.org/book/preface.html',
'http://c.learncodethehardway.org/book/introduction.html',
'http://c.learncodethehardway.org/book/ex0.html',
'http://c.learncodethehardway.org/book/ex1.html',
'http://c.learncodethehardway.org/book/ex2.html',
'http://c.learncodethehardway.org/book/ex3.html',
'http://c.learncodethehardway.org/book/ex4.html',
'http://c.learncodethehardway.org/book/ex5.html',
'http://c.learncodethehardway.org/book/ex6.html',
'http://c.learncodethehardway.org/book/ex7.html',
'http://c.learncodethehardway.org/book/ex8.html',
'http://c.learncodethehardway.org/book/ex9.html',
'http://c.learncodethehardway.org/book/ex10.html',
'http://c.learncodethehardway.org/book/ex11.html',
'http://c.learncodethehardway.org/book/ex12.html',
'http://c.learncodethehardway.org/book/ex13.html',
'http://c.learncodethehardway.org/book/ex14.html',
'http://c.learncodethehardway.org/book/ex15.html',
'http://c.learncodethehardway.org/book/ex16.html',
'http://c.learncodethehardway.org/book/ex17.html',
'http://c.learncodethehardway.org/book/ex18.html',
'http://c.learncodethehardway.org/book/ex19.html',
'http://c.learncodethehardway.org/book/ex20.html',
'http://c.learncodethehardway.org/book/ex21.html',
'http://c.learncodethehardway.org/book/ex22.html',
'http://c.learncodethehardway.org/book/ex23.html',
'http://c.learncodethehardway.org/book/ex24.html',
'http://c.learncodethehardway.org/book/ex25.html',
'http://c.learncodethehardway.org/book/ex26.html',
'http://c.learncodethehardway.org/book/ex27.html',
'http://c.learncodethehardway.org/book/ex28.html',
'http://c.learncodethehardway.org/book/ex29.html',
'http://c.learncodethehardway.org/book/ex30.html',
'http://c.learncodethehardway.org/book/ex31.html',
'http://c.learncodethehardway.org/book/ex32.html',
'http://c.learncodethehardway.org/book/ex33.html',
'http://c.learncodethehardway.org/book/ex34.html',
'http://c.learncodethehardway.org/book/ex35.html',
'http://c.learncodethehardway.org/book/ex36.html',
'http://c.learncodethehardway.org/book/ex37.html',
'http://c.learncodethehardway.org/book/ex38.html',
'http://c.learncodethehardway.org/book/ex39.html',
'http://c.learncodethehardway.org/book/ex40.html',
'http://c.learncodethehardway.org/book/ex41.html',
'http://c.learncodethehardway.org/book/ex42.html',
'http://c.learncodethehardway.org/book/ex43.html',
'http://c.learncodethehardway.org/book/ex44.html',
'http://c.learncodethehardway.org/book/ex45.html',
'http://c.learncodethehardway.org/book/ex46.html',
'http://c.learncodethehardway.org/book/ex47.html',
'http://c.learncodethehardway.org/book/ex48.html',
'http://c.learncodethehardway.org/book/ex49.html',
'http://c.learncodethehardway.org/book/ex50.html',
'http://c.learncodethehardway.org/book/ex51.html',
'http://c.learncodethehardway.org/book/ex52.html',
'http://c.learncodethehardway.org/book/krcritique.html']
try:
#get login by registering here: https://pdfcrowd.com/
#yeah there's probs a better way of doing it but meh
client = pdfcrowd.Client("username", "apikey")
for page in pages:
title = page.split('/book/')[1].split('.')[0]
client.convertURI(page, open(title + '.pdf', 'wb'))
except pdfcrowd.Error, why:
print 'Failed:', whyAnd then I compiled the resulting files into one using Adobe Acrobat.














![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)






