02 May 2023

Finding work when companies and society have a poor support system

The recent mass layoffs at big-tech companies are  proof that one shouldn't link their emotions, loyalty or future to a company. It's important to be independent. With the advent of Artificial Intelligence (or rather, Machine Learning) algorithms, the redundancy of older jobs and the creation of new types of jobs are likely. 


However, life isn't all that simple. One can be injured and end up with a permanent disability, one could suffer a burnout that makes it difficult to work long hours, one could have aging parents or a family member who needs to be taken care of. These require a support system in society (helpful neighbours, friends and relatives) and a support system in the job market. 

This is one reason I created this list of freelance opportunities that people could use (click link).

 

Despite this, there are some things that people need to learn from a young age:
1. Become financially independent ASAP: Avoid pitfalls like loans, mortgages, pointlessly expensive holidays, expensive things, too many kids and financially draining relationships.
2. Network: Spend time in building not only good relationships that can get you jobs, but also building and enriching the freelance world where one can focus on bits of work and leisure at ones own convenience. Remember however, that networking isn't just about getting benefits for yourself. You need to provide value to your network too.


11 April 2023

Tips for building a PC yourself

It's 2023, and even now there's not a single website that provides all the necessary selectors or an AI which can help users identify, compare and select PC parts based on what has been successful in the market and based on which of those parts are actually in stock at retailers or wholesalers.

There are however some tools and tips I'd like to share, which can help newbies. My old Gigabyte motherboard (bought in 2012) stopped working recently for no apparent reason, when I resumed it from suspend mode. There were no POST beeps, and the CPU fan would twitch, but wouldn't start. 

If I rotated the fan by hand, it'd continue spinning on its own lazily. These problems probably started after an automatic BIOS update (which probably happened because of Windows 10 being present), and the motherboard's sudden stoppage appeared to be due to planned obsolescence. There are quite a lot of other people posting similar problems on Tom's Hardware forums. 

So the PC upgrade began with a new SMPS. 

Buying an SMPS/PSU

It is said that the length of warranty a manufacturer provides, is an indicator of the quality of components used in an SMPS. Check for overvoltage protection and short-circuit protection. There's no need of going more than 150W above your power needs. A bad PSU can erupt in fire.


On researching various available brands, these were some points I noticed from various reviews:

There are published lists of the quality/efficiency of PSU's:

You can verify the 80+ certification of a PSU (a lower wattage SMPS is more power-efficient when idle, so you can save electricity by getting the correct wattage instead of a higher 80+ rating):

There are websites that offer an SMPS power calculator (many may not be very accurate):

Observations from reviews:

  • Ant ESports: Said to be of cheap quality. Unstable voltage.
  • Antec: Reviews say it has bad customer support, missing cables, damaged cables, and the SMPS blew up for one person.
  • CoolerMaster: Not necessarily good, but may have some good models.
  • Corsair: Was said to be good earlier, but suspected to have cheap parts now, since more than one customer reported a sparking noise and for one person it failed in a year. The plugs are not meant for India (I don't understand why they can't supply a different plug), so you need an adapter. Said to have good customer support (which is handled by a franchisee in India).
  • Zebronics: It blew up for at least one person. Couldn't handle sustained load. The higher power SMPS actually had an 80+ certification.
  • Artis: One of the cheaper quality PSU's. A user had trouble waking from suspend. No fluctuation protection.
  • NZXT: Said to be good. Acro Engineering in Bangalore is the service centre franchisee. They were responsive. Comes with a ridiculously huge 16A power plug which won't fit into any of your 6A sockets. However, even their official customer support in Spain was helpful and responsive. They confirmed that for my power needs, I could use an old 6A power cord I had.
  • Asus: Good quality and good warranty. However the Bangalore service centre does not handle SMPS servicing.
  • EVGA: Said to be good and said to honour their warranty.
  • MSI: Could be good. Service centre was responsive, but background noise at the centre didn't allow me to confirm if they handled SMPS servicing.
  • Seasonic: Among the best. But expensive. One User said his SMPS failed within a year and he had to ship it to Kolkata to get it replaced. But the entire process of replacing it took just one week.
  • ThermalTake: Among the best. But prohibitively expensive.

Precautions:

  • Make sure you buy from a reputed brand that offers a 5+ year warranty (Seasonic and ASUS sometimes offer 6+ year warranties). A stable voltage supply, various power conservation features and part quality matter, when it comes to keeping your motherboard and peripherals safe.
  • For the wattage, seek out an SMPS whose wattage number is "continuous" (steady maintenance of that wattage) rather than "peak" (can reach that wattage only for short periods). 
  • A multi-rail SMPS is advised if there's high voltage fluctuation in your area. There are three basic rails: +3.3V (PCIe/AGP, chipset and some DIMM), +5V (PCI/AGP, low voltage motors, SIMM), and +12V (PCIe/AGP, high voltage regulators, motors). SB is Standby voltage.
  • See if it helps to plug the SMPS into a voltage stabilizer.
  • Understand and verify the documentation about the pin connections that are required for your motherboard. I remember a person who had to put his 600W PSU for sale online because he didn't check the number of power connections his motherboard required.
  • Check for the number of SATA power connectors and molex connectors.
  • PSU's like Seasonic and NZXT come with a 16A plug, which won't fit into any 6A sockets in your room. See the pic below (the service centre said it's ok to use a 6A power cord, and online reviews say that you shouldn't use a 6A adapter with a 16A cord, since the current and wire thickness difference can cause overheating). If you will be doing a lot of high performance computing, it'd be worth hiring an electrician to install a socket which can support the 16A plug. Don't take risks with electricity.

Buying RAM

Don't be tricked by the RAM frequency shown. For DDR4 RAM, the base frequency (the frequency it runs at during normal operation) it runs at is 800-1600MHz. The effective frequency (when you enable XMP in BIOS) is 1600-3200MHz.
 

Precautions:

  • Also, be aware of RAM latency. Check the CL number printed on the RAM.
  • Make sure the motherboard you choose, supports the RAM version and frequency.   

Some RAM brands:

  • Corsair (likely a good brand. Origin: Taiwan)
  • GSkill (probably a good brand. Origin: Taiwan). They were one of the first and probably only brands to ensure Rowhammer safety.
  • Crucial (probably good, but these usually have a higher CL number, so are likely to be slower, so don't go by just the price)
RAM usually works well for very long, unless overclocked frequently. So even if you can buy second-hand RAM, it's ok.
 

Buying a processor

I used to think that Intel processors were superior, but I was wrong. AMD seems to be manufacturing better processors. When selecting a processor, it helps to make a table containing the processor price, name, speed (normal/boost), socket type, L1/L2/L3 cache sizes, wattage (base/max), cores and threads per core, launch date, maximum RAM and maximum channels. The smaller the nm of the processor, the more transistors they can fit into a chip, and the more power efficient the processor will be. If you aren't into serious gaming, it also helps to have a processor with an integrated GPU (called APU).
To understand how defective CPU's are classified, watch this video
Note: People say that you need to change the thermal paste often. That's probably a myth like how dentists say you need to visit them every 6 months.

Buying a motherboard

Search for "motherboard nomenclature", and you'll see articles mentioning what the "Prime", "TUF", "ROG" etc. portions of the board name means. For example:
MSI PRO boards are lower quality compared to MSI MAG boards. The order is as follows, with the names on the left of the less than sign being worse quality.
  • PRO < MAG < MPG < MEG.
Same way, for ASUS boards it is:
  • Prime < TUF < ROGStrix < ROG.
The names mentioned above are the board series names. Strix E is the best. Strix F is the second best. Strix G is a Micro-ATX and Strix H is ATX. With motherboards designed for Intel chips, the G means it is GPU optimized, and S means it is storage optimized.
The Z790, B650 etc. are the chipset names.
The model names are P, Gaming, ProAX, etc.

Precautions:

  • Select the right chipset which matches the processor. Motherboard manufacturers usually publish a processor compatibility list.
  • If you choose a motherboard that does not support overclocking, you don't need to select a processor that supports overclocking (unless you plan to switch the processor to a different motherboard later).
  • The boards with WiFi are generally not worth the extra money unless you will actually use WiFi and Bluetooth. The alternative is to buy a separate WiFi card when you need one.
  • Go to the official motherboard specifications page and ensure it has all features you need. These include NVMe, PCIe, onboard speaker, USB ports, display ports, LAN, audio and PS2 port if you ever need it.
  • Have a look at the number of pins required for the CPU power, and ensure that your SMPS provides it. 8 pins is the standard, but some have a second optional power connector with 4 pins for people who want to overclock.
  • Check for XMP support (also called AMP, EOCP or DOCP).
  • LED boot lights are helpful.
  • Check if the processor has integrated graphics. Also called APU for AMD processor. These are CPU's with GPU's built in. Some can be so powerful, that you won't need an extra graphics card. For example, the Ryzen 5 5600G has an APU that's equivalent to an NVIDIA GT 1030.
  • Check for warranty duration and service. 
  • Check for whether they have a history of stable BIOS updates.
  • Check for BIOS flashing and BIOS reset options. 
  • Be aware of the DPC and R terms.
  • Look through reviews and posts on forums for complaints about particular motherboards.

Customer support

This is an essential part of selecting a product. The customer service centers should ideally be in your city, else you'll have to ship it to another city. Before buying the product, it also helps to call up their customer support number or email, and ask some question to see how they answer it.
  • ASUS: Said to have good service. Their Bangalore customer support is handled by F1 Infosolutions at Cunningham road.
  • MSI: Bangalore customer service at F1 Infosolutions, Kalyan Nagar. They said they'd probably have to send the motherboard to Delhi for inspection. Their website has a page for registering the product.
  • ASRock: Bangalore customer service at Smartlink network systems, Jayanagar.
  • Coolermaster and Crucial: Bangalore customer service at Kaizen Infoserve at NR road, near Majestic. 
  • Gigabyte: Service center is in Chennai.
  • NZXT: Bangalore customer service is at Acro engineering, near Lalbagh. The service person was responsive and helpful.

Useful sites

Building the PC

  • Do not keep the motherboard on the anti-static bags. It is made of conducting material. You can however keep it on cardboard that has no print on it. 
  • When tightening or removing the screws of the cooler, remove the screws diagonal to each other first. If you remove the screws adjacent to each other, the spring action can make the cooler whip outward, possibly ripping the processor out and damaging the pins.
  • Before removing the cooler, run the CPU for a while to get it hot. This will make the thermal paste a bit more fluid.
  • It's ok to have XMP enabled for the RAM in the BIOS. But it's also necessary to run Memtest for a few passes to check if the RAM is functioning right, because if the RAM isn't at the right frequency, it'll cause the PC to crash at random points of time. Even if Memtest passes during the first pass, it can detect RAM failure during the next pass. So make sure you let it run for at least 3 passes. If it detects errors, you can go back to the BIOS and lower the RAM frequency and run Memtest again. Do this until the tests pass, and that's the stable frequency you can settle for.

HDD vs. SSD

Definitely buy an SSD instead of an HDD. If you have an old HDD, then install your operating systems on the SSD and attach the HDD as a secondary backup storage. There are options like NVME/SATA/M2 that you can consider.

DVD/BluRay writer

If buying any of these, buy one that can be connected to the PC via USB, because then it allows you to connect it to a laptop or any other computer easily.

Selecting a UPS

There's the ordinary "Online UPS", the "Line interactive UPS" and "Standby UPS". Choose carefully, based on your voltage stability needs.

Pre-built configurations

The shops selling PC parts may also have some pre-built configurations that you can choose if you don't want to go through the hassle of choosing parts. There are also plenty of PC building online forums where you can ask for advice, you can post your proposed PC configuration and ask if it's good enough. There are websites where you can check if the parts you are buying are good enough for the games you plan to play.
 

Final tips

  • Don't be in a hurry to buy. Plan it out well, and based on exactly what your needs are.
  • Buy more RAM and storage space than what you estimate you'd need. It's always worth it. 
  • Buy a large computer cabinet. It helps when you want to install a large modern graphics card even if you may install it only later. 
  • Think of what other accessories you'd want. A mousepad with good grip would be good. A computer cover isn't really necessary since it's simpler to cover the computer with a table cloth.
  • Do your research about mechanical keyboards and try buying one of those (there's a difference between the ones which internally have blue, red and brown keys). Search for the ones that have Cherry MX keys instead of the cheaper Chinese alternatives. Also look for ergonomic keyboards. If buying a membrane keyboard, the quality of Microsoft keyboards may be a lot better than others.
  • Check if you really need an extra graphics card or whether an APU (integrated GPU) is sufficient. You always have the option of buying a graphics card later if you really need it. 
  • Search for computer cabinets that may have an extra slot for inserting SD cards. Also, test every slot of the cabinet before bringing it home. Once I got a cabinet where the front mic and speaker connectors didn't work. 
  • Since dust may enter computer cabinets, there are certain kinds of filters that can prevent dust from entering. I'm not sure if it is useful. A few searches and asking around on forums can help you figure it out. 
  • Search other websites for anyone planning to sell off their computer. Some people try selling it off just because they are leaving the city, so if the person is reliable you may get a good PC and it gives you a great chance to bargain.
  • When going to places like SP road, first ask around in multiple shops for prices. The shops will generally give you a quotation for each part you want to purchase. Search online for which shops are good, and go to those shops. Going to good shops matters a lot so that you don't get cheated, and if there are any issues, the response of the shop owners matters. Decent owners will be helpful. Shady ones will tell you to get lost. I have had trouble with defective/fake items from unreliable shops.
  • Ask your friends if they also plan to buy something. First talk to the shopkeeper saying that only you plan to buy, and ask if he could give any discounts. Then ask how much more of a discount he could give if you ask your friends also to purchase from his shop. Try strategies like these to get a good bargain. Ask an AI to give you more tips.
  • At SP road, some shops do the PC assembly at the shop itself, and some of them outsource the assembly (done for free) to another shop. The other shop is usually a cramped up messy place where the assembly is done in a very amateurish way, so make sure you insist that the assembly be done at a safe place.
  • Ask the shopkeeper if there's any advantage in getting the PC assembled at their place and if there's any discount if you choose to do the assembly yourself. Also, whether they'd replace the parts then and there if found to be defective during assembly.
  • You could take the parts home and try building the PC yourself, but I'd recommend having some experienced person guide you. 
  • It's always better to buy a PC instead of a laptop, because you get much more performance for the money you spend. If mobility really matters, it's usually better to spend lesser to buy a tablet or one of those tiny laptops which have no fan requirement. Any heavy processing can be done on the cloud. 
  • Go to the shop well prepared, and with all necessary technical terms in your mind. If people see that you don't know your stuff, they are more likely to charge higher or trick you. 
 
Remember: When you pay for something you have the right to get it done the way you want.
 
All the best with building your PC!!!

05 April 2023

How volunteering should be done

Many years ago, I led a team of volunteers for what is usually called a CSR activity, but in our case it was just called Employee Volunteering, or Community Relations.

I noticed a trend among corporates and employees, to volunteer for social causes without really caring about improving the situation of the people they purported to help. Everyone just wanted to show that they were helping. The photos and entertainment was more important than empathy, caring and finding solutions.

I also noticed a pattern of people being forced to volunteer and then not wanting to return back to volunteering at all. Almost eight years ago, I had created this infographic to illustrate the problem to my seniors.

How volunteering is done by many

If you point out a problem, you should also offer a solution. So the next infographic shows one solution.

A better way to volunteer

A crucial part of the "better way", is the mentoring phase. Volunteers first need to be taught how to volunteer. In every sector, there are experts who know what the key problems are and how it needs to be addressed. They need your help, and they need it in specific ways. Don't use it as a chance to entertain your employees. Use it as a chance to actually help. It may be boring to do meaningful volunteering. But that's what really helps. 

The Nav test can provide some more guidance.

05 March 2023

IISC Open Day 2023

The previous Open Day was at the end of February 2020, when Covid cases had just begun surging. After all these years, Open Day was back again to enthrall scientific minds! The great thing about a science crowd is that everybody is well behaved and organized. Even the human-trains of school kids that snaked their way through everywhere, were organized and well behaved. 

Here's a video of some of the interesting exhibits:

Although IISc put up a map of the place, and it had a grid to help figure out where we were, the map turned out to be useless, since when people photographed it and ventured to other parts of the campus, referring the map ended up making them confused. We really need a better, more responsive map that recognizes locations and perhaps even helps us plan out our path of visiting exhibits and provides info on the transport vehicles.

Click to view it larger

Neural network meant for physics-specific calculations

An autoencoder that compresses data and de-compresses it with some loss

A catapult without the conventional friction joints

A robot-fish fin showing how turbulence is created in water and propels the fish forward

An anti-gravity structure that pulls the string in various directions and can even support a load

A demonstration of immiscibility of fluids of various densities

Drones display and demo


Silicon chip manufacture


You can move the arms of the robot on the left, and it'll copy the same motion on a robot placed in another room. It vibrates to let you know you have reached a boundary. Useful in robotic surgeries done remotely

An Augmented Reality gun which you can use to play a game

A circuit that calculates using analog signals instead of digital. Meant to mimic the human neurons. It performs calculations with much lower power than digital processors.

A circuit assisted with quantum computing

Tiny ML for use in ecological conservation and gesture recognition

Industrial control systems and security

Seeds encased in manure and mud, forming a ball which can be thrown in areas that need aforestation

A travelling salesman game

Ice cream made from milk cream, milk, vanilla essence and frozen with liquid nitrogen. They give you samples to taste, and it's delicious!

Flexible solar panels

Toys that make learning mathematics fun

Rainwater harvesting model

Tender coconuts at an outrageous price of Rs.40

A bus driving simulator you can try. The simulator is actually used to train BMTC drivers to handle Indian roads. Surprisingly, there were no potholes on the road. So much for trying to simulate "Indian" roads.

A toll-gate game where they design the game to see if you choose to use the toll and then switch to a non-toll road and then switch back to the toll road based on traffic. This game had a lottery for players, based on how often they used the toll road.

A traffic junction game where you control the signals. The player who reaches the highest level wins a pen

Robot football

A robot kit for children to create their own robots

The high voltage lab setup

Testing aircraft for lightning strikes

More on the lightning strikes

The demos shown at the high voltage lab. The queue is quite large here

The brain research centre

If you ever wondered how many idlis you need. Apparently, idlis contain protein too.

Click to view bigger

Explanation of flash floods


Hydrogen fuel cell powering a toy train

Tactile robot arms
Some people travelled all the way from Kerala just for Open Day

What's shown here is a minuscule subset of the massive number of exhibits and interactive games that IISc had organized. Kids can win chocolates and prizes too in the games organized. One day isn't enough to go through all the exhibits. There are so many.

Parking is available at IISc Gymkhana ground for free. However, be prepared to end up with a dusty vehicle, and if you don't find a shady area, your vehicle gets baked in the afternoon sun.

Each of the departments have toilets that you can use. There are plenty of food stalls available, but it's better if you bring sandwiches on your own, since the stalls are overpriced. There are plenty of places on the lush green campus where you can sit and relax. Everyone is helpful.


04 February 2023

Real path to linked files

In Ubuntu, when you click on a link to a folder and reach that folder via Nautilus, you are only shown the path you came from, rather than the actual path of the folder or file. 

For example, it'd be:

/media/nav/Link_to_folder/folderOrFile

However, the actual path of the file would be:

/media/nav/Transcend_NTFS/NavData/backup/folderOrFile

Even if you open a terminal in the linked folder, a pwd command would still show you only the linked path, rather than the actual path.

To view the actual path, simply use:

realpath fileOrFolderName

15 January 2023

Comparing video quality by viewing videos side by side

When you convert videos to a different quality, you'd want to compare them. While there are objective methods of comparing it, the subjective evaluation by a human is generally more accurate. When looking for solutions, I found a brilliant solution named Vivict. It not only allows you to compare streaming videos, it also allows you to compare local videos, by using the little white icon near the address bar. The best part of Vivict, is that it shows half of one video and half of another, and allows you to move the mouse to view more or less of the video.

Limitation of Vivict: It does not support all video file formats. When I wanted to play an mkv file, it didn't work.

Another solution, is to simply use ffplay like this:

ffplay -f lavfi "movie=leftVideo.mp4,scale=iw/2:ih[v0];movie=rightVideo.mp4,scale=iw/2:ih[v1];[v0][v1]hstack"

Comparing videos using ffplay

A simpler solution:

I created a program (https://github.com/nav9/splitVideoQualityViewer) similar to Vivict which shows the videos like this:


 

Feel free to either fork and modify the repository or contact me on the repository's discussion tab, to collaborate.



Say thank you or donate

01 January 2023

Automatically detecting audio video async and correcting it

It's a bit disorienting when in you see a lack of sync in the lip movement of a person and the audio. There are various reasons this can happen. If on a live stream, it could be because of network congestion or because the program doing the video encoding didn't get enough of CPU cycles. It can also happen when re-encoding video or splitting it.

Whether you want to measure how much of an async there is or even to fix it, machine learning has thankfully come to our aid. I created a simplistic open source program that finds periods of time when a person begins to speak after a silence, and matches it with audio to find out how much of an async there is, and then I use FFMPEG to fix the async.  

Code: https://github.com/nav9/audio_video_synchronizer

MediaPipe was used to identify the lip movements. I was surprised at how robust it is. Even if the person's face is turned sideways, it still tracks and estimates the face point positions as x,y,z points. Almost 400 points are tracked.

To identify human speech in the audio, I used a voice activity detection algorithm.

There's a lot more work to be done to make this program generic. Ideally, a Recurrent Neural Network (perhaps even LSTM) could be used to analyze lip movements temporally and figure out which lip movements are actually speech and which aren't. Then a probability score needs to be generated based on the actual sounds detected and matched with the lip movements. There are pre-trained models like Vosk, which can be used offline to estimate which words are spoken. Python's speech_recognition package comes in handy here.


07 December 2022

Add shutdown and reboot menu options to GRUB

I have ALWAYS wished for this, and can't believe it was only now that a lightbulb lit up in my head. There are plenty of times you'd be at the GRUB (Grand Unified Bootloader) menu, and wish you could simply shutdown from right there, instead of pressing the power button or booting into the operating system and then shutting down. 

This should have been a default option in GRUB. Anyway, here's how you add it:

I saw this technique here, and this is why I like Linux more than Windows or Mac. There are tons of things you can customize.


This file allows you to add custom menu options to GRUB:

 sudo gedit /etc/grub.d/40_custom

Add these options to the end of the file, save and exit:

menuentry "Reboot" {
      reboot
}

menuentry "Shut Down" {
      halt
}

Update GRUB:

sudo update-grub

Reboot the computer.

27 November 2022

Why a Macbook is no longer good for Linux programmers

I have relatives who use a Mac because somebody told them it's a good quality product or because they want to go with the brand-hype created around the Macbook. I understand brand-craze or the desire for a product that makes one feel good or something that offers the right features. So if a programmer is comfortable with (and actually wants) a Macbook (after evaluating if it’s really going to help be productive), let them buy one. The rest of them would be more-than-happy with any other good computer which has Linux installed. For non-technical people who don't understand why many Linux programmers abhor the Macbook, I'm listing out the reasons here so that you don't inadvertently purchase them a Mac, thinking you are doing something nice for them (there was a time when I heard a relative was planning to buy me an expensive Apple product for my birthday, and I promptly sent back a message through the grapevine that I'm not fond of Apple products).

Linux is not Unix.

There’s no more of the “good build quality” that was once synonymous with Apple. There’s no more of the good design decisions either. 


I’ve used Mac’s for almost four years, and the only thing I’ve liked about it is the absolutely amazing display quality. Besides, for programmers who work on Linux, it’s far better to have a computer that runs Linux and has a hardware architecture that is compatible with the software they commonly use.

Reasons not to use a Macbook

  • No Type A USB ports: This is by far the biggest horribly deranged decision that Apple has taken. Not having Type A USB ports means that you can’t use your existing pen drives or mouse unless you buy a Type C USB 3 adapter. What drove this decision? Greed?
  • No cut and paste in Finder: You can’t right-click to cut a file and paste it. You are expected to copy it to a destination folder and then come back and delete the original file. There is of course a shortcut, and you can drag and drop the file to move it, but somebody in Apple doesn’t seem to understand good engineering.
  • Hardware architecture changed: Macbooks now have an ARM-based architecture. I’ve already had trouble compiling certain programs on it. I've also had trouble building some Docker containers that used x86-based programs, because of this underlying ARM architecture.
  • Glassy monitor: Even when I turn the monitor away from any windows, and it’s facing a wall, I still see my own reflection and the wall on the monitor. Constant glare.
  • Key functionality like Home and End don’t work: There are keyboard shortcuts for the Home and End buttons, but they don’t work when using the Terminal. They’ve also wrongly named “Backspace” as “Delete”. Programmers use Home, End, Del, Page Up, Page Down, and Backspace a lot. Not having these keys tends to get frustrating.
  • Caps-Lock and other keys sometimes not detected: This is one example of the poor build quality. When I press the caps-lock key, the key press does not always get registered. The same happens even for the Ctrl and Command keys. This is on a brand new Macbook.
  • Ctrl sometimes; Command sometimes: In Linux, a lot of functionality just uses Ctrl+some.other.key. On Mac, it’s sometimes Ctrl and sometimes Command. I know the functionality can be changed to some extent in settings, but it doesn't always work out the right way. Why did Apple have to meddle with such a basic functionality?
  • Terminal not available on right click: For a programmer, one of the little pleasures in life is to open up any folder, right click on an empty space there and open a Terminal. That’s not available on Mac. It can be enabled, but being disabled by default shows that a Mac is clearly not designed for programmers. There are more terminals that can be installed.
  • Headphone not detected on startup: I keep my headphones plugged in, and when I start the Mac, sound plays through the default speakers. Only when I disconnect the headphone jack and re-connect it, the sound is played via the headphone. An example of poor testing procedures.
  • Vim lazy exit won’t work: The vim editor has a shortcut for saving and exiting. You can press Esc and then Shift+ZZ. It’s called the “lazy exit”. On a Mac, if you’ve opened a file using sudo, the lazy exit won’t work. You’ve got to use the “hard-working” exit ;-) Esc, wq!. Or Esc, x.
  • Keyboard backlight not available at login screen: Yet another example of poor testing. At the login screen, the keyboard backlight does not turn on.
  • psutil won’t work without sudo: This is meant to protect programs from accessing other program’s memory, but it’s really annoying that if I’m using a Python program that uses psutil, I’m expected to run the program each time as sudo python3 prog.py and type the password. The least that the designers of the OS (Operating System) could have done, was to provide a modal box that asks and marks a program as trusted, so that Users won’t have to keep using sudo.
  • psutil functions like io_counters not available: So if I want to create a Python program to measure network I/O, it’s not easy. Wonderful.
  • bashrc and profile don’t work: Apple shifted those files to /etc/profile, so it’s only after a lot of searching that you get to have your aliases and startup scripts work. Then after restarting, you realize that even that doesn't work. Use ~/.zshrc.
  • Barely any good default favourites in Finder: Normally, it helps to have commonly used folders like Home, Downloads, Desktop etc. in the Finder favourites pane on the left by default. But no. You are expected to drag and drop them to create it.
  • Icons don’t auto-align in Finder: Even setting the icons to snap to grid and making it the default for all, won’t make it work for all folders.
  • Properties being “Get Info”: In Windows and Linux, when you want to see the properties of a file, you right click and find the properties option at the bottom of the menu. In Mac, you’ve got to adapt to recognizing it as “Get info”, and it’s not at the bottom of the menu. Nice in some ways, but annoying in other ways.
  • Workspaces need work: Being able to use Ctrl+Alt+Arrow keys to switch between workspaces is one of the pleasures of using Linux. Mac OS seems to allow it only if you go to settings and enable it. Moreover, the “hot corners” tend to get confusing when one accidentally takes the mouse pointer to one of the corners and all windows suddenly disappear.
  • Can’t dual-boot Linux natively: On modern Mac’s that have a silicon chip, you can’t install a dual-boot Linux OS on the Mac anymore. Great way to create a monopoly and drive away people.
  • Bash history not enabled by default: There are plenty more people asking about this. It was a silly decision not to save history...and then make it even more difficult to find the right options to enable history.
  • Exit does not exit: If you select the "Quit" option from the menus on the top right, the application does not actually quit. You are expected to go to dock and right click and exit. This gets annoying when using apps like GEdit, where if it's opened from the terminal, you can't proceed unless it has fully exited.
  • Shutdown does not shutdown: Select shutdown from the menu, and the Mac does not shutdown. You have to select shutdown again for it to shutdown. Who are these people ruining the Mac UX?
  • Updates downloaded for different version: I was shown update suggestions for some software and a suggestion for upgrading to the next version of MacOS. I didn't want to upgrade, but I decided to update the other software. So I start the time-and-resource-consuming 1.5GB update and lock screen. I come back after a while to see that the downloaded update encountered some error. After another try, I realize that these updates are meant for the next version of Mac OS. Why on earth did it download before the OS was upgraded? Such large updates even for installed software are another issue with Apple.
  • Renaming is a pain: Right click to rename a file or folder, and even though the name is shown as highlighted, when you start typing, you realize that the text isn't getting edited. Then you have to right click or click again to make it work. 
  • Pointless audio previews: If you click the middle of a video file, it starts playing the audio from the file, when you just wanted a video player to open the file. So you have to be careful to click at the edge of the file icon. Who designed this usability nightmare?

There may be more points I’d include soon. Linux is far more customizable and programmer-friendly. Do a favour to your Linux programmers, and give them a computer that has Linux installed natively. It is especially helpful when they need to test locally and deploy onto Linux-based servers. There's more discussed on Workplace Stackexchange.

03 November 2022

Adjusting subtitles of a video

 

Many of us have been through the annoying feeling of viewing a video where the subtitles are off by one or two seconds. This is especially true when it's a foreign language video, and the subtitles are extremely important. Have you ever thought of using a software to adjust it? Well, there are plenty of them.

I tried Gnome Subtitles recently, and under the "Timings > Adjust" menu option, I could shift multiple selected subtitles by the number of seconds I wanted to adjust them (make sure the name of the video and the subtitle file are same, in order to ensure that the video opens up automatically when you open the subtitle file). Quite a handy tool! For more recent versions of Ubuntu, you can use many other software, including KDenLive.

You can also adjust subtitles using VLC or FFMPEG.

The SRT file

Although called "SubRip" files, the SRT stands for SubRip Text (in web format, they are Subtitle Resource Tracks). The time that each subtitle should be displayed is represented as <hour>:<minute>:<second>,<millisecond>. There's even support to specify the font colour, font style and even the coordinates to display the text at.

Generating subtitles

There are people whose jobs involve performing audio transcription. They'd listen to audio, type in the text and the time at which the text appears. The process is very cumbersome because they need to constantly move forward and backward along the audio track, while needing to type what they hear. This means their hands are always occupied. So some enterprising individuals decided to create a foot-operated pedal which the transcriptionists could use to control the audio playback. The pedal allowed them to rewind, pause, play or fast forward.

Of course, today there are machine learning algorithms which detect speech and automatically generate subtitles. Even if the transcription is incorrect at places, it's easier for the transcriptionist to fix it. 

I'll leave you with an amusing "interview" of a person who is quite confident that he does not require subtitles.