GCC May “Save” You Some Recursive Functions Calls: an Analysis of a Function Call Stack Length Example

Posted on

We know compilers like gcc can do lots smart optimization to make the program run faster. Regarding functions call optimization, gcc can do tail-call elimination to save the cost of allocating a new stack frame, and tail recursion elimination to turn a recursive function to non-recursive iterative one. gcc can even transform some recursive functions
Read more

Handling Sparse Files on Linux

Posted on

Sparse files are common in Linux/Unix and are also supported by Windows (e.g. NTFS) and macOSes (e.g. HFS+). Sparse files uses storage efficiently when the files have a lot of holes (contiguous ranges of bytes having the value of zero) by storing only metadata for the holes instead of using real disk blocks. They are
Read more

For QEMU/KVM, how to share data between host and guest

Posted on

General question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your
Read more

How to set Zimbra web service’s hostname and port?

Posted on

In Zimbra server, how to set Zimbra web service’s hostname and port? Set Zimbra Web service’s host and port (to mail.domain.com:80 as an example) for a mail domain domain.com: zmprov md domain.com zimbraPublicServiceHostname mail.domain.com zmprov md domain.com zimbraPublicServicePort 80 Reference: https://wiki.zimbra.com/wiki/When_using_a_proxy,_the_’change_password’_box_doesn’t_load

Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password?

Posted on

Firefox needs an email address and a password to login and sync. Is Firefox Sync safe, that is, could someone else read my password saved in Firefox without my password? In short, only you with your password can see your data. Others, even Mozilla’s servers, without your password, can not see your decrypted data. In
Read more

How can I recover data from my crashed hard drive?

Posted on

My laptop’s hard drive crashed. I went to someone else and got the hard drive replaced, but they could not recover my data. You may try PhotoRec as for https://www.systutorials.com/qa/1399/how-can-i-recover-deleted-photos-from-samsung . Although its named with “Photo”, PhotoRec can recover many kinds of files as listed in http://www.cgsecurity.org/wiki/File_Formats_Recovered_By_PhotoRec .

How to make CentOS 6.6 power off the console screen automatically?

Posted on

On CentOS 6.6, I find that it can make the screen (console, not X) blank after a while. However, it does not power the screen off. This usually work on Fedora or other releases. I guess this is caused by some configurations specific in CentOS 6.6. How to make CentOS 6.6 power off the console
Read more

How to enable RPM Fusion for CentOS 6.6?

Posted on

How to enable RPM Fusion for CentOS 6.6? Enable RPM fusion on RHEL 6 or compatible like CentOS: su -c ‘yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm’ It will install https://fedoraproject.org/wiki/EPEL. If it fails to install EPEL automatically, you will need to install it manually. Reference: http://rpmfusion.org/Configuration

How to config network in host (wireless network) for QEMU guest os

Posted on

The host os is connected into network by wireless one so how to let its guest os connect network. Take [1] as a reference. I run it successfully with following steps. 1, create /etc/qemu-ifup script and chmod it. 2, start a qemu guest os with command sudo ./qemu/qemu-system-x86_64 -enable-kvm -m 1024 -drive file=marss_dram.qcow2 -vnc 127.0.0.1:0
Read more

How to run programs in different languages from Windows’ language

Posted on

How to run programs in different languages from Windows’ language? For example, some non-unicode programs in Chinese on English version of Windows will display some garbage characters. You can use the AppLocale util provided by Microsoft to run legacy applications without changing language of non-Unicode applications (system locale): https://en.wikipedia.org/wiki/AppLocale You may check this link for
Read more

How to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin?

Posted on

How to change the mode for simplified Chinese or Traditional Chinese mode in ibus-libpinyin? What is the shortcut like “Ctrl+.” for switching full width or half width punctuation. Use shortcut “Ctrl + Shift + F”. In ibus-pinyin version 1.3.7, this shortcut is added: 2010-05-28 ibus-pinyin 1.3.7 stable release Add Ctrl + Shift + F to
Read more

How to upgrade Fedora 19 to Fedora 20 through the network?

Posted on

How to upgrade Fedora 19 to Fedora 20 through the network? The tool for Fedora to upgrade the distribution is FedUp. Check this page for how to upgrade Fedora 19 to Fedora 20: http://fedoraproject.org/wiki/FedUp#How_Can_I_Upgrade_My_System_with_FedUp.3F Be sure to check the bugs in Fedora 20 before the upgrading: http://fedoraproject.org/wiki/Common_F20_bugs#Upgrade_issues Generally, it contains 3 steps: Preparation # yum
Read more

Shared hosting services with SSH enabled

Posted on

Which shared hosting services have SSH enabled? SSH is a great tool for management and development. Lots shared hosting services support SSH. Here is a non-complete list: Dreamhost SSH on dreamhost: http://wiki.dreamhost.com/Enabling_Shell_Access BlueHost SSH on BlueHost: http://my.bluehost.com/cgi/help/180 GoDaddy SSH on GoDaddy: http://support.godaddy.com/help/article/4942 HostGator SSH on HostGator: http://support.hostgator.com/articles/hosting-guide/lets-get-started/how-do-i-get-and-use-ssh-access HostMonster SSH on HostMonster: http://my.hostmonster.com/cgi/help/180 ServerGrove SSH on
Read more

How to choose the number of mappers and reducers in Hadoop

Posted on

How to choose the number of mappers and reducers in Hadoop to get good job performance? The Hadoop Wiki gives a discussion on this: http://wiki.apache.org/hadoop/HowManyMapsAndReduces Some valuable points: About the number of Maps: The number of maps is usually driven by the number of DFS blocks in the input files. Although that causes people to
Read more