Hairy Sun

Matt's Blog on Some Geeky Topics

I Would Like Sphinx PDF Generation to Support the LaTeX Memoir Package

I would really like to use the same toolset for publishing POD (Print On Demand) books that I use for ebooks. Yet the pdf generation abilities of both docutils and Sphinx seem more focused on pdf “ebooks”—pdf’s that you would read from a computer—not pdf’s that are approriate to create physical books from. I think the solution is to add support for the LaTeX “memoir” package to Sphinx. I’ll eventually get around to it, but it is not on the top of my stack. To that end I’ll pay up to $200 (paypal or Amazon gift) to get that support.

For those not familiar with memoir, here’s a snippet of the README:

Memoir is a flexible class for typesetting poetry, fiction, non-fiction and mathematical works as books, reports, articles or manuscripts. Documents can use 9pt, 10pt, 11pt, 12pt, 14pt, or 17pt as the normal fontsize and, if you have scalable fonts, 20pt, 25pt, 30pt, 36pt, 48pt, or 60pt sizes, or even larger. Many methods are provided to let you create your particular design. The class incorporates over 30 of the more popular packages.

Here are the details. The first person who notifies me of two github repos that meet the following points will get $100:

  • A github repo containing a Sphinx project that renders out to pdf using the memoir package. The document must have an example of:
    • Half Title Page
    • Title Page
    • Copyright Page (on verso page)
    • Dedication
    • Table of Contents
    • Introduction
    • Chapters (should start on right page)
    • An index
    • blank pages at the end
    • Customizing page size
    • The chapers should have an example of:
      • Text spanning multiple pages (lorem ipsum is fine)
      • Normal text
      • Italicized text
      • bold text
      • monospace text
      • Sections
      • footnotes
      • a code block
      • an admonition
      • a long admonition that is longer than a page
      • an admonition with a code block inside of it
      • a figure
      • a table
  • A github repo containing a fork of Sphinx that has memoir support. When using this fork with the above project, a suitable pdf should fall out. Numbering of chapters is correct, page numbering is correct (odd on right side), index is correct, etc.

Ideally most of the book (Table of Contents through Index) would be pure rst (or sphinx rst++). I’m ok with raw directives on the front matter.

If you are familiar with LaTeX and Sphinx, this should be pretty straightforward. It would also be a great project for someone interesting in learning those technologies.

The person who can deliver the above will make me quite happy. But, as I said, I would pay up to $200. The remaining $100 will be appropriated to the developer (or someone else) who sees that this gets pushed upstream into Sphinx proper (ie when I see a bitbucket commit with the changes on the Sphinx project). So the person who files the bug, patch and follows through with any needed tweaks to get this into mainline will get that money. I reserve the right to split up this portion among people as well.

(I apologize in advance for the github requirement, I prefer that system, so the first deliverable needs to be there. Given that Sphinx prefers bitbucket, you need to play well with them for the second deliverable.)

Coding Is a Life Skill That Should Be Taught in Elementary School

As a seventh grader I had the choice between learning French and Spanish. I choose Spanish because it was practical (or at least my parents convinced me of that), while it seemed that all the cool kids took French. Excuse my French but I think my parents were right—taking French expecting to actually use it (or have a reason to use it) would be a waste of time. (Sorry to the 2% of my blog visitors to whom that hits home). In fact the same could be said of the two years I took Spanish. I remembered only the colors and my Spanish name, “Paco”.

But taking Spanish for two years twisted my brain enough that I actually took a year of German after (again useless if I were expecting to use it to purchase say a Mercedes). And it was easier this time. When I did become fluent in Spanish three years later, I was grateful that I had learned how to conjugate verbs previously. My uptake was quicker because I had practice. In two months I was dropped off in the middle of Colombia and held my ground ok. (Later my Spanish professor would inform me that speaking in Spanish is insulting in Gringolandia, and I don’t pull it out too much now. So it was useless.)

Likewise, the Pascal class I took in High School wasn’t super practical. I didn’t even have a machine at home to code Pascal on. I haven’t coded in Pascal since. Yet the logical manner it taught me to think has been a wonderful life skill. It has even helped me to debug plumbing issues. When a the faucet is clogged, I could just disconnect the pipes connecting the faucet to the wall and start snaking around in the wall. But (given that I have girls around with long hair) it makes sense to start right at the faucet itself and snaking that without even disconnecting any pipes. Less mess, and more time for other less grimey things.

(Alas learning more about plumbing has helped in other areas as well, such as knowing how to replace a toilet, or stop a leak. It’s probably a decent life skill to have if you are a homeowner or live in a place with running water.)

The section I took on Lisp in college was not super practical either. Even then no one programmed in Lisp. Why did I waste that time? Because I have experienced functional constructs, I now appreciate them and see their utility (and even the allure of Clojure). I appreciate list comprehensions, first class functions and the laziness of generators. (If you have read this far in the post you’ll notice that I also like parentheticals.)

I had the chance to teach ~80 year old man how to program. He wanted to learn just for the sake of understanding what the little creatures inside of his computer were doing. Waste of time?

I’ve taught 3rd graders how to create ebooks. That was really an excuse to teach them xml, html, css, typography, fibonacci sequences, image compression, debugging and actually learning how to use a computer for something other than clicking the blue “e” and typing in starfall.com. I neglected to inform them that they could have just as easily written their books in Word and exported to HTML. I don’t feel guilty about that. (Some even wrote thank you cards in both HTML and the rendered output!)

I have also been able to teach 3rd graders programming. They were able to create simple text games with conditionals, functions and looping constructs. Did they create the next 3D shooter? Did they even create a game that they’d like to play more than once? Mostly not. But they learned a little bit about how computers work. They also learned how to think logically, and how to be specific. (My wife compiler still complains that my English isn’t specific enough—too many “this” and “that”s at line 0. To which her compiler responds “I have no idea what you are talking about!”)

Today, the world still runs on Excel. A poor man’s database or programming environment. Just today a co-worker asked to help move some data from Excel to a program so more advanced calculations could be performed on the data. There was also an urgency to get rid of the manual labor of tweaking rows and columns. The end user wanted automation and power. (And to be lazy).

If you have any inclination of working with programmers you should take CS101. You need to have some semblance of understanding of what they need and what you need to help them. Do you feel like a doofus when a car repair person is telling you what you need done to your car? Do you want to get ripped off by the plumber telling you the twenty things he needs to fix?

How often am I burdened by my (loving) family and neighbors, who knowing that I “work with computers” think that that means I can clean the spyware off their XP installation! I imagine that I would not play that beast of burden if others had some understanding of how computers and the internet actually worked.

Surely a little understanding of what powers the digital aspects of our lives can’t be too harmful.

Indy Python Workshop and UTOS Conference

Today and tomorrow the Indianapolis Python Workshop is running. From the website, “The Indianapolis Python Workshop for women and their friends is a free, hands-on, beginners’ introduction to computer programming.” This event was inspired by a similar event in Boston.

I love this local effort to empower others by teaching Python. To show my support for the event, I’m running a promo on my Treading on Python. It will be discounted to $0 during the event as supplementary material.

For people local to the Rockies, the Utah Open Source Conference is coming up next month. In addition to many awesome talks, I’ll be giving 2 three hour workshops on Beginning and Intermediate Python. Though not free, the low cost of the event is a great deal considering the quality and quantity of the presentations.

KDP Select for Technical Non-fiction Books Month 2

This post describes my efforts at using Amazon KDP select to sell technical non-fiction books. After some success in my efforts last month (reaching the top of my sub niche), I can report that I fell back a few spots but for the most part sales have been steady. As can been seen in my Amazon sales chart, the rank for my Treading on Python book have been semi flat for the past month. Sales of my Decorator Book have been similarly flat. They have been hovering in rank 8-15 which is pretty good considering the other books are the standard Python recommended books or a textbook. Apparently self published books can do ok, considering my books and that number 1 or 2 is usually Al Sweigart’s Invent Your Own Computer Games With Python.

What has happened in the past month?

During PyCon I ran a promotion on Treading on Python. The Rasberry Pi folks picked it up (probably due to Steve Holden’s tweet) and I actually had more sales in the UK that in the US that day. (Odd considering that US is around 8-10X sales of UK in my experience.) Given that sales have been relatively flat, I’m wondering if I have peaked. Perhaps I have. Though I struggle with efforts to promotion. It seems I’m labelled as a troll if I try to post anything to reddit programming or hacker news related to my book. Which I find a little odd, because others seem to do so with ease. I can promote through Python channels, which for my more advanced books seems to work, but Treading on Python is aimed at people wanting to learn Python, so promoting through Python channels seems a little less effective there.

I’m still going to be running a few more promotions for my books. They seemed to have been effective.

Another challenge has been getting reviews. I think every author struggles with that. (And reviewing is long tail behavior).

In the meantime I’ve also silently pushed out my next guide, Guide to: Learning Iteration and Generators in Python. This book is not in KDP Select. I’ll probably put a bundle back up on my site and perhaps BN or Kobo. If you are interested in a review copy let me know.

To close off this post. I think technical self publishing can be “successful”. I’m not sure that you will retire like fiction writers who hit the jackpot. But I’m pretty sure that with Amazon’s 70% (or more if I sell myself), I’m getting almost as much money as people selling their books for $20-$40 (most of the rest of the people in the Python top 20 list).

PyCon 2012 Review

Here’s just a few notes from my PyCon 2012 experience. This was my 7th PyCon, and though the conference has changed over the years, I think it is mostly for the better. A general theme of PyCon this year was data analysis. I’m probably biased since I’m doing that at work. In contrast with previous years, where there seemed to be two Django tracks running concurrently.

The quality of the talks has also increased over the years. Most of the talks I attended appeared to be well rehearsed and pretty well thought out. Though I did hear some grumbling that many talks could have gone a little deeper.

The quality of the food was excellent this year. The quantity less so. I heard one attendee claim he “lost 5 pounds during the conference”. But herding 2200+ people through the lunch line is no small task and the team did it with efficiency and ease.

The layout of the conference was a little confusing. There was a double indirection between talk locations and the actual locations. Talks were located in a track. A track was located in (what appeared to be an arbitrary) room number. Said room number did not line up with the pre-existing hardcoded conference room numbers and in some cases conflicted. This caused confusion on the first days of both tutorials and sessions. With 2200+ people confusion of such type can be annoying.

Also the layout of Open Spaces, and the open space signup board was relegated to a far side of the building that didn’t get much traffic. The two BoFs I hosted were poorly attended. Perhaps that is due to marketing or the subject in general (yes, Python tiling wm’s are boring), but there was very small traffic through the open space, with the exception of the TiP BoF. This BoF was probably larger than the first PyCon I attended.

Previous years also had a job board. I told a friend that I would post a job listing for them. But alas, I never saw the job board this year. The exhibition hall was perhaps a huge t-shirt dispensing machine, but no corkboard to post a description on. If you are interested in changing the world working at a non-profit, ck12.org is looking to hire.

The PyCon 5k was a excellent respite from days of sitting and breathing regurgitated air. The amount of minimalist and even barefoot shoes relative to the general population leads me to believe that pythonistas are geeky, enlightened or suffer from Stockholm Syndrome. I really enjoyed it. During my final tutorial an attendee pulled out an ultimate disc. It was great to get outside in the wonderful weather and toss the disc around.

Facebook

My tutorials were packed. My biggest issue was the influx of people 25 minutes into the first session. Being that it was beginning Python, that caused a small delay as I helped people get going. It is pretty satisfying to walk around during the assignment portion helping people out and realizing that 95% of the people are busy hacking away. They weren’t just browsing Facebook or reading email, they were actively learning Python. One attendee told me it was the best tutorial he had ever attended, which is nice to hear. I also recieved some more constructive criticism from others. I’m always open to feedback, and if you attended one of my sessions you should fill out the tutorial survey.

Yes, Python videos are now up on the web. Some of the content is there. But the conference is more that the videos. I was talking to someone who was relating that they had an issue with translation while they were travelling in Siberia. They did a lazy twitter and got a response. While we were talking about this a fellow entered the conversation who was from Russia. Lo and behold he was the lazy web helper, but the two had NEVER previously met in real life before.

So yes, PyCon is about the people. And even though there were a lot this year, it was a great conference.

Not at PyCon? Learn Python Anyway

PyCon starts today. It’s great to be back in what used to be my backyard for PyCon. I love the Bay Area. To celebrate I’m doing an Amazon KDP Select Promotion on my Treading on Python book. During an Amazon “promotion”, the price is reduced to $0.00 for the day!

This book is aimed at getting programmers quickly bootstrapped on Python and should correspond quite well with my Beginning Hands-On Tutorial (go figure). Now I’m off to register and teach for the day.

If you are more of the handout/cheatsheet type, you might enjoy the handout for the tutorial.

Feedback as always is welcome. If you are at PyCon say hi. Cheers.