收藏到CSDN网摘
From time to time, we may need to get the current date and time in batch to automate some tasks. For instance, I am modifying the compiled programme names using the current date, which is easy to archive and search in the future. There are such DOS commands exist such as Date and Time, which you can use to retrieve or set the current date and time respectively. However, we may like to get all this information in one go and manipulate it as required. If you're on Windows like me, the Windows Management Instrumentation (WMI) Command line tool (WMIC.exe) could be used for this purpose. The following batch shows how to get the date and time information and use them as variables in the batch.
16 Jun 2020
27 Apr 2020
Add Share Folder in VirtualBox
收藏到CSDN网摘
I have used VirtualBox for trying out linux client on my Win10 laptop. Sometimes, I do need share files between the host and client OS. The option looks straightforward. But it doesn't work like that. Here is the detailed steps.
I have used VirtualBox for trying out linux client on my Win10 laptop. Sometimes, I do need share files between the host and client OS. The option looks straightforward. But it doesn't work like that. Here is the detailed steps.
3 Apr 2020
C++ Tips: Get All System Environment Variables
收藏到CSDN网摘
It's very common that you might need to get/edit/delete a system environment variable from time to time. In one of my previous post, I shared two functions that could get a system environment variable by its name or get all system environment variables in a map<string,string>. However, the function didn't return ALL variables if you checked here as shown in the screenshot.
In this post, I made another function that can obtain all system environment variables from the list.
It's very common that you might need to get/edit/delete a system environment variable from time to time. In one of my previous post, I shared two functions that could get a system environment variable by its name or get all system environment variables in a map<string,string>

In this post, I made another function that can obtain all system environment variables from the list.
C++ Tips: Grab Current Username and Datetime using C++
收藏到CSDN网摘
From time to time, the current username and datetime need to be obtained in code for either saving system logs or debugging the code. If you are working in Windows like me, there are two functions available to do this. The first is GetUserName() in WinBase.h and the other is localtime() (and strftime() for formatting) in time.h (or). All you need to do is to include them in your header and call those functions when needed.
Here we go!
From time to time, the current username and datetime need to be obtained in code for either saving system logs or debugging the code. If you are working in Windows like me, there are two functions available to do this. The first is GetUserName() in WinBase.h and the other is localtime() (and strftime() for formatting) in time.h (or
Here we go!
26 Feb 2020
Run Jupyter Notebook with Double-click
收藏到CSDN网摘
Jupyter notebook enables writing code with instructions in the same file, which is very convenient for preparing teaching materials. However, by using the default installation on Windows it requires typing commands in command window to start the server first.
To enable double-clicking opening on .ipynb files, the following command can be run using administrator privileges:
Jupyter notebook enables writing code with instructions in the same file, which is very convenient for preparing teaching materials. However, by using the default installation on Windows it requires typing commands in command window to start the server first.
To enable double-clicking opening on .ipynb files, the following command can be run using administrator privileges:
1 Jul 2019
Compare File Contents in Windows 10
收藏到CSDN网摘
To compare files, there are different approaches - GUI, command line, or using existing software. But to deal with huge files (meansured using Gb), the GUI/software may encounter problems of hanging and unresponsive. The command line must be the only option left.
To compare files, there are different approaches - GUI, command line, or using existing software. But to deal with huge files (meansured using Gb), the GUI/software may encounter problems of hanging and unresponsive. The command line must be the only option left.
Subscribe to:
Posts
(
Atom
)


