A lifetime of Babbel Language Learning is on sale for 60% off

Babbel claims they can have you talking confidently in your new language in 30 days — and with the current offer – 60% off, you can put that theory to the test at the lowest possible price. Regularly $499, you can grab a lifetime subscription to Babbel Language Learning right now, including access to all 14 of their language training staples, for only $199, or 60 percent off. Want to learn a new language with a friend? You can grab a 2-pack for $358, or $179 each.

Prices subject to change.

The Code Breaker: Jennifer Doudna, Gene Editing, and the Future of the Human Race

CRISPR Pioneer Jennifer Doudna Headlines NHGRI 25th Anniversary Celebration  | NIH Intramural Research Program
Image: Crispr

Biochemist Jennifer Doudna and her collaborators discovered a tool that can edit DNA, known as CRISPR. It has already been deployed to cure diseases, fight the coronavirus pandemic of 2020, and make inheritable changes in babies’ genes. The development of CRISPR will hasten our transition to the next great innovation revolution, says author David Wheeler. Wheeler: Children who study digital coding will be surpassed by those who study the code of life. Should we use our new evolution-hacking powers to make us less susceptible to viruses, prevent deafness and blindness, or enhance the IQ, height , memory and the muscles of the babies? The key to innovation is connecting basic science to our everyday lives, he says, moving discoveries from labs to our bedsides in ways that respect our moral values, he writes. The book is a thrilling detective tale that involves the most profound wonders of nature, from the origins of life to the future of our species.

Apophis asteroid will not hit Earth for 100 years, Nasa says

NASA has been monitoring an asteroid called Apophis for 17 years. They discovered the 335-metre space rock in 2004 and put it on their list of most hazardous asteroids. They originally said it could kill over 10 million people if it hit Earth in 2029. However, their latest prediction is that Earth will be safe from it for the next 100 years. It will come within 20,000 miles of Earth on April 13, 2029, when it will be at its closest point to the planet. The scientists used radar to predict the asteroid’s orbit around the sun. The space rock is currently 10.6 million miles away from Earth.

What if you returns exit code -1 in bash, will bash take it as -1?

Actually no, if we return -1 in bash, it will be interpreted as 255 per https://tldp.org/LDP/abs/html/exitcodes.html

if I can go back in time, I would never return exit code -1 for a failure in Linux. 1 would be ideal in this case.

Let write a simple bash script test – to copy non-existent file

the execution will fail and exit status code is 1 as expected so let’s modify this script and return the exit status code to -1.

Since we alter our script by checking if exit code is not zero, we instead return -1. As a result, bash interprets it as out of range since exit takes only integer args in the range 0 – 255 and therefore interprets it as 255 instead of -1.

Scientists have discovered stem cells that are vital in hair regeneration

Seven ways … to avoid hair loss | Men's hair | The Guardian

Scientists have discovered stem cells that are vital in hair regeneration process. They hope to adapt the stem cells to create a therapy for hair loss. Millions of people worldwide suffer from baldness. Baldness predominantly affects men and affects up to 85 per cent of men by the age of 50. The scientists are now embarking on clinical research and laboratory trials. They observed that hair growth was a cyclical process within the follicle. They used 220 combinations of chemicals to make the hair regrow naturally. The research could lead to hair follicle regeneration therapy in the near future, scientists say.  

No photo description available.

Denmark will build an artificial island 80km off its western coast in the North Sea

Denmark To Build World's First Energy Island In The North Sea

Denmark will build an artificial island 80km off its western coast in the North Sea. The island will be the size of 18 football fields and cost around $34 billion to build. It will produce enough electricity to power three million homes and help make Denmark carbon neutral. Denmark is Europe’s largest oil-producing country and will end its reliance on fossil fuels within three decades. It is expected to be in operation by 2033 and will help reduce CO2 emissions.

Pigs are intelligent enough to play video games

pigs playing video games

Scientists at Purdue University taught pigs to play video games. In the game, the player scores points for maneuvering a cursor using a joystick so as to hit a colored target. The player is in the middle of what looks like an abstract representation of a room, surrounded by four blue walls. Each wall, running the length of the screen, is a potential target, and the player need to hit any wall to complete the stage. Almost all of the pigs got to the one-sided target, though some did get to the small one- sided one-box target.  Purdue University’s online course on how to play games with pigs, with videos and tips on how-to videos can be taught with pigs. The online course is available online at: www.purdue.org/video-game-teaches. World of Boarcraft is a video game set up to mimic the behavior of a wild boar. The video game’s makers hope to attract more people to the animal kingdom.

String.IndexOf in JavaScript and C#

I am a backend engineer and we are working on a new Linux Project. We have UI UX team with us which they mainly work on UI UX front end. Once they are done with their UI UX work, they handed it over to us – backend engineers to integrate UI UX stuff with the backend Linux daemon service which runs in the background and/or at startup. After the integration, we found few issues with UI UX stuff mainly filtering as we have many options for end user to filter in the front end and I was also assigned to fix them which I did. Through working on fixing them, I came across JS code which uses IndexOf to find a match and I would have thought IndexOf(“”) empty string should yield -1 but it does not and instead it yields 0 and I also wonder what would be yielded in C#. I did a quick console app in .NET to test. And as a result, C# behaves the same way – returns 0.

From MSDN :

https://docs.microsoft.com/en-us/dotnet/api/system.string.indexof?view=net-5.0

String.IndexOf Method

Definition

Namespace:SystemAssemblies:mscorlib.dll, System.Runtime.dll

Reports the zero-based index of the first occurrence of a specified Unicode character or string within this instance. The method returns -1 if the character or string is not found in this instance.

But not too quick, if we go further below here it stated:

Returns

Int32

The zero-based index position of value from the start of the current instance if that string is found, or -1 if it is not. If value is Empty, the return value is startIndex.

Visual Studio 2019: Attach To Process takes a very long time to show up and how to fix it

I have VS 2019 enterprise edition and its attach to process took very long time to show up and that have impacted my productivity drastically. So far I have been complaining McAfee Anti-virus for this issue but turned out it was not due to McAfee at all.

Once I deselected Python Development workload in the VS installer screen below, it seems to resolve the issue and attach to process screen above pops up quicker.

Backup and Restore MySQL database on Linux Platform

A while back probably couple years ago I wrote bash scripts to backup and restore MySQL db on Linux platform mainly for debugging and/or troubleshooting purposes and here they are:

########################################
### backup.sh Backup mysql db script ###
########################################
#!/bin/bash
 
userhome=$(eval echo "~$USER")
echo "Executing under $USER context"
 
echo "Enter db username: "
read -s  USER
echo "Enter db password: "
read -s PASS
read -p "Enter database name: " DBNAME
 
### Backing up database ###
mysqldump -u$USER -p"$PASS" $DBNAME > $userhome/$DBNAME.sql
 
 
echo "---------------------------------------------------------------------------------"
echo "if no error, $DBNAME backup will be saved to $userhome/$DBNAME.sql"
echo "---------------------------------------------------------------------------------"
##########################################
### restore.sh restore mysql db script ###
##########################################
#!/bin/bash
 
userhome=$(eval echo "~$USER")
echo "Executing under $USER context"
 
echo "Enter dba username: "
read -s  USER
echo "Enter dba password: "
read -s PASS
read -p "Enter database name: " DBNAME
read -p "Enter database backup location (.sql): " DBBACKUPSQL
 
### restore backup database ###
mysql -u$USER -p"$PASS" -e "drop database $DBNAME;"
mysql -u$USER -p"$PASS" -e "create database $DBNAME;"
mysql -u$USER -p"$PASS" $DBNAME < $DBBACKUPSQL
 
echo "---------------------------------------------------------------------------------"
echo "if no error, $DBBACKUPSQL backup has been restored"
echo "---------------------------------------------------------------------------------"
To backup, at terminal execute backup.sh
# bash backup.sh 

it will prompt you for the database username and password and db.sql will be saved to the home directory of the user you use to execute this script.

To restore, at the terminal execute restore.sh

it will prompt you for the database admin username, password, and the backup script .sql location.