跳转至

技术私房菜

R 语言中的 libpng 版本冲突

事情起因是在 R 语言中调用 png 包的 readPNG 读取 png 图片的时候,碰到了错误:libpng error: Incompatible libpng version in application and library

> library(png)
> p1 = readPNG("/bioinfo/polyA/circos.png")
Error in readPNG("/bioinfo/polyA/circos.png") :
  libpng error: Incompatible libpng version in application and library
In addition: Warning messages:
1: In readPNG("/bioinfo/polyA/circos.png") :
  libpng warning: Application was compiled with png.h from libpng-1.6.37
2: In readPNG("/bioinfo/polyA/circos.png") :
  libpng warning: Application  is  running with png.c from libpng-1.2.49
> 

这个问题,其实在 《RamiGO 安装及库依赖解决备忘》曾经遇到过,当时的解决方法,在现在看起来其实是并不完善的。所以,在问题解决前,我们先来看看这个问题到底是怎么导致的。

Linux 下 PostgreSQL 源码编译安装

PostgreSQL 是一个功能强大的开源对象关系数据库管理系统(ORDBMS),它从伯克利写的 POSTGRES 软件包发展而来(1995 年几个 UCB 的学生为 Post-Ingres 开发了 SQL 的接口,正式发布了 PostgreSQL95,随后一步步在开源社区中成长起来),经过十几年的发展, PostgreSQL 已经成为世界上发展最快最受欢迎的数据库系统之一。

本文章主要介绍在 CentOS 下源码编码安装 PostgreSQL-10.0 的一些简单步骤,以供参考。

Python 陷阱之 strip、lstrip、rstrip 可以删除比预期更多的内容

本文章内容来源于 《Python Gotcha: strip, lstrip, rstrip can remove more than expected》,由作者翻译,仅供个人学习使用,如有内容侵犯了你的权益,请联系管理员删除相关内容。

介绍

作为一名软件工程师,你处理过不少脏字符串。删除用户输入中的前导或尾随空格可能是最常见的工作之一。

在 Python 中,这是通过 .strip().lstrip().rstrip() 函数完成的,通常如下所示:

>>> "     Andrew Wegner     ".lower().strip()
'andrew wegner'
>>> "     Andrew Wegner     ".lower().lstrip()
'andrew wegner     '
>>> "     Andrew Wegner     ".lower().rstrip()
'     andrew wegner'

使用 Python 的 argparse 构建命令行界面

原文:Build Command-Line Interfaces With Python’s argparse

命令行应用在普通用户空间中可能并不常见,但它们存在于开发、数据科学、系统管理和许多其他操作中。每个命令行应用都需要一个用户友好的命令行界面 (CLI),以便你可以与应用本身进行交互。在 Python 中,您可以使用标准库中的 argparse 模块创建功能齐全的 CLI。