Printing integers in hexadecimal format in Python is a simple task that can be accomplished using the built-in hex() function. By following the steps outlined in this post, you can easily print integers in hexadecimal format in Python. Additionally, by using string formatting, you can control the format of the hexadecimal output to suit your
Read more
Author: Q A
strcmp and strncmp implementation in glibc
Posted onWhat is the strcmp and strncmp implementation in glibc? strcmp implementation in glibc 2.16: string/strcmp.c /* Copyright (C) 1991, 1996, 1997, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU
Read more
x86-64 calling convention by gcc
Posted onWhat is the x86-64 calling convention by gcc? The calling convention of the System V AMD64 ABI is followed on GNU/Linux. The registers RDI, RSI, RDX, RCX, R8, and R9 are used for integer and memory address arguments and XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6 and XMM7 are used for floating point arguments. For
Read more
How to get the size of a file in C
Posted onHow to get a file’s size in C? If you have the file stream (FILE * f): fseek(f, 0, SEEK_END); // seek to end of file size = ftell(f); // get current file pointer fseek(f, 0, SEEK_SET); // seek back to beginning of file // proceed with allocating memory and reading the file Or, #include
Read more
scanf is dangerous, but what is the reason?
Posted onWe all know scanf / fscanf / sscanf is dangerous. But why? what is the exact reason? I thought the ‘%s’ is a problem that causes buffer overflow and ‘fgets’ is a better solution. But is it the exact reason? I pased a discussion by AndreyT and his discussion helps me figure it out: Claiming
Read more
Converting String to long Integer in C
Posted onConverting a string to a long in C is a common operation that can be useful in various programming tasks. In this post, we will explore how to use the strtol and strtoul C library functions to convert a string to a long in C. Using strtol and strtoul The strtol and strtoul functions are
Read more
Are there good free CDNs on the Web
Posted onAre there some good free CDNs on the Web? There are some free CDNs in the Web. Cloudflare: https://www.cloudflare.com CloudFlare protects and accelerates any website online. Once your website is a part of the CloudFlare community, its web traffic is routed through our intelligent global network. We automatically optimize the delivery of your web pages
Read more
Download the video playing in Chrome.
Posted onHow to download the video playing in Chrome? Download the video playing in Chrome. Checkout the “FVD Video Downloader”: FVD Video Downloader If you are using Firefox, DownloadHelper ( http://www.downloadhelper.net/ ) can handle videos even youtube very well.
Adding Custom Buttons to the WordPress HTML Editor
Posted onAs a WordPress user, you may have noticed that the default HTML editor lacks some of the features that you need for your content. Fortunately, you can add custom buttons to the WordPress HTML editor to make your content creation experience more efficient and productive. In this post, we will explore how to add custom
Read more
Any suggestion on the hosting service
Posted onAny suggestion on the hosting services? Seems Hostgator is great: http://www.warriorforum.com/internet-marketing-product-reviews-ratings/362470-hostgator-bluehost-dreamhost-pair-com.html I was considering moving to Hostgator from Dreamhost. Dreamhost has less limitations after comparing it with others (e.g. the 250k inodes number limitation). I will stick with it. Moreover, with CloudFlare enabled ( https://www.systutorials.com/b/web/3218/cloudflare-with-dreamhost/ ), it looks better.
Disable WordPress Built-in Canonical URL link tag in HTML head
Posted onThe built-in canonical URL function since WordPress 2.9 is great. But under some situation, it is not needed. For example, all the Mingle Forum threads’ canonical URL is set to the URL of the page that contains the [mingleforum] shortcode, which, of course, is wrong. How to diabled it? We can disabled WordPress’s Built-in Canonical
Read more
Howto: ssh automatically add new hosts to the list of known hosts
Posted onWhen managing many hosts, answering 100s of “yes” can make us crazy. In a trusted environment, let ssh automatically add the new hosts to the list of known hosts and free us from typing “yes”es. How to enable it? Method 1. Passing option to ssh ssh -o StrictHostKeyChecking=no username@host Method 2. Configuring ~/.ssh/config To automatically
Read more
Vim: case insensitive search
Posted onBy default, Vim does case sensitive search. How to make case-insensitive search in Vim? By default, Vim does case sensitive search. :set ignorecase can set Vim to conduct case insensitive search. However, it also affects substitutions, which is not we want However, how to do a case insensitive search only when it is needed? Use
Read more
Vim: Pasting text as is in Vim in Paste Mode
Posted onPasting code from another application to Vim is a nightmare. The autoindent features of Vim drive you crazy. How to make it easier to use? Pasting code from another application to Vim is a nightmare. The autoindent features of Vim will drive you crazy. What help you out is the “paste mode”. To paste code
Read more
How to add author information in Google search results
Posted onHow to enable the author information in Google search results as shown for many posts? As a post writer, we may want our authorship information to appear in search results. To do this, we need a Google+ Profile with a good, recognizable headshot as the profile photo. Then, verify authorship of our content by associating
Read more
Google Chrome keyboard and mouse shortcuts for Linux and Windows
Posted onWhat are the Google Chrome keyboard and mouse shortcuts for Linux and Windows? Keyboard shortcuts of Chrome can make it easier to control the browser and save our time. Here are a list of commonly used shortcuts: Ctrl+T Opens a new tab. Press Ctrl and click a link. Or click a link with your middle
Read more
How to disable automatic comment insertion in Vim
Posted onHow to disable automatic comment insertion in Vim? Add to ~/.vimrc: au FileType c,cpp setlocal comments-=:// comments+=f:// More: http://vim.wikia.com/wiki/Disable_automatic_comment_insertion
Installing Latex and Compiling a Latex Docuent in Linux
Posted onLatex is a popular document preparation system that is widely used for creating scientific and technical documents. Compiling Latex documents on Linux is a straightforward process that requires only a few Latex packages and a set of commands. By following the steps outlined in this post, you can easily compile Latex documents on your Linux
Read more
Gnome: disabling / deleting keyrings
Posted onHow to disable/delete the current keyrings on gnome? If the Gnome keyrings are not needed, or we forget the password, we can disable/delete the current keyrings. The keyrings are stored under ~/.gnome2/keyrings/ To disabled or delete current keyrings, we can simply delete this folder: rm -rf ~/.gnome2/keyrings/ Remember to backup this directory if you still
Read more
How to set up Firefox Sync?
Posted onHow to set up Firefox Sync? The online Firefox help provides a very good tutorial on setting up Firefox sync across computers and other devides: http://support.mozilla.org/en-US/kb/how-do-i-set-up-firefox-sync