How to Create File Chooser in Gtk using gotk3 ?
If you just want the complete code snippet, here is it. package main import ( "github.com/gotk3/gotk3/gdk" "github.com/gotk3/gotk3/gtk" ) func main() { gtk.Init(nil) win, _ := …
How to Shutdown your PC using Python ?
If you want to shutdown your Windows PC from your Python code, just use this code snippet. import os os.system("shutdown /s /t 1") Here’s a breakdown of what it does: 1. Import 🔗 import …
How to Shutdown PC using C++ ?
If you want to shutdown your Windows PC from your C++ code, use this code snippet. #include <stdio.h> #include <stdlib.h> int main() { system("c:\\Windows\\system32\\shutdown /s"); …
How to Fix (main:30677): Gtk-WARNING **: cannot open display: ?
If you are facing this error (main:30677): Gtk-WARNING **: 05:40:47.665: cannot open display: just install Gtk+ development library, and set the display screen to 0. Installing Gtk+ using Homebrew 🔗 …
How to Tune Garbage Collector in Go Language ?
How to set the GOGC value ? 🔗 You can set its value in the terminal like this. GOGC=200 Or you can change it in yaml file of the environment variable when using docker or kubernetes. What is the …
How to Draw Rectangle on Imageview ?
If you already have a bitmap image in your code, just use this code snippet. bmp = bmp.copy(Bitmap.Config.RGB_565, true); That code will recreate the bitmap image as a mutable. So you can edit that …
Linux Laptop Boot Battery Optimizations
Boot Optimization 🔗 use sudo systemd-analyze critical-chain to get the most time consuming services. If you don’t need those services just disable them by this command sudo systemctl disable …
How to Create Bash Function ?
First step: create a utilities.sh file to add all your bash functions in it. 2nd step: add your bash function/s like this. ## utilities.sh convertMP4toMP3(){ echo -n "Enter source mp4 file : " …
Convert mp4 to mp3 in Linux Terminal
First things first, install the required software packages. Most Linux distros ship with FFmpeg pre-installed but to ensure the required packages are installed, run this command anyway. sudo apt …
Adding GIF image in an ImageView in android
use android-gif-drawable library 🔗 add the following dependency to build.gradle file of your project. dependencies { implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.19' } Use …