# Programming

**URL:** https://linux-tips.com/c/programming/11.md

[Latest](https://linux-tips.com/latest.md) · [Categories](https://linux-tips.com/categories.md)

---

## [About the Programming category](https://linux-tips.com/t/about-the-programming-category/17)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 1\
**Last updated:** [September 12, 2017, 12:47am UTC](https://linux-tips.com/t/about-the-programming-category/17 "2017-09-12T00:47:43Z")

</div>

Questions about programming languages C, C++, Ruby, Python, Php, Bash etc.

---

## [QString split with multiple delimiters](https://linux-tips.com/t/qstring-split-with-multiple-delimiters/64)

<div class="topic-metadata">

**Author:** [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Replies:** 3\
**Last updated:** [April 27, 2022, 7:55am UTC](https://linux-tips.com/t/qstring-split-with-multiple-delimiters/64 "2022-04-27T07:55:40Z")

</div>

I want to split a QString into parts by using multiple delimiters , or # or | It seems that QString has regular expression support but what is the correct expression for this case?

---

## [Finding required dll's from Linux](https://linux-tips.com/t/finding-required-dlls-from-linux/841)

<div class="topic-metadata">

**Author:** [@redsector](https://linux-tips.com/u/redsector)\
**Replies:** 0\
**Last updated:** [September 25, 2021, 7:57am UTC](https://linux-tips.com/t/finding-required-dlls-from-linux/841 "2021-09-25T07:57:06Z")

</div>

It is possible to find which DLL files are needed for a windows binary or library in Linux. To do this, you can use standard objdump utility if it supports PE format or you can install mingw cross compiler toolchains an…

---

## [Gstramer error when second video recording attemp at qml camera](https://linux-tips.com/t/gstramer-error-when-second-video-recording-attemp-at-qml-camera/822)

<div class="topic-metadata">

**Author:** [@aliyolcu](https://linux-tips.com/u/aliyolcu)\
**Replies:** 3\
**Last updated:** [January 29, 2021, 7:43am UTC](https://linux-tips.com/t/gstramer-error-when-second-video-recording-attemp-at-qml-camera/822 "2021-01-29T07:43:30Z")

</div>

Hi,There is a part in the video recording application I made that does not work properly. I could not find the reason for this, after the first recorded video, while the second recording is being made, the application su…

---

## [Starting gdb with a command and its arguments](https://linux-tips.com/t/starting-gdb-with-a-command-and-its-arguments/784)

<div class="topic-metadata">

**Author:** [@DrSlump](https://linux-tips.com/u/DrSlump)\
**Replies:** 0\
**Last updated:** [March 11, 2020, 7:24am UTC](https://linux-tips.com/t/starting-gdb-with-a-command-and-its-arguments/784 "2020-03-11T07:24:05Z")

</div>

In a typical gdb session, we used following steps: $ gdb program (gdb) run program-arguments But, if you want to give both of the program and its arguments in one step (this is especially usefull if you have a very lon…

---

## [How to disable udp checksum control in kernel](https://linux-tips.com/t/how-to-disable-udp-checksum-control-in-kernel/362)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 1\
**Last updated:** [July 17, 2019, 8:34pm UTC](https://linux-tips.com/t/how-to-disable-udp-checksum-control-in-kernel/362 "2019-07-17T20:34:44Z")

</div>

If you can’t receive udp packets in your udp server application while you’re seeing packets in tcpdump/wireshark session, you should think about UDP checksum control in Linux kernel. Linux kernel calculates checksum val…

---

## [Hard link files](https://linux-tips.com/t/hard-link-files/125)

<div class="topic-metadata">

**Author:** [@elururajesh](https://linux-tips.com/u/elururajesh)\
**Replies:** 4\
**Last updated:** [April 4, 2019, 12:44pm UTC](https://linux-tips.com/t/hard-link-files/125 "2019-04-04T12:44:30Z")

</div>

C program which lists all the files of current working directory which contains hard link files - help is required for c program using system calls Actually I am working on system calls programming on linux environment a…

---

## [Ruby irb command history problem](https://linux-tips.com/t/ruby-irb-command-history-problem/693)

<div class="topic-metadata">

**Author:** [@redsector](https://linux-tips.com/u/redsector)\
**Replies:** 0\
**Last updated:** [November 5, 2018, 9:12am UTC](https://linux-tips.com/t/ruby-irb-command-history-problem/693 "2018-11-05T09:12:14Z")

</div>

Today I just installed the ruby-2.3 packages from standard Debian repositories rather than using rvm or rbenv. Soon after I realize that command history not working in irb shells. Here is a quick solution: Create .irb…

---

## [Installing gcc versions on Centos7 / Redhat7](https://linux-tips.com/t/installing-gcc-versions-on-centos7-redhat7/683)

<div class="topic-metadata">

**Author:** [@DrSlump](https://linux-tips.com/u/DrSlump)\
**Replies:** 0\
**Last updated:** [September 20, 2018, 12:24pm UTC](https://linux-tips.com/t/installing-gcc-versions-on-centos7-redhat7/683 "2018-09-20T12:24:47Z")

</div>

Centos7 and Redhat7 still uses too old gcc 4.8.5 version and this becomes very annoying if you want to use newer features in your C/C++ programs. You can install these newer versions with Devtoolset-4 from the Software …

---

## [Disabling document generation on gem install](https://linux-tips.com/t/disabling-document-generation-on-gem-install/671)

<div class="topic-metadata">

**Author:** [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Replies:** 0\
**Last updated:** [July 28, 2018, 11:22am UTC](https://linux-tips.com/t/disabling-document-generation-on-gem-install/671 "2018-07-28T11:22:18Z")

</div>

Ruby gem installations sometimes can be very slow because of the on-the-fly document generation post-process. You can disable this behaviour by providing following options to gem command: For older versions: $ gem ins…

---

## [QT with EGLFS: Multiple views at the same time?](https://linux-tips.com/t/qt-with-eglfs-multiple-views-at-the-same-time/500)

<div class="topic-metadata">

**Author:** [@mtekeli](https://linux-tips.com/u/mtekeli)\
**Replies:** 0\
**Last updated:** [April 5, 2017, 6:04am UTC](https://linux-tips.com/t/qt-with-eglfs-multiple-views-at-the-same-time/500 "2017-04-05T06:04:17Z")

</div>

Hello, With Raspberry Pi2, we are using QT with eglfs support from this repository: https://github.com/pbouda/buildroot-qt-dev Normally we were running single gui application written in QT and showing fullscreen user…

---

## [Turkish character support in Rails with Postgresql](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416)

<div class="topic-metadata">

**Author:** [@Greg](https://linux-tips.com/u/Greg)\
**Replies:** 2\
**Last updated:** [October 15, 2016, 7:26pm UTC](https://linux-tips.com/t/turkish-character-support-in-rails-with-postgresql/416 "2016-10-15T19:26:44Z")

</div>

I’m trying to setup Turkish language support for a Rails project on Postgresql First of all, following settings added into config/database.yml to support Turkish language: development: ... collation: tr\_TR.UTF-8 …

---

## [How to build a FreeBSD toolchain for Linux](https://linux-tips.com/t/how-to-build-a-freebsd-toolchain-for-linux/288)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 2\
**Last updated:** [September 6, 2016, 9:35pm UTC](https://linux-tips.com/t/how-to-build-a-freebsd-toolchain-for-linux/288 "2016-09-06T21:35:19Z")

</div>

If you're working on a C/C++ project which same codebase must be compiled also for FreeBSD and you don't want to work on a FreeBSD box just for compilation, you need a cross-compiling toolchain environment. But, this i…

---

## [Stripping static libraries](https://linux-tips.com/t/stripping-static-libraries/357)

<div class="topic-metadata">

**Author:** [@MisterNo](https://linux-tips.com/u/MisterNo)\
**Replies:** 1\
**Last updated:** [June 20, 2016, 5:19pm UTC](https://linux-tips.com/t/stripping-static-libraries/357 "2016-06-20T17:19:58Z")

</div>

What is the safe parameters for stripping static libraries? When I use strip command like below: $ arm-none-linux-gnueabi-strip myCustomLib.a it gives following error on linking: error adding symbols: Archive ha…

---

## [What is the true path for file?](https://linux-tips.com/t/what-is-the-true-path-for-file/339)

<div class="topic-metadata">

**Author:** [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Replies:** 1\
**Last updated:** [April 18, 2016, 8:32pm UTC](https://linux-tips.com/t/what-is-the-true-path-for-file/339 "2016-04-18T20:32:35Z")

</div>

Hi; I am using Qt5 on Raspberry Pi. I want to set a background-image for label and I am writing barcodeLabel-\>setStyleSheet("background:none; background-image: Url('/home/image.gif'); "); But image can't show. What is …

---

## [How can I find library dependencies of a Windows DLL?](https://linux-tips.com/t/how-can-i-find-library-dependencies-of-a-windows-dll/328)

<div class="topic-metadata">

**Author:** [@Debuser](https://linux-tips.com/u/Debuser)\
**Replies:** 2\
**Last updated:** [April 1, 2016, 9:56am UTC](https://linux-tips.com/t/how-can-i-find-library-dependencies-of-a-windows-dll/328 "2016-04-01T09:56:34Z")

</div>

Is it possible to find all of the library dependencies of a Windows DLL under Linux?

---

## [Qt5 character problem](https://linux-tips.com/t/qt5-character-problem/316)

<div class="topic-metadata">

**Author:** [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Replies:** 2\
**Last updated:** [January 5, 2016, 8:25pm UTC](https://linux-tips.com/t/qt5-character-problem/316 "2016-01-05T20:25:13Z")

</div>

Hi; I compiled Qt5 with buildroot. I set a QString like QString tmp="Ç"; But when I want to qDebug()\<\<tmp , it shows "\\u00C7" , What is the problem ?

---

## [Why software restart required after timezone database update in Linux?](https://linux-tips.com/t/why-software-restart-required-after-timezone-database-update-in-linux/291)

<div class="topic-metadata">

**Author:** [@MisterNo](https://linux-tips.com/u/MisterNo)\
**Replies:** 1\
**Last updated:** [October 27, 2015, 2:51pm UTC](https://linux-tips.com/t/why-software-restart-required-after-timezone-database-update-in-linux/291 "2015-10-27T14:51:38Z")

</div>

If you have to make updates on timezone database in Linux, already running programs couldn't detect the changes while newly executed programs display correct information according to new database. Is there any other wa…

---

## [Different qmake settings for Arm and Linux builds](https://linux-tips.com/t/different-qmake-settings-for-arm-and-linux-builds/290)

<div class="topic-metadata">

**Author:** [@Greg](https://linux-tips.com/u/Greg)\
**Replies:** 1\
**Last updated:** [October 21, 2015, 5:14pm UTC](https://linux-tips.com/t/different-qmake-settings-for-arm-and-linux-builds/290 "2015-10-21T17:14:12Z")

</div>

Within Qt application, we can use #ifdef Q\_WS\_QWS block to conditionally compile parts of the code for QtEmbedded. But we can't give specific LIBS or INCLUDEPATH directives in our .pro file. It is possible to use pla…

---

## [Libevent tcp server crash for fast disconnected clients](https://linux-tips.com/t/libevent-tcp-server-crash-for-fast-disconnected-clients/289)

<div class="topic-metadata">

**Author:** [@Greg](https://linux-tips.com/u/Greg)\
**Replies:** 1\
**Last updated:** [October 15, 2015, 1:03pm UTC](https://linux-tips.com/t/libevent-tcp-server-crash-for-fast-disconnected-clients/289 "2015-10-15T13:03:23Z")

</div>

We're using libevent (2.1 beta version) on our tcp server application. Everything works fine. But, when clients closes their tcp connections as soon as connection establishment phase, our server applications crashed wi…

---

## [Reducing rails asset pipeline's 64 bytes of digest size](https://linux-tips.com/t/reducing-rails-asset-pipelines-64-bytes-of-digest-size/283)

<div class="topic-metadata">

**Author:** [@Debuser](https://linux-tips.com/u/Debuser)\
**Replies:** 1\
**Last updated:** [September 29, 2015, 8:34pm UTC](https://linux-tips.com/t/reducing-rails-asset-pipelines-64-bytes-of-digest-size/283 "2015-09-29T20:34:12Z")

</div>

After upgrading recent version of sprockets gem in my Rails application, generated asset digest size increased to 64 bytes instead of 32. Digest hash calculation algorithm also changed to Digest::SHA256 which is %70 s…

---

## [Qt is working but only white screen](https://linux-tips.com/t/qt-is-working-but-only-white-screen/282)

<div class="topic-metadata">

**Author:** [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Replies:** 1\
**Last updated:** [September 29, 2015, 11:37am UTC](https://linux-tips.com/t/qt-is-working-but-only-white-screen/282 "2015-09-29T11:37:16Z")

</div>

Hi again; In Raspberry Pi; Qt5 is working but when i created gui application, App is starting but only white screen showing. I searched, buildroot can't transfer rpi-userland files. That is about Eglfs. Is the proble…

---

## [Raspberry Pi failed to open vchiq instance problem](https://linux-tips.com/t/raspberry-pi-failed-to-open-vchiq-instance-problem/279)

<div class="topic-metadata">

**Author:** [@saucompeng](https://linux-tips.com/u/saucompeng)\
**Replies:** 2\
**Last updated:** [September 23, 2015, 8:28pm UTC](https://linux-tips.com/t/raspberry-pi-failed-to-open-vchiq-instance-problem/279 "2015-09-23T20:28:08Z")

</div>

Hi; I created an image for Raspberry Pi with Buildroot and include Qt5 in image. I added Eglfs support. When I want to start Gui program \[ ./try1 -qws\] , giving error : failed to open vchiq instance I looked with st…

---

## [How can I change default rvm ruby version?](https://linux-tips.com/t/how-can-i-change-default-rvm-ruby-version/278)

<div class="topic-metadata">

**Author:** [@Greg](https://linux-tips.com/u/Greg)\
**Replies:** 0\
**Last updated:** [September 19, 2015, 11:37am UTC](https://linux-tips.com/t/how-can-i-change-default-rvm-ruby-version/278 "2015-09-19T11:37:08Z")

</div>

If you install a newer version of ruby in your rvm envrionment, you can make it default with following command: $ rvm --default use 2.2.1 After changing default ruby version, it will shown with an asterisk output of t…

---

## [Changing release and debug build folders of a Qt application](https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274)

<div class="topic-metadata">

**Author:** [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Replies:** 1\
**Last updated:** [September 6, 2015, 3:26pm UTC](https://linux-tips.com/t/changing-release-and-debug-build-folders-of-a-qt-application/274 "2015-09-06T15:26:20Z")

</div>

I'm using QtCreator as an IDE for Qt based projects. Generally I'm happy with it, but default project build settings are somewhat different from my expectations. QtCreator, creates separate build directories for Debug …

---

## [Using valgrind with daemons](https://linux-tips.com/t/using-valgrind-with-daemons/259)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 0\
**Last updated:** [August 3, 2015, 9:04pm UTC](https://linux-tips.com/t/using-valgrind-with-daemons/259 "2015-08-03T21:04:21Z")

</div>

Valgrind is a great tool for memory leak detection and profiling. It also helps to find other possible problems in your program. Creating valgrind-free programs (without any important valgrind warnings) is a good practic…

---

## [Display memory allocation statistics in your program](https://linux-tips.com/t/display-memory-allocation-statistics-in-your-program/232)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 0\
**Last updated:** [August 3, 2015, 6:58pm UTC](https://linux-tips.com/t/display-memory-allocation-statistics-in-your-program/232 "2015-08-03T18:58:51Z")

</div>

It is possible to get memory allocation statistics performed by malloc and related functions within your program. There are a few alternatives to get allocation stats. First one is mallinfo(void) which returns a struct…

---

## [Learning which libraries are used for a binary](https://linux-tips.com/t/learning-which-libraries-are-used-for-a-binary/219)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 0\
**Last updated:** [August 3, 2015, 4:54pm UTC](https://linux-tips.com/t/learning-which-libraries-are-used-for-a-binary/219 "2015-08-03T16:54:41Z")

</div>

You can use ldd command to display all of the libraries which linked against a binary: ldd /sbin/mkfs linux-gate.so.1 =\> (0xb7fad000) libc.so.6 =\> /lib/i686/cmov/libc.so.6 (0xb7e3a000) /lib/ld-linux.so.2 (0xb7fa…

---

## [Assembly code of a C code](https://linux-tips.com/t/assembly-code-of-a-c-code/198)

<div class="topic-metadata">

**Author:** [@demirezen](https://linux-tips.com/u/demirezen)\
**Replies:** 0\
**Last updated:** [August 3, 2015, 4:03pm UTC](https://linux-tips.com/t/assembly-code-of-a-c-code/198 "2015-08-03T16:03:48Z")

</div>

We usually use gcc to compile C codes. However, to see assembly code of the C code that we write, we should add -S option while compiling the code: gcc -S -c code.c The command above compiles code.c as it generates co…

---

## [Debugging bash scripts](https://linux-tips.com/t/debugging-bash-scripts/170)

<div class="topic-metadata">

**Author:** [@demirten](https://linux-tips.com/u/demirten)\
**Replies:** 0\
**Last updated:** [August 3, 2015, 1:52pm UTC](https://linux-tips.com/t/debugging-bash-scripts/170 "2015-08-03T13:52:41Z")

</div>

Bash can help us to find problems in bash scripts in some ways. You don't expect too much or gdb like environment but it has a few helpful options. Running a shell script with -x option: bash -x script.sh Or you can…

[Next page](https://linux-tips.com/c/programming/11.md?page=1)
