Posts

Showing posts from 2021

How to Add Code Syntax Highlighting to Blogger

Image
On my blog I always wanted to format source code in Python and a couple more languages, but couldn’t find a convenient way. Until I read a tutorial on adding syntax highlighting to Blogger blogs like mine. The Blogger post composer actually provides the monospace Courier font that may be used for source code, but it works well only for inline text . If I apply the Courier font to a block of code, the composer renders each line as a separate paragraph. This leaves too much vertical space that makes the code look ugly. A workaround is to switch to the HTML view in the composer and wrap the block within <pre> ... </pre> tags, which insert the correct line spacing. However, the code doesn’t stand out on the page and there’s room for improving its scannability and visual impact. Fortunately, Blogger is an old dog I can teach new tricks to, like the setup the tutorial I found presents. A Python code snippet with syntax highlighting rendered by highlights.js in a post of the Moo

How to Jump to the Top of the Google Photos Library

Image
Despite the impressive machine learning features, in the Google Photos app, good old browsing is still a common way of finding what you want in your library. You scroll down the timeline until you run across what you were looking for, or other interesting shots serendipity brought your way. Tap the Photos button to jump back to the top of the photo library in the Google Photos app. Here the Android app on a Pixel 4 XL. Now that you are way down the timeline, how do you get back to the top? You can scroll up all your way until you hit the latest photos. Or just tap the Photos button in the bottom bar, which instantly jumps to the top. This handy trick works also when the Android app is running on Chrome OS.

4 Things Tutorials Don't Tell You About PyPI

Image
Time to celebrate! I published my first Python package to PyPI, Suite8080 . It’s a suite of Intel 8080 Assembly cross-development tools. It’s in early development, misses some tools, and is rough around the edges. But it works, does something useful (if you’re into retrocomputing), and I’m having ridiculous amounts of fun with this hobby project. The Python Package Index (PyPI) website. The celebration is wearing out and I’m about to resume the work to complete and improve Suite8080, yet something still bugs me. Although it’s well known PyPI is unforgiving for good reasons, the package publishing process is not as straightforward as the tutorials make it seem . I run into a few unexpected minor bumps none of the guides mention. It’s not that the tutorials aren’t good, they are. I recommend the Real Python article on publishing a package to PyPI . But the authors of these guides are so experienced, and probably so detached from the challenges beginners face, they may not be aware some i

Silence Astronomy and Space Android Apps

Image
 What's the first thing to do after installing an astronomy or space app on Android? Turn off any alarms and notifications in the app's settings. Although these apps try to be helpful, they are noisy and alert you of interesting celestial phenomena or space events, such as the phases of the Moon, planetary conjunctions, satellite passes, and rocket launches. The option to turn off alarms in the ISS passes screen of the ISS onLive Android app. I learnt it the hard way when alarms in the wee hours of the night showed up on my Pixel 4 XL phone. It turned out an update of the ISS onLive app had set up alarms for International Space Station passes.

The Best Chrome OS Screen Capture Features

Image
Although the Nimbus Chrome extension is my primary screenshot and screencasting tool, I’m re-discovering the native Chrome OS screen capture functionality . Two features of the latter improve my workflow, the ability to precisely frame the capture area and to save screen recordings in the WebM video format. The Crostini Linux Terminal on my ASUS Chromebox 3. I took this screenshot with the area framing controls of the Chrome OS screen capture tool. When I activate the tool by pressing Shift+Ctrl+ShowWindows and draw the selection rectangle to delimit an area of the screen, clicking and dragging a corner brings up a magnified inset of the area around the mouse pointer that allows the precise adjustment of the selection rectangle . To make the inset show up, I have to release the mouse button after drawing the rectangle, then click a corner. My ASUS Chromebox 3 has a mouse, which allows for fine tuning the rectangle’s size and position. The trackpad or touch screen of my Chromebook req

Why I Use a Chromebox

Image
Chromebooks are mainstream but many people don’t grok Chromeboxes. A Redditor wondered what’s the point of Chromeboxes and what to use them for, especially high-end units. People seem to assume Chromeboxes are good only as kiosks or for who knows what uncommon use-case. The main unit of my ASUS Chromebox 3. I use a Chromebox because I nearly never need to move my primary desktop device . And I want the most high-end unit I can get my hands on to do the same stuff cheap Chromebooks can do, but faster. Let me elaborate. First off, in 2015 I switched to using Chrome OS exclusively on the desktop . I stopped using traditional desktop operating systems such as Linux or Windows.  Therefore, for me the choice is among the form factors of Chrome OS desktop devices: Chromebook (laptop), Chromebox (fixed desktop system), or Chromebase (think iMac for Chrome OS). I picked up a Chromebox as my daily driver because I work with it at the same desk 99.999% of the time . Since I nearly never need to

Simulating an Eclipse with Celestia for Android

Image
What would a lunar eclipse look like on the Moon? Closeup of the Earth hiding the Sun in a simulation of the May 26, 2021 lunar eclipse seen from the Moon. With Celestia for Android I simulated the May 26, 2021 lunar eclipse seen from the Moon . I screen-recorded a video on my ASUS Chromebox 3 while the Celestia app simulated the eclipse as seen from the lunar surface in an area near the North pole. Standing on the Moon the phenomenon would appear as a solar eclipse , with the Earth moving in front of the Sun and hiding it. In the video time runs 1000 X faster, from 04:00 UTC on May 26 to 19:00 UTC. The frame has a field of view of about 21° vertically. Notice the surface darkening up to the horizon while the Earth covers the Sun and casts a shadow on the Moon. How to simulate the eclipse Celestia is the best universe simulation software. To create the simulation, I used the Celestia app for Android on my ASUS Chromebox 3 not only because it runs well on Chrome OS but also because a

Python with Replit: A Journey in the Cloud

Image
Can I use only Replit for all my Python development? It’s what I set out to find. Follow along my journey to coding in Python on Chrome OS only with the tools and resources of Replit . I want to learn to live off the land in Replit; to develop, test, check into version control, run, document, deploy, and host Python code with Replit. I’ll share my experiences in Python with Replit , a blog post series documenting my ongoing efforts. A Python REPL in Replit on my ASUS Chromebox 3. This is not a philosophical quest for cloud purity or a “use only brand X for 30 days” blog challenge. It’s rather the realization of how much my tools shape the way I work. When in Chrome, do as the chromies do. I want Replit to be my main Python environment, figure out how to work around its limitations, and push the boundaries of what it can do. I’m a hobby programmer and a Python beginner, not a professional developer. These constraints define the journey and frame my setup and tooling decisions. Why use R

Explore the Moon and Mars with GlobeViewer for Android

Image
GlobeViewer Moon and GlobeViewer Mars are interactive Moon and Mars globe apps for Android. These incredible works are the best planetary globes for Android. GlobeViewer Moon for Android on my Pixel 4 XL. Under the hood they share the same rendering engine that combines shading, color, and perspective to present the shape and relief of geological features in a realistic, dramatic way. The camera controls let you explore these worlds from far away or fly close to their surfaces. The views of the Moon and Mars are stunning and educational. The apps come with high-resolution planetary textures based on space images and accurate altitude data of the celestial bodies. You can control the perception of relief by selecting the textures and adjusting the properties of simulated reflected light that determines the visual strength of surface details. 3D model of the north-eastern Montes Apenninus area at the eastern side of Oceanus Procellarum in GlobeViewer Moon on my Pixel 4 XL. Near the c

A NASA TV Still Frame Viewer in Python

Image
I wrote Spacestills , a Python program for viewing NASA TV still frames. The main window of Spacestills running on Replit. As a hobbyist wishing to improve my Python programming skills, for some time I’ve wanted to work on learning projects more substantial than code snippets , throwaway tools, or short scripts. Spacestillschecks several boxes. The problem domain is one of my primary interests, space exploration. At about 350 lines of code, it’s a non-trivial system with a GUI. It accesses the network to download data from the web. Finally, the program relies on a few Python libraries. About the program Spacestills periodically downloads NASA TV still frames from a web feed and displays them in a GUI. The program allows to correct the aspect ratio of the frames and save them in PNG format. It downloads the latest frame automatically and gives the option to reload manually, disable the automatic reload, or change the download frequency. As a learning exercise, Spacestillsis a basic pro

Free Python Books Went Viral on Hacker News

Image
Update 18 Apr 2021. Since I published the post the GitHub repository rocketed to 1.8K stars, 195 forks, and 44K views from 23K visitors. The repository is now the top Google search result for free python books . Mind-blowing, thanks all. My Free Python Books list went viral on Hacker News, ending up on the home page within the first 2-3 entries for several hours. Free Python Books on the home page of Hacker News. Mike Andreuzza shared the project’s link to Hacker News on April 10, 2021. Since then the post gathered 154 upvotes. The Free Python Books GitHub repository jumped to almost 700 stars and 80 forks (up from about 95 stars and 20 forks before), reached almost 15K views from over 8K visitors , and went trending on GitHub . This attention brought new contributions to the project as 3 authors submitted their books and another user reported a broken link. Two people even sent me donations (thanks for the coffee!). A plot of the views (green) and unique visitors (blue) of the Fre

Lenovo Tab M8 HD Review

Image
I bought a Lenovo Tab M8 HD , an 8” Android tablet. It comes with a MediaTek Helio A22 SoC, an IPS panel, 2 GB of RAM, and 32 GB of storage. I ordered the device from Lenovo’s Italian online store for €134. In this post I’ll share my early impressions on the device. The packaging box of the Lenovo Tab M8 HD tablet. Motivation The Lenovo Tab M8 HD replaces the Lenovo Tab E7 7” tablet I bought almost a year and a half earlier. After enjoying the Google Nexus 7 2012 and 2013 tablets I left Android slates for several years. My return to tablets with the November 2019 purchase of the cheap Lenovo Tab E7 was a sort of impulse buy. I wanted an affordable Android slate small enough to be compact but with a large enough screen to help productivity . I also figured it would double as an ebook reading device and let me explore the Android ecosystem. The Tab E7 was nice but limited. The screen didn’t have good touch sensitivity, performance was poor, there was a lot of lag, and the screen was no

How I Got 9K YouTube Views in 24 Hours

Image
On December 1, 2020, an uncrewed vehicle of the Chinese Chang'e 5 sample return mission was about to land on the Moon. There was a lot of excitement. As an astronomy and space enthusiast, I shared the interest and anticipation. These fields are a major part of my creative endeavours. An opportunity Space experts, scientists, enthusiasts, and reporters were sharing online a lot of information on the mission and the vehicles. But they were hardly talking about Mons Rümker (Latin for mount Rümker), the spacecraft's landing area. The Mons Rümker area is of great scientific interest. However, it's a subtle lunar feature that may be difficult to locate even if you know where to look for. So I played with Google Maps a bit to explore this area of the Moon and get a refresher ahead of the landing. Mons Rümker looked great in Google Maps. Therefore, the night before the landing I made a video to share and contribute to the online mission coverage and conversation. It's a simp

Follow Mars Rover Operations With SpaceTime for Android

Image
NASA SpaceTime is an Android app for displaying the time on Mars and the schedule of the operations teams of NASA’s Curiosity and Perseverance rovers. The NASA Jet Propulsion Laboratory runs the missions and developed this official app. The NASA SpaceTime app on my Pixel 4 XL phone. The app shows the local time at the rover sites on Mars along with a list of upcoming events, planning activities, and key meetings of the mission operations teams. The entries provide the times at your location and countdowns to the events. The descriptions of the entries are terse and worded with obscure acronyms, so it may be hard to figure what they’re about. Ex Mars rover driver Scott Maxwell helped me make sense of the acronyms and jargon. Here’s what they mean. Keep this list handy when running the app: Ace : call sign of the team member who triggers the uplink, among other things CI: Campaign Integration (the equivalent of Curiosity's supratactical process ) D/L: downlink EDR: Experiment Data

Screen Sharing Android Apps in Video Calls on Chromebooks

Image
On your Chromebook you can present the screen of an Android app in a Google Meet or Zoom video call. The trick is to select the app’s window when sharing. In Google Meet, pin the shared window to the screen to see what the app looks like to the guests in the call. Presenting the Celestia Android app in a Google Meet video call on my ASUS Chromebox 3. The same goes for Linux apps. But, if an app opens over one window, you’ll be able to share only one at a time. Sharing the whole screen with an app open in the foreground works too and has the advantage of showing all the app windows. It’s less practical, though. Given the limited resolution and quality of video calls, it’s better to maximize the Android app’s window so the guests can view a larger image with more detail. The only downside is most Android apps aren’t optimized for large screens and may have large blank areas and widgets spread wide apart. Keeping the default, non-maximized app window fixes this and can be useful. For ex

Space Apps for Android: 10 Jan 2021 Update

Image
I published version 10 Jan 2021 of my ebook Space Apps for Android: Discover the Best Astronomy and Space Apps . The readers who purchase it get free lifetime updates. So, if you bought the book, you can download the latest files in PDF, Mobi, and ePub format where you originally got it at Gumroad or Leanpub . Meteor Shower Calendar, an app my ebook Space Apps for Android covers in chapter Meteors. In this release I added an introduction to chapter Meteors, reported on how the listed apps work on Chrome OS, and revised the chapter. Among the astronomy apps for Android, few are about observing or learning about shooting stars and meteor showers. As a result, this is a brief chapter. Space Apps for Android is a work in progress. I regularly update and expand the book with the Lean Publishing process.

How to View the Rings From Saturn

Image
What would the rings of Saturn look like from the globe of the planet? Imagine you flew a spacecraft to the visible surface at the top of the atmosphere. The rings may look like this. The rings seen from the surface of Saturn at middle northern latitudes. View in Celestia for Android on my ASUS Chromebox. On Android, you have a spacecraft: the Celestia app . I’ll explain how to view the rings of Saturn with Celestia for Android. But the instructions work also with Chromebooks, Android devices, and likely other operating systems. What you need Celestia is the best universe simulation software. It’s a popular open-source project originally developed for desktop operating systems. Now Celestia is available also on Android and works well on Chrome OS. It’s actually one of the few Android apps optimized for Chrome OS. A unique feature of Celestia is the ability to “land” on the surface of a planet or celestial body , i.e. change the point of view as if you looked at the sky standing on or