Building your own computer language

Just code it

If you wanted to build your own computer language, but didn’t know how to start or thought you didn’t have time and skills to do this, then look no harder then the Crafting Interpreters book by Bob Nystrom on building a computer language from scratch. That’s it from the very beginning to the full fledged object oriented stuff.

Where do I find it?

Just visit this web page where Bob has a free of charge web book, still in the process of writing, were you can start to build you own language. You can call it BestLangEver or even something like Jabba, etc. The book is very detailed and explains thing in a clear and easy to understand manner. Thanks to the book I was able to understand how a Mark-and-Sweep garbage collector works and can be quite easily implemented. Bob has done a great work of bringing the art of language design to the masses.

What are you waiting for?

Start reading.

 

Read as if you edit. Editing Imbalanced Classification with Python

Reading can be hard, but rewarding

I like to read books. They provide me with the opportunity to discover new worlds and learn new things. Unlike other sources, e.g. YouTube tutorials, which I find a little bit distracting, books don’t seduce you to click on them, instead they lay on a flat surface and don’t care. In addition, it’s quite hard to jump from a book to a book in haphazard way reading them in parallel physically. But when you find an interesting book, say a novel, it can draw you attention and hold you captive until you finish reading it. And there are books that are interesting and at the same time require from a reader a certain amount of concentration and work that needs to be done to get the most out of reading a book.

I call such a reading a workout. It’s similar to physical exercises, that can be unpleasant at times, but it has a reward of deeper understanding and grasp of concepts. It also resembles editing a book, call it testing, even alpha testing if you have a software background. By reading a book, as if you edit it, and as such need to pay attention to details and working on it from A to Z, you are bound to better understand the information that the book tries to convey. 

Read as if you edit

With the recent wave of high interest in Machine and Deep Learning there are a lot of books published on the subject to satisfy hungry readers. The books are ranging from popular explanations for a general audience to technical books, that teach readers how to apply Machine Learning to day to day practical applications. Machine Learning Mastery web site provides a number of such books, that are written with a hands on experience first approach. This makes the books perfect candidates for the Read as if you edit approach, since it is the best way to get actual practical experience in Machine Learning by actually applying examples from each chapter in these books. For readers, who aren’t familiar with Machine Learning Mastery books, all of them (books) are structured  in a similar way, where each chapter has just enough theory to get you started using practical code samples.

It is possible to only read through the books, without running a single code sample having a feeling of understanding how things work and being happy with yourself. The issue is, this approach brings almost zero value and provides you with no real experience. Instead, think of yourself as an editor or a tester, who was tasked with finding mistakes, omissions, unclear explanations or wrong code samples. Doing this will help you get the most out of  the book since it forces you to actually run the code, play with it by adjusting it. It also helps you to get better understanding of the material by cross-referencing unclear points by searching on the internet or in other books. 

Don’t you think that read as if you edit approach is only applicable to Machine Learning books. I find it also useful in reading books on mathematics, physics and engineering. Actually, it can be applied to any source of written information, only then it becomes a critical reading approach, where you don’t blindly trust what you read, but instead analyze it and verify the information.

So how was it editing Imbalance Classification with Python book?

I very much liked editing this recent book, since it had enough theory, math and new machine learning concepts to get me excited to work with the book from start to finish. The book has about 450 pages of actual content and it took me about three hours a day for nine days to finish it. I can’t say that it was smooth and easy. The content, at least for me, required cross-checking it with other sources. The code samples required, not once, a need to reference Python libraries documentation and quick dives into sources about imbalanced classification, statistics and information theory.

All in all, reading this from A to Z made me realize the importance of knowing that the data could be imbalanced, as in case of anomaly detection, and one cannot train a model assuming an equal distribution between positive and negative classes, since such a model will tend to classify incorrectly in practice.

 

Math is in the air

Start this year the right way

New year’s time is usually a time to make some new year’s resolutions. I won’t do it and instead this year for me at least will be solely focused on applied mathematics. Math topics interest  me for a long time. But I never took it seriously to invest quality time into studying advanced math topics with enough detail. This year will be different. The plan is to start from some quite general books on math that try to approach the topic in an engaging way like Measurement book by Paul Lockhart and slowly transitioning to more technical books for applied mathematics like Elements of Applied Mathematics by Zeldovich and Myskis and  Nonlinear Dynamics and Chaos by Steven H. Strogatz.

A little bit about the books

Why these three books you may wonder? Actually, there are four books I want to focus on. What is so specially about these books is the fact that they do not simply talk about one specific field in math with a very narrow focus on the subject, but like Donald Knuth’s The Art Of Computer Programming volumes approach the subject in a more general way without being fearful to delve in fields of physics, engineering, biology etc.

To summarize the books are:

measurement

Measurement by Paul Lockhart which tries to show math as an engaging activity that resembles arts, such as music, painting where there is a place for creativity,  a joy of new discoveries or a pain of being stuck trying to get a solution.

 

 

 

 

2020-01-01 16_03_56-Elements Of Applied Mathematics _ YA. B. Zeldovich, A. D. Myskis _ Free DownloadElements of Applied Mathematics by Zeldovich and Myskis which is an old book, but it’s still relevant today, at least in many parts of it, as it was back in 1972. As authors themselves put in the foreword of the book

So our advice is: read our book and study it. But even if there is not time enough to make a deep study, then merely read it it like a novel, and it may be just the thing you will need for solving some difficult problem.

 

 

math_arnoldMathematical Understanding of Nature: Essays on Amazing Physical Phenomena and Their Understanding by Mathematicians by Vladimir Arnold. This book is a collection of applied math problems  that were drawn from various fields such as physics, engineering etc.

Note: If you’re capable of reading in Russian then this book is available in full for free here.

 

 

nonlinear-dynamics-and-chaosAnd finally there is the voluminous  Nonlinear Dynamics and Chaos by Steven H. Strogatz that makes me feel better by having hundreds of differential quotations.

Note: The older edition of this book is available for free, for example, here.

A unique feature of the book is its emphasis on applications. These include mechanical vibrations, lasers, biological rhythms, superconducting circuits, insect outbreaks, chemical oscillators, genetic control systems, chaotic waterwheels, and even a technique for using chaos to send secret messages.

 

Now is the best time to start

This paragraph is dedicated to myself and possibly you. Remember that now is the best time to start doing what you wanted, but postponed ad infinitum. So start by taking small steps to big results later. Or at least to having satisfaction from solving some non-trivial tasks and applying a new skill to real life problems.

On importance of a good pen

A pen is here to stay. Isn’t it?

Now days, that using computer programs to document various everyday activities from to-do lists to studies, one can ask whether there is still a need to have a pen in your arsenal. What’s the value of having such a heavy companion that requires paper to be functional and can’t be that easily corrected or deleted as a text in a word processor? It seems like there is no obvious answer that satisfies everyone, but definitely there’s one for me. Personally, I like to use a pen for writing to feel how I actually produce words in an antiquated analog way, instead of using discrete machines, except for this post. Text written with a pen does not require electricity to be useful, though it requires light to be seen. 

A pen to stick to

Having stated my affection to pens I personally recommend to stick with a pen that is durable, has a long lasting refill and has a beautiful embodiment. I think about fifteen years ago I found such a pen in the form of one of Parker’s low end models that are quite inexpensive, but deliver on refill longevity and durability. The pan in hand was Parker Jotter Originals Ballpoint Pen since 1954.

It’s slim and thin for touch, it’s small in size and its refill lasts almost forever even if you document lectures on history at the university. To these days I have one, but I actually prefer an older brother of this one.

A fountain pen, won’t last long enough

Generally speaking pen refills have a number of main types which are

  • Fountain using a refillable liquid ink
  • Ballpoint uses oil based ink
  • Rollerball uses water based ink

It was funny to actually try to write with a fountain pen such as, low end similar to Sonnet Stainless Steel.

What’s nice about a fountain pen is that it feels like writing in XIX century, but with the style come a number of drawbacks. The quality of written text  depends on the angle of the pen tip to the paper. A fountain ink is easily solvable by water drops which is unfortunate and the ink doesn’t last long enough, to say the least.

Is there anything else?

The true love of mine is another low end Parker pen which is a thicker version of the Jotter Originals one, and it’s Parker IM. It’s a little bit heavier than Jotter, but actually it feels nicer to handle it. It’s thicker and doesn’t press very hard against the fingers. And it has fancier finish than the Jotter. All in all this is the pen I value the most.

 

Does it really matter what pen it is?

In my opinion, what is the make and model of a pen doesn’t matter that much, but consider this.

  • The pens described in this post are reusable ones that are durable and can be used for dozen of years if not longer in comparison to plastic ones that get thrown to the garbage most of the time.
  • The refills that they use come in metal containers that can be recyclable or can degrade naturally unlike plastic ones, that again most of the time thrown into garbage.
  • Lastly, they may provide you with a real satisfaction from the writing process unlike the simpler plastic ones that merely do the task in hand.

Can you learn anything from books on Apollo program?

What this post is about?

If you are interested in Apollo Moon program and curious what books are worth reading on the subject, probably this post may help you.

So far, I’ve read more than a dozen of books on U.S. Apollo program which were written by people coming from all walks of life. There were flight directors and controllers, engineers, surely, astronauts, historians and journalists. As such, I tend to classify the books on Moon program into four main categories based on the background of the authors.

Books classification 

  • Engineers and scientists
    • Books written by engineers, including flight directors and controllers who took part in the Apollo program. These tend to be more technical and down to earth with lots of details for technically inclined readers
  • Scientists and engineers beyond Apollo
    • Books written by authors with scientific background who were not part of Apollo program
  •  Astronauts
    • Books written by astronauts. These ones range from technical to more emotional ones
  • Historians and journalists
    • Books written by historians and journalists

Examples

  • Engineers and scientists
    • Flight: My Life in Mission Control by Christopher Kraft

    • Failure Is Not an Option: Mission Control From Mercury to Apollo 13 and Beyond by Gene Kranz

    • Go, Flight!: The Unsung Heroes of Mission Control, 1965–1992 by Rick HoustonMilt Heflin, et al. 

    • Safely to Earth: The Men and Women Who Brought the Astronauts Home by Jack Clemons

    • Sunburst and Luminary: An Apollo Memoir by Don Eyles

    • Left Brains for the Right Stuff: Computers, Space, and History by Hugh Blair-Smith

  • Scientists and engineers beyond Apollo
    • Digital Apollo: Human and Machine in Spaceflight by David A. Mindell

    • The Apollo Guidance Computer: Architecture and Operation by Frank O’Brien

    • The Apollo Chronicles: Engineering America’s First Moon Missions by Brandon R. Brown

  •  Astronauts
    • Technical 
      • Two Sides of the Moon: Our Story of the Cold War Space Race by David Scott and Alexei Leonov
    • Emotional 
      • Carrying the Fire: An Astronaut’s Journeys by Michael Collins 

      • The Last Man on the Moon: Astronaut Eugene Cernan and America’s Race in Space by Eugene Cernan

  • Historians and journalists
    • Historians
      • A Man on the Moon: The Voyages of the Apollo Astronauts by Andrew Chaikin

      • First Man: The Life of Neil A. Armstrong by James R. Hansen

    • Journalists
      • Apollo 8: The Thrilling Story of the First Mission to the Moon by Jeffrey Kluger

      • Apollo 13 by Jeffrey Kluger

      • Disaster Strikes!: The Most Dangerous Space Missions of All Time by Jeffrey Kluger

 

Personal viewpoint

I personally, liked the most books from first and second category written by engineers and scientists who took an active part in the program and others who were influenced by the Apollo events and became engineers and scientists themselves fascinated with Lunar program. 

What I like about more technical books is the explanation of how certain systems were envisioned and designed. How did they worked in practice and what challenges engineers faced throughout the systems’ life and how they were tackled. 

Why should you care about technical books?

If you are a technically inclined person, reading the technical books on Apollo program may bring you enjoyment of learning how various types of obstacles were solved by people working day to day on the most challenging aspect of then never done before and exciting endeavor. You also may trace the beginnings of the U.S. space program that can be felt to these days in managing International Space Station (ISS), unmanned space vehicles traversing our solar system and beyond and private space companies.

The new book on Deep Learning for CV that worth working through

Deep-Learning-for-Computer-Vision-400

Books are not the same especially on Deep Learning

It feels and really is that we are bombarded by a growing number of books on Machine Learning, especially Deep Learning. Due to this large number of books published it is quite difficult to tell what book is worth investing the time and effort. Since humans as spices have a constrained lifespan what books you choose to read matters. That is why you’d better read the best books available out there on the subject.

The paragraph above may sound a little bit as advertising, but I really think a good book, which is frankly a subjective definition makes a difference. I would say, that a good book in my opinion is the one that engages you, makes you think, at least a little bit, and what is important makes you strive to check the references it provides and find additional information beside what the book already includes.

What’s inside?

planes

The newest Deep Learning for Computer Vision book from Machine Learning Mastery brings exactly this. It is crafted in a well recognizable machinelearningmastery style which is a practical approach with a simple to complex information presentation spiced with just enough theory to get you started in the Machine and Deep Learning fields.  

More details on content

  • If you read any of their books previously you know that each chapter has a battle proven working Python code samples that work on MacOS, Linux, and even Windows (who would thought). 
  • Each chapter composed in such a way that it may serve as a stand alone tutorial, but overall they are tide together in a logical order if you prefer to read the book from  beginning to end.
  • What I personally find valuable is the Extensions at the end of the chapters that provide additional tasks to practice the chapter’s material. 
  • Not to mention the references to books, papers and other relevant data that were mentioned in the chapter.

More Technical information

bananas_mrcnn.jpg

The book’s subject is about Pytohn libraries to process images while working on machine learning or Deep Learning projects. The main library that is used for Deep Learning is Keras including helpful Keras Functional API.  In addition, the book describes how to download build, train and run models such as Mask R-CNN, Multi-task Cascade CNN, FaceNet and other using TensorFlow.

 

So far

If this post made you curious about the book then give it a try. You may find it very helpful.

 

The Moon For All. An Apollo Story.

Why to write about space now?

I’ve been long fascinated with space exploration, especially with Apollo Lunar program. So far I’ve read a dozen of books and watched more than dozens of documentaries, interviews and movies on the subject. I have to tell you my enthusiasm is not even close to be exhausted. As you may know this year will mark 50th anniversary of Apollo 11 first Moon landing that took place on July 20th, 1969, 20:17 UTC. It’s not  strange that last year we saw the First Man movie about Neil Armstrong hitting the theaters across the globe. This year on March 8th long awaited Apollo 11 documentary featuring never before seen hi quality video along with re-mastered videos was released in IMAX format in theaters. It seems like more is to come when we get closer to July 20th of 2019.

What books do I recommend?

I recommend Flight: My Life in Mission Control by Christopher Kraft. In my mind it is one of the most interesting books written about American space program by the founding father of mission control.

 

 

 

 

 

 

I also find Sunburst and Luminary: An Apollo Memoir book by Don Eyles very interesting from an engineer-programmer point of view. He describes in detail how the Lunar Module (LM) software was designed and behaved in practice.

 

 

 

 

 

 

It is hard to not recommend The Last Man on the Moon book by Eugene Cernan who was the last man so far on the Moon. I find this book very inspirational thanks to Cernan’s insightful thoughts and his deep personality. He was able to describe his emotions while being on the Moon with vivid colors. It feels like you join him there. 

What documentaries and movies are worth watching?

Actually, there are quite a lot documentaries that are available for free on YouTube. But there are a number of very good ones that worth the money to pay for them. I’ll mention only a number of them. Others may be found in my earlier Deep Space, Do You Copy? post.

I recommend you to watch Apollo 11 documentary that was released recently (at time of writing) in IMAX if possible. It successfully conveys the enormity of the event that unfolds before your eyes. It is possible at times to forget that you are watching the movie. I would also mention the sound track for the film by Matt Morton that helps this film to stand out.

It turns out that Apollo 11 documentary stands upon shoulders of another, today long forgotten For All Mankind documentary from 1989 by Al Reinert. It is also accompanied by very impressive sound tracks of Brian Eno and provides interesting interviews with Apollo astronauts along with nice video of them having fun on the way to the Moon and on the surface. 

Conclusion

The manned space exploration is again an exciting topic since Israeli Beresheet space craft is on its way to the Moon and a Chinese vehicle is exploring the Moon as I write these lines. US SpaceX and Canadian Space Agency partnering with NASA and others to built Gateway a Lunar Space Station for a long stay on Moon orbit and on the Moon surface on our way to Mars.  So, book your next flight with Virgin Galactic, take a seat, fasten your belts, check oxygen level and prepare for a liftoff to space.