Skip to content

XSLT: add element, read content from file

I ran into a complicated XSLT question. Input.xml Here I want to add a new element <DESCRIPTION>. The tricky part: the content are in separate files, the file name of the description file is the : (00050802.html,00033802.html === <ID>.html). The .html contains some html code, so the content should…

pg_upgrade oldbindir check fails

I’m trying to upgrade postgresql database from 9.1 to 9.4. I ran the 9.4 version of pg_upgrade as follows: I get: The folder exists, I set the permissions to 777, even gave the postgres user ownership of the directory structure, but I’m still getting the same error. Running in verbose mode does no…

How to store screen output of Scrapy into a file in Linux

I often use to debug Scrapy project. However, when there are lot of items crawled, those log information will be embedded inside a lot of non-useful information. What I want is to store the screen output into a file, so that I can do search, do text editing, etc. I tried: but it doesn’t work Answer It s…

Replacement for MS vsprintf_s on Linux?

I’m converting C++ code from Windows to work under Linux and I came across this function “vsprintf_s”. It is a Microsoft specific function so I would like to ask if there is a replacement in Linux? Thanks Answer Looks like vsnprintf() would be a suitable replacement according to linux.die.ne…

Git whitespace/line ending

I’m going to give you a simplified version of what happen and where I am right now. I have tried different solution but I’m not even sure where does my problem come from. I made some modification on my branch B which is a fork of the branch A of an upstream repository. Then I tried to Pull Request…

Commands terminated with the same char

How can I fix the follow line: The problem is that the commands of for and -exec end with a semicolon, the for command has this statement and find statment with -exec Answer You don’t even need to use -exec echo {} since that is default action in find. You can use this for loop: There is no need to