Showing posts with label mercurial. Show all posts
Showing posts with label mercurial. Show all posts

This Week I Learned 2018 - Week 38

You may like to read archived posts or something from last week?

What happened if your Perl's structure exceeded maximum nested level? You will get this error message of "json text or perl structure exceeds maximum nesting level (max_depth set too low?." I was surprised that certain structure may reach over the default level of 512 (a sign for you to redesign your data structure). Changing the 'max_length' threshold to unlimited did not solve the problem. Likewise, switching to the faster JSON::XS. Looking through the data structure did not indicate any circular loops? Due to time constraints, in the end, I just switched from text to binary serialization through Sereal package (benchmark wise is better than others).

What happened when you exceed the maximum daily exposure to Bisphenol A (BPA)? (via Reddit) So many things that can mess up your immune and nervous system. You should avoid drinking from soda can, plastic bottle number 3, 6, or 7, plastic cups, and paper receipts (those using heat). One thing for sure, avoid drinking from any plastic bottles exposed to the sun (especially left in the car). Temperatures shift may leach this chemical into the drinking water. What worse is there is so little studies on the side effect of this chemical, we may only figure out the harm it causes in coming 30 till 50 years. For now, just use nothing but stainless steel (18-8 food grade) bottle (e.g. Klean Kanteen) or glass jar. Also, do no microwave food in plastic container or wash them in dish washer.

Worse still, there are more of these harmful chemicals. The American Academy of Pediatrics have written a policy on identifying and preventing these chemicals from entering our body. If the paper is too long, read the summarized version by Harvard Health.

How do you slow down a gif image? Use GIMP and GAP libraries and adjust the delay between frames.

Why Git was more popular than Mercurial? (via HN) The battle of DVCS have long won by Git (largely due to GitHub and GNU/Linux) even though Mercurial provides a better usage experiences and documentation, based on my biased preference opinion. I'm quite surprised that a bottleneck performance issue (as it was written in Python?) in large repository is still not resolved after all this while even though performance-wise, both are quite the same (old benchmark in 2011, things have surely changed). What's next for DVCS? Pijul, written a Rust and inspired by Darc. But I doubt it can dethrone the popularity of Git in coming future.

Upgrading to Mercurial 2.8 in Ubuntu 13.10

Update: A far more direct installation method using pip
$ sudo pip install

Mercurial, the distributed version control tool was recently released to version 2.8. Decided to give it a try after all these while. However, the default installed version in Ubuntu 13.10 is still stuck at version 2.6.3. Hence, try to upgrade it to this latest version. Installation procedure as follows.

1. Just to confirm, find the installed version using different methods. I didn't realize there are so many alternative ways to find a version for a installed packages.
$ hg --version | grep version
Mercurial Distributed SCM (version 2.6.3)

$ dpkg -s mercurial | grep Version
Version: 2.6.3-1

$ sudo apt-get install apt-show-versions
$ apt-show-versions mercurial                                                                                                                        
mercurial:amd64/saucy 2.6.3-1 uptodate

$ apt-cache policy mercurial | grep Installed
  Installed: 2.6.3-1
2. Add the Mercurial's PPA repository. Update and upgrade your packages.
$ sudo apt-add-repository ppa:mercurial-ppa/snapshots
$ sudo apt-get update
$ sudo apt-get dist-upgrade

3. Check the version again. Nope still at version 2.7.2. Have to do an installation by source code compilation.
$ hg --version | grep version
Mercurial Distributed SCM (version 2.7.2+48-5b327880a660)

4. Download the latest source code (currently 2.8) from the official website. Extract the source code and try to compile the source code.
$ wget
$ tar zxvf mercurial-2.8.tar.gz
$ cd mercurial-2.8
$ make

5. You will encounter some missing Python library. Install all the necessary packages in order to compile the source again. Before that, please make sure you have uninstall existing old Mercurial installation.
$ sudo apt-get remove --purge mercurial
$ sudo apt-get build-dep mercurial

6. Compile the source and create a deb package using checkinstall so we can remove it later.
$ make install && sudo checkinstall
$ hg version | grep version
Mercurial Distributed SCM (version 2.8)