Archive for 2020

Announcing Classic Computer Science Problems in Java

I am pleased to announce the availability of my fourth book, Classic Computer Science Problems in Java. You can now purchase early access to the book from Manning. Use promo code ccspkopec for 40% off. This is the third book in the Classic Computer Science Problems series, following Classic Computer Science Problems in Swift and Classic Computer Science Problems in Python. You can find out more about the series at classicproblems.com. The manuscript is complete but it is being rolled out in chunks for reader feedback over the summer. Hopefully, the final version will be in print by the end of the year.

The books are aimed at intermediate programmers who want to delve deeper into the covered problem solving techniques, brush up on core algorithms, or learn more Swift/Python/Java using problems familiar to them from other languages. They are suitable for professionals looking to deepen their understanding of the covered topics, students with some programming background looking to expand their computer science knowledge, and anyone preparing for coding interviews.

What is a “Classic Computer Science Problem?” It is a problem one typically finds in an undergraduate computer science curriculum. The topics covered in the books span the gamut from core computer science algorithms you would find in a data structures & algorithms class to artificial intelligence and its sub-discipline machine learning. There are both practical and whimsical problems. They include classic search problems, constraint satisfaction problems, graph algorithms, genetic algorithms, k-means clustering, simple neural networks, and more!

They’re meant to be approachable broad books, not deep books. They’re not textbooks. They’re hands on code-centric tutorials to pique your interest in the many topics covered.

All of the code in the most recent book is available on GitHub. The book takes advantage of features up to version 11 of the Java language. The code only uses the Java standard library throughout, so there’s no wrestling with third-party libraries. You will learn how to solve all of the problems in the book “from scratch” so that you gain a deeper understanding of how each problem solving technique works under-the-hood.

To learn more, checkout the Classic Computer Science Problems in Java page on Manning’s website where you will find a full table of contents and temporary free access to small portions of the book.

We decided to bring the book to Java (a language close to my heart because I first learned it as a teenager over 20 years ago and have worked professionally in it), because the Python version has been a huge success. It has sold many thousands of copies and has been translated into eight human languages in addition to the original English. The Swift version did only moderately well, so we are excited to bring the book to another mainstream language audience. We try to be careful to make sure each version uses best practices in its respective language, but I would love to hear your feedback about the Java version during the early access period for any ways we can improve on our use of the Java language.

Remember that you are purchasing a pre-release version of the book, so you will be joining me on the journey to its final release in the fall. You will be receiving rough drafts of chapters before they have been fully vetted. I encourage you to send me your feedback, but keep-in mind that these are early days and everything is not yet perfect. You will receive the final version of the book upon publication.

Posted in , , , , , |

Updating the Declaration of Independence

The Declaration of Independence is considered to be one of the most important documents in human history. Not only was it the seminal document in the political formation of the United States, it also was arguably the first time that a nation was expressly formulated with an understanding of the essential nature of human rights, despite not living up to it. It inspired many more rebellions against tyranny around the world in places as far removed as Vietnam and Haiti, and continues to inform our understanding of the relationship between a people and their government.

However, while its syntax is beautiful, it also no longer rings true to everyone who reads it. This is both because of our updated understanding of who political rights should be applied to (all human beings), and because not every reader is familiar with the assumptions and meanings inherent in the eighteenth century English of its writers. I don’t think we should literally update a historical document, but I do think it’s important to be clear about what the Declaration means to us today.

Here is the language in the Declaration’s most famous section:

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.–That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, –That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn, that mankind are more disposed to suffer, while evils are sufferable, than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, pursuing invariably the same Object evinces a design to reduce them under absolute Despotism, it is their right, it is their duty, to throw off such Government, and to provide new Guards for their future security.

Here is my interpretation of the Declaration’s most famous section in the simplest language that can represent what it means to me in today’s context, and no simpler:

We believe that all people should be treated equally under the law. There are universal human rights including, but not limited to, the rights to life, liberty, and the pursuit of happiness. Government exists to ensure these rights. Government’s only legitimate power comes from the people it governs. Governments that infringe on human rights or derive their power from a source other than the people, are illegitimate. It is the right and duty of people to replace such governments.

This is my personal interpretation of the Declaration. This is what it means to me today. And it’s how I will parse it for my children. Maybe I have some details wrong and I’ve changed some of its intent. But I think the spirit is right and I think the language will be very easy for them to understand and contextualize for the modern world.

Posted in , , , |

Building a Local Newsletter

One year ago, I launched BTV Daily, a daily email newsletter that delivers news, events, top social media posts, and other items of local interest to subscribers in the Burlington, Vermont area. The newsletter is largely automated, although I write a short daily blurb in a section called “Dave’s Corner.” BTV Daily is a hobby, but one that I take quite seriously because it provides real value to its subscribers. I know this because for the one-year launch anniversary this week, I put out a subscriber survey, and I was impressed to find how many people really appreciate the newsletter.

This post contains details about how I built BTV Daily and how I’ve grown it from 0 subscribers to (a still fairly meager) 296 subscribers (as of today). Keep in mind that Burlington, Vermont is a city of just 40,000 people. Also, keep in mind that the newsletter is not (yet?) monetized. In fact, it costs me money. This is a passion project, not a business.

Generating Content

To see what a copy of the newsletter looks like, you can checkout the archive section of the BTV Daily website. The sections in the newsletter are Weather, This Day in Vermont History, News, Events, Top Twitter Posts, Dave’s Corner, Latest SeeClickFix Issues, and Quote of the Day.

Technical Setup

BTV Daily is generated by a Python script that runs via a cron job on a Raspberry Pi in my home. At 7:45 AM each day, the Pi connects to GitHub to pull my latest blurb for Dave’s Corner. At 8 AM each day, the main script executes. It calls various APIs to generate BTV Daily’s content, which is amalgamated into an HTML file that is passed to MailChimp to deliver to our subscribers. I use no images in the newsletter to decrease load time and avoid being marked as spam. I do make extensive use of emoji instead. Unfortunately, I still get erroneously marked as spam by gmail’s spam filter for some users despite the fact that this is a subscribe-only newsletter (I don’t manually add any users).

Weather

The day’s weather information is generated using the Dark Sky API. An avid reader asked me to include sunset time in it, and I think that was a very nice addition. Apple has purchased Dark Sky, but their API will keep working through the end of 2021.

This Day in Vermont History

I added this section about halfway through the year after receiving permission from the Vermont Division for Historic Preservation to use their database (which they sent me as a Word document). This was, of course, very nice of them. I wrote a script to reformat the database into a Python dictionary.

News

When I first started BTV Daily, I used the RSS feed of The Burlington Free Press to generate the news content. However, much of the content from them is paywalled, and users complained. So, I moved to the Bing News API, which Microsoft provides a Python library for accessing. I carefully calibrated the local sources to request stories from, the keywords to use to get Burlington specific stories, and other settings. I also added the NY Times as a source, so that when Burlington is in the national news, relevant stories will come up. This did lead to some Bernie Sanders political stories making their way into the newsletter even though they were not really about Burlington (sometimes stories about him will mention his hometown of Burlington in passing).

Events

The newsletter links to Burlington area events from Seven Days, hopefully driving some traffic to this venerable publication.

Top Twitter Posts

I use the Twitter API to search for the top five tweets in the past 24 hours that have the most favorites that use hashtag #BTV or #BurlingtonVT. #BTV was unfortunately getting me tweets from non-Burlington sources, but I later discovered that the API has an option to limit searched tweets to a radius around a zip code. I use a 250 mile radius of Burlington and it works well.

Dave’s Corner

I write Dave’s Corner in a text file that is labeled by date in a format the script looks for. I can include HTML tags. I should probably put the work in to include markdown support. Occasionally, my wife will write a blurb and the section changes from Dave’s Corner to Rebecca’s Corner if the first line is “Rebecca.” My blurbs are usually observations about Burlington or my life.

SeeClickFix Issues

SeeClickFix is a tool for citizens to report local issues to municipal authorities. I have some concerns about the fact that people can be virtually anonymous on the site (they can act almost as a secret police). By exposing issues to the general populace through the newsletter, hopefully they are getting more scrupulous attention. I report the SeeClickFix issues of the last 24 hours via the SeeClickFix API. They are released under a non-commercial license. If I monetize the newsletter in the future, I suppose I may need to remove this section, or is it fair use?

Other APIs

I use the MailChimp API for actually sending the newsletter. I use the WikiQuotes API for generating a random local quote at the end of the newsletter. Unfortunately, the only non-political and non-controversial figures from Burlington on Wikiquotes are Ethan Allen and John Dewey. These quotes get pretty boring, pretty quickly.

Getting Subscribers

I got my first twenty subscribers through a Reddit post. I got another twenty or so subscribers by mentioning the newsletter on a Vermont email social network called Front Porch Forum. Several people in the one-year anniversary survey said I should post more about the newsletter on Front Porch Forum, but believe it or not the advertising rates on Front Porch Forum are exorbitant. And I don’t want to post regularly there without paying for advertising since that doesn’t feel right.

The rest of the ~300 subscribers have come through Bing ads, Facebook ads, Twitter ads, and word of mouth. I also tried a few physical advertisements on bulletin boards around the city. It ends up costing me about $1/subscriber when using Facebook/Twitter ads. I guess that’s my “customer acquisition cost.” Since this is a hobby project that I enjoy, I don’t mind that I’ve spent a few hundred dollars on it.

Keeping Subscribers

The vast majority of people who subscribe to BTV Daily stay subscribed. The numbers show that over the first year, about 80% of people who subscribe don’t unsubscribe. I try to be responsive to individual emails I get from subscribers. Several improvements to the newsletter have been a result of reader feedback. About 40–50% of subscribers open any given edition of the newsletter within 24 hours.

The vast majority of subscribers live in Burlington or one of the surrounding communities. Once in a while someone from out of state will accidentally subscribe and they will realize their mistake and unsubscribe. The most infuriating thing is when someone unsubscribes after being on the list for months and marks the reason to Mailchimp as “spam.” This happens rarely, but how can a newsletter that you personally signed up for and read for months be spam?

Looking Forward

I would like to add additional sections to BTV Daily. One section in particular that I am interested in adding is job postings in the Burlington area. I contacted Craigslist legal for permission two times, one year apart, and nobody got back to me. I applied to become an Indeed.com publisher almost a month ago and never heard back as well.

I would like to grow the newsletter to 1,000 subscribers (2.5% of the population of Burlington proper). I am thinking of showing a progress bar in the newsletter. Perhaps that would encourage subscribers to tell their friends. Or perhaps it would discourage them because they thought the newsletter had thousands of subscribers and it only has ~300.

If I reach the 1,000 subscriber goal, I may try to monetize the newsletter to at least cover its advertising costs by allowing people to place local ads. I would not be opposed to making a profit either! But it’s not my primary concern right now.

If you have questions or comments about the newsletter, feel free to reach out to me at newsletter at btvdaily dot com

Posted in , , , , , |

Book Review: Showstopper! The Breakneck Race to Create Windows NT and the Next Generation at Microsoft

I enjoy books about tech history and business. I also enjoy biographies. So, Showstopper!: The Breakneck Race to Create Windows NT and the Next Generation at Microsoft by G. Pascal Zachary was a perfect fit for me. It has a compelling software business narrative, backed up by significant author access to the major players, and features non-stop action throughout most of the book.

Showstopper, written in 1994, is a book about the building of Windows NT, one of the last still-in-use desktop operating systems to be developed from scratch (Windows NT remains the underpinnings of Windows 10). Zachary had incredible access. He was able to interview all of the major players involved in NT development, including David Cutler, the project’s lead, and Bill Gates, the CEO of Microsoft at the time. It provides real insight into the market landscape at the time, the challenges that Windows NT faced, and what is was like for regular software developers and management to laboriously crank out NT over many sleepless nights throughout a period of roughly four years.

Zachary does a good job balancing vignettes about management with vignettes covering lowly software developers, testers, and their families during development. He pays attention to the human story. What was the toll of the breakneck development schedule and the high pressure environment on families and worker mental health? He clearly did his research, took the time to interview everyone relevant that was involved, and weaved their respective narratives into a cohesive largely chronological whole.

Where Showstopper falls short is in Zachary’s understanding of the technology. While seemingly written for a mainstream audience, I imagine most readers today, like me, will be software developers. From the beginning it was clear to me that Zachary did not fully grasp all of the software development technology that a book like this inevitably needs to cover. Or if he did, he dumbed it down too much for my liking. He did his best, and I think if I were a mainstream reader, his explanations would actually be quite good: just enough to give me a basic understanding. But as a software developer, I was left wanting.

The parts of Showstopper I liked least were the first thirty pages, largely covering Cutler’s career at Digital, and the Afterword in the 2008 edition with Zachary pontificating about 2008 Microsoft. I think Showstopper was at its best when reporting on the week-by-week challenges and worker vignettes during NT development, and at its worst when trying to analyze the big picture. Another problem with the book is that it tries to cover too many characters. It was easy to lose track of who was who. You will be treated to many mini-biographies, which while interesting, are not enough to get you invested in each of the players.

Despite its flaws, Showstopper! is worth reading because it pulls back the covers of a Herculean software project in human terms. If you are interested in computer software history or the business history of Microsoft in the early 1990s, it’s a must read. Software developers with an appreciation of computer history will find it compelling and enthralling, if they make it past page thirty.

Posted in , , , , , , , , |

One Year of Classic Computer Science Problems in Python

Approximately one year ago today, my most recent book came out, Classic Computer Science Problems in Python. It is the second book in the Classic Computer Science Problems series. You can purchase it on Amazon or through the publisher’s website. It has been an amazing year for the book.

I had the good fortune to be on several podcasts to promote the book. I really appreciate all of the podcast hosts who gave me the honor of being on their show. It made a huge difference in sales. For example, my appearances on Talk Python to Me and Podcast Init alone accounted for approximately 1,000 sales according to the publisher. To see all of the podcasts I’ve been on, checkout the interviews section of classicproblems.com.

This has been the most successful book that I’ve written by an order of magnitude. It’s surpassed the sales of Dart for Absolute Beginners and Classic Computer Science Problems in Swift by a multiple of their combined sales. I appreciate all of the support from the community. I think Classic Computer Science Problems in Swift was a good book but the publisher was right in saying that it needed a larger language audience. Python not only has more users in absolute numbers, it also has more users in one of the major target demographics for the series, which is self-taught programmers who missed out on a computer science education.

I’ve done many things to promote the book, and I appreciate how my publisher, Manning, has advertised the book to their audience. However, more effective than anything have been the podcast episodes. I can’t tell you how many people have told me they learned about the book through a podcast episode. Podcast episodes have even led to translations. If I hadn’t appeared on the mostly Portuguese (but sometimes English) podcast Castalio, then perhaps the Portuguese edition would not have come out.

Amazingly, the book is now on target to be translated into seven languages, including: Russian, Polish, German, Traditional Chinese, Japanese, Korean, and Portuguese. Interestingly, the only translation publisher that has been in regular contact with me has been O’Reilly Japan. I think they did a really nice job on their edition, and I thank them for their attention to detail. It’s interesting to see how the book’s teaching style (informal in terms of theory/math, to the point, and code heavy) appeals to some cultures and not to others. Anecdotally, my worst review has been for the Russian edition, and some of my best reviews have been out of Germany for the English edition. Of course I can’t tell you if the Russian translation is good or not, since I don’t speak Russian.

By far the most controversial decision I made about the book was to use type hints/type annotations throughout. This decision alone led to some of the worst reviews of the book. Would I do it again? It’s impossible to say how many people bought the book because it was one of the first Python books to use type hints throughout. I do think the type hints add value in terms of readability once you get used to them, but I can definitely see how the effect of turning some people off, makes any benefits not worth it. And of course I agree that the way Python does type hints is still too verbose.

Looking forward, one nice thing about the Python book versus the Swift book is how much more stable a language Python is. I wrote both books according to the latest versions of their languages respectively. However, by the time the Swift book came out (it took 6 months to go from done to store shelves) it was already a little outdated due to the fast pace of change in the Swift language. Python on the other hand, has a much longer shelf life and greater backwards compatibility between versions.

Finally, I am currently writing the third book in the series, Classic Computer Science Problems in Java. I look forward to it being released later this year, so look out for it if you are a Java aficionado. To decide what language to do next, we did a poll of Manning readers that had 300 votes. Java practically tied with Go. The idea of going with Java is that this book did well in a large language community (Python) and only okay in an emerging language community (Swift). Writing a book in Java feels like going back to my roots since Java was one of the first “real” languages that I learned in the late ’90s. I have done some professional projects in Java as well, so rest assured that I’m competent to write it!

I’d like to thank all of the readers who have purchased the book. I’d like to thank anyone who’s shared their constructive feedback. And, I’d like to thank the team at Manning. If you are a reader and you like the book, please do leave a review on Amazon or your place of choice.

Also, it goes without saying, but please stay home during the coronavirus crisis if you can. Stay safe!

Posted in , , , , |
Copyright 2012-2020 David Kopec. Powered by Blogger.

Search

Swedish Greys - a WordPress theme from Nordic Themepark. Converted by LiteThemes.com.